# Cantor's theorem

In mathematical set theory, Cantor's theorem is a fundamental result which states that, for any set ${\displaystyle A}$, the set of all subsets of ${\displaystyle A,}$ known as the power set of ${\displaystyle A,}$ has a strictly greater cardinality than ${\displaystyle A}$ itself.

For finite sets, Cantor's theorem can be seen to be true by simple enumeration of the number of subsets. Counting the empty set as a subset, a set with ${\displaystyle n}$ elements has a total of ${\displaystyle 2^{n}}$ subsets, and the theorem holds because ${\displaystyle 2^{n}>n}$ for all non-negative integers.

Much more significant is Cantor's discovery of an argument that is applicable to any set, and shows that the theorem holds for infinite sets also. As a consequence, the cardinality of the real numbers, which is the same as that of the power set of the integers, is strictly larger than the cardinality of the integers; see Cardinality of the continuum for details.

The theorem is named for German mathematician Georg Cantor, who first stated and proved it at the end of the 19th century. Cantor's theorem had immediate and important consequences for the philosophy of mathematics. For instance, by iteratively taking the power set of an infinite set and applying Cantor's theorem, we obtain an endless hierarchy of infinite cardinals, each strictly larger than the one before it. Consequently, the theorem implies that there is no largest cardinal number (colloquially, "there's no largest infinity").

## Proof

Cantor's argument is elegant and remarkably simple. The complete proof is presented below, with detailed explanations to follow.

Theorem (Cantor) — Let ${\displaystyle f}$ be a map from set ${\displaystyle A}$ to its power set ${\displaystyle {\mathcal {P}}(A)}$. Then ${\displaystyle f:A\to {\mathcal {P}}(A)}$ is not surjective. As a consequence, ${\displaystyle \operatorname {card} (A)<\operatorname {card} ({\mathcal {P}}(A))}$ holds for any set ${\displaystyle A}$.

Proof

${\displaystyle B=\{x\in A\mid x\notin f(x)\}}$ exists via the axiom schema of specification, and ${\displaystyle B\in {\mathcal {P}}(A)}$ because ${\displaystyle B\subseteq A}$.
Assume ${\displaystyle f}$ is surjective.
Then there exists a ${\displaystyle \xi \in A}$ such that ${\displaystyle f(\xi )=B}$.
From  for all ${\displaystyle x}$ in ${\displaystyle A\ [x\in B\iff x\notin f(x)]}$ , we deduce  ${\displaystyle \xi \in B\iff \xi \notin f(\xi )}$  via universal instantiation.
The previous deduction yields a contradiction of the form ${\displaystyle \varphi \Leftrightarrow \lnot \varphi }$, since ${\displaystyle f(\xi )=B}$.
Therefore, ${\displaystyle f}$ is not surjective, via reductio ad absurdum.
We know injective maps from ${\displaystyle A}$ to ${\displaystyle {\mathcal {P}}(A)}$ exist. For example, a function ${\displaystyle g:A\to {\mathcal {P}}(A)}$ such that ${\displaystyle g(x)=\{x\}}$.
Consequently, ${\displaystyle \operatorname {card} (A)<\operatorname {card} ({\mathcal {P}}(A))}$. ∎

By definition of cardinality, we have ${\displaystyle \operatorname {card} (X)<\operatorname {card} (Y)}$ for any two sets ${\displaystyle X}$ and ${\displaystyle Y}$ if and only if there is an injective function but no bijective function from ${\displaystyle X}$ to ${\displaystyle Y}$. It suffices to show that there is no surjection from ${\displaystyle X}$ to ${\displaystyle Y}$. This is the heart of Cantor's theorem: there is no surjective function from any set ${\displaystyle A}$ to its power set. To establish this, it is enough to show that no function ${\displaystyle f}$ (that maps elements in ${\displaystyle A}$ to subsets of ${\displaystyle A}$) can reach every possible subset, i.e., we just need to demonstrate the existence of a subset of ${\displaystyle A}$ that is not equal to ${\displaystyle f(x)}$ for any ${\displaystyle x\in A}$. Recalling that each ${\displaystyle f(x)}$ is a subset of ${\displaystyle A}$, such a subset is given by the following construction, sometimes called the Cantor diagonal set of ${\displaystyle f}$:[1][2]

${\displaystyle B=\{x\in A\mid x\not \in f(x)\}.}$

