Chapter 4
Chapter 4
A set is a collection of objects, each of which is called an element or member of the set.
Some rules:
(1) Fix a a set U, called the universal set, which contains all the mathematical objects under
consideration.
For example, in calculus of one variable, we usually take U be the set R of all real numbers,
and in elementary number theory, we usually take U to be the set Z of integers.
(2) Given a set A and a fixed object x in U, we can say whether x is an element of A or not.
• Write x ∈ A for “x is an element of the set A”.
This is a statement, i.e. x ∈ A is either true or false, but not both.
• We write x < A for “x is not an element of the set A”.
This is the negation of x ∈ A, so x < A is an alternative notation for ¬(x ∈ A).
(3) Two sets are equal if and only if they have the same elements.
So a set is uniquely determined by its elements.
By Rule (3), two sets are equal if and only if they have exactly the same elements.
Example (i) The set B = {3, 4, 5, ..., 12} can be written in set-builder notation as
B = {n ∈ Z | 3 ≤ n ≤ 12}.
(ii) Let
D = {x ∈ R | 3 ≤ x ≤ 12}.
Then D is the set of all real number between 3 and 12. So D is the closed interval [3, 12].
2
(iii) In set-builder notation, the set C = {2, 4, 6, 8, ...} of all even positive integers is written as
C = {n ∈ Z+ | n is even}
or
C = n ∈ Z+ | (∃k ∈ Z+ )[n = 2k] .
In general, if X is a given set, and for every x ∈ X, the notation f (x) denotes a well-defined
object in U, then
A = { f (x) | x ∈ X}
is the set defined by
(∀y ∈ U){y ∈ A ⇔ (∃x ∈ X)[y = f (x)]}.
Intuitively, the set A is obtained from the set X by replacing each x ∈ X by f (x).
Exercise Is {∅} = ∅?
3
Subsets and the inclusion relation ⊆
Definition Let A and B be sets.
We say that A is a subset of B (in notation A ⊆ B) if every element of A is also an element of B:
A ⊆ B iff (∀x ∈ U) [x ∈ A ⇒ x ∈ B] .
(So to prove A ⊆ B, you need to show that for each x such that x ∈ A, we also have x ∈ B.)
Venn diagram: We can denote a set as the interior of a circle, so that the following diagram
illustrates A ⊆ B.
Venn diagram can be used to show the logical relation between different sets, but they should
not be used as proof.
The negation of A ⊆ B
We will write A ⊈ B for the statement “A is not a subset of B”. So
A ⊈ B ⇐⇒ ¬(A ⊆ B)
⇐⇒ ¬ {(∀x ∈ U) [x ∈ A ⇒ x ∈ B]}
⇐⇒ (∃x ∈ U) ¬ [x ∈ A ⇒ x ∈ B]
⇐⇒ (∃x ∈ U) [(x ∈ A) ∧ ¬(x ∈ B)]
⇐⇒ (∃x ∈ U) [(x ∈ A) ∧ (x < B)] .
So to prove A ⊈ B, you need to show that there exists x ∈ U such that x ∈ A and x < B.
Proper subset
We will write A ⊊ B for the statement (A ⊆ B) ∧ (A , B).
In this case, we say that A is a proper subset of B.
4
Example
(1) Z+ ⊆ Z, Z ⊆ Q, Q ⊆ R.
Q R
+
Z
Z
(4) Let
A = {4k + 1 | k ∈ Z} and B = {n ∈ Z | n is odd}.
Prove that A ⊆ B and B ⊈ A.
Claim: 3 < A.
Assume for the sake of a contradiction that 3 ∈ A.
Then there exists k ∈ Z such that 3 = 4k + 1.
This gives 2 = 4k and so 4 | 2, which is a contradiction.
Hence, 3 < A.
5
Proposition 4.1.1. Let A and B be sets. Then
A = B if and only if [A ⊆ B and B ⊆ A] .
Proof. We have
A = B iff (∀x ∈ U)[x ∈ A ⇔ x ∈ B]
iff (∀x ∈ U)[(x ∈ A ⇒ x ∈ B) ∧ (x ∈ B ⇒ x ∈ A)]
iff {(∀x ∈ U)[x ∈ A ⇒ x ∈ B]} ∧ {(∀x ∈ U)[x ∈ B ⇒ x ∈ A)]}
(using (∀x ∈ U)[P(x) ∧ Q(x)] ≡ {(∀x ∈ U) P(x))} ∧ {(∀x ∈ U) Q(x)})
iff (A ⊆ B) ∧ (B ⊆ A). □
This proposition says that to prove A = B, you first prove A ⊆ B, and then prove B ⊆ A.
Example Let
A = {n ∈ Z | n + 5 is odd} and B = {n ∈ Z | n is even}.
Prove that A = B.
6
Proposition 4.1.2. Let A, B and C be sets. If A ⊆ B and B ⊆ C, then A ⊆ C.
Proof. Let x ∈ A.
Since x ∈ A and A ⊆ B, x ∈ B.
Since x ∈ B and B ⊆ C, x ∈ C.
Hence A ⊆ C. □
Next, we prove A ⊆ A.
Let x ∈ A. Then x ∈ A. So A ⊆ A. □
7
4.2 Operations on sets
This section deals with operations we may perform on sets to build “new” sets from “old” ones.
A∪B
U
A B
A∩B
U
A B
8
(3) The complement of B in A is the set
A − B = {x ∈ A | x < B}
= {x ∈ U | x ∈ A and x < B}.
In logical notation,
(∀x ∈ U)[x ∈ A − B ⇔ (x ∈ A) ∧ (x < B)].
The set difference A − B is sometimes denoted by A \ B.
A−B
U
A B
(4) The set difference U − A is denoted by Ac (or A ) and is called the complement of A; i.e.,
Ac = U − A = {x ∈ U | x < A}
In logical notation,
(∀x ∈ U)[x ∈ Ac ⇔ x < A].
Ac
U
A
Example If U = R, then
Qc = R − Q = {x ∈ R | x is irrational}
is the set of all irrational numbers.
9
Example Let
A = {1, 3, 4, 5, 7, 9}, B = {3, 6, 7, 10}, C = {2, 6}
and let the universal set be U = Z+ .
Determine A ∪ B, A ∩ B, A − B, B − A, A ∩ C, C c .
Solutions: We have
A ∪ B = {x ∈ Z+ | x ∈ A or x ∈ B} = {1, 3, 4, 5, 6, 7, 9, 10},
A ∩ B = {x ∈ Z+ | x ∈ A and x ∈ B} = {3, 7},
A − B = {x ∈ Z+ | x ∈ A and x < B} = {1, 4, 5, 9},
B − A = {x ∈ Z+ | x ∈ B and x < A} = {6, 10},
A ∩ C = {x ∈ Z+ | x ∈ A and x ∈ C} = ∅ (we say A and C are disjoint),
C c = {n ∈ Z+ | n < C} = {n ∈ Z+ | n , 2 and n , 6}.
Proposition 4.2.2. Let A, B and C be subsets of some universal set U. Then we have:
(a) (Idempotent Laws) A ∪ A = A, A ∩ A = A.
(b) (Identity Laws) A ∪ ∅ = A, A ∩ U = A.
(c) (Domination Laws) A ∪ U = U, A ∩ ∅ = ∅.
(d) A ∩ B ⊆ A, A ⊆ A ∪ B.
(e) (Associative Laws) A ∪ (B ∪ C) = (A ∪ B) ∪ C, A ∩ (B ∩ C) = (A ∩ B) ∩ C.
(f) (Commutative Laws) A ∪ B = B ∪ A, A ∩ B = B ∩ A.
(g) (Distributive Laws) A ∪ (B∩C) = (A ∪ B) ∩ (A ∪C), A ∩ (B∪C) = (A ∩ B) ∪ (A ∩C).
(h) (DeMorgan’s Laws) (A ∪ B)c = Ac ∩ Bc , (A ∩ B)c = Ac ∪ Bc .
(i) (Complement Laws) A ∪ Ac = U, A ∩ Ac = ∅.
(j) (Double Complement Law) (Ac )c = A.
11
Let us also prove one of the DeMorgan’s laws in (h): (A ∪ B)c = Ac ∩ Bc .
Proof. Let x ∈ U. Then
x ∈ (A ∪ B)c ⇐⇒ x< A∪B
⇐⇒ ¬(x ∈ A ∪ B)
⇐⇒ ¬[(x ∈ A) ∨ (x ∈ B)]
⇐⇒ ¬(x ∈ A) ∧ ¬(x ∈ B)
⇐⇒ (x < A) ∧ (x < B)
⇐⇒ (x ∈ Ac ) ∧ (x ∈ Bc ).
⇐⇒ x ∈ Ac ∩ Bc .
Hence, (A ∪ B)c = Ac ∩ Bc . □
12
More generally, if n ∈ Z+ and A1 , A2 , ..., An , A are sets, then
A1 × A2 × · · · × An = {(x1 , x2 , ..., xn ) | (∀i ∈ Z)[1 ≤ i ≤ n ⇒ xi ∈ Ai ]}
is a set of ordered n-tuples and
n copies
z }| {
A = A × A × · · · × A = {(x1 , x2 , ..., xn ) | (∀i ∈ Z)[1 ≤ i ≤ n ⇒ xi ∈ A]}.
n
(2) R2 is the Euclidean plane, R3 is the Euclidean space, and Rn is the n-dimensional Euclidean
space:
R × R = R2 = {(x, y) | x, y ∈ R},
R × R × R = R3 = {(x, y, z) | x, y, z ∈ R},
Rn = {(x1 , x2 , ..., xn ) | x1 , x2 , ..., xn ∈ R}.
(1) A × ∅ = ∅ = ∅ × A.
(2) A × (B ∪ C) = (A × B) ∪ (A × C).
(3) A × (B ∩ C) = (A × B) ∩ (A × C).
(4) (A × B) ∩ (C × D) = (A ∩ C) × (B ∩ D).
(5) (A × B) ∪ (C × D) ⊆ (A ∪ C) × (B ∪ D). ( In general, equality need not hold.)
13
Proof. (2) We have
(x, y) ∈ A × (B ∪ C) ⇐⇒ (x ∈ A) ∧ (y ∈ B ∪ C)
⇐⇒ (x ∈ A) ∧ [(y ∈ B) ∨ (y ∈ C)]
⇐⇒ [(x ∈ A) ∧ (y ∈ B)] ∨ [(x ∈ A) ∧ (y ∈ C)]
⇐⇒ [(x, y) ∈ A × B)] ∨ [(x, y) ∈ A × C)]
⇐⇒ (x, y) ∈ (A × B) ∪ (A × C).
Definition Let X be a set. The power set of X is the set of all subsets of X, i.e.,
P(X) = {A | A ⊆ X}.
Exercise In general, if a set X has n elements, then P(X) has 2n elements. Why?
14
Proposition 4.4.1. Let A and B be sets. Then
A ⊆ B ⇐⇒ P(A) ⊆ P(B).
Definition Let n ∈ Z+ and let A1 , A2 , ..., An be subsets of some universal set U. Then
n
[
Ai = A1 ∪ A2 ∪ · · · ∪ An
i=1
= {x ∈ U | (x ∈ A1 ) ∨ (x ∈ A2 ) ∨ · · · ∨ (x ∈ An )}
= {x ∈ U | (∃ j ∈ Z+ )[(1 ≤ j ≤ n) ∧ (x ∈ A j )]}
= {x ∈ U | there exists j ∈ Z+ such that 1 ≤ j ≤ n and x ∈ A j },
n
\
Ai = A1 ∩ A2 ∩ · · · ∩ An
i=1
= {x ∈ U | (x ∈ A1 ) ∧ (x ∈ A2 ) ∧ · · · ∧ (x ∈ An )}
= {x ∈ U | (∀ j ∈ Z+ )[1 ≤ j ≤ n ⇒ x ∈ A j ]}
= {x ∈ U | for all j ∈ Z+ with 1 ≤ j ≤ n, x ∈ A j }.
15
Definition
(i) If F is a set such that all the elements of F are sets, then we call F a family of sets.
(ii) If F is a family of sets and there is a nonempty set I such that F = {Ai | i ∈ I}, then we
say F is an indexed family of sets and I is an index set of F .
This suggests how the union and the intersection of the sets in any indexed family of sets should
be defined.
Definition Let I be a nonempty set and let {Ai | i ∈ I} be a family of sets indexed by I, with
underlying universal set U (i.e. Ai ⊆ U for all i ∈ I). Then we define
[
Ai = {x ∈ U | (∃i ∈ I)[x ∈ Ai ]}
i∈I
= {x ∈ U | x ∈ Ai for some i ∈ I} ,
\
Ai = {x ∈ U | (∀i ∈ I)[x ∈ Ai ]} ,
i∈I
= {x ∈ U | x ∈ Ai for all i ∈ I} .
16
Proposition 4.5.1. Let I be a nonempty set and let {Ai | i ∈ I} be a family of sets indexed by
I, with underlying universal set U, and let B be a set. Then we have:
T S
(a) For all j ∈ I, i∈I Ai ⊆ A j and A j ⊆ i∈I Ai .
(b) (Distributive Laws) B ∪ ( i∈I Ai ) = i∈I (B ∪ Ai ), B ∩ ( i∈I Ai ) = i∈I (B ∩ Ai ).
T T S S
S
Proof. (a) Let j ∈ I. We will only prove A j ⊆ i∈I Ai .
Let x ∈ A j . For this x, the statement (∃i ∈ I)[x ∈ Ai ] is true, i.e., by taking i = j. So x ∈ i∈I Ai .
S
S
Hence, A j ⊆ i∈I Ai .
(b) We will only prove B ∪ ( i∈I Ai ) = i∈I (B ∪ Ai ).
T T
T T
We first show B ∪ ( i∈I Ai ) ⊆ i∈I (B ∪ Ai ).
T T
Let x ∈ B ∪ ( i∈I Ai ). Then x ∈ B or x ∈ i∈I Ai .
Case I: x ∈ B.
T
Then for all i ∈ I, x ∈ B ∪ Ai , and hence x ∈ i∈I (B ∪ Ai ).
\
Case II: x ∈ Ai .
i∈I T
Then for all i ∈ I, x ∈ Ai , and so x ∈ B ∪ Ai . This also gives x ∈ i∈I (B ∪ Ai ).
T T
This proves that B ∪ ( i∈I Ai ) ⊆ i∈I (B ∪ Ai ).
T T
Next we show i∈I (B ∪ Ai ) ⊆ B ∪ ( i∈I Ai ).
T
Let x ∈ i∈I (B ∪ Ai ). Then for all i ∈ I, x ∈ B ∪ Ai .
Case I: x ∈ B.
T
Then x ∈ B ∪ ( i∈I Ai ).
Case II: x < B.
Let i ∈ I. Then since x ∈ B ∪ Ai and x < B, we must have x ∈ Ai .
T T
Hence, x ∈ i∈I Ai , and so x ∈ B ∪ ( i∈I Ai ).
T T
This shows that i∈I (B ∪ Ai ) ⊆ B ∪ ( i∈I Ai ). □
17
Example For each i ∈ Z+ , let Ai = {i, i + 1}; i.e.,
A1 = {1, 2}, A2 = {2, 3}, A3 = {3, 4}, ...
Prove that ∞ ∞
[ \
Ai = Z+ and Ai = ∅.
i=1 i=1
+
Solution: First we show that i=1 Ai = Z .
S∞
+
Let n ∈ ∞
S
i=1 Ai . Then there exists j ∈ Z such that n ∈ A j .
Since A j ⊆ Z+ and n ∈ A j , n ∈ Z+ .
+
This shows ∞
S
i=1 Ai ⊆ Z .
Solution: We claim that (a) ∞ i=1 Ai = A1 = [0, 1), and (b) i=1 Ai = {0}.
S T∞
Proof of (a): Let x ∈ i=1 Ai . Then there exists j ∈ Z+ such that x ∈ A j = [0, 1j ). So
S∞
18
Exercise For each t ∈ R+ , let At = (−t, t). Prove that
[ \
At = R and Ai = {0}.
t∈R+ t∈R+
Sometimes, a family of sets is not indexed. In this case, we shall use the following notation.
Definition Let F be a nonempty family of sets. Then we define
[
A = {x ∈ U | x ∈ A for some A ∈ F } ,
A∈F
\
A = {x ∈ U | x ∈ A for all A ∈ F } .
A∈F
Exercise Let F be the family of all subsets of Z with 2 elements. Prove that
[ \
A = Z and A = ∅.
A∈F A∈F
Consider the predicate P(x) x is a set and x < x , and consider the set defined by this predicate:
A = {x | P(x)} = {x | x is a set and x < x}.
Since A is a set, we can ask: Is A ∈ A?
If A ∈ A, then A must satisfy the defining condition of A, i.e A < A.
But if A < A, then A satisfies the defining condition for A, and so A ∈ A.
19
Therefore we have proved:
A ∈ A ⇔ A < A,
which is a contradiction.
This was discovered by the English mathematician Bertrand Russell in 1902.
The barber paradox: The only barber in a village sets a rule that he will shave everyone in
the village who does not shave himself. Should the barber shave himself?
Axiomatic Set Theory was later developed to fix the Russell paradox. Essentially it puts a
restriction on what type of sets exist. In this theory, Russell’s paradox become the proof of the
statement that there is no “set of all sets”.
20