I am reading a proof that the set of all binary strings is countable- it justifies this by mapping each binary string to the natural number it represents in binary. However, I am not seeing how this mapping is bijective, as the element $0$ is represented multiple times in the enumeration of binary strings the proof gives as $0, 00, 000,$ etc. so this can't just map to zero each time otherwise the mapping won't be injective. So I am wondering how we can formalize the bijection better to formally show every binary string is a binary number which uniquely represents a base 10 number. For context, here is the proof I am reading:
Our next example concerns the set of all binary strings (of any finite length), denoted $\{0,1\}^*$. Despite the fact that this set contains strings of unbounded length, it turns out to have the same cardinality as $\mathbb{N}$. To see this, we set up a direct bijection $f:\{0,1\}^* \rightarrow \mathbb{N}$ as follows. Note that it suffices to enumerate the elements of $\{0,1\}^*$ in such a way that each string appears exactly once in the list. We then get our bijection by setting $f(n)$ to be the $n$th string in the list. How do we enumerate the strings in $\{0,1\}^*$ ? Well, it's natural to list them in increasing order of length, and then (say) in lexicographic order (or, equivalently, numerically increasing order when viewed as binary numbers) within the strings of each length. This means that the list would look like $$ \varepsilon, 0,1,00,01,10,11,000,001,010,011,100,101,110,111,1000, \ldots, $$ where $\varepsilon$ denotes the empty string (the only string of length 0 ). It should be clear that this list contains each binary string once and only once, so we get a bijection with $\mathbb{N}$ as desired. It seems this bijective mapping maps each binary string to the number it represents in binary.
Actually this is a good question.
Firstly, there is an error in the author's list of binary strings. It should be:
$$ \varepsilon, 0,1,00,01,10,11,000,001,010,011,100,101,110,111, \color{red}{0}000, \ldots\ . $$
$$$$
As Brian said in the comments, pre-append a $1$ to each member of
$$ \varepsilon, 0,1,00,01,10,11,000,001,010,011,100,101,110,111,0000, \ldots $$
so that we get:
$$ 1_2, 10_2,11_2,100_2,101_2,110_2,111_2,1000_2,1001_2,1010_2,1011_2,1100_2,1101_2,1110_2,1111_2,10000_2, \ldots $$
$$ =1_{10},2_{10},3_{10},4_{10},5_{10},6_{10},7_{10},8_{10},9_{10},10_{10},11_{10},12_{10},13_{10},14_{10},15_{10},16_{10}\ldots,\ $$
where we define $1\varepsilon_2:= 1_{2}.$