This means, by definition, that for all ${\displaystyle x\in A}$, ${\displaystyle x\in B}$ if and only if ${\displaystyle x\notin f(x)}$. For all ${\displaystyle x}$ the sets ${\displaystyle B}$ and ${\displaystyle f(x)}$ cannot be equal because ${\displaystyle B}$ was constructed from elements of ${\displaystyle A}$ whose images under ${\displaystyle f}$ did not include themselves. For all ${\displaystyle x\in A}$ either ${\displaystyle x\in f(x)}$ or ${\displaystyle x\notin f(x)}$. If ${\displaystyle x\in f(x)}$ then ${\displaystyle f(x)}$ cannot equal ${\displaystyle B}$ because ${\displaystyle x\in f(x)}$ by assumption and ${\displaystyle x\notin B}$ by definition. If ${\displaystyle x\notin f(x)}$ then ${\displaystyle f(x)}$ cannot equal ${\displaystyle B}$ because ${\displaystyle x\notin f(x)}$ by assumption and ${\displaystyle x\in B}$ by the definition of ${\displaystyle B}$.

Equivalently, and slightly more formally, we have just proved that the existence of ${\displaystyle \xi \in A}$ such that ${\displaystyle f(\xi )=B}$ implies the following contradiction:

{\displaystyle {\begin{aligned}\xi \in B&\iff \xi \notin f(\xi )&&{\text{(by definition of }}B{\text{)}};\\\xi \in B&\iff \xi \in f(\xi )&&{\text{(by assumption that }}f(\xi )=B{\text{)}}.\\\end{aligned}}}

Therefore, by reductio ad absurdum, the assumption must be false.[3] Thus there is no ${\displaystyle \xi \in A}$ such that ${\displaystyle f(\xi )=B}$ ; in other words, ${\displaystyle B}$ is not in the image of ${\displaystyle f}$ and ${\displaystyle f}$ does not map onto every element of the power set of ${\displaystyle A}$, i.e., ${\displaystyle f}$ is not surjective.

Finally, to complete the proof, we need to exhibit an injective function from ${\displaystyle A}$ to its power set. Finding such a function is trivial: just map ${\displaystyle x}$ to the singleton set ${\displaystyle \{x\}}$. The argument is now complete, and we have established the strict inequality for any set ${\displaystyle A}$ that ${\displaystyle \operatorname {card} (A)<\operatorname {card} ({\mathcal {P}}(A))}$.

Another way to think of the proof is that ${\displaystyle B}$, empty or non-empty, is always in the power set of ${\displaystyle A}$. For ${\displaystyle f}$ to be onto, some element of ${\displaystyle A}$ must map to ${\displaystyle B}$. But that leads to a contradiction: no element of ${\displaystyle B}$ can map to ${\displaystyle B}$ because that would contradict the criterion of membership in ${\displaystyle B}$, thus the element mapping to ${\displaystyle B}$ must not be an element of ${\displaystyle B}$ meaning that it satisfies the criterion for membership in ${\displaystyle B}$, another contradiction. So the assumption that an element of ${\displaystyle A}$ maps to ${\displaystyle B}$ must be false; and ${\displaystyle f}$ cannot be onto.

Because of the double occurrence of ${\displaystyle x}$ in the expression "${\displaystyle x\in f(x)}$", this is a diagonal argument. For a countable (or finite) set, the argument of the proof given above can be illustrated by constructing a table in which each row is labelled by a unique ${\displaystyle x}$ from ${\displaystyle A=\{x_{1},x_{2},\ldots \}}$, in this order. ${\displaystyle A}$ is assumed to admit a linear order so that such table can be constructed. Each column of the table is labelled by a unique ${\displaystyle y}$ from the power set of ${\displaystyle A}$; the columns are ordered by the argument to ${\displaystyle f}$, i.e. the column labels are ${\displaystyle f(x_{1}),f(x_{2})}$, ..., in this order. The intersection of each row ${\displaystyle x}$ and column ${\displaystyle y}$ records a true/false bit whether ${\displaystyle x\in y}$. Given the order chosen for the row and column labels, the main diagonal ${\displaystyle D}$ of this table thus records whether ${\displaystyle x\in f(x)}$ for each ${\displaystyle x\in A}$. The set ${\displaystyle B}$ constructed in the previous paragraphs coincides with the row labels for the subset of entries on this main diagonal ${\displaystyle D}$ where the table records that ${\displaystyle x\in f(x)}$ is false.[3] Each column records the values of the indicator function of the set corresponding to the column. The indicator function of ${\displaystyle B}$ coincides with the logically negated (swap "true" and "false") entries of the main diagonal. Thus the indicator function of ${\displaystyle B}$ does not agree with any column in at least one entry. Consequently, no column represents ${\displaystyle B}$.

Despite the simplicity of the above proof, it is rather difficult for an automated theorem prover to produce it. The main difficulty lies in an automated discovery of the Cantor diagonal set. Lawrence Paulson noted in 1992 that Otter could not do it, whereas Isabelle could, albeit with a certain amount of direction in terms of tactics that might perhaps be considered cheating.[2]

## When A is countably infinite

