Let $C \subset \mathbb{R}^N$ be a closed convex set with nonempty interior. Let $f : \mathbb{R}^N \to \mathbb{R}$ be twice differentiable on $C$. We also assume that it is convex on $C$:
$$ (\forall x,y \in C) (\forall \alpha \in [0,1]) \quad f((1- \alpha)x + \alpha y) \leq (1- \alpha)f(x) + \alpha f(y).$$
My main question is : can we say that the Hessian of $f$ is positive semidefinite on $C$?
Some comments:
The basic result I know holds when $C$ is an open set ; so applying such result on the interior of $C$, we immediately get that for all $x \in {\rm{int}}~C$, $\nabla^2 f(x) \succeq 0$. So my question is about what happens at the boundary.
What is also clear is that if I assume further that $f$ is of class $C^2$ on $C$ (and not only twice differentiable), we could pass to the limit from the interior to the boundary of $C$ to conclude that yes, $\nabla^2 f(x) \succeq 0$ for all $x \in C$.
I have been trying to find a counterexample, but every example of "twice differentiable but not $C^2$" function I find is highly nonconvex, so I start to wonder if convexity and twice differentiable implies $C^2$? After all, it is known that:
- convex functions are always continuous in the interior of their domain
- the subdifferential of a convex function has a closed graph ; so differentiable convex functions have a continuous gradient
So my secondary question is : is the hessian of a twice differentiable convex function always continous?