why is the Cantor-Lebesgue function increasing I am trying to derive the fact that the function $F$ defined below is monotonically increasing. The only thing I can use is that the any member of the Cantor set has a ternary expansion involving only $0$'s and $2$'s. The function is defined as follows: Let $x\in[0,1]$ have ternary expansion $0.a_1a_2\cdots$. Define $N$ as the first index $n$ for which $a_n=1$ and set $N=\infty$ if none of the $a_n$ are $1$. Now let $F(x)=\sum_{n=1}^{N-1}\frac{a_n}{2^{n+1}}+\frac{1}{2^N}$.   
I have shown that $F$ is constant while on a particular middle third removed in the construction of the Cantor set $C$ so I am really interested in showing the increasing nature on $C$. Essentially therefore I wish to show that given $x=\sum \frac{a_n}{3^n}<\sum\frac{b_n}{3^n}=y$ we have $\sum\frac{a_n}{2^{n+1}}<\sum\frac{b_n}{2^{n+1}}$ on $C$. How do I establish that?
Thanks
 A: Remember that $a_n-b_n\in\{-2,0,2\}$.
Suppose that
$$
\sum_{n=1}^\infty\frac{a_n-b_n}{3^n}\gtrless0\tag{1}
$$
$(1)$ happens if and only if, for the smallest $n_0$ so that $a_{n_0}\not=b_{n_0}$, it is the case that $a_{n_0}\gtrless b_{n_0}$.
The claim above is true because
$$
\text{If }a_{n_0}>b_{n_0}\text{ then }\sum_{n=1}^\infty\frac{a_n-b_n}{3^n}\ge\frac2{3^{n_0}}-\sum_{n>n_0}\frac2{3^n}=\frac1{3^{n_0}}\tag{2}
$$
$$
\text{If }a_{n_0}<b_{n_0}\text{ then }\sum_{n=1}^\infty\frac{a_n-b_n}{3^n}\le-\frac2{3^{n_0}}+\sum_{n>n_0}\frac2{3^n}=-\frac1{3^{n_0}}\tag{3}
$$
If for the smallest $n_0$ so that $a_{n_0}\not=b_{n_0}$, it is the case that $a_{n_0}\gtrless b_{n_0}$, then
$$
\sum_{n=1}^\infty\frac{a_n-b_n}{2^{n+1}}\gtreqless0\tag{4}
$$
This is because
$$
\text{If }a_{n_0}>b_{n_0}\text{ then }\sum_{n=1}^\infty\frac{a_n-b_n}{2^{n+1}}\ge\frac1{2^{n_0}}-\sum_{n>n_0}\frac1{2^n}=0\tag{5}
$$
$$
\text{If }a_{n_0}<b_{n_0}\text{ then }\sum_{n=1}^\infty\frac{a_n-b_n}{2^{n+1}}\le-\frac1{2^{n_0}}+\sum_{n>n_0}\frac1{2^n}=0\tag{6}
$$
So, if $x\gtrless y$, $F(x)\gtreqless F(y)$. We can't get strict increase since $F$ is constant on all the "middle-thirds" intervals.
