Analysis

A staircase with no steps

A function that rises from nought to one, is continuous everywhere, and has derivative zero at almost every point. All of its climbing happens on a set of no length at all, which is possible because that set has uncountably many points.

Worth reading first: No interval in it, and length to spare · Which functions can be added up.

The fourth rung of this ladder settles which functions can be integrated, and the answer is Lebesgue’s: exactly those whose points of discontinuity form a set of measure zero. The phrase almost everywhere is doing a great deal of work in that sentence, and this rung is about how much.

Here is a function that establishes it. It is continuous at every point of the unit interval, it increases from zero to one, and its derivative is zero at almost every point. Each of those three is easy to arrange on its own; together they sound impossible, and the impression that they are is what the rung is for.

A staircase with no steps. The Cantor function drawn to several stages: a continuous non-decreasing curve from nought to one which is constant on every interval of the complement of the middle-thirds set, so its whole rise happens on a set of measure zero.
Fig. 1 The function built to seven stages. It never decreases, it rises from nought to one, and it is flat on every interval the middle-thirds construction removes — which at this stage already covers most of the unit interval and covers all of it in the limit. So the whole of the rise happens on a set of no length at all.

The construction

Take the middle-thirds set of the ladder’s second rung: remove the open middle third of [0,1][0,1], then the middle thirds of what is left, and so on for ever.

On the first removed interval, define the function to be 12\tfrac12. On the two removed at the second stage, define it to be 14\tfrac14 and 34\tfrac34. On the four removed at the third, 18\tfrac18, 38\tfrac38, 58\tfrac58, 78\tfrac78. Continue.

That defines the function on everything removed, which is a set of total length one. On the middle-thirds set itself — measure zero — the values are forced by continuity, and it is a small argument that they can be so forced: the function defined so far is non-decreasing on a dense set, and a non-decreasing function on a dense set extends uniquely to a continuous one exactly when it has no jumps, which the halving construction guarantees.

Notice the shape of that. The function is specified on the complement of the set it is interesting on, and the interesting values arrive by a limit. That inversion is characteristic of every construction on this ladder: the middle-thirds set itself is specified by what is removed, and the measure by what it gives to the pieces.

There is a cleaner description in base three, and it is worth having because it makes every property immediate. Write xx in base three. If a digit 11 appears, cut the expansion there and replace the 11 by nothing; otherwise halve every 22 to a 11. Read the result in base two. That is the value.

Why it does what it does

Three properties, each following from that description in a line.

It is non-decreasing. Increasing xx can only increase or preserve the base-three digits read left to right, which can only increase the base-two number they map to. The digit map is order-preserving because it is order-preserving digit by digit, and reading a number from its most significant digit is exactly what makes that enough.

It is continuous. Two numbers agreeing in their first kk base-three digits have values agreeing in their first kk base-two digits, so the values differ by at most 2k2^{-k}. That is a modulus of continuity, and it gives more: two points within 3k3^{-k} have values within 2k2^{-k}, so the function is Hölder continuous of exponent log2/log30.63\log 2 / \log 3 \approx 0.63. It is not Lipschitz — no constant bounds the ratio of the change in value to the change in position — and that failure is where the whole phenomenon sits.

And its derivative is zero on every removed interval, because it is constant there — and the removed intervals have total length one, since the lengths sum to a third plus two ninths plus four twenty-sevenths and so on, which is a geometric series adding to exactly one. So the derivative is zero almost everywhere.

It nonetheless rises by one. The rise happens entirely on the middle-thirds set, which has measure zero and uncountably many points, and uncountably many points is exactly the room needed.

The last clause is the one to dwell on, because it is where the apparent contradiction dissolves. A function cannot rise across a countable set while being flat elsewhere — a countable set can be covered by intervals of arbitrarily small total length, and a continuous function’s variation across those is small. The middle-thirds set is uncountable, so that argument does not apply, and there is room for a rise of one. Measure zero and countable are different conditions, and the whole construction lives in the gap between them.

Middle thirds removed 6 times over. The interval with its middle third removed, then the middle third of each survivor, and so on. The lengths removed are a geometric series adding to the whole interval.
Fig. 2 The set the rise happens on. Removing middle thirds for ever leaves a set with no interval in it and no length at all, and with as many points as the interval it came from. The function above is constant on everything removed and does all its climbing on what is left.

What it breaks

The function is a counterexample to a statement most people believe without having checked it, and identifying the statement is the point of the construction.

The fundamental theorem of calculus, in its naive form, is false for it. If ff is continuous and differentiable almost everywhere, one might expect

f(1)f(0)=01f(x)dx.f(1) - f(0) = \int_0^1 f'(x)\,dx.

Here the left side is one and the right side is zero, since ff' is zero almost everywhere and an integral does not see a set of measure zero.

