Cantor-Bernstein-Schröder Theorem/Lemma

Theorem
Let $S$ be a set.

Let $T \subseteq S$.

Suppose that $f: S \to T$ is an injection.

Then there is a bijection $g: S \to T$.

Proof
Recursively define a sequence $\langle C_n \rangle$ in the power set of $S$ as follows:


 * $C_0 = S \setminus T$, the difference between $S$ and $T$.
 * $C_{n+1} = f(C_n)$, the image of $C_n$ under $f$.

Let $\displaystyle C = \bigcup_{n \in \N} C_n$.

Define a mapping $h: S \to T$ as follows:


 * $\displaystyle h(x) = \cases {

f(x) & \text{if $x \in C$} \\ x & \text{if $x \notin C$} }$

$h$ is indeed a mapping from $S$ to $T$
By the Principle of Recursive Definition the construction produces a mapping from $S$ to $S$.

We need only show that $h(x) \in T$ for each $x \in S$.

Let $x \in S$.

By Law of Excluded Middle:


 * $x \in C$ or $x \notin C$.

If $x \in C$, then $h(x) = f(x) \in T$.

If $x \notin C$, then by Subset of Union, $x \notin C_0$.

Since $x \in S$, $x \in S \setminus C_0$.

By Relative Complement of Relative Complement:


 * $S \setminus C_0 = T$

Thus $x \in T$ by the definition of subset.

Since $h(x) = x$ in this case:


 * $h(x) \in T$

$h$ is injective
Let $x, y \in S$ and suppose that $h(x) = h(y)$.

By Law of Excluded Middle:


 * $(x \in C) \lor (x \notin C)$ and
 * $(y \in C) \lor (y \notin C)$

Because Conjunction Distributes over Disjunction:


 * $(x \in C) \land (y \in C)$ or
 * $(x \notin C) \land (y \notin C)$ or
 * $(x \in C) \land (y \notin C)$ or
 * $(x \notin C) \land (y \in C)$.

If $x, y \in C$, then $x = y$ because $f$ is injective.

If $x, y \notin C$, then $x = y$ by Identity Mapping is Injection.

If $x \in C$ and $y \notin C$, then:

$x \in C_n$ for some $n$ by the definition of union.


 * $h(x) = f(x) \in C_{n+1} \subseteq C$ by Subset of Union.

Thus $h(x) \in C$.


 * $h(y) = y$ by the definition of $h$.

Since $y \notin C$, this contradicts the assumption that $h(x) = h(y)$.

The argument for the case of $x \notin C$ and $y \in C$ is identical to the preceding.

Thus $h(x) = h(y) \implies x = y$ for all $x, y \in S$, so $h$ is injective.

$h$ is surjective
Let $y \in T$.

By Law of Excluded Middle:


 * $y \in C$ or $y \notin C$.

If $y \notin C$, then $h(y) = y$.

If $y \in C$, then since $y \notin C_0 = S \setminus T$:


 * $y \in C_{n+1}$ for some $n \ge 0$.

Thus $y = f(x)$ for some $x \in C_n$.

By the definition of union, $x \in C$.

Thus $h(x) = f(x) = y$.

This in all cases we can find an $x \in S$ such that $h(x) = y$, so $h$ is surjective.