Real Numbers are Uncountably Infinite/Proof 2 using Ternary Notation

Theorem
The set of real numbers $\R$ is uncountably infinite.

Lemma
Let $\left\langle{d_n}\right\rangle$ and $\left\langle{e_n}\right\rangle$ be $1$-indexed infinite sequences in $\left\{{0, 1}\right\}$.

Then the ternary representations $D = 0.d_1 d_2 \ldots$ and $E = 0.e_1 e_2 \dots$ represent distinct real numbers.

Proof
Suppose that $\left\langle{d_n}\right\rangle \ne \left\langle{e_n}\right\rangle$.

By the Well-Ordering Principle, there is a smallest $n \in \N_{>0}$ such that $d_n \ne e_n$.

Suppose WLOG that $d_n = 0$ and $e_n = 1$.

Let $K = 0.d_1 d_2 \ldots d_{n-1} = \sum_{i \mathop = 1}^{n-1} d_i 3^{-i}$.

Let:
 * $\displaystyle D := K + \sum_{i \mathop = n+1}^\infty d_i 3^{-i}$
 * $\displaystyle E := K + 3^{-n} + \sum_{i \mathop = n+1}^\infty e_i 3^{-i} \ge K + 3^{-n}$

But then:


 * $\displaystyle D \le K + \sum_{i \mathop = n+1}^\infty 3^{-i} = K + 3^{-n-1} \sum_{i \mathop = 0}^\infty 3^{-i} = K + 3^{-n - 1} \dfrac 3 2 = K + 3^{-n}/2$

Thus $D < E$, so $D \ne E$.

Proof
Define a mapping $f: \mathcal P \left({\N_{>0}}\right) \to \R$ thus:


 * $f \left({S}\right) = 0.d_1 d_2 \ldots$, interpreted as a ternary expansion

where $\left\langle{d_n}\right\rangle$ is the characteristic function of $S$.

That is:
 * $\displaystyle f \left({S}\right) = \sum_{i \mathop \in S} 3^{-i}$

By the lemma, $f$ is an injection.

Suppose for the sake of contradiction that $\R$ is countable.

Then there is an injection $g: \R \to \N$.

By Composite of Injections is Injection, $g \circ f: \mathcal P \left({\N}\right) \to \N$ is an injection.

But this contradicts No Injection from Power Set to Set.

Thus $\R$ is not countable.