The diagonal and its consequences

R is uncountable

Statement

Cantor's theorem. The set R\mathbb{R} is uncountable.

In other words, there is no bijection from N\mathbb{N} onto R\mathbb{R}: the infinity of the reals is strictly larger than that of the integers. Cantor published this result in 1874, then in 1891 gave the proof that became famous, the diagonal argument.

It is enough to deal with the interval [0,1)\left[0, 1\right), because if it is uncountable, then R\mathbb{R}, which contains it, is uncountable as well.

The diagonal argument

Proof by contradiction. Suppose [0,1)\left[0, 1\right) is countable. Then there is an enumeration x0,x1,x2,…x_0, x_1, x_2, \ldots of all its elements. Write the proper decimal expansion of each, denoting by an,ka_{n,k} the kk-th digit after the decimal point of xnx_n:

Rank Decimal expansion Diagonal digit
00 0.1 4 1 5…0.\mathbf{1}\,4\,1\,5\ldots a0,0=1a_{0,0} = 1
11 0.7 1 8 2…0.7\,\mathbf{1}\,8\,2\ldots a1,1=1a_{1,1} = 1
22 0.5 7 7 2…0.5\,7\,\mathbf{7}\,2\ldots a2,2=7a_{2,2} = 7
33 0.3 0 1 0…0.3\,0\,1\,\mathbf{0}\ldots a3,3=0a_{3,3} = 0

Constructing the escaping real. We build a number yy in [0,1)\left[0, 1\right) by requiring its kk-th decimal digit bkb_k to be different from ak,ka_{k,k}:

bk={5if ak,k≠54if ak,k=5b_k = \begin{cases} 5 & \text{if } a_{k,k} \neq 5 \\ 4 & \text{if } a_{k,k} = 5 \end{cases}

In the example, y=0.5545…y = 0.5545\ldots

Contradiction. The real number yy does belong to [0,1)\left[0, 1\right). Yet, for every nn, it differs from xnx_n in the nn-th decimal place, so y≠xny \neq x_n. The enumeration, supposed to contain all the elements, misses one: it does not exist. The interval [0,1)\left[0, 1\right) is uncountable, and so is R\mathbb{R}.

Why the digits 44 and 55

This choice is not cosmetic. The same real number can have two decimal expansions, such as

0.4999…=0.5000…0.4999\ldots = 0.5000\ldots

If the digits 00 and 99 were allowed in the construction, the number yy obtained could coincide with some xnx_n despite having a different expansion, and the argument would collapse. By using only 44 and 55, we avoid any sequence ending in infinitely many 00s or 99s: the expansion of yy is proper, and the digit-by-digit comparison is legitimate.

The general form: Cantor's theorem

The same argument, applied to indicator functions, gives a much stronger result:

For any set EE, there is no surjection from EE onto the set P(E)\mathcal{P}(E) of its subsets.

Proof. Let f:E→P(E)f : E \to \mathcal{P}(E). Set D={ x∈E  :  x∉f(x) }D = \left\{\, x \in E \;:\; x \notin f(x) \,\right\}. If DD had a preimage dd, then d∈D  ⟺  d∉f(d)=Dd \in D \iff d \notin f(d) = D, which is contradictory. The set DD therefore has no preimage, and ff is not surjective.

Starting from N\mathbb{N}, we thus obtain a strictly increasing sequence of infinities: there is no largest cardinal.

Classic pitfall

Objecting "just add yy to the list." This misreads the reasoning: we are not constructing a number missing from one particular list, we are showing that every enumeration misses one. Adding yy produces a new enumeration, to which the same procedure will immediately apply a new escaping number.