# Cantor's diagonal argument

In set theory, **Cantor's diagonal argument**, also called the **diagonalisation argument**, the **diagonal slash argument** or the **diagonal method**, 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.^{[1]}^{[2]}^{[3]}
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.^{[4]}^{[5]}
However, it demonstrates a powerful and general technique that has since been used in a wide range of proofs,^{[6]} including the first of Gödel's incompleteness theorems^{[2]} and Turing's answer to the *Entscheidungsproblem*. Diagonalization arguments are often also the source of contradictions like Russell's paradox^{[7]}^{[8]} and Richard's paradox.^{[9]}

## Uncountable set

In his 1891 article, 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 theorem:

- If
*s*_{1},*s*_{2}, … ,*s*_{n}, … is any enumeration of elements from*T*, then there is always an element*s*of*T*which corresponds to no*s*_{n}in the enumeration.

The proof starts with an enumeration of elements from *T*, for example:

*s*_{1}=(0, 0, 0, 0, 0, 0, 0, ...) *s*_{2}=(1, 1, 1, 1, 1, 1, 1, ...) *s*_{3}=(0, 1, 0, 1, 0, 1, 0, ...) *s*_{4}=(1, 0, 1, 0, 1, 0, 1, ...) *s*_{5}=(1, 1, 0, 1, 0, 1, 1, ...) *s*_{6}=(0, 0, 1, 1, 0, 1, 1, ...) *s*_{7}=(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 *s*_{1} (swapping **0**s for **1**s and vice versa), the 2nd digit as complementary to the 2nd digit of *s*_{2}, the 3rd digit as complementary to the 3rd digit of *s*_{3}, and generally for every *n*, the *n*^{th} digit as complementary to the *n*^{th} digit of *s*_{n}. For the example above, this yields:

*s*_{1}= ( ,**0**0, 0, 0, 0, 0, 0, ...) *s*_{2}= (1, ,**1**1, 1, 1, 1, 1, ...) *s*_{3}= (0, 1, ,**0**1, 0, 1, 0, ...) *s*_{4}= (1, 0, 1, ,**0**1, 0, 1, ...) *s*_{5}= (1, 1, 0, 1, ,**0**1, 1, ...) *s*_{6}= (0, 0, 1, 1, 0, ,**1**1, ...) *s*_{7}= (1, 0, 0, 0, 1, 0, ,**0**...) ... *s*= ( ,**1**,**0**,**1**,**1**,**1**,**0**,**1**...)

By construction, *s* differs from each *s*_{n}, since their *n*^{th} digits differ (highlighted in the example).
Hence, *s* cannot occur in the enumeration.

Based on this theorem, Cantor then uses a proof by contradiction to show that:

- The set
*T*is uncountable.

The proof starts by assuming that *T* is countable.
Then all its elements can be written as an enumeration *s*_{1}, *s*_{2}, … , *s*_{n}, … .
Applying the previous theorem to this enumeration produces a sequence *s* not belonging to the enumeration. However, this contradicts *s* being an element of *T* and therefore belonging to the enumeration. This contradiction implies that the original assumption is false. Therefore, *T* is uncountable.

### Interpretation

The interpretation of Cantor's result will depend upon one's view of mathematics. To constructivists, the argument shows no more than that there is no bijection between the natural numbers and *T*. It does not rule out the possibility that the latter are subcountable. In the context of classical mathematics, this is impossible, and the diagonal argument establishes that, although both sets are infinite, there are actually *more* infinite sequences of ones and zeros than there are natural numbers.

### Real numbers

The uncountability of the real numbers was already established by Cantor's first uncountability proof, but it also follows from the above result. To prove this, an injection will be constructed from the set *T* of infinite binary strings to the set **R** of real numbers. Since *T* is uncountable, the image of this function, which is a subset of **R**, is uncountable. Therefore, **R** is uncountable. Also, by using a method of construction devised by Cantor, a bijection will be constructed between *T* and **R**. Therefore, *T* and **R** have the same cardinality, which is called the "cardinality of the continuum" and is usually denoted by
or
.

An injection from *T* to **R** is given by mapping strings in *T* to decimals, such as mapping *t* = 0111… to the decimal 0.0111…. This function, defined by *f* (*t*) = 0.*t*, is an injection because it maps different strings to different numbers.

Instead of mapping 0111… to the decimal 0.0111…, it can be mapped to the base *b* number: 0.0111…_{b}. This leads to the family of functions: *f*_{b} (*t*) = 0.*t*_{b}. The functions *f* _{b}(*t*) are injections, except for *f* _{2}(*t*). This function will be modified to produce a bijection between *T* and **R**.

Construction of a bijection between T and R |
---|

This construction uses a method devised by Cantor that was published in 1878. He used it to construct a bijection between the closed interval [0, 1] and the irrationals in the open interval (0, 1). He first removed a countably infinite subset from each of these sets so that there is a bijection between the remaining uncountable sets. Since there is a bijection between the countably infinite subsets that have been removed, combining the two bijections produces a bijection between the original sets. Cantor's method can be used to modify the function To modify To construct a bijection from |

## General sets

A generalized form of the diagonal argument was used by Cantor to prove Cantor's theorem: for every set *S*, the power set of *S*—that is, the set of all subsets of *S* (here written as * P*(

*S*))—has a larger cardinality than

*S*itself. This proof proceeds as follows:

Let *f* be any function from *S* to * P*(

*S*). It suffices to prove

*f*cannot be surjective. That means that some member

*T*of

*(*

**P***S*), i.e. some subset of

*S*, is not in the image of

*f*. As a candidate consider the set:

