[proofplan]
We prove each of the six properties of the Cantor function $\varphi: [0,1] \to [0,1]$ in sequence. Properties (1)-(3) follow from the digit-substitution definition: monotonicity and constancy on gaps are immediate from the formula, and continuity follows from a uniform estimate on the oscillation over constituent intervals. Property (4) follows from (3) and the fact that $[0,1] \setminus \mathcal{C}$ has full measure. Property (5) follows from the surjectivity of the digit map. Property (6) uses the Fundamental Theorem of Calculus for absolutely continuous functions, which would force $\varphi(1) - \varphi(0) = \int_0^1 \varphi' \, d\mathcal{L}^1 = 0$, contradicting $\varphi(1) - \varphi(0) = 1$.
[/proofplan]
[step:Verify $\varphi$ is nondecreasing with $\varphi(0) = 0$ and $\varphi(1) = 1$ (Property 2)]
We establish Property (2) first, as it is needed for subsequent properties.
**Boundary values.** At $x = 0 = \sum_{k=1}^{\infty} 0/3^k$, we have $a_k = 0$ for all $k$, so $\varphi(0) = \sum_{k=1}^{\infty} 0/2^k = 0$. At $x = 1$, the $\{0,2\}$-ternary representation is $1 = \sum_{k=1}^{\infty} 2/3^k$ (since $\sum_{k=1}^{\infty} 2/3^k = 2 \cdot (1/3)/(1-1/3) = 1$), so $\varphi(1) = \sum_{k=1}^{\infty} 1/2^k = 1$.
**Monotonicity.** Let $x, y \in \mathcal{C}$ with $x < y$, having $\{0,2\}$-ternary expansions $(a_k)$ and $(c_k)$ respectively. Let $m$ be the first index with $a_m \ne c_m$. Since $x < y$, we have $a_m = 0$ and $c_m = 2$ (as in the proof of [total disconnectedness](/theorems/1200)). Then $b_m = a_m/2 = 0$ and $d_m = c_m/2 = 1$, so
\begin{align*}
\varphi(y) - \varphi(x) = \sum_{k=m}^{\infty} \frac{d_k - b_k}{2^k} = \frac{1}{2^m} + \sum_{k=m+1}^{\infty} \frac{d_k - b_k}{2^k} \ge \frac{1}{2^m} - \sum_{k=m+1}^{\infty} \frac{1}{2^k} = \frac{1}{2^m} - \frac{1}{2^m} = 0.
\end{align*}
More precisely, equality holds only if $d_k - b_k = -1$ for all $k > m$, which requires $b_k = 1$ and $d_k = 0$ for all $k > m$, meaning $a_k = 2$ and $c_k = 0$ for all $k > m$. In this case $\varphi(x) = \varphi(y)$. In all other cases, $\varphi(x) < \varphi(y)$. Either way, $\varphi(x) \le \varphi(y)$.
For $x \in [0,1] \setminus \mathcal{C}$, $\varphi(x) = \varphi(a)$ where $a$ is the left endpoint of the gap containing $x$, so $\varphi$ is constant on each gap and hence nondecreasing on all of $[0,1]$.
[/step]
[step:Show $\varphi$ is constant on each connected component of $[0,1] \setminus \mathcal{C}$ (Property 3)]
The set $[0,1] \setminus \mathcal{C}$ is a countable union of disjoint open intervals (removed at various stages of the construction). Each such interval $(a, b)$ has endpoints $a, b \in \mathcal{C}$.
Consider a gap removed at stage $m$: the open middle third of a constituent interval of $C_{m-1}$. The left endpoint $a$ of this gap has $\{0,2\}$-ternary expansion with $a_m = 0$ and $a_k = 2$ for all $k > m$ (it is the right endpoint of the left third). The right endpoint $b$ has $c_m = 2$ and $c_k = 0$ for all $k > m$ (it is the left endpoint of the right third). The digits $a_k = c_k$ for $k < m$ agree.
Computing $\varphi$ at each endpoint:
\begin{align*}
\varphi(a) &= \sum_{k=1}^{m-1} \frac{a_k/2}{2^k} + \frac{0}{2^m} + \sum_{k=m+1}^{\infty} \frac{1}{2^k} = \sum_{k=1}^{m-1} \frac{a_k/2}{2^k} + \frac{1}{2^m}, \\
\varphi(b) &= \sum_{k=1}^{m-1} \frac{a_k/2}{2^k} + \frac{1}{2^m} + \sum_{k=m+1}^{\infty} \frac{0}{2^k} = \sum_{k=1}^{m-1} \frac{a_k/2}{2^k} + \frac{1}{2^m}.
\end{align*}
Hence $\varphi(a) = \varphi(b)$, and by definition $\varphi(x) = \varphi(a)$ for all $x \in (a, b)$. So $\varphi$ is constant on $(a, b)$.
[guided]
The computation reveals the mechanism: the left endpoint $a$ ends in $0\overline{2}$ (digit $0$ at position $m$ followed by all $2$'s), and the right endpoint $b$ starts its differing part with $2\overline{0}$ (digit $2$ at position $m$ followed by all $0$'s). Under the digit substitution $a_k \mapsto a_k/2$, these become $0\overline{1}$ and $1\overline{0}$ in binary — which represent the same real number (e.g., $0.0111\ldots_2 = 0.1000\ldots_2$). This is exactly the binary ambiguity for dyadic rationals, and it explains why $\varphi$ takes the same value at both endpoints of every gap.
[/guided]
[/step]
[step:Prove $\varphi$ is continuous on $[0,1]$ (Property 1)]
We show $\varphi$ is continuous at every $x_0 \in [0,1]$.
**Case 1: $x_0 \in [0,1] \setminus \mathcal{C}$.** Then $x_0$ lies in some open gap $(a, b)$, and $\varphi$ is constant (hence continuous) on $(a, b)$.
**Case 2: $x_0 \in \mathcal{C}$.** Let $\varepsilon > 0$. Choose $N \in \mathbb{N}$ such that $2^{-N} < \varepsilon$. The point $x_0$ belongs to a unique constituent interval $I$ of $C_N$, which has length $3^{-N}$. Set $\delta := 3^{-N}$.
For any $x \in [0,1]$ with $|x - x_0| < \delta$: if $x \in \mathcal{C}$, then $x$ belongs to $I$ or to an adjacent constituent interval of $C_N$. In either case, $x$ and $x_0$ share the same first $N-1$ ternary digits (at minimum), so
\begin{align*}
|\varphi(x) - \varphi(x_0)| \le \sum_{k=N}^{\infty} \frac{|b_k - b_k'|}{2^k} \le \sum_{k=N}^{\infty} \frac{1}{2^k} = \frac{1}{2^{N-1}}.
\end{align*}
Choosing $N$ large enough that $2^{-(N-1)} < \varepsilon$ (i.e., $N > 1 + \log_2(1/\varepsilon)$), we get $|\varphi(x) - \varphi(x_0)| < \varepsilon$.
If $x \in [0,1] \setminus \mathcal{C}$, then $\varphi(x) = \varphi(c)$ for some $c \in \mathcal{C}$ that is an endpoint of the gap containing $x$. Since $\varphi$ is nondecreasing and $c$ is closer to $x_0$ than $x$ is (or equidistant), the bound still holds by monotonicity.
[guided]
A more elegant approach uses the fact that $\varphi$ is nondecreasing and defined on the compact interval $[0,1]$. A nondecreasing function on $[0,1]$ can only have jump discontinuities. At a jump discontinuity $x_0$, the left and right limits $\varphi(x_0^-)$ and $\varphi(x_0^+)$ would satisfy $\varphi(x_0^-) < \varphi(x_0^+)$, and the open interval $(\varphi(x_0^-), \varphi(x_0^+))$ would be disjoint from the range of $\varphi$. But we will show in Property (5) that $\varphi$ is surjective, so no such gap in the range can exist. However, since we prove the properties in order, the direct $\varepsilon$-$\delta$ argument above is self-contained.
[/guided]
[/step]
[step:Show $\varphi' = 0$ $\mathcal{L}^1$-almost everywhere (Property 4)]
By the [Cantor Set Has Measure Zero](/theorems/1197), $\mathcal{L}^1(\mathcal{C}) = 0$, so $\mathcal{L}^1([0,1] \setminus \mathcal{C}) = 1$. Property (3) shows that $\varphi$ is constant on each connected component of $[0,1] \setminus \mathcal{C}$. A function that is constant on an open interval has zero derivative at every interior point of that interval.
Since $[0,1] \setminus \mathcal{C}$ is the countable union of open intervals, $\varphi'(x) = 0$ for every $x \in [0,1] \setminus \mathcal{C}$. As $[0,1] \setminus \mathcal{C}$ has full measure, $\varphi' = 0$ holds $\mathcal{L}^1$-almost everywhere on $[0,1]$.
[/step]
[step:Verify $\varphi$ is surjective onto $[0,1]$ (Property 5)]
Let $y \in [0,1]$. Choose a binary expansion $y = \sum_{k=1}^{\infty} b_k / 2^k$ with $b_k \in \{0, 1\}$. Set $a_k := 2 b_k \in \{0, 2\}$ and define $x := \sum_{k=1}^{\infty} a_k / 3^k$. By the [Ternary Characterisation](/theorems/1196), $x \in \mathcal{C}$, and
\begin{align*}
\varphi(x) = \sum_{k=1}^{\infty} \frac{a_k/2}{2^k} = \sum_{k=1}^{\infty} \frac{b_k}{2^k} = y.
\end{align*}
Hence $\varphi$ is surjective.
[/step]
[step:Prove $\varphi$ is not absolutely continuous (Property 6)]
Suppose for contradiction that $\varphi$ is absolutely continuous on $[0,1]$. Then the Fundamental Theorem of Calculus for Lebesgue integrals gives
\begin{align*}
\varphi(1) - \varphi(0) = \int_0^1 \varphi'(x) \, d\mathcal{L}^1(x).
\end{align*}
By Property (4), $\varphi'(x) = 0$ for $\mathcal{L}^1$-a.e. $x \in [0,1]$, so the right-hand side equals $0$. But $\varphi(1) - \varphi(0) = 1 - 0 = 1$ by Property (2), giving $1 = 0$, a contradiction. Hence $\varphi$ is not absolutely continuous.
[guided]
This is the precise sense in which the Cantor function demonstrates the necessity of absolute continuity in the Fundamental Theorem of Calculus. The function $\varphi$ is continuous, nondecreasing, and differentiable $\mathcal{L}^1$-a.e. with $\varphi' = 0$ a.e. — yet $\varphi(1) \ne \varphi(0)$. The Fundamental Theorem of Calculus identity $f(b) - f(a) = \int_a^b f' \, d\mathcal{L}^1$ holds for absolutely continuous functions but fails for merely continuous functions, even monotone ones. The "missing" increase of $\varphi$ is entirely concentrated on $\mathcal{C}$, a set of $\mathcal{L}^1$-measure zero, which the Lebesgue integral cannot detect.
[/guided]
[/step]