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:

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.

The language of sets in one place: 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\}.

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.

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.