Set Theory
Set Theory
1
Preliminaries
2
Russell’s Paradox
3
Set Operations
4
Set Properties
5
Cardinality of Sets
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Defining Sets
Sets can be defined by extension i.e. listing the elements or by a
property.
By Extension i.e. listing the elements:
e.g. A = {2, 3, 5, 7, 11, 13, 17, 19}
By Property:
e.g. B = {n|n < 20 and n is prime}
{} is the empty set; it has no elements.
e.g. {} = {x | x 6= x} .
Query:
Does the set E = {x | x = x} , the set of everything, exist.
i.e. x ∈ E ≡ x ∈
/ {}.
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Subset ⊆
X ⊆ Y iff every element of X is an element of Y .
Theorem
{} ⊆ X , for all sets X .
Proof.
Show, for all z, z ∈ {} → z ∈ X .
From logic (later): p → q ≡ ¬p ∨ q
where ¬p denotes ’not p’ and p ∨ q is ’p or q’.
z ∈ {} → z ∈ X
= ¬(z ∈ {}) ∨ (z ∈ X )
= ¬(z 6= z) ∨ (z ∈ X )
= (z = z) ∨ (z ∈ X )
= true ∨ (z ∈ X ) , but true ∨ q = true
= true.
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Equality of Sets
Two sets are equal if they have the same elements.
In particular,
X = Y iff X ⊆ Y and Y ⊆ X
Example
Sets
A = {2, 3, 5, 7, 11, 13, 17, 19} and
B = {n|n < 20 and n is prime}
above are equal.
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Example
Let S = {x ∈ R | x 2 < x} and T = {x ∈ R | 0 < x < 1}
Show S = T .
Show i) S ⊆ T and ii) T ⊆ S
Proof.
i) S ⊆ T
Let x ∈ S then
x2 < x
≡
x2 − x < 0
≡ x(x − 1) < 0
x and x − 1 have opposite signs or parity;
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Proof.
Case: x > 0 and x − 1 < 0
If x > 0 and x − 1 < 0 i.e. x < 1 then 0 < x < 1.
therefore (tf.) x ∈ T .
Case: x < 0 and x − 1 > 0
Impossible, as x − 1 < x.
Set Theory
Proof.
ii) T ⊆ S
Let x ∈ T then 0 < x < 1
tf. x < 1,
{since 0 < x }
tf. x 2 < x,
tf. x ∈ S.
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Standard Number sets
N , Natural Numbers {0,1,2,...}
Z , Integers {...-2, -1, 0, 1, 2, ...}
Q , Rationals (Fractions) { ba | a, b ∈ Z, b 6= 0}
R , Real numbers e.g. all the points on the number line.
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Russell’s Paradox
Example
Library Reference Books
A library has reference books, some of which refer to themselves
and some which do not. The Librarian creates a new reference
book, R, with the entries of all those reference books that do not
reference themselves. The book, R, is a reference book and the
librarian now considers whether they should include a reference to R
in the book R.
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Should R include a reference to itself
Case: Include a reference to R in R:
By definition of R, it should contain references to books that
do not reference themselves. Since by assumption a reference
to R is included in R then, by definition, R should not include
R.
Case: Exclude a reference to R in R:
By assumption, R does not contain a reference to R hence by
definition of R, the book R should include a reference to R.
In either case, we get a contradiction.
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Simpler Version
Consider a library with just 25 reference books, labeled A to Y.
Some of these reference themselves, some don’t. Consider a new
reference book, Z, which is made of just the entries of the books A
to Y which do not reference themselves. If book A does not list
itself then book Z includes an entry for A. Should Z reference itself
or not?
We may need to be more precise. We could include a time limit.
Book Z is to include all books that do not reference themselves by
12noon. Therefore, since book Z is not in the library at 12noon, it
will not be mentioned in his own entries.
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
If we dispense with a time limit then books A to Y exist at 12 noon
but book Z does not. Book Z is created by 1pm
containing entries to all books in A to Y that do not reference
themselves by 12noon and so book Z does not contain a reference
to itself. If time continues and we consider all reference books in
library at 1pm then we update Z to include a reference to Z. At
2pm we update book Z to exclude a reference to book Z and we
continue on forever. Book Z is never completed and so is more of a
project than a book in the library.
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Normal Sets
A set is called normal (or ordinary) if it does not contain itself. The
set of numbers s = {1, 2, 3} is normal as s ∈
/ {1, 2, 3}, i.e. s ∈
/ s. It
is not easy to think of a set that is not normal but a possibility
would be the set of everything i.e. E above.
Consider a set, N, the set of all normal sets
N = {x | x ∈
/ x}
x ∈N≡x ∈
/x
i.e. For any element, x, x ∈ N iff x is a normal set.
Substituting N for x we get
N∈N≡N∈
/N
This is a contradiction. So there is a problem in defining a set using
the property, x ∈
/ x.
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
(Local) Universal Set
Also there is likewise a problem in defining a set E = {x | x = x}
and so in standard set theory, the set of all sets is not regarded as a
set.
If one is to use set thery, one begins by first determining the set of
elements of interest. That is, one defines a local universal set, U.
For example, in mathematics, the set R (real numbers) is
frequently used as a local universal set, U.
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Operations
Union, intersection, difference, complement.
Union: X ∪ Y = {z | z ∈ X or z ∈ Y }
Intersection: X ∩ Y = {z | z ∈ X and z ∈ Y }
Difference: X − Y = {z | z ∈X and z ∈
/Y}
Complement: X = U − X where U is a universal set of
elements of interest.
In particular, {} = U and U = {}
Set Theory
Venn Diagrams
A∪B
A∩B
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Theory
Venn Diagrams (Cont’d)
A−B
B −A
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Theory
Veitch Diagrams
Set expression with one variable:
e.g. set X is represented as
X =
X
0
1
e.g. X , the complement of X
X =
X
1
0
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Theory
Union, Intersection
Set Expression with 2 variables:
e.g. X ∪ Y
X
0
1
Y
1
1
X
0
0
Y
0
1
X ∪Y =
e.g. X ∩ Y
X ∩Y =
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Theory
Set Difference
e.g. X − Y
X
0
1
Y
0
0
X
0
0
Y
1
0
X −Y =
e.g. Y − X
Y −X =
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Theory
Defining Set Operations
Example
Define a set operator, ⊕, such that X ⊕ Y = (X ∩ Y ) ∪ (X ∩ Y )
X ∩Y
X
0
1
X ∩Y
Y
0
0
∪
X
’Union’ these to get
X ⊕Y
=
X
0
1
Y
1
0
0
0
Y
1
0
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Theory
Exercise: Determine whether
(X − Y ) ∪ (Y − X ) = (X ∪ Y ) − (X ∩ Y )
LHS (X − Y ) ∪ (Y − X )
X −Y
X
0
1
Y
0
0
Y −X
∪
Y
1
0
0
0
X
’Union’ these to get
(X − Y ) ∪ (Y − X )
=
X
0
1
Y
1
0
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Theory
RHS (X ∪ Y ) − (X ∩ Y )
X ∪Y
X
0
1
X ∩Y
Y
1
1
−
Y
0
1
0
0
X
’Difference’ these to get
(X ∪ Y ) − (X ∩ Y )
=
X
0
1
Y
1
0
Therefore
X ⊕Y
= (X ∩ Y ) ∪ (X ∩ Y )
= (X − Y ) ∪ (Y − X )
= (X ∪ Y ) − (X ∩ Y )
Set Theory
3-Variable Set Expressions
Set expression with 3 variables
Example
X ∪Y ∪Z
Y
X
1
1
1
1
1
1
Z
0
1
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Theory
Example
Determine X ∪ (X ∩ Z ) ∪ (Y ∩ Z )
X ∩Z
Y
X
0
1
0
1
0
1
0
1
∪
X
Y
0
0
0
1
Z
0
1
0
0
Z
Y ∩Z
∪
X
Y
0
0
0
0
1
1
Z
0
0
Set Theory
‘Union’ these together to get:
Y
0 0 1 0
X 1 1 1 1
Z
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
(X ⊕ Y ) ⊕ Z
Example
Example_A: Determine (X ⊕ Y ) ⊕ Z
Let A = X ⊕ Y i.e. A = (X ∩ Y ) ∪ (X ∩ Y ) tf.
Y
A
=
X
0
1
0
1
1
0
Z
1
0
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Theory
(X ⊕ Y ) ⊕ Z Cont’d
A ⊕ Z = (A ∩ Z ) ∪ (A ∩ Z )
Y
0 0 1 1
X 1 1 0 0
∩
Z
A ∩
∪
A ∩
Y
1 1 0 0
X 0 0 1 1
∩
Z
Y
X
1
1
0
0
0
0
1
1
Z
Z
Z
Y
X
0
0
1
1
1
1
Z
0
0
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Theory
(X ⊕ Y ) ⊕ Z Cont’d
i.e.
Y
X
0
1
0
0
0
0
1
0
Z
∪
Y
X
0
0
1
0
0
1
0
0
Z
i.e.
Y
(X ⊕ Y ) ⊕ Z
=
X
0
1
1
0
0
1
Z
1
0
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
X ⊕ (Y ⊕ Z )
Example
Example_B Determine X ⊕ (Y ⊕ Z ) viewing ⊕ as ‘addition mod
2’
Let B = Y ⊕ Z tf. by adding individual cells ‘mod 2’ we get:
Y
B
=
X
0
0
0
0
1
1
Y
1
1
Z
=
X
1
1
Y
⊕
0
0
Z
=
X
1
1
1
1
Z
Y
0
0
⊕
0
0
Z
1
1
0
0
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
X ⊕ (Y ⊕ Z ) Cont’d
tf. X ⊕ (Y ⊕ Z ) = X ⊕ B
Y
X
0
1
0
1
0
1
Y
0
1
⊕
X
0
0
Z
⊕
Y
X
0
1
1
0
X
⊕
0
1
1
0
(Y
⊕
Z
=
0
0
Z
X
=
1
1
Z)
B
1
1
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Disjoint Union, Symmetric Difference
From Example_A and Example_B
(X ⊕ Y ) ⊕ Z = X ⊕ (Y ⊕ Z )
The set operator, ⊕ is referred to as ‘Disjoint Union’ or ‘Symmetric
Difference’
From above:
X ⊕Y
= (X ∩ Y ) ∪ (X ∩ Y )
= (X − Y ) ∪ (Y − X )
= (X ∪ Y ) − (X ∩ Y )
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Set Properties
Sets have properties similar but not the same as arithmetic.
Let U be the Universal set of elements of interest.
Let X , Y , Z ⊆ U
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Identity
X ∩U =X
X ∪ {} = X
Anihilation
X ∩ {} = {}
X ∪U =U
Complement
X ∪X =U
X ∩ X = {}
Idempotent
X ∩X =X
X ∪X =X
Commutativity
X ∩Y =Y ∩X X ∪Y =Y ∪X
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Associativity
(X ∩ Y ) ∩ Z = X ∩ (Y ∩ Z ) (X ∪ Y ) ∪ Z = X ∪ (Y ∪ Z )
Distributivity: ∩ over ∪
X ∩ (Y ∪ Z ) = (X ∩ Y ) ∪ (X ∩ Z )
Distributivity: ∪ over ∩
X ∪ (Y ∩ Z ) = (X ∪ Y ) ∩ (X ∪ Z )
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Cardinality of Sets
Disjoint Sets
Sets X and Y are disjoint iff X ∩ Y = {} .
We define |X | as the size of set X ,
i.e. |X | is the number of elements in X .
Sometimes #X is used instead of |X | .
With A = {2, 3, 5, 7, 11, 13, 17, 19}, |A| = 8.
Lemma 1
B ⊆ A → |A − B| = |A| − |B|
Lemma 2
A ∩ B = {} → |A ∪ B| = |A| + |B|
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Theorem |A ∪ B| = |A| + |B| − |A ∩ B|
We can split A ∪ B into disjoint sets:
i.e. A ∪ B = (A − (A ∩ B)) ∪ (B − (A ∩ B)) ∪ (A ∩ B)
Proof.
|A ∪ B| = |(A − (A ∩ B)) ∪ (B − (A ∩ B)) ∪ (A ∩ B)|
{all these disjoint}
= |A − (A ∩ B)| + |B − (A ∩ B)| + |A ∩ B|
{A ∩ B ⊆ A and A ∩ B ⊆ B}
= |A| − |A ∩ B| + |B| − |A ∩ B| + |A ∩ B|
= |A| + |B| − |A ∩ B|
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Cardinality A ∪ B ∪ C
|A ∪ B ∪ C | = |(A ∪ B) ∪ C |
= |A ∪ B| + |C | − |(A ∪ B) ∩ C |
= {Set Theory distributive law }
|A ∪ B| + |C | − |(A ∩ C ) ∪ (B ∩ C )|
= |A| + |B| − |A ∩ B| + |C |
−(|A ∩ C | + |B ∩ C | − |(A ∩ C ) ∩ (B ∩ C )|
= |A| + |B| + |C |
−(|A ∩ B| + |A ∩ C ) + |B ∩ C |)
+|A ∩ B ∩ C |
|A∪B ∪C | = |A|+|B|+|C |−|A∩B|−|A∩C |−|B ∩C |+|A∩B ∩C |
Set Theory
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
Example
Students pass the year if they pass all 3 exams A, B, C.
For a particular year it was found that
3% failed all 3 papers
9% failed papers B and C
10% failed papers A and C
12% failed papers A and B
32% failed paper A
30% failed paper B
46% failed paper C
1
What percentage of students passed the year
2
What percentage failed exactly one paper.
Set Theory
Solution
Solution:
A
20
13
B
6 12
3 9
30
7
C
Preliminaries
Russell’s Paradox
Set Operations
Set Properties
Cardinality of Sets
© Copyright 2026 Paperzz