Tutorials › Measure Theory › Constant Intervals and Almost-Everywhere Derivative

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

Constant Intervals and Almost-Everywhere Derivative

Use ternary and binary digit descriptions to locate the Cantor function’s constant intervals and establish where its derivative vanishes.

Advanced 9 min read

What You'll Learn

  • Describe each deleted interval using its finite ternary prefix.
  • Compute the Cantor function’s constant value on a deleted interval.
  • Check that the two endpoint expansions give the same function value.
  • Prove that the derivative is zero at every point in a deleted interval.
  • Deduce the almost-everywhere derivative statement from the nullity of the Cantor set.
  • Distinguish a derivative conclusion almost everywhere from one at Cantor-set endpoints.

Plateaus of the Cantor Function

Removing the middle thirds creates open intervals on which the Cantor function does not change. These plateaus explain its derivative away from the Cantor set: each point in a deleted interval has a whole neighborhood on which the function is constant, so the derivative there is zero. The conclusion is almost everywhere because the deleted intervals make up the complement of the Cantor set, which has Lebesgue measure zero. It does not assert that the derivative is zero at every point of the Cantor set.

Let \(C\subseteq[0,1]\) be the middle-third Cantor set, and let \(F:[0,1]\to[0,1]\) be the Cantor function. We use its ternary-digit description: if a point of \(C\) has ternary digits \(d_j\in\{0,2\}\), its function value is the binary number with digits \(d_j/2\). If a point lies in a deleted interval and its first ternary digit \(1\) occurs in position \(k\), the function value is the binary prefix from positions \(1,\ldots,k-1\), followed by a \(1\) in position \(k\) and zeros thereafter. At endpoints, the two possible ternary expansions give the same value. These are the standard digit rules for \(F\); its continuity and monotonicity were established earlier.

Definition: A deleted interval at stage \(k\) has a prefix \(a_1,\ldots,a_{k-1}\), where every \(a_j\) is \(0\) or \(2\). Put \(p=\sum_{j=1}^{k-1}a_j3^{-j}\). The interval is \((p+3^{-k},p+2\cdot3^{-k})\). The Cantor function’s value on that interval is \(\sum_{j=1}^{k-1}a_j2^{-(j+1)}+2^{-k}\).

The empty prefix is allowed when \(k=1\), with \(p=0\) and the empty sum equal to zero. For a point in the interval, the first \(k-1\) ternary digits are the specified prefix and the \(k\)-th digit is \(1\). The digit rule therefore assigns the same binary value to every point in that interval. The endpoint computations below also show why that value matches continuously at both ends.

Worked Example: The First Deleted Interval

The first removed interval is \((1/3,2/3)\). Here \(k=1\), the prefix is empty, and the stated value is \(2^{-1}=1/2\). Indeed, every interior point has first ternary digit \(1\), so the digit rule gives \(F(x)=1/2\) throughout the interval.

At the left endpoint, \(1/3=0.1000\ldots_3=0.0222\ldots_3\). The first expansion gives the binary value \(0.1000\ldots_2=1/2\). The second gives \(0.0111\ldots_2=1/2\), since \(\sum_{j=2}^{\infty}2^{-j}=1/2\). At the right endpoint, \(2/3=0.2000\ldots_3\), which gives \(0.1000\ldots_2=1/2\). Thus both endpoints have value \(1/2\), as required.

Check: the formula for the interval gives \(2^{-1}=1/2\), and both endpoint calculations give \(1/2\) as well.

Worked Example: A Stage-Two Deleted Interval

Take the prefix \(a_1=2\) and \(k=2\). Then \(p=2/3\), so the gap is \((2/3+1/9,\,2/3+2/9)=(7/9,8/9)\). Its function value is \(2\cdot2^{-2}+2^{-2}=1/2+1/4=3/4\).

For the left endpoint, \(7/9=0.20222\ldots_3\). Its binary value is \(0.10111\ldots_2\): the first digit contributes \(1/2\), the second contributes \(0\), and the remaining digits contribute \(\sum_{j=3}^{\infty}2^{-j}=1/4\). The total is \(3/4\). For the right endpoint, \(8/9=0.22000\ldots_3\), whose binary value is \(0.11000\ldots_2=1/2+1/4=3/4\). All points strictly between these endpoints have first two ternary digits \(21\), so the digit rule gives \(3/4\) throughout the gap.

Check: the formula, the left endpoint expansion and the right endpoint expansion all give \(3/4\).

Constancy Gives a Zero Derivative

Theorem: For the Cantor function \(F:[0,1]\to[0,1]\), \(F\) is constant on every deleted interval. At every \(x\in[0,1]\setminus C\), its (ordinary two-sided) derivative exists and \(F'(x)=0\). Consequently, relative to Lebesgue measure on \([0,1]\), \(F'(x)=0\) for \(m\)-almost every \(x\); this means the derivative exists and equals zero outside a set of measure zero.

Proof. Fix a deleted interval at stage \(k\), with prefix \(a_1,\ldots,a_{k-1}\) and \(p=\sum_{j=1}^{k-1}a_j3^{-j}\). Each interior point has the specified prefix followed by ternary digit \(1\) at position \(k\). The digit rule assigns it the value \(\sum_{j=1}^{k-1}a_j2^{-(j+1)}+2^{-k}\), independent of the point. This proves constancy on the whole interval.

