<s>[INST] Prove that a non-decreasing function $F$ with the properties $F(0) = 0$, $F(x/3)=F(x)/2$ and $F(1-x) = 1 - F(x)$ is the Cantor function $\begingroup$
I'm trying to prove by induction an assertion of Chalice (1991) article (http://people.math.sc.edu/girardi/m555/current/hw/FunkyFunctions/Cantor.pdf). I know that if $a_{n+1_{k}}$ is a $k$th bounder of an interval removed at the $(n+1)$th step of construction of the Cantor set $K$ or $a_{n+1_{k}}\in \{0,\ 1\}$, then $a_{n+1_{k}} \in \frac{1}{3}E_{n} \cup \left(\frac{2}{3}+\frac{1}{3}E_{n}\right)$, where $E_{n}$ is the set of the bounders of the removed intervals at the $n$th step of construction of $K$ in union with $\{0,\ 1\}$. If $a_{n+1_{k}}$ is at the first set, then I could prove by the following way:
$$a_{(n+1)_{k}} = \frac{1}{3}a_{n_{k}} \Rightarrow F\left(a_{(n+1)_{k}}\right) = F \left(\frac{1}{3}a_{n_{k}}\right)=\frac{1}{2}F(a_{n_{k}})$$
By the induction hypothesis:
$$ F\left(a_{(n+1)_{k}}\right) =\frac{1}{2} \mathcal{C} \left(a_{n_{k}}\right) = \frac{1}{2}\mathcal{C}\left(3(a_{(n+1)_{k}})\right)$$
where $\mathcal{C}$ is the Cantor function.
Just as $a_{(n+1)_{k}} \in  E_{n+1} \cup \{0,\ 1\} \subset K $, so it can be written in its ternary expansion as
$$ a_{(n+1)_{k}} = \sum_{i=1}^{\infty} \frac{a_{(n+1)_{k_{i}}}}{3^{i}};\  a_{(n+1)_{k_{i}}} \in \{0,\ 2\} $$
So, by definition:
$$\mathcal{C} \left(3a_{(n+1)_{k}}\right) = \sum_{i=1}^{\infty} \frac{1}{2} \frac{a_{(n+1)_{k_{i}}}}{2^{i-1}}$$
and
\begin{align*} F(a_{(n+1)_{k}}) &= \frac{1}{2} \sum_{i=1}^{\infty} \frac{1}{2} \frac{a_{(n+1)_{k_{i}}}}{2^{i-1}}\\  &= \sum_{i=1}^{\infty} \frac{1}{2} \frac{a_{(n+1)_{k_{i}}}}{2^{i}} \\&=  \mathcal{C} \left(a_{(n+1)_{k}}\right)
\end{align*}
just as desired.
Although, if $$a_{n+1_{k}} \in \left(\frac{2}{3}+\frac{1}{3}E_{n}\right)$$
I could go no further than \begin{align*}a_{(n+1)_{k}} = \frac{2}{3}+\frac{1}{3}a_{n_{k-\left(2^{n+1}\right)}} \\ &\Rightarrow  F\left(a_{(n+1)_{k}}\right) = F\left(\frac{2}{3}+\frac{1}{3}a_{n_{k-\left(2^{n+1}\right)}}\right) \\ &\Rightarrow F(a_{(n+1)_{k}}) = 1-F\left(1-\frac{2}{3}-\frac{1}{3}a_{n_{k-\left(2^{n+1}\right)}}\right) = 1-F\left(\frac{1}{3}\left(1-a_{n_{k-\left(2^{n+1}\right)}}\right)\right) = 1-\frac{1}{2}F\left(1-a_{n_{k-\left(2^{n+1}\right)}}\right) \\ &\Rightarrow F(a_{(n+1)_{k}}) = 1-\frac{1}{2}\left(1-F\left(a_{n_{k-\left(2^{n+1}\right)}}\right)\right) = \frac{1}{2}+\frac{1}{2}F\left(a_{n_{k-\left(2^{n+1}\right)}}\right)\end{align*}
Now, by the induction hypothesis, $$F\left(a_{(n+1)_{k}}\right) = \frac{1}{2}+\frac{1}{2} \mathcal{C}  \left(a_{n_{k-\left(2^{n+1}\right)}}\right)  = \frac{1}{2}+\frac{1}{2} \mathcal{C}  \left(3a_{(n+1)_{k}}-2\right)$$  That's the point I'm stuck, I'm not managing to prove that the right side of the last equation is $\mathcal{C} \left(a_{(n+1)_{k}}\right)$. Just explaining better the index $k$, I'm considering $a_{n_{0}} = 0 $ and so $0 \leq k \leq 2^{n+1}-1$ at th $n$th step of construction of $K$.
 [/INST] I think I solved the step I was stucked on. Since $a_{n_{k-\left(2^{n+1}\right)}} \in  E_{n} \cup \{0,\ 1\} \subset K $, we have $a_{(n+1)_{k}} = \frac{2}{3}+\frac{1}{3}a_{n_{k-\left(2^{n+1}\right)}} \Rightarrow a_{(n+1)_{k}} = \frac{2}{3}+\frac{1}{3}\sum_{i=1}^{\infty} \frac{a_{n_{k-\left(2^{n+1}\right)_{i}}}}{3^{i}} $, so, in base $3$, $a_{(n+1)_{k}} = 0,2a_{(n+1)_{k_{2}}}a_{(n+1)_{k_{3}}} \cdots $, with $a_{(n+1)_{k_{i}}} \in \{0,\ 2\} $. Then $ \left[3.a_{(n+1)_{k}}-2\right]_{10} = \left[10.a_{(n+1)_{k}}-2\right]_{3} = \left[2,a_{(n+1)_{k_{i+1}}}-2\right]_{3} =  \sum_{i=1}^{\infty} \frac{a_{(n+1)_{k_{i+1}}}}{3^{i}}$.
By definition $ \frac{1}{2} + \frac{1}{2} \mathcal{C} \left(\sum_{i=1}^{\infty} \frac{a_{(n+1)_{k_{i+1}}}}{3^{i}}\right) = \frac{1}{2}  + \left(\sum_{i=1}^{\infty} \frac{1}{2} \frac{a_{(n+1)_{k_{i+1}}}}{2^{i+1}}\right)$ and also $  \mathcal{C} (a_{(n+1)_{k}}) =  \sum_{i=1}^{\infty} \frac{1}{2} \frac{a_{(n+1)_{k_{i}}}}{2^{i}}$. Since $ a_{(n+1)_{k_{1}}} = 2$, then  $  \mathcal{C} (a_{(n+1)_{k}}) =  \frac{2/2}{2^1}+\sum_{i=1}^{\infty} \frac{1}{2} \frac{a_{(n+1)_{k_{i+1}}}}{2^{i+1}} = \frac{1}{2} + \frac{1}{2} \mathcal{C}\left(3a_{(n+1)_{k}}-2\right) = F\left(a_{(n+1)_{k}}\right)$.
Now, $ F = \mathcal{C} $ in the removed intervals  bounders, and both $ F $ and $ \mathcal{C} $ are constant (this result I've proved before) at each of these intervals in  $[0,\ 1]/K$ then $ F = \mathcal{C} $ in $[0,\ 1]/K$. Going further, $ F = \mathcal{C} $ in the removed intervals bounders implies that they're equal in a dense subset of $K$, and so they're equal in  each compact subset of $K$. Just as $K$ is compact, they're equal in $K$.
</s>