Cantor-Bernstein-Schröder Theorem/Proof 4

Theorem
If a subset of one set is equivalent to the other, and a subset of the other is equivalent to the first, then the two sets are themselves equivalent:
 * $\forall S, T: T \sim S_1 \subseteq S \land S \sim T_1 \subseteq T \implies S \sim T$

Proof
By Definition:Set Equivalence there exist bijections $f : S \hookrightarrow \hspace{-8pt} \rightarrow T_1 \subseteq T$ and $g : T \hookrightarrow \hspace{-8pt} \rightarrow S_1 \subseteq S$. One can consider these as injections into $T$ and $S$ respectively and by Composite_of_Injections_is_Injection: $(h_S := g\circ f) : S \hookrightarrow S$, $(h_T := f\circ g) : T \hookrightarrow T$. In the following denote by $X$ either $S$ or $T$.

Using $h_X$, $X$ will be divided into equivalence classes such that there exists a bijection between the classes of $S$ and those of $T$.

First define $\preceq_X \subseteq X^2$ by


 * $\langle x_1,x_2 \rangle \in \preceq_X \hspace{8pt}\Leftrightarrow\hspace{8pt} \exists n\in\N: x_2 = h_X^n x_1$

Claim

 * $\preceq_X$ is a preorder.

Proof

 * (Reflexivity) Let $x \in X$ then $x = h_X^0 x$ $\implies x\preceq x$
 * (Transitivity) Let $x \preceq y$ and $y \preceq z$ then $y = h_X^m x$ and $z = h_X^n y$ $\implies z = h_X^{m+n}x \implies x\preceq z$

Now define $\sim_X \subseteq X^2$ by


 * $\langle x_1,x_2 \rangle \in \sim_X \hspace{8pt}\Leftrightarrow\hspace{8pt} x_1\preceq x_2 \vee x_2\preceq x_1$

Claim

 * $\sim_X$ is an equivalence relation.

For $x\in X$ denote by $\left[\!\left[{x}\right]\!\right]_X := \left[\!\left[{x}\right]\!\right]_{\sim_X} \in X/\!\sim_X$ the equivalence class of $x$.

Since Equivalence_Classes_are_Disjoint these $\left[\!\left[{x}\right]\!\right]_X$ form a partition of $X$ and therefor every element of $X$ belongs to exactly one element of $X/\!\sim_X$ (namely $\left[\!\left[{x}\right]\!\right]_X$).

Now define $\widetilde{f} : S/\!\sim_S \to T/\!\sim_T$ by $f(\left[\!\left[{s}\right]\!\right]_S) = \left[\!\left[{f(s)}\right]\!\right]_T$ and $\widetilde{g}$ analogous.

Claim

 * $\widetilde{f}$ is well defined.

Proof

 * Let $s_1,s_2\in \left[\!\left[{s}\right]\!\right]_S$.
 * Then $s_1\sim_S s_2$ and wlog $s_1\preceq_S s_2$.
 * Let $n\in\N$ such that $s_2 = h_S^n s_1 = (g\circ f)^n s_1$. It follows that
 * $f(s_2) = f((g\circ f)^n s_1) = f\circ(g\circ f)^n s_1 = (f\circ g)^n\circ f\ s_1 = h_T^n (f(s_1))$
 * Therefor $f(s_1) \preceq_T f(s_2) \implies f(s_1)\sim_T f(s_2)$

Claim

 * $\widetilde{f} : S/\!\sim_S \simeq T/\!\sim_T$.

Proof

 * Let $\left[\!\left[{t}\right]\!\right]_T \in T/\!\sim_T$ then $\widetilde{g}\left[\!\left[{t}\right]\!\right]_S \in S/\!\sim_S$ and obviously $\widetilde{f}\widetilde{g}(\left[\!\left[{t}\right]\!\right]_S) = \left[\!\left[{f(g(t))}\right]\!\right]_T = \left[\!\left[{h_T(t)}\right]\!\right]_T = \left[\!\left[{t}\right]\!\right]_T$ which proves surjectivity.
 * Now let $\left[\!\left[{s_1}\right]\!\right]_S,\left[\!\left[{s_2}\right]\!\right]_S\in S/\!\sim_S$ such that $\widetilde{f}(\left[\!\left[{s_1}\right]\!\right]_S) = \widetilde{f}(\left[\!\left[{s_2}\right]\!\right]_S)$. Then
 * Now let $\left[\!\left[{s_1}\right]\!\right]_S,\left[\!\left[{s_2}\right]\!\right]_S\in S/\!\sim_S$ such that $\widetilde{f}(\left[\!\left[{s_1}\right]\!\right]_S) = \widetilde{f}(\left[\!\left[{s_2}\right]\!\right]_S)$. Then

