# Directional derivatives in every direction for a convex function implies differentiability

Let $$f$$ be a convex function from $$\Bbb R^n$$ to $$\Bbb R$$ and $$x\in \mathbb R^n$$
Suppose $$f$$ has derivatives in every direction in $$x$$.
Prove that $$f$$ is differentiable at $$x$$.

I already proved that a convex function is continuous and locally-Lipschitz, but I don't see how this can help here.

I know the statement is not true without the assumption that $$f$$ is convex, see for example this question: $f$ not differentiable at $(0,0)$ but all directional derivatives exist

Since the function is convex, I guess something can be done using subdifferentials.

• $f(x) = \| x \|$ is convex everywhere, but not differentiable at $x =0$. – Martin R Aug 23 '19 at 13:19
• @TonyK I know, but it is a part of statement, not of solution. – dead slug Aug 23 '19 at 13:20
• @MartinR: You are not the first to interpret the question that way! I have edited it to remove the ambiguity. – TonyK Aug 23 '19 at 13:21
• @TonyK: Changing “It is known” to “Suppose it is known” changes the meaning of the question significantly. I wouldn't do that without conformation from OP. – Martin R Aug 23 '19 at 13:21
• Now all OK. Don't edit anymore. – dead slug Aug 23 '19 at 13:23

Theorem 25.1 in Rockafellar's Convex Analysis states that if the subdifferential of $$f$$ at $$x$$ is a singleton, then $$f$$ is differentiable at $$x$$.
Let $$u,v\in \partial f(x)$$. Note that for any direction $$y$$, if $$\alpha >0$$ $$\langle y,u \rangle = \frac 1{\alpha} \langle y,\alpha u \rangle \leq \frac{f(x+\alpha y)-f(x)}{\alpha}$$ and if $$\alpha <0$$ $$\langle y,u \rangle = \frac 1{\alpha} \langle y,\alpha u \rangle \geq \frac{f(x+\alpha y)-f(x)}{\alpha}$$ Letting $$\alpha \to 0$$ yields $$\langle y,u \rangle = f'(x,y)$$.
Replacing $$u$$ with $$v$$, $$\langle y,v \rangle = f'(x,y) = \langle y,u \rangle$$. Hence $$\forall y\in \mathbb R^n, \langle y,u-v\rangle =0$$ and $$u-v=0$$. $$\partial f(x)$$ is thus a singleton.