Mathematics → Set Theory
Set Theory
Set theory is the branch of mathematics that studies collections of objects. Introduced by Georg Cantor in the 1870s, it became the foundation upon which nearly all of modern mathematics is built.
What is a Set?
A set is a well-defined collection of distinct objects called its elements or members. Sets are written using curly braces, with elements separated by commas:
A={1, 2, 3, 4, 5} Two fundamental ideas: order doesn't matter and duplicates are ignored. The sets {1,2,3} and {3,1,2} are identical, and {1,1,2} is the same as {1,2}.
Membership
We write a∈A to say element a belongs to set A, and b∈/A to say it does not:
A={2,4,6}⇒4∈A,5∈/A The Empty Set
The empty set ∅ (also written {}) contains no elements. It is the unique set with cardinality zero and plays the role of zero in set arithmetic.
Definition — Set
A set
A is a collection of distinct objects. We write
x∈A if
x is an element of
A, and
x∈/A otherwise. The empty set
∅ contains no elements.
Set-Builder Notation
When a set is too large or abstract to list explicitly, we describe it with a rule:
{x∈U∣P(x)} Read: "the set of all x in universe U such that P(x) is true." The vertical bar ∣ (or colon :) means "such that."
Examples
{x∈Z∣x>0}={1,2,3,…} {x∈R∣x2<4}=(−2, 2) {n∈N∣n is even}={0,2,4,6,…} Standard Number Sets
Mathematics uses several standard sets, each denoted by a blackboard-bold letter:
Natural numbers
{0,1,2,3,…} Integers
{…,−2,−1,0,1,2,…} Rational numbers
{qp∣p,q∈Z, q=0} Real numbers
all points on the number line Complex numbers
{a+bi∣a,b∈R} These are nested: N⊂Z⊂Q⊂R⊂C.
Subsets
Definition — Subset
A is a
subset of
B, written
A⊆B, if every element of
A is also an element of
B:
A⊆B⟺∀x(x∈A⇒x∈B) If additionally A=B, we call A a proper subset, written A⊂B.
Key facts
Reflexivity
Every set is a subset of itself.
Empty set
∅⊆A The empty set is a subset of every set.
Antisymmetry
A⊆B and B⊆A⇒A=B Sets are equal iff each is a subset of the other.
Transitivity
A⊆B and B⊆C⇒A⊆C Set Operations
Given sets A and B within a universe U, four fundamental operations produce new sets:
Union
The union A∪B contains every element that is in A, in B, or in both:
A∪B={x∣x∈A or x∈B} Example: {1,2,3}∪{3,4,5}={1,2,3,4,5}
Intersection
The intersection A∩B contains only elements that belong to both sets:
A∩B={x∣x∈A and x∈B} Example: {1,2,3}∩{3,4,5}={3}
Sets with an empty intersection are called disjoint: A∩B=∅.
Set Difference
The difference A∖B (also written A−B) contains elements in A that are not in B:
A∖B={x∣x∈A and x∈/B} Example: {1,2,3,4}∖{3,4,5}={1,2}
Complement
The complement Ac (or A) contains everything in the universe that is not in A:
Ac=U∖A={x∈U∣x∈/A} Laws of Set Algebra
Set operations obey algebraic laws analogous to those of arithmetic. Let A,B,C⊆U:
Commutativity
A∪B=B∪A A∩B=B∩A Associativity
(A∪B)∪C=A∪(B∪C) (A∩B)∩C=A∩(B∩C) Distributivity
A∪(B∩C)=(A∪B)∩(A∪C) A∩(B∪C)=(A∩B)∪(A∩C) Identity
A∪∅=A Complement
A∪Ac=U A∩Ac=∅ Double Complement
(Ac)c=A De Morgan's Laws
These laws relate complements to unions and intersections — they are among the most useful identities in both set theory and logic:
(A∪B)c=Ac∩Bc (A∩B)c=Ac∪Bc Intuitively: "not (A or B)" means "not A and not B." "not (A and B)" means "not A or not B."
Cardinality
Definition — Cardinality
The
cardinality of a set
A, written
∣A∣ or
#A, is the number of elements it contains.
Finite sets
A={a,b,c}⇒∣A∣=3∣∅∣=0 Inclusion-Exclusion Principle
For two finite sets, union and intersection cardinalities are related by:
∣A∪B∣=∣A∣+∣B∣−∣A∩B∣ The intuition: adding ∣A∣ and ∣B∣ counts elements in A∩B twice, so we subtract once.
For three sets:
∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣A∩C∣−∣B∩C∣+∣A∩B∩C∣ Infinite cardinality
Cantor showed that not all infinite sets have the same size. The cardinality of N is denoted ℵ0 (aleph-null) — any set that can be put in one-to-one correspondence with N is called countably infinite. The real numbers R are uncountably infinite, with cardinality ∣R∣=c=2ℵ0.
Power Set
Definition — Power Set
The
power set of
A, written
P(A), is the set of all subsets of
A, including
∅ and
A itself.
P({1,2})={∅, {1}, {2}, {1,2}} The cardinality of the power set grows exponentially:
∣A∣=n⇒∣P(A)∣=2n For a set with 3 elements, the power set has 23=8 members. For 10 elements, it has 1,024.
This formula holds because each element of A is either included or excluded from a subset — a binary choice — giving 2n combinations total.
Cartesian Product
Definition — Cartesian Product
The
Cartesian product A×B is the set of all ordered pairs
(a,b) where
a∈A and
b∈B:
A×B={(a,b)∣a∈A, b∈B} {1,2}×{x,y}={(1,x), (1,y), (2,x), (2,y)} The cardinality of a Cartesian product is the product of the cardinalities:
∣A×B∣=∣A∣⋅∣B∣ The familiar coordinate plane R2 is exactly R×R — pairs of real numbers (x,y). More generally, Rn=R×R×⋯×R (n times).
A relation from A to B is any subset of A×B. A function f:A→B is a relation where each element of A appears in exactly one pair.
Next: Logic → (coming soon)