Pugh exercise 1.18 I am trying to solve the below exercise.

Prove that real numbers correspond bijectively to decimal expansions to decimal expansions not terminating in an infinite string of nines, as follows. The decimal expansion of $x \in \mathbb{R}$ is $N.x_1 x_2 \ldots$, where $N$ is the largest integer $\leq x$, $x_1$ is the largest integer $\leq 10(x-N)$, $x_2$ is the largest integer $\leq 100(x-(N+ x_1/10)$, and so on.


(a) Show that each $x_k$ is a digit between $0$ and $9$.


(b) Show that for each $k$ is there an $\ell \geq k$ such that $x_{\ell} \neq 9$.


(c) Conversely, show that for each expansion $N.x_1 x_2 \ldots$ not terminating in an infinite string of nines, the set
$$\{N, N + \frac{x_1}{10}, N + \frac{x_1}{10} + \frac{x_2}{100}, \ldots \}$$
is bounded and its least upper bound is a real number $x$ with decimal expansion $N.x_1 x_2 \ldots$.

First, I'm having trouble understanding the construction. So $x = N.x_1 x_2 \ldots$. It makes sense to define $N = \lfloor{x} \rfloor$. I don't fully understand the digits $x_k$, though I know what they, intuitively, should represent.
I think part (a) can be done by induction on $k$, but the statement sounds as though it follows vacuously from the definition of the floor function. I tried to solve part (b) by contradiction, supposing that there exists a $k$ such that for all $\ell \geq k$, $x_{\ell} = 9$. Since $N \leq x$, $N - x \leq 0$, and
$$x = N.x_1 x_2 \ldots = N + \frac{x_1}{10} + \frac{x_2}{100} + \ldots,$$
we have
$$N - (N + \frac{x_1}{10} + \frac{x_2}{100} + \ldots) \leq 0.$$
By the assumption:
$$N - (N + \frac{x_1}{10} + \frac{x_2}{100} + \ldots + \frac{x_k}{10^k} + \frac{9}{10^{k+1}} + \frac{9}{10^{k+2}} + \ldots$$
I should be able to find a contradiction, but I can't figure out where to go from here.
For part (c): since each $x_k \leq 9$ by (a), we have
\begin{align*}
N + \frac{x_1}{10} + \frac{x_2}{10} + \ldots & \leq N + \frac{9}{10} + \frac{9}{100} + \ldots \\
& = N + 9 \sum\limits_{k=1}^{\infty} \left(\frac{1}{10}\right)^k \\
& = N + 9 \cdot \frac{1}{9} \\
& = N + 1
\end{align*}
Non-emptyness seems vacuous: it's defined to be nonempty. So it has a supremum. I can't figure out how to proceed from here.
Any help on this problem would be appreciated. I will update this first post as I work on this problem more.
 A: This will not be a complete solution, but it should help make clear what’s going on, give you a push in the right direction for finishing off all three parts.
To see how the digits $x_k$ are being calculated, imagine that we already knew that the decimal expansion of $x$ was $N.x_1x_2x_3\ldots\;$. Clearly $N=\lfloor x\rfloor$, and $x-N$ is the fractional part: $N-x=0.x_1x_2x_3\ldots\;$. Multiplying this by $10$ just shifts the decimal point one place to the right to yield $x_1.x_2x_3\ldots\,,$ and taking the floor picks off the digit $x_1$: $x_1=\lfloor 10(x-N)\rfloor$.
To get $x_2$, we need to apply the same idea to $0.0x_2x_3\ldots$: multiply it by $10^2$ to shift the decimal point immediately to the right of $x_2$, getting $x_2.x_3x_4\ldots\,,$ and take the floor. To do this, we have to have $0.0x_2x_3\ldots\,,$ so what is it? It’s $x-\left(N+\frac{x_1}{10}\right)$, so
$$x_2=\left\lfloor10^2\left(x-\left(N+\frac{x_1}{10}\right)\right)\right\rfloor\,.\tag{1}$$
In general, if we’ve determined $x_1,\ldots,x_n$, we have
$$N.x_1x_2\ldots x_n=N+\sum_{k=1}^n\frac{x_k}{10^k}\,,$$
and
$$x-\left(N+\sum_{k=1}^n\frac{x_k}{10^k}\right)=0.\underbrace{00\ldots00}_nx_{n+1}x_{n+2}\ldots\,,$$
so that we expect that
$$\begin{align*}
x_{n+1}&=\lfloor x_{n+1}.x_{n+2}x_{n+3}\ldots\rfloor\\
&=\left\lfloor 10^{n+1}\left(x-\left(N+\sum_{k=1}^n\frac{x_k}{10^k}\right)\right)\right\rfloor\,.
\end{align*}$$
Part (a) does require an argument: it is not vacuously true. Remember, we don’t actually have a decimal expansion: we’re showing that one exists. From the definition of the floor function we know that $0\le x-N<1$, so $0\le 10(x-N)<10$, and it follows immediately that $x_1$ is an integer, and $0\le x_1\le 9$.
We can now argue that $x_1\le 10(x-N)<x_1+1$, so $\frac{x_1}{10}\le x-N<\frac{x_1+1}{10}$, so
$$0\le x-\left(N+\frac{x_1}{10}\right)<\frac1{10}\,,$$
and therefore
$$0\le 10^2\left(x-\left(N+\frac{x_1}{10}\right)\right)<10\,.$$
It follows immediately that $x_2$, as defined by $(1)$, is an integer, and $0\le x_2\le 9$.

*

*Now see if you can use the step from $x_1$ to $x_2$ as a model for the general induction step from $x_n$ to $x_{n+1}$.

Your idea for (b) is basically sound. You will need to show by induction on $n$ that
$$x\ge N+\sum_{k=1}^n\frac{x_k}{10^k}$$
for all $n\in\Bbb Z^+$. You can then conclude that if $x_\ell=9$ for each $\ell\ge k$, then
$$\begin{align*}
x&\ge N+\color{red}{\sum_{\ell=1}^{k-1}\frac{x_\ell}{10^\ell}}+\sum_{\ell\ge k}\frac9{10^\ell}\\
&=N+\color{red}{\sum_{\ell=1}^{k-1}\frac{x_\ell}{10^\ell}}+\frac1{10^{k-1}}\,,
\end{align*}$$
where the red sum is $0$ if $k=1$. If $k=1$, this says that $x\ge N+1$, which we know is false, since $N=\lfloor x\rfloor$. If $k>1$, we can rewrite it as
$$x\ge N+\sum_{\ell=1}^{k-2}\frac{x_\ell}{10^\ell}+\frac{x_{k-1}+1}{10^{k-1}}$$
and show that this contradicts the definition of $x_{k-1}$ as
$$\left\lfloor 10^{k-1}\left(x-\left(N+\sum_{\ell=1}^{k-2}\frac{x_\ell}{10^\ell}\right)\right)\right\rfloor\,.$$
For (c) you should first be showing that $N$ and each of the numbers $N+\sum_{k=1}^n\frac{x_k}{10^k}$ for $n\in\Bbb Z^+$ is bounded above by $N+1$; you should not yet be dealing with the infinite decimal. The calculation is almost identical to the one that you actually made: the only difference is the lefthand side. This shows that the set has a least upper bound. Let $y$ be that least upper bound; you’ll be done if you can show that $y$ has the decimal expansion $N.x_1x_2x_3\ldots\;.$
One approach is to show first that
$$N+\sum_{k=1}^{n-1}\frac{x_k}{10^k}+\frac{x_n+1}{10^n}$$
is an upper bound for the set for each $n\in\Bbb Z^+$, so that for each $n\in\Bbb Z^+$ we have
$$N+\sum_{k=1}^n\frac{x_k}{10^k}\le y<N+\sum_{k=1}^{n-1}\frac{x_k}{10^k}+\frac{x_n+1}{10^n}\,;$$
this follows from the definition of the digits $x_k$, and you can use it to show that the $x_k$ are the digits of the decimal expansion of $y$.
