Sets and Set Notation
Almost everything in mathematics is really a collection of things: the numbers
that solve an equation, the points on a line, the vowels in the alphabet, the students in a
class. A set is the precise name for such a collection, and
set notation is the compact, universal language mathematicians use to describe
collections, who belongs to them, and how they combine.
You already think in sets without noticing. “The pupils who play football” and
“the pupils who play chess” are two sets; the ones who do both are their
intersection; the ones who do either are their union.
This page gives you the handful of symbols that turn those everyday ideas into exact, shareable
mathematics.
A set is a collection of distinct objects. Each object in the
set is an element, and we list the elements inside curly
braces: \{1, 2, 3\} is the set whose elements are
1, 2 and 3.
A small handful of symbols carries most of the language of sets:
-
x \in A — “x
is an element of A”.
-
x \notin A — “x
is not an element of A”.
-
B \subseteq A — “B
is a subset of A”: every element of
B is also in A.
-
\varnothing — the empty set, the set with no
elements at all.
-
\mathcal{E} — the universal set: everything under
consideration in the current problem.
The number of elements in a set A is written
|A|. So if A = \{1, 2, 3\} then
|A| = 3.
For big or infinite sets we don't list every element — we give a rule, using
set-builder notation: \{x : \text{condition}\}, read
“the set of all x such that the condition holds.”
For example \{x : x \text{ is a whole number and } 1 \le x \le 4\} = \{1, 2, 3, 4\},
and \{x : x^2 = 9\} = \{-3, 3\}.
Two sets can be combined into a new set. There are three core operations.
-
Union A \cup B — everything in
A or B (or both).
-
Intersection A \cap B — everything in
both A and B.
-
Complement A' — everything in the universal set
that is not in A.
The language of sets in one place:
- \in — element of;
- \subseteq — subset;
- \varnothing — the empty set;
- A \cup B — union (or);
- A \cap B — intersection (and);
- A' — complement (not);
- \{x : \dots\} — set-builder (a rule).
A Venn diagram pictures all of them at once.
Worked examples
Let A = \{1, 2, 3, 4, 5\} and
B = \{4, 5, 6, 7\}, inside the universal set
\mathcal{E} = \{1, 2, 3, \dots, 10\}.
-
Intersection. Which elements are in both? Only
4 and 5. So
A \cap B = \{4, 5\} and |A \cap B| = 2.
-
Union. Which elements are in either? Pool them all and drop repeats:
A \cup B = \{1, 2, 3, 4, 5, 6, 7\}, so
|A \cup B| = 7 — not 9, because
4 and 5 are counted once each.
-
Complement. Everything in \mathcal{E} but not in
A: A' = \{6, 7, 8, 9, 10\}.
-
Subset. Is \{4, 5\} \subseteq A? Yes — both
4 and 5 live in
A. Is B \subseteq A? No, because
6 \in B but 6 \notin A.
-
Set-builder. The condition “even numbers in
\mathcal{E}” is written
\{x \in \mathcal{E} : x \text{ is even}\} = \{2, 4, 6, 8, 10\}.
Picturing the operations
Two sets A and B are drawn as overlapping
circles inside the rectangle, which stands for the universal set
\mathcal{E}. Step forward to shade the intersection, then the union.
These are the mistakes examiners see again and again.
-
Union and intersection are opposites — don't swap them.
\cup is union, meaning “or”
— everything in either set. \cap is
intersection, meaning “and” — only what is in
both. A memory hook: \cup looks like a
cup that scoops up everything; \cap is the small
overlap left over.
-
Elements are distinct, and order doesn't matter. A set never repeats an
element and has no built-in order:
\{1, 2\} = \{2, 1\}, and
\{1, 1, 2\} is just \{1, 2\} — a set with
2 elements, not 3. (An ordered collection
with repeats is a list, written with round brackets, not a set.)
-
The empty set is a subset of everything.
\varnothing \subseteq A is true for every set
A — there is no element of \varnothing
that could fail to be in A. Also,
\varnothing and \{\varnothing\} are
different: the first is empty; the second is a set containing one thing (the empty set), so
|\{\varnothing\}| = 1.
Set theory was built almost single-handedly by Georg Cantor in the 1870s, and
it is now the foundation of all modern mathematics: numbers, functions, shapes
— every mathematical object can be defined purely in terms of sets. It is the shared language of
mathematics, of computer science (databases, types, the very idea of a data structure), and of
logic.
Cantor's most shocking discovery was that infinity comes in different sizes. By
cleverly trying to pair them up, he proved there are strictly more real numbers than
whole numbers — the reals are a “bigger” infinity. The idea was so revolutionary
that it was ridiculed in his lifetime; today it is bedrock. All of it rests on the same tiny
vocabulary of curly braces, \in, \cup and
\cap you have just met.