[Math] Cantor-Lebesgue function is continuous. Proof explanation.

real-analysis

Let $x$ be a real number in $[0,1]$ with the ternary expansion $<a_n>$. Let $N = \infty$ if none of the $a_n$ are 1, and otherwise let $N$ be the smallest value of $n$ such that $a_n = 1$. Let $b_n = \frac{a_n}{2}$ for $n <N$ and $b_N = 1.$ Show that the function $f$ defined by setting $$f(x) = \sum_{n=1}^N\frac{b_n}{2^n}$$ is a continuous, monotone function on the interval $[0,1].$

The suggestion is: Pick $N$ such that $2^N > \frac{1}{\epsilon},$ and $\delta = \frac{1}{3^{N + 1}},$ and this should imply that whenever $|x – c|< \delta,$ then $|f(x) – f(c)| < \epsilon ,$ for $x,c$ having ternary expansions $(x_n)$ and $(c_n)$ such that $x_n = c_n$ for all $n \le N.$

I tried to follow the suggestion and proving the statement for myself, but I had no idea what to do, and maybe this is reflected in the fact that it is not clear to me at all how is the $\delta = \frac{1}{3^{N + 1}}$ being used in the next proof.
I also need help figuring out why does the coloured equality holds.
Thanks a lot.

Proof: Let $(y_n)$ and $d_n$ be the binary expansions of $f(x)$ and $f(c).$ Then, $y_n = d_n$ for all $n \le N$. Then

$$|f(x) – f(c)| = |\sum_{n=1}^{\infty}\frac{y_n}{2^n} – \sum_{n=1}^{\infty}\frac{d_n}{2^n}| = |\sum_{n=1}^{\infty}\frac{y_n – d_n}{2^n}| = |\sum_{n=1}^{N}\frac{y_n – d_n}{2^n} + \sum_{n=N + 1}^{\infty}\frac{y_n – d_n}{2^n}|$$
$$= \color{fuchsia}{|\sum_{n=N + 1}^{\infty}\frac{y_n – d_n}{2^n}| = \frac{1}{2^N}|\sum_{n=N + 1}^{\infty}\frac{y_{N+1+n} – d_{N+1+n}}{2^n}|} \le \frac{1}{2^N} < \epsilon.$$

Best Answer

The pink equality is wrong because they forgot to shift the lower bound of the sum. It should say

$$\left | \sum_{n=N+1}^\infty \frac{y_n-d_n}{2^n} \right | = \frac{1}{2^N} \left | \sum_{n=1}^\infty \frac{y_{N+n}-d_{N+n}}{2^n} \right |.$$

Minor variations on this are possible, depending on how exactly you want to do it. In this version, the point is that what remains in the absolute value is less than $\sum_{n=1}^\infty 2^{-n}=1$.

The idea here is very simple: if the first $N$ ternary digits of $x$ and $c$ agree then the first $N$ binary digits of $f(x)$ and $f(c)$ agree. Writing it up formally makes it a bit harder to see that.