mk

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}A = \{1,\ 2,\ 3,\ 4,\ 5\}

Two fundamental ideas: order doesn't matter and duplicates are ignored. The sets {1,2,3}\{1, 2, 3\} and {3,1,2}\{3, 1, 2\} are identical, and {1,1,2}\{1, 1, 2\} is the same as {1,2}\{1, 2\}.

Membership

We write aAa \in A to say element aa belongs to set AA, and bAb \notin A to say it does not:

A={2,4,6}4A,5AA = \{2, 4, 6\} \quad\Rightarrow\quad 4 \in A, \quad 5 \notin A

The Empty Set

The empty set \emptyset (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 AA is a collection of distinct objects. We write xAx \in A if xx is an element of AA, and xAx \notin A otherwise. The empty set \emptyset contains no elements.

Set-Builder Notation

When a set is too large or abstract to list explicitly, we describe it with a rule:

{xUP(x)}\{x \in U \mid P(x)\}

Read: "the set of all xx in universe UU such that P(x)P(x) is true." The vertical bar \mid (or colon  ⁣:\colon) means "such that."

Examples

{xZx>0}={1,2,3,}\{x \in \mathbb{Z} \mid x > 0\} = \{1, 2, 3, \ldots\}
{xRx2<4}=(2, 2)\{x \in \mathbb{R} \mid x^2 < 4\} = (-2,\ 2)
{nNn is even}={0,2,4,6,}\{n \in \mathbb{N} \mid n \text{ is even}\} = \{0, 2, 4, 6, \ldots\}

Standard Number Sets

Mathematics uses several standard sets, each denoted by a blackboard-bold letter:

N\mathbb{N}
Natural numbers
{0,1,2,3,}\{0, 1, 2, 3, \ldots\}
Z\mathbb{Z}
Integers
{,2,1,0,1,2,}\{\ldots, -2, -1, 0, 1, 2, \ldots\}
Q\mathbb{Q}
Rational numbers
{pqp,qZ, q0}\left\{\tfrac{p}{q} \mid p, q \in \mathbb{Z},\ q \neq 0\right\}
R\mathbb{R}
Real numbers
all points on the number line\text{all points on the number line}
C\mathbb{C}
Complex numbers
{a+bia,bR}\{a + bi \mid a, b \in \mathbb{R}\}

These are nested: NZQRC\mathbb{N} \subset \mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R} \subset \mathbb{C}.

Subsets

Definition — Subset

AA is a subset of BB, written ABA \subseteq B, if every element of AA is also an element of BB:
AB    x(xAxB)A \subseteq B \iff \forall x\,(x \in A \Rightarrow x \in B)

If additionally ABA \neq B, we call AA a proper subset, written ABA \subset B.

Key facts

Reflexivity

AAA \subseteq A

Every set is a subset of itself.

Empty set

A\emptyset \subseteq A

The empty set is a subset of every set.

Antisymmetry

AB and BAA=BA \subseteq B \text{ and } B \subseteq A \Rightarrow A = B

Sets are equal iff each is a subset of the other.

Transitivity

AB and BCACA \subseteq B \text{ and } B \subseteq C \Rightarrow A \subseteq C

Set Operations

Given sets AA and BB within a universe UU, four fundamental operations produce new sets:

Union

The union ABA \cup B contains every element that is in AA, in BB, or in both:

AB={xxA or xB}A \cup B = \{x \mid x \in A\ \text{or}\ x \in B\}

Example: {1,2,3}{3,4,5}={1,2,3,4,5}\{1,2,3\} \cup \{3,4,5\} = \{1,2,3,4,5\}

Intersection

The intersection ABA \cap B contains only elements that belong to both sets:

AB={xxA and xB}A \cap B = \{x \mid x \in A\ \text{and}\ x \in B\}

Example: {1,2,3}{3,4,5}={3}\{1,2,3\} \cap \{3,4,5\} = \{3\}

Sets with an empty intersection are called disjoint: AB=A \cap B = \emptyset.

Set Difference

The difference ABA \setminus B (also written ABA - B) contains elements in AA that are not in BB:

AB={xxA and xB}A \setminus B = \{x \mid x \in A\ \text{and}\ x \notin B\}

Example: {1,2,3,4}{3,4,5}={1,2}\{1,2,3,4\} \setminus \{3,4,5\} = \{1,2\}

