Here's the problem statement:
Let $X = \{ x:\mathbb{N}\to\{0,1\}:\{i\in\mathbb{N}: x(i) = 1\}$ is finite $\}$.
The function $b_\infty: X \to \mathbb{N}$ defined by $b_\infty(x)=\sum_{i=0}^{\infty} x(i) \cdot 2^i$ is well-defined and bijective.
First let's prove injectivity.
Let $x_1,x_2 \in X$
Let $j\in\mathbb{N}$ be the largest $i$ s.t. $x_1(i) = 1$. Define $k \in \mathbb{N}$ similarly for $x_2$.
Let $x_1' = \{x_1(0), x_1(1), ...,x_1(j)\}$ and $x_2' = \{x_2(0), x_2(1), ...,x_1(k)\}$.
Then we can rewrite $b_\infty(x_1')=\sum_{i=0}^{j} x_1' \cdot2^i$ and $b_\infty(x_2')=\sum_{i=0}^{k} x_2' \cdot2^i$.
So, in general $b_\infty(x')=\sum_{i=0}^{n} x' \cdot2^i$ which is the decimal representation of a binary expansion and demonstrably injective.
I'm now stuck trying to prove $b_\infty$ is surjective.
$X$ must have the same cardinality as $\mathbb{N}$, correct? If so, I can use the fact that $b_\infty$ is injective to conclude that $b_\infty$ is surjective using the pigeonhole principle. But how can I show this mathematically?
Thanks in advance!