So “differentiable almost everywhere” is not enough, and the correct hypothesis is a genuinely stronger one: absolute continuity. A function is absolutely continuous when, for any ε\varepsilon, a small enough total length of intervals guarantees a small total variation across them. The Cantor function fails it — the middle-thirds set has total length zero and the function varies by one across it.

Absolute continuity is exactly the right hypothesis, which is the substantial theorem here: a function is the integral of its derivative if and only if it is absolutely continuous. That equivalence is the reason the notion exists.

The definition is worth reading against the example rather than in the abstract. Absolute continuity asks that for every ε\varepsilon there is a δ\delta such that any finite collection of disjoint intervals of total length under δ\delta has total variation under ε\varepsilon. Ordinary continuity asks the same thing for one interval; absolute continuity asks it for many at once. The Cantor function is continuous and not absolutely continuous, and the difference is exactly that its variation is spread over many tiny intervals rather than concentrated in one.

Addresses with no 1 in them. The surviving intervals with their base-three addresses, which use only the digits 0 and 2, and the same addresses read as binary — which is what pairs the set with the whole interval.
Fig. 3 The base-three reading the whole construction rests on. A point of the middle-thirds set is exactly a number with no digit one in its base-three expansion, and the address is what the function reads off. The two constructions — remove middle thirds, forbid the digit one — are the same construction described twice.

The digit reading is worth trusting rather than checking, because it is the definition that makes the properties provable rather than plausible.

Every construction in this rung is a statement about base-three digits. “Removed at stage kk” means “the kk-th digit is a one and the earlier ones are not”. “Constant on a removed interval” means “the value depends only on the digits before the first one”. “Rises by one across the interval” means “the map from allowed digit strings to base-two strings is onto”. Three geometric statements, three digit statements, and the digit statements are the ones that can be checked.

What survives

The failure is not total, and what survives is worth stating because it is one of the good theorems of the subject.

Every non-decreasing function is differentiable almost everywhere. That is Lebesgue’s differentiation theorem, and the Cantor function satisfies it — its derivative exists and is zero at almost every point. So monotonicity buys differentiability almost everywhere and nothing more.

And every non-decreasing function decomposes. It splits uniquely into an absolutely continuous part, which is the integral of its derivative, plus a singular part, whose derivative is zero almost everywhere. For the Cantor function the first part is zero and the second is everything, which is why it is the standard example of a purely singular function. A step function is singular in a different way — its rise is concentrated at countably many points — so the singular part itself splits again, into jumps and a Cantor-like remainder.

So the picture is: monotone functions are the sum of a well-behaved piece and a Cantor-like piece, and the theorems of calculus apply to the first. That is a satisfying resolution rather than a defeat: the pathology is not everywhere and is not rare, it is a summand, and knowing its size is knowing how far the ordinary theorems reach.

A staircase with no steps. The Cantor function drawn to several stages: a continuous non-decreasing curve from nought to one which is constant on every interval of the complement of the middle-thirds set, so its whole rise happens on a set of measure zero.
Fig. 4 The same function at four stages rather than seven, where the flat pieces can be counted. At each stage the number of flat pieces trebles and each is a third as long, so the total flat length climbs towards one — and the picture converges to a curve that is flat almost everywhere.

Where it appears without being invited

The function is not a pathology invented to break a theorem. It arises.

As a distribution. Take a random number by choosing each base-three digit independently to be 00 or 22 with equal probability. Its distribution function is the Cantor function, and the resulting random variable has no density — it is neither discrete nor continuous in the elementary sense, and the third category exists precisely because of it. Anybody who has been told that a random variable is either discrete or has a density has been told something false, and this is the counterexample.

In dynamics. The devil’s staircase of a circle map is a function of exactly this kind: the rotation number against a parameter, flat on an interval for every rational rotation and rising on a set of measure zero. That the two objects have the same shape is not a coincidence; both are built by a self-similar construction, and in both the flat parts are indexed by the rationals while the rise happens on what is left.

And in the study of self-similar sets generally, where the natural measure on any such set has a distribution function of this type. The function is the Cantor set’s own measure, written as a graph — and every fractal carries one, so the phenomenon is as common as self-similarity is.

The measure it is the distribution of

There is a way of seeing the function that makes it a natural object rather than a construction, and it is worth having because it removes the impression of contrivance.

Put a unit of mass on the interval and distribute it by a rule: half goes to the left third and half to the right third, and none to the middle. Repeat inside each third. In the limit the mass sits entirely on the middle-thirds set, distributed evenly in the sense that each of the 2k2^k intervals at stage kk carries 2k2^{-k} of it.

The Cantor function is the amount of mass to the left of xx. That is what its graph is: a cumulative distribution.

Read that way its properties are obvious rather than surprising. It is non-decreasing because mass is non-negative; it is continuous because no single point carries any mass; it is flat on the removed intervals because there is no mass there. And the derivative — the density — does not exist, because the mass is concentrated on a set of measure zero without being concentrated at any point.