Complement

The complement AcA^c (or A\overline{A}) contains everything in the universe that is not in AA:

Ac=UA={xUxA}A^c = U \setminus A = \{x \in U \mid x \notin A\}

Laws of Set Algebra

Set operations obey algebraic laws analogous to those of arithmetic. Let A,B,CUA, B, C \subseteq U:

Commutativity

AB=BAA \cup B = B \cup A
AB=BAA \cap B = B \cap A

Associativity

(AB)C=A(BC)(A \cup B) \cup C = A \cup (B \cup C)
(AB)C=A(BC)(A \cap B) \cap C = A \cap (B \cap C)

Distributivity

A(BC)=(AB)(AC)A \cup (B \cap C) = (A \cup B) \cap (A \cup C)
A(BC)=(AB)(AC)A \cap (B \cup C) = (A \cap B) \cup (A \cap C)

Identity

A=AA \cup \emptyset = A
AU=AA \cap U = A

Complement

AAc=UA \cup A^c = U
AAc=A \cap A^c = \emptyset

Double Complement

(Ac)c=A(A^c)^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:

(AB)c=AcBc(A \cup B)^c = A^c \cap B^c
(AB)c=AcBc(A \cap B)^c = A^c \cup B^c

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 AA, written A|A| or #A\#A, is the number of elements it contains.

Finite sets

A={a,b,c}A=3=0A = \{a, b, c\} \Rightarrow |A| = 3 \qquad |\emptyset| = 0

Inclusion-Exclusion Principle

For two finite sets, union and intersection cardinalities are related by:

AB=A+BAB|A \cup B| = |A| + |B| - |A \cap B|

The intuition: adding A|A| and B|B| counts elements in ABA \cap B twice, so we subtract once.

For three sets:

ABC=A+B+CABACBC+ABC|A \cup B \cup C| = |A| + |B| + |C| - |A \cap B| - |A \cap C| - |B \cap C| + |A \cap B \cap C|

Infinite cardinality

Cantor showed that not all infinite sets have the same size. The cardinality of N\mathbb{N} is denoted 0\aleph_0 (aleph-null) — any set that can be put in one-to-one correspondence with N\mathbb{N} is called countably infinite. The real numbers R\mathbb{R} are uncountably infinite, with cardinality R=c=20|\mathbb{R}| = \mathfrak{c} = 2^{\aleph_0}.

Power Set

Definition — Power Set

The power set of AA, written P(A)\mathcal{P}(A), is the set of all subsets of AA, including \emptyset and AA itself.
P({1,2})={, {1}, {2}, {1,2}}\mathcal{P}(\{1,2\}) = \bigl\{\emptyset,\ \{1\},\ \{2\},\ \{1,2\}\bigr\}

The cardinality of the power set grows exponentially:

A=nP(A)=2n|A| = n \Rightarrow |\mathcal{P}(A)| = 2^n

For a set with 3 elements, the power set has 23=82^3 = 8 members. For 10 elements, it has 1,024.

This formula holds because each element of AA is either included or excluded from a subset — a binary choice — giving 2n2^n combinations total.

Cartesian Product

Definition — Cartesian Product

The Cartesian product A×BA \times B is the set of all ordered pairs (a,b)(a,b) where aAa \in A and bBb \in B:
A×B={(a,b)aA, bB}A \times B = \{(a,b) \mid a \in A,\ b \in B\}
{1,2}×{x,y}={(1,x), (1,y), (2,x), (2,y)}\{1,2\} \times \{x,y\} = \{(1,x),\ (1,y),\ (2,x),\ (2,y)\}

The cardinality of a Cartesian product is the product of the cardinalities:

A×B=AB|A \times B| = |A| \cdot |B|

The familiar coordinate plane R2\mathbb{R}^2 is exactly R×R\mathbb{R} \times \mathbb{R} — pairs of real numbers (x,y)(x, y). More generally, Rn=R×R××R\mathbb{R}^n = \mathbb{R} \times \mathbb{R} \times \cdots \times \mathbb{R} (nn times).

A relation from AA to BB is any subset of A×BA \times B. A function f:ABf: A \to B is a relation where each element of AA appears in exactly one pair.


Next: Logic → (coming soon)