# Can there exist a function that has a weak derivative, but is not differentiable almost everywhere?

I am currently learning about Sobolev spaces, and I am trying to build some intuition of weak derivatives. My current intuition is imagining the weak derivative of f as a function equal to f's derivative almost everywhere. However, this assumption assumes that f is differentiable almost everywhere. Is this always the case for weakly differentiable functions?

If $p>n$, then the function is differentiable a.e. and the derivative coincides with the weak derivative a.e.

If $p\leq n$ (or even $f\in BV$) the function is only approximately differentiable a.e.

Both results can be found in Evans & Gariepy, Measure theory and fine property of functions, section 6.1 (and if I recall correctly "a.e." can be replaced by "outside a set of zero $p$-capacity", which is slightly stronger).

To construct a counterexample to a.e. differentiability for $p$ strictly below $n$, consider a nonnegative function $\eta \in C^\infty (\mathbb{R}^n)$ with support in $B_1$ and with value $1$ on $B_{1/2}$, and enumerate the rationals as $\mathbb{Q}=\{q_i\}_{i\in \mathbb{N}}$. Choose a sequence $r_i\searrow 0$ to be specified later, and define $$f(x)=\sum_{i\in \mathbb{N}}\eta\left(\frac{x-q_i}{r_i}\right).$$ This is a dense sum of bumps with smaller and smaller support. By the scaling of the $L^p$ norms you can check that indeed $f\in W^{1,p}$, provided $\sum_{i\in \mathbb{N}}r_i^{\frac{n}{p}-1}<\infty$.

However, the support of $f$ is contained in $\bigcup_{i\in \mathbb{N}} B(q_i,r_i)$ which can be made as small as wanted by sending $r_i$ quickly to zero, therefore at most points the function is zero. On the other hand, $f$ has value at least $1$ on a dense set (and the same holds for any function in the same equivalence class), therefore it can not be differentiable where it attains value zero.

I couldn't come up with a similar counterexample for $f\in W^{1,n}(\mathbb{R}^n)$, but maybe a similar construction would work.

• Isn't $1_\mathbb{Q}$ a counterexample? it's weak derivative is $0$, but even nowhere continuous. – David Lingard Jul 31 '19 at 0:00
• Yes you're right, but I wanted to construct a stronger counterexample, so that even if you're allowed to change the function in a negligible set, it's still not differentiable. – Del Mar 14 at 15:41

Fellow time travelers, allow me to highlight a good example which I found in the notes that Hass Saidane refers to:

The Heaviside step function is differentiable almost everywhere. However, it is not weakly differentiable.

[Edit: thus, we see that even for functions which are classically differentiable almost everywhere, OP's proposed intuition still isn't entirely air-tight].

Indeed, it can be said that $$H'=h$$ weakly if two conditions are met: First, (integrating against) $$h$$ is the distributional derivative of (integrating against) $$H$$. Second, $$h$$ lives in some appropriate $$L^p$$ space.

However, the distributional derivative of (integrating against) the Heaviside functional is the dirac-delta, in a sense which is very different from the technically legitimate $$L^p$$ function $$\infty \cdot \chi_{\{0\}}$$ (which is precisely the zero element of $$L^p$$). Therefore, the distributional derivative of $$H$$ fails to be of the form "integrate against an $$L^p$$ function."

Good luck, fellow students.

• This is not a global issue. The issue is plainly at 0 because the derivative is the Dirac delta. Also the issue about being in L^p means you are talking about belonging to a Sobolev space; not exactly the same as being weakly differentiable which only requires $L^1_{loc}$. Also note that this answer (and the answer of Hass) does not answer the question. Instead of A such that not B, this is an example of B such that not A. – Calvin Khor Mar 13 at 23:41
• Thanks for the feedback. I see your point: I haven't provided an example of a weakly differentiable function for which the classical derivative fails to exist a.e., but hopefully this at least complements Del's canonical answer by further showing that OP's proposed intuition has the potential to fail even if the classical derivative exists a.e.. As I say, though, point taken. I'll be more attentive to that in the future. – Thomas Winckelman Mar 14 at 18:47
• Oh, and I suppose what I was referring to as a "global phenomenon" is the notion of weak differentiability in general, since it isn't affected by anything that happens on a null set. You're right that, at best, this particular example doesn't highlight that property of the weak derivative. Hopefully it is still worth the bits of memory that it occupies on some server :) – Thomas Winckelman Mar 14 at 19:01

Here are 2 references on the topic: https://www.math.ucdavis.edu/~hunter/pdes/ch3.pdf https://en.wikipedia.org/wiki/Weak_derivative

• the down vote is because this gives a counter example of: continuous+derivable a.e implies weakly derivable. – David Lingard Jul 30 '19 at 23:41