A measure with no atoms and no density is exactly what the third category means, and it is neither exotic nor rare: every self-similar set carries one.

What it costs to have such objects

The construction is often presented as a curiosity, and it changed what a definition had to say.

It forced the notion of absolute continuity, without which the fundamental theorem has no correct statement in the Lebesgue setting. That notion is now a standard hypothesis appearing throughout analysis, and it exists because of this example.

It clarified what “almost everywhere” cannot do. A property holding almost everywhere is compatible with the exceptional set carrying all the interesting behaviour, and the Cantor function is the standing reminder. A set of measure zero is not a small set in any sense except length — it can be uncountable, it can be topologically large in the sense of being dense, and it can carry a whole unit of anything except length.

It supplies a canonical example wherever one is needed. A construction in analysis that claims to handle “all reasonable functions” is tested against this one, and a great many claims have failed the test. Having a standard counterexample is worth more to a subject than most theorems.

And it separated three notions that had been conflated: continuous, differentiable almost everywhere, and the integral of a derivative. Before the example the second and third looked the same.

A set with no interval in it and half its length left, after 6 stages. Stages of removing a shrinking middle from every surviving interval, with the total length left printed at each stage, and the middle-thirds construction of the same depth drawn beneath for comparison.
Fig. 5 The relative from the ladder’s second rung: a nowhere-dense set with positive length. Between them, the fat Cantor set and this function make the point that measure and topology are independent — a set can be large in one sense and small in the other, and neither implies anything about the other.

Who built it, and what for

Cantor introduced the function in 1884, in a note appended to a paper on trigonometric series, and it was not a curiosity even then — it was an answer to a specific question about when a series determines its coefficients.

The name it usually carries in French, l’escalier du diable, and in English, the devil’s staircase, arrived later and from physics, where the same shape appears as a rotation number against a parameter.

The interesting history is what it did to the calculus. Between Newton and Cantor, “continuous and increasing” and “the integral of its derivative” were not distinguished, because nobody had exhibited a function satisfying the first and failing the second. Once one existed, the fundamental theorem needed a hypothesis, and finding the right one took twenty years and produced absolute continuity — Vitali’s, in 1905.

That sequence is the standard one for this part of mathematics and is worth recognising. A pathological example is the thing that forces a definition to be correct, and the definitions that result are usually the ones that turn out to be useful for other reasons. Absolute continuity is now a hypothesis in the theory of differential equations, in probability, and in the study of measures, none of which is about staircases.

What the pictures cannot show

The curve drawn is a finite stage. At seven stages the function has flat pieces and jumps between them; the limit has flat pieces on a set of full measure and no jumps at all. Every drawing is of a piecewise-linear approximation, and the object being described is the limit of those.

The middle-thirds set is invisible. It is where all the rise happens and it has no length, so it occupies no ink. What the picture shows is the complement — the flat parts — and the reader has to supply the rest.

Five stages of flat pieces are drawn and the construction has infinitely many. The figure shows the widest few dozen and stops; the rest are below the resolution of the page, and they are the ones that make the total flat length reach one. What is drawn is the beginning of a limit.

And “zero derivative almost everywhere” is not a visual property. The curve looks as though it climbs; it climbs on a set that no drawing can indicate, and at every visible point it is flat. The disagreement between what the picture shows and what is true is the whole content.

Where the ladder goes next

The anchor’s six rungs now cover measure, the fat Cantor set, outer measure, Lebesgue’s criterion, the Vitali set and this. Named here as debts:

The Lebesgue decomposition in general, of which the monotone case above is a special instance, and which classifies every measure into absolutely continuous, singular continuous and atomic parts.

And the Hausdorff dimension of the middle-thirds set, which is log2/log3\log 2/\log 3 and is exactly the Hölder exponent of the function — a coincidence that is not one, and which nothing above explains. The dimension is measured on a different anchor; why it equals the exponent is a general fact about the graphs of measures on self-similar sets, and it is a rung this ladder has not reached.

Sideways, the set the rise happens on is the ladder’s second rung, the criterion this function complicates is the fourth, and the theorem it breaks is the fundamental theorem.

Sideways: a set with no size at all is what happens when the construction is pushed past what a measure can carry, and covering a set from outside is the definition every claim here is made against.

What is worth carrying away

A hypothesis is only understood once something satisfying its weaker form and failing its conclusion has been built.

“Continuous and differentiable almost everywhere” sounds like enough for the fundamental theorem, and the Cantor function shows it is not. The correct hypothesis — absolute continuity — is not something anybody would have written down without the example, and it is now the standard one.

The habit worth taking is to ask what a property holding almost everywhere leaves out. A set of measure zero can be uncountable, can be where every interesting thing happens, and is invisible to every integral — which makes “almost everywhere” a much weaker phrase than it sounds.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

Almost everywhereCantor setContinuityDerivativeIntegralMeasureMonotoneSelf-similarity