Sets and Functions
Sets and Functions
Sets and Functions
For convenience, it is useful to introduce a set that has no elements. We call it the
empty set and denote it by φ . To justify the definition, we need to prove that there is
only one empty set.
1.2.2 Proposition. The empty set is unique. That is, if φ andψ are sets that have no
elements, then φ = ψ .
Proof. Suppose that φ ≠ ψ . Then either φ ⊄ ψ orψ ⊄ φ . Without loss of generality,
assume that ψ ⊄ φ . Thus, there is an object x such that x ∈ψ but x ∉ φ . This
contradicts the fact that ψ has no elements. We conclude that the hypothesis
that φ ≠ ψ is false and hence φ = ψ .
□
We now introduce some basic set operations. Usually, every set considered is a subset
of some universal set. In the following definitions, we assume that every set is a
subset of a given set Ω .
It is useful to visualize these sets using the so-called Venn Diagrams, which usually
consist of intersecting circles with various regions representing certain sets. However,
the Venn Diagram is only a tool to assist our thinking. Derivation solely based on it
cannot substitute formal proofs.
Here we use the logical symbol “ ∧ ” to represent “and” and “ ∨ ” to represent “or”.
For more details of the above proof, see Appendix 1.
The notion of union and intersection can be generalized to more than two sets. Let
Ω be a set. We define the power set of Ω , 2 Ω , to be the set of all subset of Ω . In
symbols,
2 Ω = { A : A ⊂ Ω} .
Now let C be a collection of subsets of Ω . That is, every element of C is a subset
of Ω , or simply C ⊂ 2 Ω . We define the union and intersection of sets in C by
U A = U { A : A ∈ C} =
A∈C
{x ∈ Ω : x ∈ A for some A ∈ C} ,
I A = I{ A : A ∈ C} = {x ∈ Ω : x ∈ A for all A ∈ C} .
A∈C
U A = U Ai and
A∈C i =1
I A = I Ai .
A∈C i =1
1.2.5 Examples. (1) The classic example of a Cartesian product is the Cartesian
plane R 2 , where R 2 is just R × R .
(2) Let Ω = {1,2,3,4,5,6} be the set of outcomes of throwing a die. Then the set of
possible outcomes of throwing two distinguishable dies can be represented by
Ω × Ω = {(i, j ) : i, j ∈ Ω} .
This set has 6 × 6 = 36 elements. The event that the sum of the numbers is 6 is
represented by the subset
A = {(i, j ) ∈ Ω × Ω : i + j = 6} .
Question: How to represent the outcomes of throwing two indistinguishable dies?
□
We end this section with some standard notations. Throughout this notes, we
denote N = {0,1,2,...} as the set of natural numbers, Z = {...,−2,−1,0,1,2,...} as the set
m
of integers, Q = { : m, n ∈ Z , n ≠ 0} be the set of rational numbers, R be the set of
n
real numbers, and C = {x + iy : x, y ∈ R} be the set of complex numbers. We have
N ⊂Z ⊂Q⊂R⊂C.
1.3 Functions
In the past, mathematicians thought of “functions” as explicit formulas such
2 ex + e−x
as x + 5 x + 6 , sin x and . The present definition that has evolved is much
2
more abstract and does not require any “formula” at all.
1 1 1
f ( x) = f (− x) for every x ∈ [0,1] . The image of the set [0, ] is f [0, ] = [0, ] . The
2 2 4
1 1 1 1 1 1
pre-image the set [0, ] is f −1 [0, ] = [− , ] . Thus [0, ] ⊂ f −1 [ f [0, ]] . This is true
4 4 2 2 2 2
in general: For A ⊂ X , A ⊂ f −1 [ f [ A]] . (Prove this! When will A = f −1[ f [ A]] ?)
□
The following propositions contain some basic properties of general functions. The
proofs are good exercises of set operations.
~ ~
1.3.6. Proposition. Let f : X → Y be an injection. Let Z = f [ X ] ⊂ Y . Then the
~
function f : X → Z defined by f ( x) = f ( x) for x ∈ X is a bijection. Moreover, there
constant function defined by 1( x) = 1 for all x. Then (1) is equivalent to the statement
(2) 1 A∩ B = 1 A ⋅ 1B
(3) 1 A∪ B = 1 A + 1B − 1 A∩ B
In particular, if A ∩ B = φ , then 1A∪ B = 1 A + 1B .
(4) A ⊂ B ⇔ 1 A ≤ 1B
(5) 1 A ⋅ 1 A = 1 A
1( A∪ B ) c = 1 − 1 A∪ B and
1 Ac ∩ B c = 1 Ac ⋅ 1B c = (1 − 1 A )(1 − 1B ) = 1 − (1 A + 1B − 1 A∩ B ) .
A ∪ ( B ∩ C ) = ( A ∪ B) ∩ ( A ∪ C ) .
(2) The above calculation seems cumbersome, but there are situations where direct
logic falls short. For example, let us show that for any sets A, B, C , we have
A ∩ ( B ∆C ) = ( A ∩ B ) ∆ ( A ∩ C ) .
You (at least I) will quickly get confused if you start considering different cases.
However, the method of indicator function is straightforward:
1( A∩ B ) ∆ ( A∩ C ) = 1A ⋅ 1B ⋅ 1( A∩ C ) c + 1A ⋅ 1C ⋅ 1( A∩ B ) c
= 1A ⋅ 1B ⋅ (1A c + 1C c − 1A c 1C c ) + 1A ⋅ 1C ⋅ (1A c + 1B c − 1A c 1B c )
= 1A ⋅ 1B ⋅ 1C c + 1A ⋅ 1C ⋅ 1B c
= 1A ⋅ (1B ⋅ 1C c + 1C ⋅ 1B C )
= 1A∩ ( B∆C )
(3) As a final example, we derive the inclusion-exclusion formula for a finite union
of sets. Let A1 , A2 ,..., An ⊂ Ω . Then
1 A1 ∪ A2 ∪...∪ An
= 1 − 1( A ∪ A ∪...∪ A )c
1 2 n
(*)
= 1 − 1 Ac ∩ Ac ∩...∩ Ac = 1 − (1 − 1 A1 )(1 − 1 A2 )...(1 − 1 An )
1 2 n
To show this, take expectation on both sides of (*) and use the facts that (1) E is a
linear operator and (2) E (1 A ) = P ( A) for all event A.
□
Appendix 1
The crucial step of the proof of proposition 1.2.3(3) is the third line, which in a more
general form is the following: If p, q and r are statements, then
p ∨ (q ∧ r ) ⇔ ( p ∨ q) ∧ ( p ∨ r ) .
This is a basic principle of logic which we will now derive using truth table:
Since p ∨ (q ∧ r ) and ( p ∨ q ) ∧ ( p ∨ r ) have the same truth value in all cases, they are
logically equivalent. Thus p ∨ (q ∧ r ) ⇔ ( p ∨ q ) ∧ ( p ∨ r ) . The proofs of other
properties in the proposition depend on other rules of logic, such as
¬( p ∧ q ) ⇔ ¬p ∨ ¬q and p → q ⇔ ¬q → ¬p .
1.5 Exercises
1. Prove Proposition 1.2.3 and 1.2.4 (a) from first principles and (b) using indicator
functions. Note that neither of the two methods is superior to the other.
2. Show that for any sets A, B and C, we have
(a) ( A∆B )∆C = A∆ ( B∆C )
(b) ( A∆B )∆ ( B∆C ) = A∆C
3. Suppose A × B = C × D . Is it true that A = C and B = D ? Assume that the sets are
non-empty.
∞ ∞
4. Let A1 , A2 ,... be a sequence of sets. Let UA
n =1
n and I An be the union and
n =1
intersection of these sets respectively. We define the upper limit of the sequence by
the formula
∞ ∞
lim sup An = I (U Ak ) .
n =1 k = n
(The reasons for the names will unfold if you study real analysis.) Show that
(a) x ∈ lim sup An ⇔ x ∈ An for infinitely many n (Note: I did not define what “a set
has infinitely many elements” means. Just use common sense. )
(b) x ∈ lim inf An ⇔ x ∈ An for all but finitely many n (i.e. x ∉ An for at most finitely
many n)
References
Kai Lai Chung, Elementary Probability Theory, 4th ed. Springer, 2006
Paul R. Halmos, Naive Set Theory, Springer, 1974
Yiannis Moshovakis, Notes on Set Theory, 2nd ed. Springer, 2005