Logic, Sets and Infinity

How Numbers Can Be Built From Nothing but Sets

Start with the empty set and build counting numbers, integers, fractions and real numbers, one clear definition at a time.

Key takeaways

  • In von Neumann's construction, 0 is the empty set and each number n is the set of all smaller numbers.
  • Addition and multiplication are defined by repeating the successor step, and their laws are proved by induction.
  • Integers and rationals are classes of pairs, which encode "a minus b" and "p divided by q" before those operations exist.
  • A real number can be defined as a Dedekind cut, and other encodings work equally well, so the structure matters more than the particular sets.

You can define every familiar kind of number using only sets, starting from the set that contains nothing. Zero is the empty set, each next counting number collects all the ones before it, and integers, fractions and real numbers are then assembled from those.

The point is not that numbers "really are" curly brackets. The construction shows that one small collection of assumptions about sets is enough to support ordinary arithmetic, with nothing about numbers assumed in advance.

Zero and the successor

Begin with ∅, the empty set. Define it to be 0. Then define the successor of n, the next number, as S(n) = n ∪ {n}: take everything in n, and add n itself as one more member.

0 = ∅
1 = {0}        = {∅}
2 = {0, 1}     = {∅, {∅}}
3 = {0, 1, 2}  = {∅, {∅}, {∅, {∅}}}

The pattern has two pleasant features. The number n has exactly n members, so it can serve as the standard set of that size. And m < n holds exactly when m ∈ n, so order comes free. This definition is due to John von Neumann.

Here the natural numbers include 0. The axioms that permit each step are described in the Zermelo-Fraenkel axioms.

The first numbers as sets
1 Zero The set with no members 2 One The set whose only member is zero 3 Two The set containing zero and one 4 Three The set containing zero, one and two Zero The set with no members 1 One The set whose only member is zero 2 Two The set containing zero and one 3 Three The set containing zero, one and two 4

Collecting all of them

Each number exists by pairing and union. To gather all of them into one set N you need the axiom of infinity, which says there is a set containing 0 and closed under successor. Take N to be the smallest such set.

"Smallest" is powerful. Suppose A is a subset of N that contains 0 and contains S(n) whenever it contains n. Then A is closed under successor, so N, being smallest, is contained in A. Hence A = N. That is the principle of mathematical induction, now a theorem instead of an assumption.

You can also verify that 0 is not a successor, since S(n) has at least one member, and that different numbers have different successors. These are the properties listed in Peano's axioms.

Addition and multiplication

Arithmetic is defined by recursion: say what happens at 0, then how to get from n to S(n).

m + 0    = m
m + S(n) = S(m + n)

m × 0    = 0
m × S(n) = (m × n) + m

Here is 2 + 2, using 1 = S(0) and 2 = S(1).

2 + 2 = 2 + S(1)        since 2 = S(1)
      = S(2 + 1)        rule for successor
      = S(2 + S(0))     since 1 = S(0)
      = S(S(2 + 0))     rule for successor
      = S(S(2))         rule for zero
      = S(3) = 4

From these rules, induction proves that addition and multiplication are commutative and associative, and that multiplication distributes over addition. The proofs are not instant. Even m + n = n + m takes a couple of preliminary results, which makes a good first exercise.

Proving a law by induction

To see how a familiar rule becomes a theorem, prove that 0 + n = n for every n. The definition only tells you that m + 0 = m, with zero on the right, so the other order needs an argument.

Base case:   0 + 0 = 0                    rule m + 0 = m
Assume:      0 + k = k                    induction hypothesis
Then:        0 + S(k) = S(0 + k)          rule for successor
                      = S(k)              by the hypothesis
Conclusion:  0 + n = n for every n in N

The set of numbers for which the statement holds contains 0 and is closed under successor, so it is all of N. Every basic law of arithmetic can be built up this way. Order matters: the associative law is usually proved first, and commutativity follows after a short lemma about adding 1.

Subtraction and division do not appear yet. Within the natural numbers they are only sometimes possible, which is the reason for the next two constructions.

The integers as differences

The natural numbers do not let you solve x + 3 = 1. We want a number meaning "1 − 3", but subtraction is not yet available. The trick is to represent it by the pair (1, 3).

Many pairs should mean the same integer: (1, 3), (2, 4) and (0, 2) all stand for −2. So declare (a, b) and (c, d) equivalent when a + d = b + c, a condition that uses only addition. Each integer is then an equivalence class of pairs.

(a, b) + (c, d) = (a + c, b + d)
(a, b) × (c, d) = (ac + bd, ad + bc)

The multiplication rule mirrors (a − b)(c − d). You can now check a famous sign rule. Take −1 as the pair (0, 1).

(0, 1) × (0, 1) = (0×0 + 1×1,  0×1 + 1×0) = (1, 0)

