# Gradient of a convex function is continuous on the interior of its domain

Given a convex, lower semicontinuous, and proper function $$f:\mathbb{R}^n\to \mathbb{R}$$ which is differentiable on its domain, is it true that its gradient $$\nabla f$$ is continuous on the interior of the domain of $$f$$? Here I am taking $$\text{dom}f = \{x\in\mathbb{R}^n: f(x)<\infty\}$$. What I came up with was that for such a function $$f$$, it must be true that $$f$$ is locally Lipschitz continuous on its domain and then by Rademacher's theorem it is locally differentiable a.e.. This doesn't get what I want, however. Anyone have a proof or counter example?

Edit: this is corollary 9.20 in Rockafellar and Wets, as it turns out.

• Locally Lipschitz doesn't help. Consider $f(x) = |x|$ on $\mathbb R^1$. – Stephen Montgomery-Smith Aug 16 '20 at 20:36
• I can prove it for $n = 1$ using the fact that $\nabla f = f'$ is increasing, and the mean value theorem. But this doesn't help for $n > 1$. – Stephen Montgomery-Smith Aug 16 '20 at 20:37
• @StephenMontgomery-Smith that's not differentiable to begin with, not applicable. – TSF Aug 16 '20 at 21:05
• I wasn't presenting it as a counterexample. I was presenting it as an example that your argument was the wrong direction to go. – Stephen Montgomery-Smith Aug 16 '20 at 21:06
• Looks like this is a duplicate: math.stackexchange.com/questions/3591521/… although no-one answered it there. – Stephen Montgomery-Smith Sep 9 '20 at 2:54

Without loss of generality, it is sufficient to prove $$\nabla f$$ is continuous at $$x = 0$$ when $$\nabla f(0) = 0$$. Suppose $$x_n \to 0$$ is such that $$|\nabla f(x_n)| > a > 0$$. Given $$\epsilon>0$$ such that $$B(0,2\epsilon) \subset \text{dom}(f)$$, pick $$n$$ so that $$x_n \in B(0,\epsilon)$$ and $$f(x_n) - f(0) > -\epsilon^2$$. We know there exists $$y \in B(x_n,\epsilon)$$, $$y \ne x_n$$, such that $$f(y) \ge f(x_n) + a |x_n - y|$$ (that is, choose $$y$$ in the direction of $$\nabla f(x_n)$$ close to $$x_n$$). For $$t \in \mathbb R$$, let $$z_t = t(y-x_n) + x_n$$. By convexity, see that for $$t \ge 1$$ $$\tfrac1t f(z_t) + (1-\tfrac{1}t) f(z_0) \ge f(z_1) ,$$ that is $$f(z_t) \ge f(x_n) + a t |x_n-y| .$$ Choose $$t = \epsilon / |x_n - y|$$. Note that $$|z_t| < 2 \epsilon$$. Then $$f(z_t) - f(0) = f(z_t) - f(x_n) + f(x_n) - f(0) \ge a \epsilon - \epsilon^2 .$$ This contradicts that $$\nabla f(0) = 0$$.
I am updating this post with the follow-up question: If $$f$$ is a convex function defined on some convex set $$E\subseteq \mathbb R^n$$ and if it is differentiable on $$E$$, is it true that its gradient must be continuous on $$E$$ (and not only in the interior) ?
• @TSF: thank you, but I believe that the convexity assumption is essential. Indeed, if a convex function is differentiable on $E$, then it is automatically $C^1$ in the interior of $E$, and I am trying to determine whether it is actually $C^1$ on the whole $E$. – TrivialPursuit Nov 13 '20 at 13:32