In 1891, Cantor gave a short proof that no sequence of infinite binary sequences contains all of them. The method, called diagonalization, is the most frequently used argument in computability theory: it shows that the halting problem is undecidable, that there are total computable functions which are not primitive recursive, and, in more elaborate forms, it underlies most constructions of non-computable sets. This lesson presents the argument, isolates its general form, and derives the uncountability of , , and .
4.1 Cantor space
Cantor space is the set of infinite binary sequences, that is, of functions . For and , the value is the -th bit of , and one writes .
A sequence and the set determine each other: the map is a bijection from onto , whose inverse sends a set to its characteristic function. In computability theory the two points of view are used interchangeably: the same letter denotes a subset of and its characteristic function, so that if and only if .
Finite binary strings are written ; the set of finite binary strings is , the length of is , and is the prefix of length of . By Proposition 3.11, is countable.
4.2 The diagonal argument
The set is uncountable: for every sequence of elements of , the sequence defined by
is different from every .
For every , the sequences and differ at position , since . So is none of the . Hence no function is surjective, and , which is non-empty, is not countable by Proposition 3.3.
The name of the argument comes from the table: the bits form its diagonal. Two features matter. First, is defined from the sequence , explicitly: the proof does not only show that some sequence is missing, it computes one. Second, each is defeated at a position of its own, so that the constraints on never conflict.
4.3 A general form
The argument uses neither binary values nor the indexing by integers in an essential way. Its general form is the following.
Let and be sets, a function, and a function without fixed point, that is, for every . Then the function defined by
is different from each function , for .
For , , so and differ at .
A function is the same thing as a family of functions , indexed by , that is, a function from to the set of functions from to . The lemma says that such a family never contains all functions , as soon as has a fixed-point-free map. Read contrapositively:
If there is a surjection from onto , then every function has a fixed point.
Let be a surjection from onto , and let . If had no fixed point, the function of Proposition 4.3 would differ from every , contradicting surjectivity.
If has at least two elements , the map exchanging and and fixing every other element has no fixed point, so there is no surjection from onto . The fixed point form is not a curiosity: Kleene’s fixed point theorem in the course on fundamentals (Fixed point theorem) has the same structure, with a numbering of partial computable functions in place of the surjection, and with the conclusion that every total computable transformation of programs has a fixed point up to the function computed: for some .
- , , , and gives Theorem 4.2.
- , : for every sequence of functions , the function differs from every . So the Baire space of functions is uncountable.
- arbitrary, : functions are characteristic functions of subsets of ; this gives the theorem of the next section.
4.4 Every set is smaller than its power set
For every set , there is no surjection from onto its power set . Hence .
Let , and let
If for some , then if and only if , a contradiction. So is not in the image of . Finally, is an injection , so ; and , since a bijection would be a surjection.
Iterating, , , , … is a sequence of infinite sets of strictly increasing cardinalities: there is no largest cardinality.
Apply the proof to a hypothetical set of all sets, with the identity: every subset of is a set, hence an element of , so for (and, say, for the elements of that are not sets) is a surjection onto . The diagonal set is , essentially Russell’s set, and the contradiction is Russell’s paradox (1901). In axiomatic set theory, the conclusion is that there is no set of all sets; the collection exists only as a class.
4.5 The real numbers
The diagonal argument gives a short proof of Cantor’s first uncountability theorem (1874). Decimal expansions need some care, because some real numbers have two of them: . For a real number and , let
be the -th decimal digit of the fractional part , in the expansion that does not end with infinitely many s.
The set is uncountable: for every sequence of real numbers, the number
is different from every .
We first show for every . For every , write
The first sum is an integer , and since every lies in , the tail satisfies . So , and .
Now if , then , which contradicts the definition of , chosen different from .
The digits and are chosen so that the tail stays below , which makes the expansion of that does not end with s; any two digits other than would do as well. The digit must be avoided: a rule that only requires could produce and for all , so that , while has .
4.6 Exercises
Show that the set of infinite subsets of , and the set of strictly increasing functions , are uncountable.
Solution
The map is an injection of into the set of infinite subsets of : the image contains exactly one element of for each , and is its parity. Similarly, is an injection of into the set of strictly increasing functions, since . A set into which injects is uncountable, since otherwise would be countable by Corollary 3.4.
Show that the set of bijections is uncountable.
Solution
To , associate the permutation that exchanges and when , and fixes them when . It is a bijection (it is its own inverse), and is injective, since if and only if . Conclude as in the previous exercise.
(Cantor’s proof of 1874.) Let be a sequence of real numbers. Construct closed intervals with and , and deduce that some real number differs from every . Which property of is used?
Solution
Start from . Given , cut it into three closed thirds; belongs to at most two of them, since the first and the last third are disjoint. Let be the leftmost third not containing . The sequence is non-decreasing and bounded by , so it has a limit , by the completeness of ; and for every , since for all and . Then , so , for every . Over , which is countable, the limit need not exist.
Let be a sequence of elements of . Show that the set of different from every is uncountable.
Solution
Let . It is non-empty by Theorem 4.2. If it were countable, there would be a surjection from onto , and the sequence , that is, and , would enumerate all of , contradicting Theorem 4.2. The lesson on the continuum shows more: is equipotent to .
4.7 Notes and references
The diagonal argument appears in Cantor’s note of 1891, where it is applied to binary sequences and then to the power set of an arbitrary set. The 1874 proof of the uncountability of uses nested intervals. The general form of the diagonal lemma and its fixed point reading are due to Lawvere, in the setting of cartesian closed categories; Yanofsky gives an elementary account, with applications to the paradoxes and to incompleteness. Russell communicated his paradox to Frege in a letter of 1902, and published it in the Principles of Mathematics.
- G. Cantor, Über eine elementare Frage der Mannigfaltigkeitslehre, Jahresbericht der Deutschen Mathematiker-Vereinigung 1 (1891), 75–78.
- F. W. Lawvere, Diagonal arguments and cartesian closed categories, in Category Theory, Homology Theory and their Applications II, Lecture Notes in Mathematics 92, Springer, 1969, 134–145.
- N. S. Yanofsky, A universal approach to self-referential paradoxes, incompleteness and fixed points, Bulletin of Symbolic Logic 9 (2003), 362–386.
- B. Russell, The Principles of Mathematics, Cambridge University Press, 1903.