In set theory, Cantor's diagonal argument, also called the diagonalisation argument, the diagonal slash argument, the anti-diagonal argument, the diagonal method, and Cantor's diagonalization proof, was published in 1891 by Georg Cantor as a mathematical proof that there are infinite sets which cannot be put into one-to-one correspondence with the infinite set of natural numbers. Such sets are now known as uncountable sets, and the size of infinite sets is now treated by the theory of cardinal numbers which Cantor began.
The diagonal argument was not Cantor's first proof of the uncountability of the real numbers, which appeared in 1874.
However, it demonstrates a general technique that has since been used in a wide range of proofs, including the first of Gödel's incompleteness theorems and Turing's answer to the Entscheidungsproblem. Diagonalization arguments are often also the source of contradictions like Russell's paradox and Richard's paradox.
Cantor considered the set T of all infinite sequences of binary digits (i.e. each digit is zero or one).
He begins with a constructive proof of the following lemma:
If s1, s2, ... , sn, ... is any enumeration of elements from T, then an element s of T can be constructed that doesn't correspond to any sn in the enumeration.
The proof starts with an enumeration of elements from T, for example
{|
|-
| s1 = || (0, || 0, || 0, || 0, || 0, || 0, || 0, || ...)
|-
| s2 = || (1, || 1, || 1, || 1, || 1, || 1, || 1, || ...)
|-
| s3 = || (0, || 1, || 0, || 1, || 0, || 1, || 0, || ...)
|-
| s4 = || (1, || 0, || 1, || 0, || 1, || 0, || 1, || ...)
|-
| s5 = || (1, || 1, || 0, || 1, || 0, || 1, || 1, || ...)
|-
| s6 = || (0, || 0, || 1, || 1, || 0, || 1, || 1, || ...)
|-
| s7 = || (1, || 0, || 0, || 0, || 1, || 0, || 0, || ...)
|-
| ...
|}
Next, a sequence s is constructed by choosing the 1st digit as complementary to the 1st digit of s1 (swapping 0s for 1s and vice versa), the 2nd digit as complementary to the 2nd digit of s2, the 3rd digit as complementary to the 3rd digit of s3, and generally for every n, the nth digit as complementary to the nth digit of sn.