which shows injectivity.

Claim

 * $\left[\!\left[{x}\right]\!\right]_X$ is totally ordered and
 * $\operatorname{Ord}(\left[\!\left[{s}\right]\!\right]_S) = \operatorname{Ord}(\widetilde{f}(\left[\!\left[s\right]\!\right]_T))$

Proof

 * First choose a representative $x$ for every equivalence class $\left[\!\left[{x}\right]\!\right]_X \in X/!\sim_X$.
 * Now observe that for $y_1,y_2\in\left[\!\left[x\right]\!\right]_X$ either $y_i\preceq x$ or $y_i\succeq x$.
 * By abuse of notation let $n_i\in\Z$ be such that $x = h_X^{n_i} y_i$ where $x = h_X^{-\left|n_i\right|}y_i$ means $y_i = h_X^{\left|n_i\right|}x$.
 * Since the integers are totally ordered we can assume $n_1\le n_2$.
 * Now $y_1 = h_X^{n_2-n_1}y_2$ since $h_X^{n_1}h_X^{n_2-n_1}y_2 = h_X^{n_2}y_2 = x = h_X^{n_1} y_1$ and $h_X^{n_1}$ is an injection.
 * Therefor $y_1 \preceq y_2$ and $\preceq$ is transitive.
 * Let $y_1 \preceq y_2$ and $y_2 \preceq y_1$ then $y_2 = h_X^m y_1$ and $y_1 = h_X^n y_2$, $y_2 = h_X^{m+n} y_2$ and since $y_2$ was arbitrary $(h_X\restriction_{\left[\!\left[x\right]\!\right]_X})^{m+n} = \operatorname{id}$.
 * Therefor we can assume $m+n = 0$ and $m+n=0 \underset{m,n\in\N}\implies m=n=0 \implies y_2 = h_X^0 y_1 = y_1$ and $\preceq$ is antisymmetric.
 * Let $\mathcal S$ be the set of representatives of $S$. Since $\widetilde f$ is bijective $\mathcal T := \{f(s):s\in\mathcal S\}$ is a set of representatives of $T$.
 * By the above construction for any $r\in\mathcal S$ and any $s \in \left[\!\left[r\right]\!\right]_S$ there exists a unique $n_{r,s}\in\Z$ such that $r = h_S^{n_{r,s}}s$.
 * Define $\sigma_r : \left[\!\left[{r}\right]\!\right]_S \to \Z $ by $\sigma_r(s) = n_{r,s}$
 * $\sigma_r$ is order preserving by construction.
 * Define $\tau_{f(r)} : \left[\!\left[{f(r)}\right]\!\right]_T \to \Z $ analogous. Then $\operatorname{Im}(\sigma_r) = \operatorname{Im}(\tau_{f(r)})$ since if
 * $s = h_S^n r$ then $f(s) = h_T^n f(r)$ and if $t = h_T^n f(r)$ then $g(t) = h_S^n g(f(r))$
 * Therefor we can restrict $\sigma_r$ and $\tau_{f(r)}$ to their common image and since they are now surjective, order-preserving functions between totally ordered sets they are bijective.
 * And we have $\tau_{f(r)}^{-1}\sigma_r : \left[\!\left[{r}\right]\!\right]_S \simeq \left[\!\left[{f(r)}\right]\!\right]_T$
 * And we have $\tau_{f(r)}^{-1}\sigma_r : \left[\!\left[{r}\right]\!\right]_S \simeq \left[\!\left[{f(r)}\right]\!\right]_T$

Finally define the bijection $b:S\simeq T$ by

$$ b(s) = \tau_{f(r)}^{-1}\sigma_r(s) $$

where $r$ is the chosen representant of $\left[\!\left[{s}\right]\!\right]_S$