*T*= {*s*∈*S*:*s*∉*f*(*s*) }.

For every *s* in *S*, either *s* is in *T* or not. If *s* is in *T*, then by definition of *T*, *s* is not in *f*(*s*), so *T* is not equal to *f*(*s*). On the other hand, if *s* is not in *T*, then by definition of *T*, *s* is in *f*(*s*), so again *T* is not equal to *f*(*s*); cf. picture.
For a more complete account of this proof, see Cantor's theorem.

### Consequences

This result implies that the notion of the set of all sets is an inconsistent notion. If *S* were the set of all sets then * P*(

*S*) would at the same time be bigger than

*S*and a subset of

*S*.

Russell's Paradox has shown us that naive set theory, based on an unrestricted comprehension scheme, is contradictory. Note that there is a similarity between the construction of *T* and the set in Russell's paradox. Therefore, depending on how we modify the axiom scheme of comprehension in order to avoid Russell's paradox, arguments such as the non-existence of a set of all sets may or may not remain valid.

The diagonal argument shows that the set of real numbers is "bigger" than the set of natural numbers (and therefore, the integers and rationals as well). Therefore, we can ask if there is a set whose cardinality is "between" that of the integers and that of the reals. This question leads to the famous continuum hypothesis. Similarly, the question of whether there exists a set whose cardinality is between |*S*| and |* P*(

*S*)| for some infinite

*S*leads to the generalized continuum hypothesis.

Analogues of the diagonal argument are widely used in mathematics to prove the existence or nonexistence of certain objects. For example, the conventional proof of the unsolvability of the halting problem is essentially a diagonal argument. Also, diagonalization was originally used to show the existence of arbitrarily hard complexity classes and played a key role in early attempts to prove P does not equal NP.

### Version for Quine's New Foundations

The above proof fails for W. V. Quine's "New Foundations" set theory (NF). In NF, the naive axiom scheme of comprehension is modified to avoid the paradoxes by introducing a kind of "local" type theory. In this axiom scheme,

- {
*s*∈*S*:*s*∉*f*(*s*) }

is *not* a set — i.e., does not satisfy the axiom scheme. On the other hand, we might try to create a modified diagonal argument by noticing that

- {
*s*∈*S*:*s*∉*f*({*s*}) }

*is* a set in NF. In which case, if **P**_{1}(*S*) is the set of one-element subsets of *S* and *f* is a proposed bijection from **P**_{1}(*S*) to * P*(

*S*), one is able to use proof by contradiction to prove that |

**P**_{1}(

*S*)| < |

*(*

**P***S*)|.

The proof follows by the fact that if *f* were indeed a map *onto* * P*(

*S*), then we could find

*r*in

*S*, such that

*f*({

*r*}) coincides with the modified diagonal set, above. We would conclude that if

*r*is not in

*f*({

*r*}), then

*r*is in

*f*({

*r*}) and vice versa.

It is *not* possible to put **P**_{1}(*S*) in a one-to-one relation with *S*, as the two have different types, and so any function so defined would violate the typing rules for the comprehension scheme.

## See also

## References

- ↑ Georg Cantor (1891). "Ueber eine elementare Frage der Mannigfaltigkeitslehre".
*Jahresbericht der Deutschen Mathematiker-Vereinigung 1890–1891*.**1**: 75–78. English translation: Ewald, William B. (ed.) (1996).*From Immanuel Kant to David Hilbert: A Source Book in the Foundations of Mathematics, Volume 2*. Oxford University Press. pp. 920–922. ISBN 0-19-850536-1. - 1 2 Keith Simmons (30 July 1993).
*Universality and the Liar: An Essay on Truth and the Diagonal Argument*. Cambridge University Press. pp. 20–. ISBN 978-0-521-43069-2. - ↑ Rudin, Walter (1976).
*Principles of Mathematical Analysis*(3rd ed.). New York: McGraw-Hill. p. 30. ISBN 0070856133. - ↑ Gray, Robert (1994), "Georg Cantor and Transcendental Numbers" (PDF),
*American Mathematical Monthly*,**101**(9): 819–832, doi:10.2307/2975129, JSTOR 2975129 - ↑ Bloch, Ethan D. (2011).
*The Real Numbers and Real Analysis*. New York: Springer. p. 429. ISBN 978-0-387-72176-7. - ↑ Sheppard, Barnaby (2014).
*The Logic of Infinity*(illustrated ed.). Cambridge University Press. p. 73. ISBN 978-1-107-05831-6. Extract of page 73 - ↑ "Russell's paradox". Stanford encyclopedia of philosophy.
- ↑ Bertrand Russell (1931).
*Principles of mathematics*. Norton. pp. 363–366. - ↑ Keith Simmons (30 July 1993).
*Universality and the Liar: An Essay on Truth and the Diagonal Argument*. Cambridge University Press. p. 27. ISBN 978-0-521-43069-2. - ↑ See page 254 of Georg Cantor (1878), "Ein Beitrag zur Mannigfaltigkeitslehre",
*Journal für die Reine und Angewandte Mathematik*,**84**: 242&ndash, 258 . This proof is discussed in Joseph Dauben (1979),*Georg Cantor: His Mathematics and Philosophy of the Infinite*, Harvard University Press, ISBN 0-674-34871-0 , pp. 61–62, 65. On page 65, Dauben proves a result that is stronger than Cantor's. He lets "*φ*denote any sequence of rationals in [0, 1]." Cantor lets_{ν}*φ*denote a sequence enumerating the rationals in [0, 1], which is the kind of sequence needed for his construction of a bijection between [0, 1] and the irrationals in (0, 1)._{ν}