๐Ÿงฎ Brain Teaser

The Cantor Function Is Continuous but Its Derivative Vanishes a.e. Yet It Climbs from 0 to 1

Let f:[0,1]โ†’[0,1]f : [0,1] \to [0,1] be the Cantor function (also called the Devil's Staircase): the unique non-decreasing, continuous function that is constant on each interval of [0,1]โˆ–C[0,1] \setminus C (where CC is the Cantor set) and satisfies f(0)=0f(0)=0, f(1)=1f(1)=1.

(a) Show that fโ€ฒ(x)=0f'(x) = 0 for almost every xโˆˆ[0,1]x \in [0,1].

(b) Yet ff is not constant. Explain why this does not contradict the fundamental theorem of calculus, and conclude:

โˆซ01fโ€ฒ(x)โ€‰dx=0โ‰ 1=f(1)โˆ’f(0).\int_0^1 f'(x)\, dx = 0 \neq 1 = f(1) - f(0).

Why does the usual FTC formula f(1)โˆ’f(0)=โˆซ01fโ€ฒ(x)โ€‰dxf(1) - f(0) = \int_0^1 f'(x)\, dx fail here?

Cantor functionabsolute continuityFTCLebesgue integrationmeasure zero

Answer: Devil's Staircase: FTC Fails Without Absolute Continuity

Key Idea / Intuition

The Cantor function does all of its "climbing" on the Cantor set CC, which has Lebesgue measure zero. Off CC, the function is locally constant, so its derivative is zero โ€” yet the total rise is 1. The FTC in its standard Lebesgue form holds if and only if ff is absolutely continuous, and the Cantor function is the canonical example of a continuous, monotone function that is not absolutely continuous. Absolute continuity is exactly the extra condition that bridges "derivative zero a.e." with "function is constant."


Formal Proof / Solution

Part (a): fโ€ฒ=0f' = 0 a.e.

The complement of the Cantor set in [0,1][0,1] is the open set

[0,1]โˆ–C=โ‹ƒkIk,[0,1] \setminus C = \bigcup_{k} I_k,

a countable union of open intervals (the removed middle thirds). By construction, ff is constant on each IkI_k (e.g., fโ‰ก12f \equiv \frac{1}{2} on (13,23)(\frac{1}{3}, \frac{2}{3}), etc.).

Therefore:

xโˆˆ[0,1]โˆ–Cโ€…โ€ŠโŸนโ€…โ€Šfโ€ฒ(x)=0.x \in [0,1] \setminus C \implies f'(x) = 0.

Since ฮป(C)=0\lambda(C) = 0 (the Cantor set has Lebesgue measure zero), the set [0,1]โˆ–C[0,1] \setminus C has measure 1. Hence fโ€ฒ=0f' = 0 almost everywhere. โœ“\checkmark

Part (b): Why FTC fails

Computing the integral:

โˆซ01fโ€ฒ(x)โ€‰dx=โˆซ010โ€‰dx=0,\int_0^1 f'(x)\, dx = \int_0^1 0 \, dx = 0,

yet f(1)โˆ’f(0)=1โˆ’0=1f(1) - f(0) = 1 - 0 = 1.

So indeed โˆซ01fโ€ฒ(x)โ€‰dxโ‰ f(1)โˆ’f(0)\int_0^1 f'(x)\,dx \neq f(1) - f(0).

Why is this not a contradiction?

The version of FTC that says

f(b)โˆ’f(a)=โˆซabfโ€ฒ(x)โ€‰dxf(b) - f(a) = \int_a^b f'(x)\,dx

requires ff to be absolutely continuous on [a,b][a,b]. Recall:

ff is absolutely continuous on [a,b][a,b] if for every ฮต>0\varepsilon > 0 there exists ฮด>0\delta > 0 such that for any finite collection of disjoint subintervals (ak,bk)(a_k, b_k) with โˆ‘(bkโˆ’ak)<ฮด\sum (b_k - a_k) < \delta, we have โˆ‘โˆฃf(bk)โˆ’f(ak)โˆฃ<ฮต\sum |f(b_k) - f(a_k)| < \varepsilon.

The Cantor function fails absolute continuity. Here is the intuition: you can cover CC by intervals of arbitrarily small total length (since ฮป(C)=0\lambda(C)=0), yet the total variation of ff over those intervals is 1 โ€” all of ff's increase happens there, no matter how small the cover.

More precisely, after nn stages of constructing CC, the remaining 2n2^n intervals each have length 3โˆ’n3^{-n} and together carry total oscillation 11. Taking nโ†’โˆžn \to \infty: total length โ†’0\to 0 but total variation =1โ†’ฬธ0= 1 \not\to 0, violating absolute continuity.

The correct FTC for monotone functions (Lebesgue's theorem):

If ff is monotone on [a,b][a,b], then fโ€ฒf' exists a.e., fโ€ฒf' is integrable, and โˆซabfโ€ฒ(x)โ€‰dxโ‰คf(b)โˆ’f(a),\int_a^b f'(x)\,dx \leq f(b) - f(a), with equality if and only if ff is absolutely continuous.

The Cantor function saturates the inequality with a strict gap of 1โˆ’0=11 - 0 = 1.

Summary

| Property | Cantor function | |---|---| | Continuous? | โœ… Yes | | Monotone? | โœ… Yes (non-decreasing) | | fโ€ฒ=0f'=0 a.e.? | โœ… Yes | | Absolutely continuous? | โŒ No | | FTC holds? | โŒ No (โˆซfโ€ฒ=0โ‰ 1\int f' = 0 \neq 1) |

The Devil's Staircase is the canonical example that continuity + monotonicity + a.e. differentiability is strictly weaker than absolute continuity, and that the FTC genuinely requires absolute continuity as a hypothesis.

Source: Rudin, Real and Complex Analysis, Chapter 7; Stein & Shakarchi, Real Analysis, Chapter 3

Type: analysisSource: Rudin, Real and Complex Analysis, Chapter 7; Stein & Shakarchi, Real Analysis, Chapter 3Edit on GitHub โ†—