Two equivalent definitions of the Cantor function I know two definitions of the Cantor function $c: [0,1] \to [0,1]$.
$$
c(x) = 
\begin{cases}
\sum_{n=1}^{\infty} \frac{a_{n}}{2^{n}}, \; x \in C\\
\sup_{y \leq x, \; y \in C} c(y), \; x \notin C
\end{cases}
$$
where $\{a_{n}\}$ is the ternary expansion of $x$.
I also know the recursive definition:
$$
c(x) = \lim_{n \to \infty} c_{n}(x)
$$
where
$$
c_{n+1}(x) = 
\begin{cases}
\frac{1}{2} c_{n}(3x), & x\in [0, \frac{1}{3}); \\
\frac{1}{2}, & x\in[\frac{1}{3}, \frac{2}{3}];\\
\frac{1}{2}(1 + c_{n}(3x-2)), & x\in (\frac{2}{3}, 1]. 
\end{cases}
$$
and
$$
c_{0}(x) = x
$$
I have seen and understood the proof that the recursive definition converges uniformly to some continuous function. This function is the Cantor function of course, but I cannot see how this is. Is there some easy way to demonstrate that this recursive definition of the function is the equivalent the function above it?
 A: Consider the metric space of continuous non falling functions $f$ on $[0,1]\to\mathbb R$ so that $f(0)=0$, $f(1)=1$ with the maximum norm. Then is space is complete (as the space of continuous functions is complete and by pointwise limit the conditions on $f(0)$ and $f(1)$ as well es inequalities carry on to limits).
The map $\Gamma$ where $\Gamma(f)(x)$ is $1/2 f(3x)$ for $x\in[0,1/3)$ and $1/2$ if $x\in[1/3,2/3]$ and $1/2(1+f(3x-2))$ if $x\in(2/3,1]$ (it is easy to see that this satisfies the above conditions) is a strict contraction, as
$$ ||\Gamma f-\Gamma g||_\infty \leq 1/2 ||f-g||_\infty$$
Thus by the Banach fixed point theorem the $c$ from the second definition is in fact the unique fixed point of $\Gamma$. Thus we get
$$ \Gamma(c) = c $$
So if $a_0$ is the first ternary digit of $x$, then this shows us:
$$ c(x) = 1/2(a_0/2+c(3x-a_0) $$
if $a_0\neq 1$ or $c(x)=1/2$ if so. By iteration on $c(3x-a_i)$ this shows us that if $I$ is the first time that the terniary digit $a_I$ of $x$ is $1$ we have
$$ c(x) = \sum_{i<I} a_i/2^{i+1} + 1/2^I$$
and if this never happens (i.e. $x\in C$) we get by taking limits
$$ c(x) = \sum_{i\in\mathbb N} a_i/2^{i+1}$$
Note that as $c$ is continous and non-decreasing we get if $x\not \in C$ that $\sup_{y<x,y\in C} c(y) = c(x)$.
Thus we have proven that $c$ has the form of the first definition.
