Chapter 0: Logic and Sets
In arithmetic, one studies numbers and how they are combined via
operations such as addition and multiplication. In Propositional logic, one
studies statements and how they are combined with operations such as and
and or.
Start with a collection
of (atomic) statements. Individual statements
will be denoted by capital letters:
.... So, for example
might be the statement "The sky is blue." and
might be the
statement "The area of a circle is
times the radius squared." Each
statement can be either true or false. We assume that the
statements include one which is known to be true and one which is known to
be false; these are denoted
and
One can combine statements to make additional statements in a number of
ways:
-
is true if and only if that either
is true or
is true.
-
is true if and only if that both
and
are true.
-
is true is and only if
is false.
-
is true if and only if either
is true of
is false.
-
is true if and only if either both A and B are true or else
both
and
are false.
Remark 0.1:
- Throughout mathematics, the word or means the
inclusive or and not the exclusive or. So
is true
if and only if at least one of
and
is true. Exclusive or would
imply that not both
and
are true.
-
is often expressed as, "If A is true, then B is true."
This is exactly the meaning of "If...Then..." in mathematics. However, you
should be careful to note that it is only one of multiple possible meanings
in everyday language. Another meaning is expressed by, "If you don't obey,
you will be punished."
By repeatedly combining the above operations, one can make more and more
complex statements. Faced with two complex statements
and
, it is natural to
ask if they are equivalent, i.e. Is
true? To answer such questions,
we need to develop a set of rules for simplifying statements. Let's begin
with some properties of equivalence:
Proposition 1.1: For all statements
and
- (
is reflexive)
- (
is symmetric) If
then
- (
is transitive) If
and
then
Proof:One can use the definition of equivalence:
-
is reflexive because A is true if and only if A is true.
-
is true if either
and
are both true or they are both false.
But then
and
are either both true or both false. So
is true.
- If
is true, then either both
and
are true or they are both
false. Suppose
and
are true. If
then it follows that
must also be true and so both
and
are true.
On the other hand, suppose
and
are both false. If
then
it follows that
must also be false. So both
and
are both false.
In either case, we see that
and
are both either true or both false.
So,
Exercise 1.1: Show that
is reflexive and transitive.
Is it also symmetric?
Relations like
which are reflexive, symmetric, and
transitive are called equivalence relations. Intuitively, these
are the relations which behave like equality.
The next result lists some important equivalent expressions and the
proof introduces the important technique of using truth tables:
Proposition 1.2: For all statements
and
:
- (Commutativity)
and
.
- (Associativity)
and
- (Distributive Laws)
and
- (True and False)
and
- (Absorption)
and
Proof: For each assertion, just verify that the assertion is true
for each of the possible cases of whether
etc. are true or false.
You can summarize the steps in a what is called a truth table. For
example, to show that
is commutative, one has the truth table:
|
|
|
|
| false | false | false | false |
| false | true | true | true |
| true | false | true | true |
| true | true | true | true |
In the first two columns, each row represents one possible combination of
possibilities for the truth or falsehood of
and
. The subsequent
columns are computed from the values in the earlier columns. For example,
in the second row,
is true because
is false but
is true.
The commutative law is true because, in each row, the values in the third
and fourth columns are the same.
For the first distributive law, the truth table for the expression
looks like:
|
|
|
|
|
| false | false | false | false | false |
| false | false | true | false | false |
| false | true | false | false | false |
| false | true | true | true | true |
| true | false | false | false | true |
| true | false | true | false | true |
| true | true | false | false | true |
| true | true | true | true | true |
The truth table for
is:
|
|
|
|
|
|
| false | false | false | false | false | false |
| false | false | true | false | true | false |
| false | true | false | true | false | false |
| false | true | true | true | true | true |
| true | false | false | true | true | true |
| true | false | true | true | true | true |
| true | true | false | true | true | true |
| true | true | true | true | true | true |
The distributive law asserts that the two expressions are equivalent, and this
is true because the values in the last column of corresponding rows always
match.
As a final example, the truth table for the first absorption identity
is:
|
|
|
|
| false | false | false | false |
| false | true | false | false |
| true | false | false | true |
| true | true | true | true |
The rule is correct because the entries in the first and fourth columns of
each row are identical.
Exercise 1.2 Complete the proof of this proposition by making
all the remaining truth tables.
Exercise 1.3 Use truth tables to prove De Morgan's Laws:
-
-
A set is a collection of things: For example, one has the set
of positive integers, a set of stamps, a set of theorems, etc. The
things in the set are called elements of the set. For example,
3 is an element of the set of positive integers. The assertion that
is
an element of a set
is written
.
The set
with finitely many elements
...,
is written
where we simply list out the elements
comma separated between curly brackets. Similarly, one can write
for the set of integers.
Definition 2.1: A set
is a subset of the set
(written
),
if and only if every element of
is an element of
Two sets
and
are equal if and only if each is a subset of the other.
A set
is a proper subset of the set
if
is a subset
of
and
is not equal to
Example 2.1:(i) The set of integers is a subset of the set of
real numbers because every integer is a real number.
(ii) The empty set
is the set with no elements. The
empty set is a subset of every set.
(iii) It is false that 2 is a subset of
In fact, 2
is an integer not a set. On the other hand
is a set with the
single element 2;
is a subset of
We would like to develop a mathematical theory of sets. Choose a
particular set
called the universal set. Our theory of sets
will deal with subsets of
Whenever, we talk about a set, it will be
implicitly assumed that it is a subset of
Remark: We will change
as is appropriate for the application.
For example, when doing geometry in the plane, we might take
to be the
set of all points in the plane. If we need real numbers too, we might
take
to be the set of all points in the plane and all real numbers. This
notion of a universal set is an artifice to avoid a logical anomaly known
as Russell's paradox.
Just as in the last section, we will introduce a number of operations:
Definition 2.2: Let
and
be subsets of the universal
set
- The union
of
and
is the set whose elements
are all the elements
of
with
or
- The intersection
of
and
is the set whose elements
are all the elements
of
with
and
Two sets are called
disjoint if and only if their intersection is the empty set.
- The complement
of
in
is the set whose elements
are all the elements
of
with
and
(The symbol
is read not in or not an element of.)
- The complement
of
is the set
- The sets
and
are equal if and only if they have the
same elements.
The equality relation is an equivalence relation, i.e.:
Proposition 2.1: For all subsets
and
of the universal set
- (Equality is reflexive)
- (Equality is symmetric) If
then
- (Equality is transitive) If
and
then
Proof: Left as an exercise.
Proposition 2.2: For all subsets
and
of the universal
set
- (Commutativity)
and
.
- (Associativity)
and
- (Distributive Laws)
and
- (Empty and Universal Sets)
and
- (Absorption)
and
Proof: These are straightforward to verify. For example, to see
that intersection
is commutative, you just note that the
elements of
and of
are both the set of elements of
which are both in
and in
Similarly, for the second distributive
law, the elements of
are the set of elements of
which are in
and either in
or in
. This is the same as the
set of elements that are either both in
and
or both in
and
,
which is the set of elements of
As an exercise,
you should verify all the remaining assertions.
There is a parallel between the set theory operations and the logic
operations. With each set A, we can associate the statement
where
is an element of the universal set. Then one has equivalent statements:
This allows one to verify identities or subset relationships using truth
tables. For example, for absorption, one has the truth table:
|
|
|
|
| true | true | true | true |
| true | false | false | true |
| false | true | false | false |
| false | false | false | false |
Because the first and last columns are the equal, we can conclude that
is equivalent to
and so
by
the definition of set equality.
Exercise 2.1 Prove De Morgan's Laws:
-
-
Hint: For the first assertion, start by assuming that
is an element of
Then
or
If
then
and so
So
On the other hand, if
then
and so
So
Next, assume that
is an element of the right
hand side, and show that it must be an element of the set
If you
can fill in all the reasons, you will have a proof of the first of the
two assertions. Construct a proof of the second one along the same lines.
Alternatively, you can use truth tables to make up a proof in a purely
mechanical way.
In the two previous sections, we studied two apparently unrelated
subjects: the logic of propositions and the theory of sets. But there is
an obvious parallel. Let's formalize the situation reflected by Propositions
1.2 and 2.2 as:
Definition 3.1: A Boolean algebra is a set of with two
binary operations + and
and one unary operation - which satisfy the
following conditions for all
and
in the Boolean algebra
- (Commutativity)
and
.
- (Associativity)
and
- (Distributive Laws)
and
- (0 and 1) There are elements 0 and 1 with
and
- (Absorption)
and
Example 3.1: Propositional logic and set theory are two examples of
Boolean algebras.
Duality Principle: If one has any result about Boolean algebras,
then one can obtain another result by replacing the operators +,
and
the elements 0 and 1 with the operators
, + and the elements 1 and 0
respectively. This new result is called the dual of the original result.
Proof: This transformation maps each condition in the definition
of Boolean algebra into another condition. So, if one has proved some
result, the proof of the dual result is obtained by replacing each step
with the its dual dual.
Rather than continuing to develop Propositional logic and set theory,
separately, we can instead work in the context of a Boolean algebra. Any
result there will then apply to both of these earlier examples.
Proposition 3.1: In an Boolean algebra
, one has:
- For any
one has
and
The dual results
and
are also true.
In particular,
and
- (Idempotence) For any
, one has
and
the dual result
- For any
one has
- For any
and
in
one has
if and only
if
Proof: (i) One has
and so the dual result
is also true. In particular, one
has
and its dual
One has
and so also its dual
(ii)
and so the dual
is also true.
(iii) One can calculate
and
(iv) If
then
The dual of this is: If
then
and so the by
switching the roles of
and
we get the other half of (iv).
Definition 3.2: If
and
are in a Boolean algebra, then
one says that
if and only if
Remark 3.1 By part (iv) of the last proposition, this condition
is equivalent to
Proposition 3.2: The relation
satisfies:
- (Reflexivity)
- (Anti-symmetry) If
and
then
- (Transitivity) If
and
then
Proof: (i)
means
which was proved in Proposition
3.1.
(ii) If
then
If
then
Combining results, we get
(iii) If
and
then
and
So,
and so
Definition 3.3: If a binary relation
is reflexive,
anti-symmetric, and transitive, it is said to define a partial order.
Remark 3.2: The dual of
is
This means
that the dual of
is
So, in forming the dual of an
assertion, you need to replace
with
and vice versa.
Proposition 3.3: In a Boolean algebra, if
then
Proof: Suppose
Then
and multiplying by
gives
Since
one has
On the other hand, multiplying
both sides of
by
gives
and so
Proposition 3.4: (De Morgan's Laws) In a Boolean algebra, one has
-
-
Proof: Multiply both sides of
by
to get
The last term on the right can be simplified:
where we have used associativity, commutativity and the fact that the product
of any element with its complement is zero. With this simplification, the
equation becomes
which just means that
The dual must also be true:
In particular,
this holds when we substitute
and
in place of
and
respectively:
. Since
and
it follows that
Applying the complement to both
sides switches the
to
to yield
Using anti-symmetry, we can therefore conclude that
which proves the first of the De Morgan laws.
The second De Morgan law follows from the first by duality.
Example 3.2: Consider the set of factors of the number 30. This
is the set
Define the sum of two
of these numbers to be the least common multiple of the two numbers and
the product of the two numbers to be the greatest common divisor of the
two numbers. The complement of the number k is the number 30/k. With these
operations, one can verify that our set is a Boolean algebra.
It follows that all the results in this section are true of this Boolean
algebra.
Exercise 3.1: What plays the role of 0 and 1 in this Boolean
algebra? Are there other numbers like 30 with this same property? Are
there numbers for which the corresponding set of factors do not form
a Boolean algebra?
Revised: August 23, 2003
All contents © copyright 2002, 2003 K. K. Kubota. All rights reserved
|