Exercise 1.5.7 (b) in Abbott’s Understanding Analysis In the second edition, this exercise is as follows:
Find a 1-1 mapping from $S$, the open unit square $\{(x,y) : 0<x,y<1\}$, to the open interval $(0,1)$. Use the fact that each real number has a decimal expansion.
The answer I’ve been seeing the most, and is also the one I thought of, was to consider the decimal expansions of $x$ and $y$, $0.x_1x_2x_3...$ and $0.y_1y_2y_3...$, respectively. Map $(x,y)$ to the number in $(0,1)$ of the form $0.x_1y_1x_2y_2...$
Since numbers of the form $0.a_1a_2...a_n$ are equal to $0.a_1a_2...a_{n-1}(a_n-1)99999...$, I noticed that this creates the following issue:
Suppose I have $(.2,.7)$ which is equal to the pair $(.1999...,.6999...)$. Upon applying the previous mapping to both, they map to $.27$ and $.16999...$, respectively. Since $.16999...$ is the same as $.17$, this means the ordered pairs $(.1,.7)$ and $(.2,.7)$ map to the same element of $(0,1)$. So it isn’t 1-1? Is this problem avoided by just referring to $x$ and $y$‘s finite decimal expansion if it exists?
 A: More importantly, this tells us that the mapping is not well-defined and so is not a function. (This mapping is required to be a function in the problem statement in my copy of this book).
That is, the pairs $(.2,.7)$,$(.1999...,.6999...)$ each map to distinct numbers, even though the pairs are the same.
Perhaps someone else can shed some light on this as the proofs I have seen for this do the same thing as you, but never check that the mapping is well-defined in the first place, which would make the argument invalid.
A: Maybe "1-1 mapping" just means injective.
In this case you omit all "finite" decimals, and represent ${1\over2}$ as $0.49999\ldots\ $. Doing your construction you will then obtain a unique decimal for each pair $(x,y)\in S$, but you will not obtain all numbers in $(0,1)$. For example, the number $0.3510401050902060\ldots$ will not appear in the image.
A: You are correct. He gives this as the solution in the solution manual, but it isn't right. Even his own example to "keep in mind" does not pass. You can fix this by choosing the map $0.x_1 y_1 0 x_2 y_2 0 x_3 y_3 0 ...$ such that you will never get an infinite sequence of 9's and therefore no room to play.
