# Differentiability of the Cantor Function

I know that the Cantor function is differentiable a.e. but I want to prove it without using the theorem about monotonic functions. I have already proved that $f'(x) = 0$ for all $x \in [0,1] \backslash \mathbb{C}$ where $\mathbb{C}$ is the Cantor set.

But I'm not sure how to go about proving that if $x \in \mathbb{C}$ then $f$ is not differentiable at $x$.

Actually, upon reflection, I think I have already proved differentiability a.e. but I would still like to know how to finish this part.

Also, the definition I am using for the function: $$f:[0,1] \to [0,1]$$ Let $x \in [0,1]$ with ternary expansion $0.a_1a_2...$ Let $N$ be the first $n \in \mathbb{N}$ such that $a_n = 1$. If for all $n \in \mathbb{N}$, $a_n \in \{0,2\}$, let $N = \infty$.

Now define $b_n = \frac{a_n}{2}$ for all $n < N$ and $b_N = 1$. Then $$f(x) = \sum_{i=1}^{N} \frac{b_n}{2^n}.$$

• Is there a particular reason you want to do it without monotone functions? That's one of the most excellent things about it, since it defines a cumulative distribution, that it can be used to define a measure for integration is immediate and beautiful! Commented Jun 30, 2014 at 3:41
• @user124104: By the Cantor function you mean the function that takes the Cantor set to $[0,1]$? Commented Jun 30, 2014 at 3:51
• What do you mean by "the" Cantor set? Ternary one? Fat one? Commented Jun 30, 2014 at 3:54
• Sorry, Cantor ternary set. Commented Jun 30, 2014 at 4:00
• Then the answer to the differentiability a.e. is immediate since the ternary Cantor set has zero measure. Maybe your question is how to prove that Cantor function is nowhere differentiable in the ternary Cantor set? Commented Jun 30, 2014 at 4:06

Consider a right-hand endpoint of one of the intervals removed to form the Cantor set. It has a ternary representation

$$x = 0.(2a_1)(2a_2)\ldots(2a_n)2000\ldots$$

where the $a$'s are all $0$ or $1$,

and the binary representation of $f(x)$ is

$$f(x) = 0.(a_1)(a_2)\ldots(a_n)1000\ldots.$$

Pick $m > n$ and $h>0$ with $3^{-(m+1)} < h < 3^{-m}.$

Then as $m \rightarrow \infty$ and $h \rightarrow 0+$

$$\frac{f(x+h)-f(x)}{h}>\frac{3^m}{2^{m+1}}\rightarrow \infty$$

and the right-hand derivative $f'_+(x) = \infty$.

You can make a similar argument for a left-hand endpoint of a removed interval.

• If I am not mistaken your proof only holds for a strict subset of the Cantor set (those points which are endpoints of removed intervals). Do you know if it is true that the function is non-differentiable at all the points of $C$? (After some online searches I am not so sure...) Commented Dec 10, 2016 at 14:00
• @AsafShachar: Those other points of $\mathcal{C}$ are limits of sequences of endpoints. I believe the Cantor function is not differentiable at those points as well. Do you have a reference that says otherwise?
– RRL
Commented Dec 10, 2016 at 18:46
• I am not sure. You might be right. I have found various references that discuss all kinds of differentiability properties (of generalized Cantor functions which are based on "fat" Cantor sets etc), but did not find any clear statement characterising the points of (non)-differentiability of the standard function. Commented Dec 10, 2016 at 18:53

Here is a proof that the Cantor function $$f$$ is not differentiable at non-endpoints of the Cantor set.

Let $$C_0=[0,1]$$, and let $$C_n$$ be constructed from $$C_{n-1}$$ by removing an open interval from each closed interval in $$C_{n-1}$$, in particular the middle third. The Cantor set $$C$$ is the intersection of the $$C_n$$.

Let $$x$$ be a point of $$C$$, but not an endpoint. Then for each $$n$$, $$x$$ is contained in some interval of $$C_n$$ (of maximal size), i.e. $$x\in [a_n,b_n]\subset C_n$$.