Its endpoints have expansions \(0.a_1\cdots a_{k-1}0\,222\ldots_3\) and \(0.a_1\cdots a_{k-1}2\,000\ldots_3\). At the left endpoint, the tail contributes \(\sum_{j=k+1}^{\infty}2^{-j}=2^{-k}\) to the binary value. At the right endpoint, the digit \(2\) at position \(k\) contributes \(2\cdot2^{-(k+1)}=2^{-k}\). Both endpoints therefore have the same value as the interior, consistent with the digit rule at ambiguous expansions.

Now take \(x\in[0,1]\setminus C\). By the construction of \(C\), \(x\) belongs to one of the deleted open intervals, say \((u,v)\). Choose \(r>0\) so that \((x-r,x+r)\subset(u,v)\); for instance, \(r=\min(x-u,v-x)/2\) is positive. For every \(h\) with \(0<|h|<r\), both \(x\) and \(x+h\) lie in that interval, so constancy gives \(F(x+h)-F(x)=0\). Hence \[ \frac{F(x+h)-F(x)}{h}=0 \] for every such \(h\), and the limit as \(h\to0\) is zero. Thus \(F'(x)=0\).

Finally, \(C\) has Lebesgue measure zero. To see the measure bound directly, let \(C_n\) be the union of the \(2^n\) closed intervals remaining after \(n\) stages. Each has length \(3^{-n}\), so \(m(C_n)=(2/3)^n\). Since \(C\subseteq C_n\) for every \(n\), \(0\le m(C)\le(2/3)^n\) for every \(n\), and \((2/3)^n\to0\); therefore \(m(C)=0\). The derivative exists and is zero on \([0,1]\setminus C\), whose complement is this null set. This proves the almost-everywhere assertion. \(\square\)

Worked Example: A Derivative at an Interior Point of a Gap

Take \(x=4/9\), which lies in the first deleted interval \((1/3,2/3)\). Its distance to the left endpoint is \(4/9-1/3=1/9\), and its distance to the right endpoint is \(2/3-4/9=2/9\). Choose \(r=1/18\), which is less than both distances. For every \(h\) with \(0<|h|<1/18\), \(x+h\) remains in \((1/3,2/3)\). The function has value \(1/2\) at both \(x+h\) and \(x\), so \[ \frac{F(x+h)-F(x)}{h}=\frac{1/2-1/2}{h}=0. \] The difference quotient is identically zero on this punctured neighborhood; therefore \(F'(4/9)=0\).

Check: \(4/9-1/18=7/18>1/3=6/18\), and \(4/9+1/18=9/18<2/3=12/18\), so the chosen neighborhood really is inside the constant interval.

Almost Everywhere Is Not Everywhere

The derivative conclusion depends on being inside an open deleted interval. A point at an endpoint of a gap lies in \(C\), and a plateau on only one side does not by itself give a two-sided derivative. In fact, the derivative at the endpoint \(1/3\) is not finite. For each integer \(n\ge2\), set \(x_n=1/3-3^{-n}\). Its ternary expansion is \(0.0\underbrace{22\cdots2}_{n-1\text{ digits}}{}_3\), so \(F(x_n)=\sum_{j=2}^{n}2^{-j}=1/2-2^{-n}\), while \(F(1/3)=1/2\). Thus \[ \frac{F(x_n)-F(1/3)}{x_n-1/3} =\frac{-2^{-n}}{-3^{-n}} =\left(\frac32\right)^n. \] As \(n\to\infty\), these quotients tend to \(+\infty\), so they cannot converge to a finite derivative. This does not conflict with the theorem: \(1/3\in C\), and the theorem makes no derivative claim at every point of \(C\).

A common error is to reason that \(F'=0\) everywhere because \(F\) is constant on the deleted intervals and the remaining Cantor set has measure zero. That confuses “outside a null set” with “at every point.” For example, the calculation above shows that the difference quotients at \(1/3\) do not approach zero; indeed, they are \((3/2)^n\) along the displayed sequence. The valid conclusion is exactly that the derivative exists and equals zero at every point of the complement of \(C\), hence almost everywhere, not everywhere.

The plateau description also distinguishes this function from one that is locally constant on all of \([0,1]\): the deleted intervals are its constant regions, while the Cantor set contains all points not covered by those open intervals. The nullity of \(C\) makes the derivative statement an almost-everywhere result without extending it to those exceptional points.

Check Your Understanding

Use the ternary-digit rule and the derivative definition to answer the following.

  1. For the gap \((1/9,2/9)\), compute the constant value of \(F\), and verify it using both endpoint expansions.
  2. For a deleted interval with prefix \(a_1,\ldots,a_{k-1}\), explain why every interior point has the same first \(k\) ternary digits.
  3. Why does local constancy on an open interval imply that the derivative is zero at each interior point of that interval?
  4. Use the stage-\(n\) sets \(C_n\) to show that \(m(C)=0\).
  5. Why does \(F'=0\) almost everywhere not imply that \(F'\) exists and equals zero at every point of \([0,1]\)?