The Devil's staircase: continuous and nondecreasing from 0 to 1, yet constant on every complementary interval, so f′=0 on a set of total length 1. f(1)−f(0)=1=∫01f′ — why the FTC needs more than differentiability almost everywhere.
Prove that the Cantor function f is well-defined (the ambiguity of ternary expansions does not change its value), nondecreasing, and continuous on [0,1]. For instance, the two expansions 0.0222…3=0.13 must both give f=1/2.
Stage 3: C3 has 8 intervals (=23) of total length (2/3)3=8/27≈0.29630 — the staircase is already the finished f, with the flat step f=1/2 over (1/3,2/3) visible.Show proof
Ternary expansions are unique except at points k/3m, which have exactly two: the terminating one 0.c1…cm−11 and the repeating-2 one 0.c1…cm−10222…3. If some ck=1 with k<m, both expansions see the first 1 at the same position, so the b-sequences agree. Otherwise the terminating expansion has N=m with bm=1, while the repeating-2 expansion has no 1 at all, giving bm=0 and bk=1 for k>m — but ∑k>m2−k=2−m, so the totals agree. Example: 0.0222…3 has N=∞, hence b=0.0111…2=1/2; 0.13 has N=1, hence b1=1 and f=1/2. So f is well-defined.
The function f is nondecreasing. Let x<y and let m be the first index where the (chosen) ternary expansions differ; then (cm(x),cm(y)) is one of (0,1), (0,2), (1,2). Write S for the shared contribution of the first m−1 digits. Case (0,1): x has bm=0 and tail at most ∑k>m2−k=2−m, so f(x)≤S+2−m; y sees its first 1 at m, so f(y)=S+2−m. Case (0,2): f(x)≤S+2−m while y has bm=1 and tail ≥0, so f(y)≥S+2−m. Case (1,2): f(x)=S+2−m and f(y)≥S+2−m. Endpoint ambiguity was already settled by well-definedness, so f(x)≤f(y).
The function f is continuous. On each closed rank-n ternary interval I, f varies by at most 2−n: if a 1 occurs among the n digits the tails vanish and f is exactly constant on I; otherwise f=∑k≤n(ck/2)2−k+tail with the tail between 0 and 2−n. Let fn be the continuous piecewise-linear interpolant of f at the endpoints k/3n. For x in a rank-n interval [l,r], both f(x) and fn(x) lie in [f(l),f(r)] (by monotonicity), an interval of length at most 2−n. Hence fn→f uniformly, and a uniform limit of continuous functions is continuous, so f is continuous on [0,1]. Note f(0)=0 and f(1)=1 (reading 1=0.222…3).
Prove that f is constant on every open interval complementary to the Cantor set. Conclude that f′=0 at every point of the complement, which has total length 1.
(a,b)removed at stage m:a=0.c1…cm−113,b=0.c1…cm−123
x∈(a,b)⇒cm(x)=1⇒f(x)=k<m∑2ck2−k+2−m(constant)
m≥1∑2m−13−m=31m≥1∑(32)m−1=1
Stage 5: C5 has 32 intervals (=25) of total length (2/3)5=32/243≈0.13169 — the bars thin out, but the flat steps of the staircase (e.g. f=1/2 over (1/3,2/3)) stay put.Show proof
The complement of the Cantor set is the disjoint union of the removed open middle thirds. Each interval removed at stage m has the form (a,b) with a=0.c1…cm−113 (terminating) and b=0.c1…cm−123, where c1,…,cm−1 contain no 1. Let x∈(a,b). Since x>a, the m-th ternary digit cannot be 0 (that would give x≤0.c1…cm−10222…3=a); since x<b, it cannot be 2 (that would give x≥0.c1…cm−12000…3=b). Hence cm(x)=1, and with no 1 before it, N(x)=m. So f(x)=∑k<m(ck/2)2−k+2−m, a constant independent of x — f is constant on every complementary interval. Numerically: f≡1/4 on (1/9,2/9) and f≡1/2 on (1/3,2/3).
A function constant on an open interval has derivative 0 at every point of it (the difference quotient is identically 0). Hence f′(x)=0 at every point x of the complement — the staircase is flat "almost everywhere".
The total length of the complement sums the 2m−1 intervals of length 3−m removed at stage m: ∑m≥12m−13−m=31∑m≥1(2/3)m−1=31⋅1−2/31=1. So the set where f′=0 has length 1: the staircase climbs a total of 1 while moving only on the Cantor set, which has length 0.
Compute that f(1)−f(0)=1 yet ∫01f′=0, and prove that f is therefore not absolutely continuous. This is why the Fundamental Theorem of Calculus needs a stronger hypothesis than "differentiable almost everywhere". (The definition of absolute continuity itself may be stated at idea level.)
Stage 4: C4 has 16 intervals (=24) of total length (2/3)4=16/81≈0.19753 — f climbs from 0 to 1 on these thin bars alone.Show proof
By problem 1, f is continuous on [0,1] with f(0)=0 and f(1)=1, so f(1)−f(0)=1. On the other hand, Lebesgue's theorem says a monotone function is differentiable almost everywhere, and problem 2 gives f′=0 wherever it exists — so f′=0 a.e., and the (Lebesgue) integral ∫01f′=0.
If f were absolutely continuous, the Fundamental Theorem of Calculus would give f(1)−f(0)=∫01f′. But 1=0 — a contradiction. Hence f is not absolutely continuous: continuity plus differentiability almost everywhere does not imply the FTC. "Differentiable almost everywhere" is not enough to recover a function by integration; absolute continuity is the sharp hypothesis.
This can also be seen directly. Absolute continuity means: for every ε>0 there is δ>0 such that any finite family of disjoint intervals with total length below δ has total ∣f∣-increment below ε. Take ε=1/2. The 2n intervals of Cn have total length (2/3)n→0, eventually below any δ. But f is constant on the gaps between them and nondecreasing, so ∑i(f(ri)−f(li))=f(1)−f(0)=1≥ε — every δ fails. The Cantor set is nearly 0 in length yet covers all of [0,1] in f-value (f maps C onto [0,1]).