Let us examine the proof for the specific case when ${\displaystyle A}$ is countably infinite. Without loss of generality, we may take ${\displaystyle A=\mathbb {N} =\{1,2,3,\ldots \}}$, the set of natural numbers.

Suppose that ${\displaystyle \mathbb {N} }$ is equinumerous with its power set ${\displaystyle {\mathcal {P}}(\mathbb {N} )}$. Let us see a sample of what ${\displaystyle {\mathcal {P}}(\mathbb {N} )}$ looks like:

${\displaystyle {\mathcal {P}}(\mathbb {N} )=\{\varnothing ,\{1,2\},\{1,2,3\},\{4\},\{1,5\},\{3,4,6\},\{2,4,6,\dots \},\dots \}.}$

${\displaystyle {\mathcal {P}}(\mathbb {N} )}$ contains infinite subsets of ${\displaystyle \mathbb {N} }$, e.g. the set of all positive even numbers ${\displaystyle \{2,4,6,\ldots \}=\{2k:k\in \mathbb {N} \}}$, along with the empty set ${\displaystyle \varnothing }$.

Now that we have an idea of what the elements of ${\displaystyle {\mathcal {P}}(\mathbb {N} )}$ are, let us attempt to pair off each element of ${\displaystyle \mathbb {N} }$ with each element of ${\displaystyle {\mathcal {P}}(\mathbb {N} )}$ to show that these infinite sets are equinumerous. In other words, we will attempt to pair off each element of ${\displaystyle \mathbb {N} }$ with an element from the infinite set ${\displaystyle {\mathcal {P}}(\mathbb {N} )}$, so that no element from either infinite set remains unpaired. Such an attempt to pair elements would look like this:

${\displaystyle \mathbb {N} {\begin{Bmatrix}1&\longleftrightarrow &\{4,5\}\\2&\longleftrightarrow &\{1,2,3\}\\3&\longleftrightarrow &\{4,5,6\}\\4&\longleftrightarrow &\{1,3,5\}\\\vdots &\vdots &\vdots \end{Bmatrix}}{\mathcal {P}}(\mathbb {N} ).}$

Given such a pairing, some natural numbers are paired with subsets that contain the very same number. For instance, in our example the number 2 is paired with the subset {1, 2, 3}, which contains 2 as a member. Let us call such numbers selfish. Other natural numbers are paired with subsets that do not contain them. For instance, in our example the number 1 is paired with the subset {4, 5}, which does not contain the number 1. Call these numbers non-selfish. Likewise, 3 and 4 are non-selfish.

Using this idea, let us build a special set of natural numbers. This set will provide the contradiction we seek. Let ${\displaystyle B}$ be the set of all non-selfish natural numbers. By definition, the power set ${\displaystyle {\mathcal {P}}(\mathbb {N} )}$ contains all sets of natural numbers, and so it contains this set ${\displaystyle B}$ as an element. If the mapping is bijective, ${\displaystyle B}$ must be paired off with some natural number, say ${\displaystyle b}$. However, this causes a problem. If ${\displaystyle b}$ is in ${\displaystyle B}$, then ${\displaystyle b}$ is selfish because it is in the corresponding set, which contradicts the definition of ${\displaystyle B}$. If ${\displaystyle b}$ is not in ${\displaystyle B}$, then it is non-selfish and it should instead be a member of ${\displaystyle B}$. Therefore, no such element ${\displaystyle b}$ which maps to ${\displaystyle B}$ can exist.

Since there is no natural number which can be paired with ${\displaystyle B}$, we have contradicted our original supposition, that there is a bijection between ${\displaystyle \mathbb {N} }$ and ${\displaystyle {\mathcal {P}}(\mathbb {N} )}$.

Note that the set ${\displaystyle B}$ may be empty. This would mean that every natural number ${\displaystyle x}$ maps to a subset of natural numbers that contains ${\displaystyle x}$. Then, every number maps to a nonempty set and no number maps to the empty set. But the empty set is a member of ${\displaystyle {\mathcal {P}}(\mathbb {N} )}$, so the mapping still does not cover ${\displaystyle {\mathcal {P}}(\mathbb {N} )}$.

Through this proof by contradiction we have proven that the cardinality of ${\displaystyle \mathbb {N} }$ and ${\displaystyle {\mathcal {P}}(\mathbb {N} )}$ cannot be equal. We also know that the cardinality of ${\displaystyle {\mathcal {P}}(\mathbb {N} )}$ cannot be less than the cardinality of ${\displaystyle \mathbb {N} }$ because ${\displaystyle {\mathcal {P}}(\mathbb {N} )}$ contains all singletons, by definition, and these singletons form a "copy" of ${\displaystyle \mathbb {N} }$ inside of ${\displaystyle {\mathcal {P}}(\mathbb {N} )}$. Therefore, only one possibility remains, and that is that the cardinality of ${\displaystyle {\mathcal {P}}(\mathbb {N} )}$ is strictly greater than the cardinality of ${\displaystyle \mathbb {N} }$, proving Cantor's theorem.

