# An equivalent condition for differentiability almost everywhere?

Given a function $$f \in L^1 (\mathbb R)$$, define the roughness $$R_f$$ of $$f$$ at $$x \in \mathbb R$$ by

$$\DeclareMathOperator{\esssup}{\operatorname{esssup}} R_f (x) := \limsup_{r \to 0+}\dfrac{r \esssup_{y \in B_r (x)} |f(y) - f(x)|}{\displaystyle\int\limits_{B_r (x)} |f(s) - f(x)| ds}$$ where $$\esssup$$ denotes the essential supremum, and by convention we take $$\frac{0}{0} = 1$$.

Question: Let $$f$$ be continuous. Is it true that $$f$$ is differentiable almost everywhere if and only if $$R_f = 1$$ almost everywhere?

Remark: The “only if” direction is relatively straightforward, the “if” direction is the issue.

• Is the "only if" direction relatively straightforward? What if $f(x) = x^2$? I get esssup$_{y \in B_r(x)} |f(y)-f(x)| = xr+\frac{r^2}{4}$ and $\int_{x-r/2}^{x+r/2} |s^2-x^2|ds = \frac{1}{2}xr^2+O(r^3)$. What's your definition of $B_r(x)$? Commented Jul 21, 2021 at 17:46
• Oh it’s the integral over the ball of radius $r$ around $x$. So, the integral in your sentence would be the integral from $x-r$ to $x + r$. Commented Jul 22, 2021 at 2:42
• @mathworker21 : The limit is $1$ for all $x$ with $f'(x)\ne0$. Commented Jul 22, 2021 at 3:56
• Can you check to see if you got the integral part correct? @mathworker21 Commented Jul 22, 2021 at 5:21
• @NateRiver sorry about the noise. deleted my second comment. thanks for the clarifications. Commented Aug 18, 2021 at 6:58

The answer is negative: If $$f'(x) = 0$$ "too often", then $$R_f$$ may fail to be equal to one almost everywhere.

Let $$C$$ be a fat Cantor set, let $$I_n = (a_n, b_n)$$ ($$n \geqslant 2$$) be the sequence of all finite components of the complement of $$C$$, and let $$f$$ be a differentiable function with the following properties:

• $$f(x) = 0$$ for $$x \in C$$;

• on $$I_n$$, $$f$$ is a smooth bump of a fixed shape, supported in $$\tfrac1n I_n$$ (the middle $$n$$th part of $$I_n$$), and with maximum equal to $$|I_n|^2$$ (and hence the integral of $$f$$ over $$I$$ is equal to $$\tfrac1n |I_n|^3$$).

Then $$f'(x) = 0$$ for $$x \in C$$ by the first property, so $$f$$ is everywhere differentiable. On the other hand, it is rather straigthforward to see that there is a constant $$C$$ such that for each $$n$$ and $$t \in I_n = (a_n, b_n)$$ we have $$\int_{a_n}^t f(y) dy \leqslant \frac{C}{n} (t - a_n) \sup_{y \in [a_n, t]} f(y)$$ and $$\int_t^{b_n} f(y) dy \leqslant \frac{C}{n} (b_n - t) \sup_{y \in [t, b_n]} f(y) .$$ It follows that if $$x \in C$$ and $$r$$ is small enough, so that $$B_r(x)$$ is disjoint with $$\tfrac12 I_2 \cup \tfrac13 I_3 \cup \ldots \cup \tfrac1{n-1} I_{n-1}$$, then $$\int_{B_r(x)} f(y) dy \leqslant \frac{C}{n} |B_r(x)| \sup_{y \in B_r(x)} f(y) .$$ This, in turn, implies that $$R_f(x) = \infty$$ for every $$x \in C$$.

Thus, $$R_f(x) \ne 1$$ on a set of positive Lebesgue measure.

• Unless I made a mistake, this shows that the ("relatively straightforward") "only if" part fails. I believe the "if" part is false, too, but I do not have a proof. A counterexample could be of the form $f(t) = \int_0^1 s^{-1/2} (\log s)^{-2} B(t+s) ds$ where $B(t)$ is the Brownian motion: this should be nowhere differentiable with probability one, but nevertheless we should have $R_f(t) = 1$ for all $t$ with probability one. (This is very similar to the fracftional Brownian motion with Hurst parameter approaching $1$.) Commented Sep 19, 2021 at 1:27
• Ah wow I made a mistake it seems - I did think that $f’ = 0$ would be a problem, but I thought I had overcome the difficulty by some argument or other saying that “$f$ is locally constant most places where $f’$ is $0$“. But, I forgot about the existence of positive measure nowhere dense sets like $C$. Nicely done! Commented Sep 19, 2021 at 5:37