The pair (1, 0) means +1. A negative times a negative comes out positive because of how the definitions fit together. You also need to confirm that the answer does not depend on which representative pairs you pick, a step called checking that the operation is well defined.

Checking that a definition is well defined

Whenever objects are classes of pairs, any operation defined through a representative must give the same class no matter which representative you use. Otherwise the definition is meaningless.

Test addition on two choices. The pair (1, 3) and the pair (4, 6) both stand for −2, since 1 + 6 = 3 + 4. Add the pair (5, 1), which stands for 4, to each.

(1, 3) + (5, 1) = (6, 4)       stands for 2
(4, 6) + (5, 1) = (9, 7)       stands for 2
check: 6 + 7 = 4 + 9 = 13      so the two results are equivalent

An example is not a proof, but the general proof is short: if a + d = b + c, then adding e + f to both sides gives (a + e) + (d + f) = (b + f) + (c + e), which says that the two sums are equivalent.

The natural number n sits inside the integers as the class of (n, 0), and every integer is such a class or the negative of one.

Fractions as pairs again

The same idea produces the rational numbers. Take pairs (p, q) of integers with q ≠ 0, thought of as p divided by q. Declare (p, q) and (r, s) equivalent when p × s = q × r.

So (1, 2), (3, 6) and (−5, −10) belong to one class, the rational number one half. Check the middle one: 1 × 6 = 2 × 3. Addition follows the school rule:

(p, q) + (r, s) = (ps + qr, qs)
(1, 2) + (1, 3) = (1×3 + 2×1, 6) = (5, 6)

The condition q ≠ 0 is not decoration. If pairs with second entry 0 were allowed, the pair (0, 0) would be equivalent to every pair, and the whole system would collapse.

Real numbers as cuts

The rationals have gaps. No rational number has square 2, as shown in several proofs that √2 is irrational. Richard Dedekind's idea was to define a real number by the rationals that lie below it.

A Dedekind cut is a set L of rationals that is not empty, is not all rationals, contains every rational smaller than any of its members, and has no largest member. For √2:

L = { q rational : q < 0  or  q² < 2 }

This describes the gap using only rational arithmetic. The rational number 3/4 becomes the cut of all rationals below 3/4. Order is inclusion of cuts, addition adds members pairwise, and multiplication takes a little care with signs.

The reward is completeness: every nonempty set of reals with an upper bound has a least upper bound, namely the union of the cuts. That property underpins calculus and is explored in the completeness of the real numbers. Cantor and others gave another construction using sequences of rationals whose terms get arbitrarily close together.

The ladder at a glance

Number system Built as New thing you can do
Natural numbers Sets formed from ∅ by successor Count, add, multiply
Integers Classes of pairs of naturals Always subtract
Rationals Classes of pairs of integers Divide by anything nonzero
Reals Cuts of rationals Fill the gaps, take limits
Complex numbers Pairs of reals with a special product Solve every polynomial equation of degree at least 1

For complex numbers, (a, b) × (c, d) = (ac − bd, ad + bc). Then (0, 1) × (0, 1) = (−1, 0), so the pair (0, 1) behaves as i.

Strictly, the natural number 2, the integer 2, the rational 2 and the real 2 are different sets. Each level contains a faithful copy of the one before, with the same arithmetic, and mathematicians identify them.

Is a number really a set?

Von Neumann's definition is not the only one. Zermelo used S(n) = {n}, so that 2 = {{∅}}. Both give a perfectly good arithmetic. Yet they disagree on questions such as whether 0 ∈ 2: yes in the first, no in the second.

The philosopher Paul Benacerraf pressed this point in a 1965 article titled "What Numbers Could Not Be". If two encodings are equally good, it seems odd to say that the number 2 is one of them. One response, often called structuralism, is that a number is just a position in a structure with a start and a successor.

For working purposes you can think of the set definitions as an implementation. Like different file formats storing the same text, they differ inside and agree on everything arithmetic can ask.

The agreement can be made exact. Any two structures that have a starting element, a one-to-one successor that never returns to the start, and the full induction property over subsets match up element for element. Zermelo's numbers and von Neumann's numbers are two such structures, so every statement phrased purely with zero and successor, and operations built from them, holds in one exactly when it holds in the other.

Each number system rests on the one below
Real numbers Cuts in the rationals Rational numbers Classes of integer pairs Integers Classes of natural number pairs Natural numbers Generated by the successor step The empty set The only starting object Real numbers Cuts in the rationals Rational numbers Classes of integer pairs Integers Classes of natural number pairs Natural numbers Generated by the successor step The empty set The only starting object

Written for 4Mathematics with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 41 articles in Logic, Sets and Infinity →

Latest news on this topic