Tutorials › Measure Theory › Continuity and Monotonicity of the Cantor Function

Non-Measurable Sets and the Cantor Function · Tutorial 157 of 798

Continuity and Monotonicity of the Cantor Function

See how the binary digit rule on the Cantor set determines matching endpoint values on every deleted interval, yielding a continuous nondecreasing function on the whole unit interval.

Advanced 12 min read

What You'll Learn

  • Define the digit-based function on the Cantor set using its unique expansion with digits zero and two.
  • Compute and compare the function values at endpoints of deleted middle-third intervals.
  • Construct continuous piecewise linear approximations to the extended function.
  • Prove uniform convergence of the approximations and deduce continuity.
  • Prove monotonicity and identify a common error involving ordinary ternary expansions.

From Ternary Digits to a Function on the Interval

The Cantor function begins with a rule on the middle-third Cantor set, but its continuity and monotonicity concern a function on the entire interval \([0,1]\). The key step is to check that the digit rule assigns the same value to the two endpoints of every deleted interval. Assigning that common value throughout each deleted interval then gives the extension. We prove its continuity by approximating it uniformly with continuous piecewise linear functions.

Let \(C_0=[0,1]\). At each stage, remove the open middle third of every closed interval remaining from the previous stage; let \(C_n\) be the union of the closed intervals left after \(n\) stages, and let \(C=\bigcap_{n=0}^{\infty}C_n\). The set \(C\) is the middle-third Cantor set. Every \(x\in C\) has a ternary expansion using only the digits \(0\) and \(2\). Write that expansion as \(x=\sum_{j=1}^{\infty}d_j3^{-j}\), where \(d_j\in\{0,2\}\), and set \(e_j=d_j/2\in\{0,1\}\).

Definition: On \(C\), define \(F_C(x)=\sum_{j=1}^{\infty}e_j2^{-j}\). The Cantor function on \([0,1]\) is the extension \(F\) that agrees with \(F_C\) on \(C\) and is constant on each open interval removed in the construction of \(C\). Both \(F_C\) and \(F\) are real-valued; \(F_C:C\to[0,1]\) and \(F:[0,1]\to[0,1]\).

The allowed expansion is unique. Indeed, if two sequences of digits from \(\{0,2\}\) first differ at position \(k\), the contribution of that differing digit to the difference of the represented numbers has magnitude \(2\cdot3^{-k}\). The maximum possible difference contributed by all later digits is \(\sum_{j>k}2\cdot3^{-j}=3^{-k}\). The later digits therefore cannot cancel the first difference. This also explains why endpoints require care: the rule uses only expansions with digits \(0\) and \(2\), not every ordinary ternary expansion.

Values at the Ends of Deleted Intervals

Consider a gap removed at stage \(k\). Its endpoints have allowed ternary expansions that share their first \(k-1\) digits. At position \(k\), the left endpoint has digit \(0\) and is followed by digits \(2\) forever; the right endpoint has digit \(2\) and is followed by digits \(0\) forever. If the shared binary prefix has value \(S=\sum_{j<k}e_j2^{-j}\), the digit rule gives the left endpoint value \(S+\sum_{j>k}2^{-j}=S+2^{-k}\). The right endpoint value is \(S+2^{-k}\) as well. Thus the prescribed values match, so assigning this common value across the gap is consistent.

Worked Example: The First Deleted Interval

The first deleted interval is \((1/3,2/3)\). For \(1/3\), the allowed Cantor expansion is \(0.0222\ldots_3\), not \(0.1000\ldots_3\). Its binary digits under the rule are \(0.0111\ldots_2\), so

$$ F_C(1/3)=\sum_{j=2}^{\infty}2^{-j}=\frac{1/4}{1-1/2}=\frac12. $$

For \(2/3\), the allowed expansion is \(0.2000\ldots_3\), giving binary value \(0.1000\ldots_2\), hence \(F_C(2/3)=2^{-1}=1/2\). The extension therefore sets \(F(x)=1/2\) for every \(x\in(1/3,2/3)\). Check: the left endpoint value is \(1/2\), and the right endpoint value is \(1/2\), so the constant value agrees with both.

Worked Example: A Non-Endpoint Cantor Point

The point \(x=1/4\) has the allowed ternary expansion \(0.020202\ldots_3\). To check the represented value, sum its nonzero terms:

$$ \sum_{j=1}^{\infty}2\cdot3^{-2j} =\frac{2/9}{1-1/9} =\frac{2/9}{8/9} =\frac14. $$

The corresponding binary expansion is \(0.010101\ldots_2\), so

$$ F_C(1/4)=\sum_{j=1}^{\infty}2^{-2j} =\frac{1/4}{1-1/4} =\frac13. $$

Check: the binary series equals \((1/4)(4/3)=1/3\), as claimed. The ternary and binary digit sums both converge, since they are bounded above by geometric series.

Worked Example: A Later Deleted Interval

The stage-two gap is \((1/9,2/9)\). Its left endpoint has allowed expansion \(0.00222\ldots_3\), and the digit rule gives

$$ F_C(1/9)=\sum_{j=3}^{\infty}2^{-j} =\frac{1/8}{1-1/2} =\frac14. $$

The right endpoint has allowed expansion \(0.02000\ldots_3\), whose binary value is \(0.01000\ldots_2=1/4\). Thus \(F_C(2/9)=1/4\), and \(F\) is \(1/4\) throughout \((1/9,2/9)\). Check: both endpoint calculations give \(1/4\), including the right endpoint’s single nonzero binary digit \(2^{-2}\).