Cantor's theorem and its proof are closely related to two paradoxes of set theory.

Cantor's paradox is the name given to a contradiction following from Cantor's theorem together with the assumption that there is a set containing all sets, the universal set ${\displaystyle V}$. In order to distinguish this paradox from the next one discussed below, it is important to note what this contradiction is. By Cantor's theorem ${\displaystyle |{\mathcal {P}}(X)|>|X|}$ for any set ${\displaystyle X}$. On the other hand, all elements of ${\displaystyle {\mathcal {P}}(V)}$ are sets, and thus contained in ${\displaystyle V}$, therefore ${\displaystyle |{\mathcal {P}}(V)|\leq |V|}$.[1]

Another paradox can be derived from the proof of Cantor's theorem by instantiating the function f with the identity function; this turns Cantor's diagonal set into what is sometimes called the Russell set of a given set A:[1]

${\displaystyle R_{A}=\left\{\,x\in A:x\not \in x\,\right\}.}$

The proof of Cantor's theorem is straightforwardly adapted to show that assuming a set of all sets U exists, then considering its Russell set RU leads to the contradiction:

${\displaystyle R_{U}\in R_{U}\iff R_{U}\notin R_{U}.}$

This argument is known as Russell's paradox.[1] As a point of subtlety, the version of Russell's paradox we have presented here is actually a theorem of Zermelo;[4] we can conclude from the contradiction obtained that we must reject the hypothesis that RUU, thus disproving the existence of a set containing all sets. This was possible because we have used restricted comprehension (as featured in ZFC) in the definition of RA above, which in turn entailed that

${\displaystyle R_{U}\in R_{U}\iff (R_{U}\in U\wedge R_{U}\notin R_{U}).}$

Had we used unrestricted comprehension (as in Frege's system for instance) by defining the Russell set simply as ${\displaystyle R=\left\{\,x:x\not \in x\,\right\}}$, then the axiom system itself would have entailed the contradiction, with no further hypotheses needed.[4]

Despite the syntactical similarities between the Russell set (in either variant) and the Cantor diagonal set, Alonzo Church emphasized that Russell's paradox is independent of considerations of cardinality and its underlying notions like one-to-one correspondence.[5]

## History

Cantor gave essentially this proof in a paper published in 1891 "Über eine elementare Frage der Mannigfaltigkeitslehre",[6] where the diagonal argument for the uncountability of the reals also first appears (he had earlier proved the uncountability of the reals by other methods). The version of this argument he gave in that paper was phrased in terms of indicator functions on a set rather than subsets of a set.[7] He showed that if f is a function defined on X whose values are 2-valued functions on X, then the 2-valued function G(x) = 1 − f(x)(x) is not in the range of f.

Bertrand Russell has a very similar proof in Principles of Mathematics (1903, section 348), where he shows that there are more propositional functions than objects. "For suppose a correlation of all objects and some propositional functions to have been affected, and let phi-x be the correlate of x. Then "not-phi-x(x)," i.e. "phi-x does not hold of x" is a propositional function not contained in this correlation; for it is true or false of x according as phi-x is false or true of x, and therefore it differs from phi-x for every value of x." He attributes the idea behind the proof to Cantor.

Ernst Zermelo has a theorem (which he calls "Cantor's Theorem") that is identical to the form above in the paper that became the foundation of modern set theory ("Untersuchungen über die Grundlagen der Mengenlehre I"), published in 1908. See Zermelo set theory.

## Generalizations

Lawvere's fixed-point theorem provides for a broad generalization of Cantor's theorem to any category with finite products in the following way:[8] let ${\displaystyle {\mathcal {C}}}$ be such a category, and let ${\displaystyle 1}$ be a terminal object in ${\displaystyle {\mathcal {C}}}$. Suppose that ${\displaystyle Y}$ is an object in ${\displaystyle {\mathcal {C}}}$ and that there exists an endomorphism ${\displaystyle \alpha :Y\to Y}$ that does not have any fixed points; that is, there is no morphism ${\displaystyle y:1\to Y}$ that satisfies ${\displaystyle \alpha \circ y=y}$. Then there is no object ${\displaystyle T}$ of ${\displaystyle {\mathcal {C}}}$ such that a morphism ${\displaystyle f:T\times T\to Y}$ can parameterize all morphisms ${\displaystyle T\to Y}$. In other words, for every object ${\displaystyle T}$ and every morphism ${\displaystyle f:T\times T\to Y}$, an attempt to write maps ${\displaystyle T\to Y}$ as maps of the form ${\displaystyle f(-,x):T\to Y}$ must leave out at least one map ${\displaystyle T\to Y}$.