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 Law of Excluded Middle, for each $x \in S$:


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

Thus the construction produces a mapping on S.

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

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 the definition of set difference.

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 for Two Variables:


 * $(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.

Proof 2
Define a mapping $E: \mathcal P(S) \to \mathcal P(S)$ by letting:


 * $E(K) = S \setminus (T \setminus f(K))$

Then $E(K) = (S \setminus T) \cup f(K)$.

By Set Union Preserves Subsets/Corollary, $E$ is increasing.

Thus by Knaster-Tarski Lemma/Power Set, $E$ has a fixed point $X$.

Then by the definition of fixed point, $E(X) = X$.

That is, $(S \setminus (T \setminus f(X))) = X$.

Taking the set difference from $S$:


 * $T \setminus f(X) = S \setminus X$

By Restricting Injection to Bijection, the restriction, $f'$, of $f$ to $X \times f(X)$ is a bijection.

By Identity Mapping is Bijection, the identity mapping $i$ from $S \setminus X$ to $T \setminus f(X)$ is a bijection.

Thus by Union of Bijections with Disjoint Domains and Codomains is Bijection, $g = f' \cup i$ is the bijection we seek.