We then have the following properties:

P1: $$b_n-a_n = \frac{1}{3^n}$$

P2: $$f(b_n)-f(a_n)=\frac{1}{2^n}$$

P3: $$x-a_n<\frac{1}{3^n}$$

P4: $$x$$ must be in the left third of $$(a_n,b_n)$$ infinitely many times. Similarly for the right third.

P5: if $$x$$ is in the right third of an interval $$(a_n,b_n)$$, then $$x-a_n>\frac{2}{3^{n+1}}$$

P6: if $$x$$ is in the right third of an interval $$(a_n,b_n)$$, then $$f(b_n)-f(x)<\frac{1}{2^{n+1}}$$

Let us consider a subsequence $$a_{n_k}$$ where $$x$$ is in the right third of the interval $$(a_{n_k},b_{n_k})$$

\begin{align*} \frac{f(x)-f(a_{n_k})}{x-a_{n_k}} &= \frac{f(b_{n_k})-f(a_{n_k})}{x-a_{n_k}} - \frac{f(b_{n_k})-f(x)}{x-a_{n_k}} \end{align*}

Both fractions are positive due to the monotonicity of $$f$$. Using the properties above

\begin{align*} \frac{f(x)-f(a_{n_k})}{x-a_{n_k}} &\geq \frac{\frac{1}{2^{n_k}}}{\frac{1}{3^{n_k}}} - \frac{\frac{1}{2^{n_k+1}}}{\frac{2}{3^{n_k+1}}}\\ &= \left(\frac{3}{2}\right)^{n_k} - \frac{3}{4}\left(\frac{3}{2}\right)^{n_k} \\ &= \frac{1}{4}\left(\frac{3}{2}\right)^{n_k} \end{align*}

You stated it correctly:

However you proved it (using the fact that it is a monotonic function or whatever), if you already proved that the function is differentiable on $[0,1]-\mathcal{C}$ then there is no need to continue (who cares what happens on $\mathcal{C}$ it is a set of measure zero) and when we say that a property $\mathcal{P}$ occurs almost everywhere what we mean is that $\mathcal{P}$ is true everywhere except $perhaps$ on a set of measure zero.

Suppose $(x_n)\to x$ and $(y_n)\to x$ such that $x_n < y_n$ for all $n$. Then by way of contradiction assume the derivative exists $$\frac{f(y_n)-f(x_n)}{y_n-x_n} \to f'(x)$$

So if $x\in \mathcal{C}$ such that $x\in I_n:=[x_n,y_n]$ for all $n$. Then we immediately see it cannot be differentiable because $y_n-x_n=\frac{1}{3^n}$ but $f(y_n)-f(x_n)=\frac{1}{2^n}$.

• He knows that $f$ is differentiable a.e. and is asking how to prove that it is not differentiable on the Cantor set. Commented Jun 30, 2014 at 4:15
• How do you know $\lim_{n \to \infty} \frac{f(y_n)-f(x_n)}{y_n-x_n} = f'(x)$. I do not think this limit needs to exist in general- in the definition of the derivative we keep one point fixed. I do not see why you can use two non-constant sequences (i.e you only know the limit exists when $x_n=x$ for instance). Commented Dec 10, 2016 at 13:41
• It's an old post. I would have to think about this. But in any case, I don't think I'm saying the limit does exist, I'm saying "assume by way of contradiction" Commented Dec 10, 2016 at 22:51

On the other hand, suppose that one uses a fat Cantor set to produce a similar Cantor function. So now the Cantor set has a positive Lebesgue measure. I would conjecture that now, except for the endpoints of the complementary intervals, the derivative would exist and be finite. Then it would be finite. It would likely be infinite at the endpoints. Remember that, for a function of bounded variation, the derivative exists and is finite almost everywhere. Certainly something of this sort must happen. The devil's staircase

• "I would conjecture", "It would likely be", are not exactly answer stuff. This would be better off as a comment. Commented Mar 1, 2021 at 15:01