Continuous Approximations and the Main Result

For each \(n\), the set \(C_n\) consists of \(2^n\) closed intervals of length \(3^{-n}\). Each such interval is determined by a prefix \(d_1,\ldots,d_n\), where every \(d_j\) is \(0\) or \(2\). Put \(e_j=d_j/2\) and \(s=\sum_{j=1}^ne_j2^{-j}\). The interval’s left endpoint has Cantor-function value \(s\), and its right endpoint has value \(s+2^{-n}\): the right endpoint’s remaining ternary digits are all \(2\), so its remaining binary digits are all \(1\), whose sum is \(2^{-n}\).

Define \(F_n\) on each interval of \(C_n\) by linear interpolation between these two endpoint values. On every gap removed by stage \(n\), define \(F_n\) to be the common endpoint value. There are finitely many such intervals and gaps at stage \(n\). At their shared endpoints the definitions agree, so \(F_n\) is continuous. On each component interval it is increasing, and on each removed gap it is constant. The endpoint values occur in nondecreasing order from left to right: the digit prefixes are ordered lexicographically, and their binary prefix values are ordered the same way. Consequently \(F_n\) is nondecreasing on \([0,1]\).

Theorem: The extension \(F:[0,1]\to[0,1]\) defined by the Cantor digit rule on \(C\) and by the common endpoint value on each deleted interval is continuous and nondecreasing.

Proof. First compare \(F_n\) with \(F\). If \(x\) lies in a gap removed by stage \(n\), both functions take the common endpoint value there. Otherwise \(x\) lies in a component interval \(I\) of \(C_n\). The endpoint values on \(I\) differ by \(2^{-n}\). The digit rule is nondecreasing on the Cantor points in \(I\): if two Cantor points first differ at position \(k\), the smaller point has digit \(0\) and the larger point has digit \(2\). In the binary values, the later digits after the smaller point’s \(0\) can sum to at most \(\sum_{j>k}2^{-j}=2^{-k}\), while the larger point contributes \(2^{-k}\) at position \(k\). Thus the function values are ordered. The extension on gaps within \(I\) takes the corresponding endpoint values, so all values of \(F\) on \(I\) lie between its endpoint values. The interpolant \(F_n\) also lies between those same values. Therefore

$$ |F_n(x)-F(x)|\le 2^{-n}\qquad\text{for every }x\in[0,1]. $$

Since \(2^{-n}\to0\), this proves uniform convergence of \(F_n\) to \(F\). To verify continuity directly, fix \(x\in[0,1]\) and \(\varepsilon>0\). Choose \(n\) so that \(2^{-n}<\varepsilon/3\). The continuous function \(F_n\) is continuous at \(x\), so there is \(\delta>0\) such that \(|y-x|<\delta\) implies \(|F_n(y)-F_n(x)|<\varepsilon/3\). For such \(y\), the triangle inequality gives \[ |F(y)-F(x)| \le |F(y)-F_n(y)|+|F_n(y)-F_n(x)|+|F_n(x)-F(x)| <\frac{\varepsilon}{3}+\frac{\varepsilon}{3}+\frac{\varepsilon}{3} =\varepsilon. \] Thus \(F\) is continuous at every \(x\), including \(0\) and \(1\) with the relative topology on \([0,1]\).

Finally, if \(x\le y\), then \(F_n(x)\le F_n(y)\) for every \(n\), since each \(F_n\) is nondecreasing. Taking limits in this real inequality gives \(F(x)\le F(y)\). Hence \(F\) is nondecreasing. The endpoint values follow from the digit rule: \(F(0)=0\), since all ternary digits are zero, and \(F(1)=1\), using the allowed expansion \(1=0.222\ldots_3\), which maps to \(0.111\ldots_2=1\). This proves the theorem. \(\square\)

A Common Endpoint Error

A tempting but invalid calculation at \(1/3\) is to use the ordinary ternary expansion \(1/3=0.1000\ldots_3\) in the Cantor digit rule and then treat its digit \(1\) as if the rule specified how to map it. It does not: the rule is defined only for expansions whose digits are \(0\) and \(2\). The allowed Cantor expansion is \(0.0222\ldots_3\), and it gives \(F_C(1/3)=0.0111\ldots_2=1/2\). Its ordinary alternative expansion is not another allowed expansion for this definition. The same distinction matters at every endpoint where ordinary ternary expansions are ambiguous.

The proof also shows why checking endpoint values is essential: without matching values, a constant assignment on a deleted interval would not define an extension agreeing with the digit rule at both ends. Here the matching values make the construction well-defined, and the finite-stage approximations control its continuity over the entire interval.

Check Your Understanding

Use the allowed \(0\)-and-\(2\) ternary expansions when applying the digit rule.

  1. Compute \(F_C(1/9)\) from its allowed ternary expansion and verify the value using the binary series.
  2. For a deleted interval created at stage \(k\), explain why the left endpoint’s binary tail after position \(k\) has sum \(2^{-k}\).
  3. Why does the endpoint-value difference on every component interval of \(C_n\) equal \(2^{-n}\)?
  4. In the continuity proof, where is the uniform bound \(|F_n(x)-F(x)|\le 2^{-n}\) used?
  5. Explain why \(0.1000\ldots_3\) cannot be used as an input expansion for the Cantor digit rule at \(1/3\).