On proving $\{0,1\}^\mathbb{N}\sim\{0,1,2\}^\mathbb{N}$ I'm trying to prove $\{0,1\}^\mathbb{N}\sim\{0,1,2\}^\mathbb{N}$ (the sets are equinumerous). 
I have already proved that $\{0,1\}^\mathbb{N}\sim\mathbb{N}^\mathbb{N}$, with the following method:


*

*For every countable $X\subset\{0,1\}^\mathbb{N}$, $\{0,1\}^\mathbb{N}\sim\{0,1\}^\mathbb{N}\setminus X$.

*There exists an injective mapping $f:\mathbb{N}^\mathbb{N}\rightarrow \{0,1\}^\mathbb{N}$ for which $\{0,1\}^\mathbb{N}\setminus f\left(\mathbb{N}^\mathbb{N}\right)$ is countable

*From 1. and 2. it follows directly that $\{0,1\}^\mathbb{N}\sim\mathbb{N}^\mathbb{N}$


Points 1. and 3. should be clear, let me elaborate on 2. a little bit more by constructing this $f$.
Let $(n_0,n_1,\ldots)\in\mathbb{N}^\mathbb{N}$. We construct $(a_0,a_1,\ldots)\in\{0,1\}^\mathbb{N}$ by:


*

*The sequence starts with $n_0$ zeroes, so $a_0 = \ldots = a_{n_0-1} = 0$

*Then a one, so $a_{n_0}=1$

*We continue with $n_1$ zeroes, so $a_{n_0+1}=\ldots=a_{n_0+n_1-1}=0$

*$a_{n_0+n_1}=1$

*$\vdots$


Now the only sequences not reached are the ones that will be zero from some point on. This would namely require an ''$a_n=\infty$'' for some $n$. Thereby we constructed the injective $f$.
Now, what I want is a similar proof for $\{0,1,2\}^\mathbb{N}\sim\mathbb{N}^\mathbb{N}$, but I haven't been able to construct a function like in 2. Is this the way to go, or is there a direct way to prove equinumerosity?
 A: $\{0,1\}^\Bbb N$ is the set of sequences of $0$s and $1$s. For example, $001101010\dots$. $\{0,1,2\}^\Bbb N$ is the set of sequences of $0$s, $1$s, and $2$s. For example, $110210100\dots$.
Define $f:\{0,1,2\}^\Bbb N\to\{0,1\}^\Bbb N$ by the following. For any sequence $S\in\{0,1,2\}^\Bbb N$, let $f(S)$ be $S$ with all $1$s replaced by $10$s, and all $2$s replaced by $11$s. For example:
$$f(110210100\dots)=10\,10\,0\,11\,10\,0\,10\,0\,0\dots$$
(spaces added to make it easier to read). Can you prove that $f$ is a bijection?
A: Hint:
It is much easier to show that $$\{0,1,2,3\}^{\mathbb N}\sim \{0,1\}^{\mathbb N}$$ and then show that there there are $1-1$ functions:
$$ \{0,1\}^{\mathbb N}\to \{0,1,2\}^{\mathbb N}\to \{0,1,2,3\}^{\mathbb N}$$
A: Since you already know $\{0,1\}^{\mathbb{N}} \cong \mathbb{N}^{\mathbb{N}}$, there is an injective map $\{0,1,2\}^{\mathbb{N}} \to \mathbb{N}^{\mathbb{N}} \cong \{0,1\}^{\mathbb{N}}$. There is also an injective map in the other direction, just the inclusion. Hence, you may apply the Schröder-Bernstein theorem.
A: Why not just use the Schröder-Bernstein theorem?
Let us build an injective map from $\{0,1,2\}^\mathbb{N}$ to $\{0,1\}^\mathbb{N}$. Given $A\in\{0,1,2\}^\mathbb{N}$, represented by $\{a_n\}_{n\in\mathbb{N}}$, with $a_n\in\{0,1,2\}$, we may consider the binary representation of:
$$ r_A = \sum_{n\geq 0}\frac{a_n}{10^{n+1}}.$$
In the opposite direction, given $B\in\{0,1\}^{\mathbb{N}}$, represented by $\{b_n\}_{n\in\mathbb{N}}$, with $b_n\in\{0,1\}$, we may consider the ternary representation of
$$ r_B = \sum_{n\geq 0}\frac{b_n}{10^{n+1}}.$$
The existence of these injective maps ensures $\left|\{0,1\}^{\mathbb{N}}\right|=\left|\{0,1,2\}^{\mathbb{N}}\right|$, i.e. $2^{\aleph_0}=3^{\aleph_0}$.
We chose $10$ in order to avoid ambiguities deriving from:
$$ 0.1111\ldots_2 = 1_2,\qquad  0.2222\ldots_3 = 1_3.$$
A: Consider the inclusion map $i:\{0,1\}^{\mathbb N}\to \{0,1,2\}^{\mathbb N}$, i.e. for a sequence $x:=\{x_n\}\in\{0,1\}^{\mathbb N}$, $i(x)_n = x_n$ for all $n$. Clearly $i$ is injective, so $\#\{0,1\}^{\mathbb N}\leqslant \#\{0,1,2\}^{\mathbb N}$. 
Now consider the map $f:\{0,1,2\}^{\mathbb N}\to\{0,1\}^{\mathbb N}$ where 
$$f(x) = \{\delta_{x_1,2},\delta_{x_1,1}, \delta_{x_3,2},\delta_{x_4,1}, \ldots, \delta_{x_{2n-1},2}, \delta_{x_{2n},1}, \ldots, \}.$$
Then if $f(x) = f(y)$, $f(x)_n=f(y)_n$, that is, $\delta_{x_{2n-1},2}=\delta_{y_{2n-1},2}$ and $\delta_{x_{2n},1}=\delta_{y_{2n},1}$ for all $n$. Since for any $n$, $f(x)_n,f(y)_n\in\{0,1\}$, it follows that $x_n=y_n$ for all $n$, and so $x=y$ and $f$ is injective. Hence $\#\{0,1,2\}^{\mathbb N}\leqslant \#\{0,1\}^{\mathbb N}$.
