The Cantor function is a continuous function that is nondecreasing, satisfies and , and has derivative zero almost everywhere. Its increase is concentrated on the middle-thirds Cantor set, a set of Lebesgue measure zero. Named after Georg Cantor, it is a central example in mathematical analysis showing that continuity and monotonicity do not suffice to recover a function by integrating its derivative.
Construction from the Cantor set
Let be the middle-thirds Cantor set, obtained by repeatedly removing the open middle third of each remaining interval in . A point belongs to exactly when it has a ternary expansion using only the digits and .
For , choose such an expansion:
Define
Thus the construction replaces each ternary digit by the binary digit , and each ternary digit by the binary digit .
The expansion convention matters at endpoints. For example,
Their images are
The two endpoints of every deleted interval similarly receive the same value. Extend to the interior of each deleted interval by assigning that common endpoint value throughout the interval.
Consequently,
At the next stage,
and
These horizontal plateaus, repeated at every scale, give the graph its staircase appearance.
Self-similarity and approximation
The function satisfies
The overlapping formulas agree at the boundary points. Each outer third contains a copy of the whole graph, compressed horizontally by a factor of and vertically by a factor of .
This relation also gives a construction by uniform convergence. Begin with , and define by substituting for on the right-hand side. Each is continuous and piecewise linear. On the intervals remaining after stages of the Cantor-set construction, its slope is ; on intervals already removed, it is constant.
If denotes this recursive operation, then
Successive approximations therefore converge uniformly to . The Banach fixed-point theorem also establishes uniqueness among continuous functions with endpoint values and satisfying the recursion.
Continuity, monotonicity, and regularity
The Cantor function is a nondecreasing function, but it is not strictly increasing because it is constant on every deleted interval. Nevertheless, continuity and its endpoint values imply that it is a surjection onto .
Its restriction to is also onto : every binary expansion determines a corresponding ternary expansion using and . Thus a set of measure zero is mapped onto an entire interval. This illustrates why continuous functions need not preserve sets of measure zero.
The function has the symmetry
Its regularity is described more precisely by Hölder continuity. With
there is a constant such that
This exponent is optimal. Indeed,
so for any ,
In particular, is not Lipschitz continuous.
Derivative and failure of integral recovery
Every point of lies in an open interval on which is constant. Hence
Because has measure zero, the derivative is zero almost everywhere.
This does not mean that the derivative exists everywhere. For example, at , right-hand difference quotients are zero because of the central plateau. On the other hand, setting
gives
and therefore
Thus no finite two-sided derivative exists there.
Since almost everywhere, its Lebesgue integral is zero:
where the derivative may be assigned arbitrary values on the exceptional null set. Yet
This is not a contradiction of the fundamental theorem of calculus. The Lebesgue version that reconstructs a function from its derivative requires absolute continuity, not merely continuity and monotonicity. The Cantor function is not absolutely continuous.
A direct demonstration uses the intervals remaining at stage . Their total length is , which tends to zero, while the sum of the increases of across them is always . This violates the defining condition for absolute continuity.
Probability and singular measure
Extended by for and for , the Cantor function is the cumulative distribution function of the Cantor distribution.
One construction uses independent random variables , each taking the values and with equal probability. The convergent random series
takes values in , and
Its probability distribution assigns probability to , even though has Lebesgue measure zero. It assigns probability zero to each individual point. It is therefore singular continuous: singular with respect to Lebesgue measure, but without point masses.
In particular, this distribution has no probability density function with respect to Lebesgue measure. The almost-everywhere derivative of its cumulative distribution function cannot serve as such a density: that derivative is zero and would integrate to zero rather than one.
Bounded variation and generalized differentiation
As a nondecreasing function with endpoint increase , has bounded variation, with total variation equal to . Its associated Lebesgue–Stieltjes measure satisfies
This is precisely the probability measure of the Cantor distribution.
In distribution theory, the derivative of is the measure , rather than the zero function. More explicitly, for every smooth test function compactly supported in ,
The classical derivative records the local slopes wherever a finite derivative exists; the distributional derivative also records the singular increase concentrated on . This distinction makes the Cantor function a standard example in the study of integration, measures, and generalized derivatives.