Non-existence of a Surjective Function from a Set to Its Subsets (Cantor's theorem)

Cantor's theorem states:

Suppose that $A$ is a set and $f\colon A\to\mathcal P(A)$ is any function, then $f$ is not surjective.

The proof is quite simple, and constructive!

Proof. Suppose that $f\colon A\to\mathcal P(A)$ is a function, we define $D=\{a\in A\mid a\notin f(a)\}$. This is a good definition, since $f(a)$ is a subset of $A$, and $a$ is an element of $A$, we can ask whether or not $a\in f(a)$. So $D$ is the set of those elements of $A$ which do not have this property.

Of course that $D\in\mathcal P(A)$ since it is clearly a subset of $A$. We will show that $f(a)\neq D$ for all $a\in A$.

  1. If $a\in D$ then, by definition of $D$, $a\notin f(a)$. So $f(a)\neq D$, since the element $a$ belongs to D but not to $f(a)$.
  2. If $a\notin D$ then, by definition of $D$, $a\in f(a)$. By the same argument, again $f(a)\neq D$.

Either way, $D\neq f(a)$ for all $a\in A$. Therefore $f$ is not surjective. $\square$


Note that for different functions we have different $D$'s. It is possible that $D=A$ (e.g. if $f(a)=\varnothing$ for all $a$), or it could be $\varnothing$ (e.g. if $f(a)=\{a\}$ for all $a$). However regardless to its value it will not be in the range of $f$.


Look up Cantor's Theorem. There are several versions of this theorem. The basic version is to the effect that there is no bijection between a set $A$ and its power set $P(A)$. One of the proofs goes by showing there is no surjection from $A$ to $P(A)$. What one does is to assume there is, so that for each $a$ there is a subset $f(a)$ in the power set. Then one defines a set $B$ by saying that $x$ is in $B$ if and only if $x$ is NOT in the set $f(x)$. Now you ask: Is $x$ in $B$? If it is, it isn't, and if it isn't then it is... either way you get a contradiction!