Section 2.1: Sets
MTH 260 Fall 2025
9/16/25
1/9
Sets
A set is an unordered collection of objects, referred to as
the set’s members or elements.
If you know Python, then sets are very much like instances
of the built-in set type.
We often use set-builder notation to define a set. The
notation A = {a, b, c, d, . . . } means A is the set consisting
of elements a, b, c, d, . . . .
More generally, if P(x) is a predicate, then
A = { x | P(x) }
is the set of all objects x such that P(x) is true.
Write x ∈ A to mean “x is an element of A”. Read “x in A”.
Then A = { x ∈ A | P(x) } means “the set of all x in A such
that P(x) is true”.
2/9
Examples of sets
3/9
Relationships between sets
If A and B are sets, then A is a subset of B if
∀x (x ∈ A → x ∈ B). Notation: A ⊆ B.
Also say B is a superset of A, written B ⊇ A.
A and B are equal, A = B, iff they have the same elements.
In other words, A = B iff A ⊆ B and B ⊆ A.
(This is related to the philosophical concept of extensionality.)
A is a strict subset of B if A ⊆ B and A ̸= B. Notation:
A ⊂ B. Also say B is a strict superset of A, written B ⊃ A.
Fact: ∅ ⊆ A for every set A.
4/9
Making new sets from old
The union of A and B is A ∪ B = { x | (x ∈ A) ∨ (x ∈ B) }.
Their intersection is A ∩ B = { x | (x ∈ A) ∧ (x ∈ B) }.
Their difference is A − B = { x | (x ∈ A) ∧ (x ∈
/ B) }.
(Also frequently written A \ B.)
The complement of A is Ā = { x | x ∈
/ A }.
C
(Also written A .) Note A − B = A ∩ B̄.
A and B are disjoint if A ∩ B = ∅.
5/9
Cardinality
The cardinality of a set is its number of elements.
Notation: |S| = cardinality of S.
A set is called finite if its cardinality is finite. Otherwise it’s
infinite. We will talk a lot more about infinite sets in Section 2.5.
The power set of a set A is P(A) = { x | x ⊆ A }.
Fact: If A is finite, then |P(A)| = 2|A| .
6/9
More ways to make new sets from old
If A and B are sets, then their Cartesian product is the set
A × B of all ordered pairs where the first element is from A
and the second is from B. That is:
A × B = { (a, b) | (a ∈ A) ∧ (b ∈ B) }.
Think of this as “all possible ways to pair an element of A
with an element of B”.
7/9
Dictionary of Python set operations
Abstract set operation
Python set operation
x∈A
{ x ∈ A | P(x) }
A=B
A⊆B
A⊇B
A ⊂ B; A ⊃ B
A∪B
∪ni=0 Ai
A∩B
∩ni=0 Ai
A \ B or A − B
A×B
∅
A∩B=∅
|A|
x in A
{x for x in A if P(x)}
A == B
A <= B or A.issubset(B)
A >= B or A.issuperset(B)
A < B; A > B
A | B or A.union(B)
A0 | A1 | ... | An
A & B or A.intersection(B)
A0 & A1 & ... & An
A - B or A.difference(B)
{(a,b) for a in A for b in B}
{}
A.isdisjoint(B)
len(A)
8/9
Comprehension and Russell’s Paradox
What we have been doing is called “naive set theory”
because we allow ourselves to define sets using predicates
with any domain.
Russell’s Paradox: Let R be the set of all sets which do not
contain themselves (as elements). That is, R = { x | x ̸∈ x }.
Does R contain itself or not? i.e., is R ∈ R or R ∈
/ R?
Axiomatic set theory gets around paradoxes like this by
restricting how you can use predicates to define sets. The
comprehension axiom states (roughly) that if A is already
a set, and P is a predicate which can be expressed entirely
in terms of ∈, =, and logical connectives, then
{ x ∈ A | P(x) } is also a set.
This gets around Russell’s Paradox because U is not a set,
and so R is not a set either. (That is: the definition of R is
not a valid definition of a set.)
9/9