# 'Locally' Convex Function

I have a continously differentiable function $$f:\mathbb{R}^{n}\rightarrow\mathbb{R}$$ which I am trying to prove is globally convex. Computing the Hessian directly is very difficult as it is a somewhat complicated function of a matrix, other methods of proving global convexity have proved inconclusive. So far I am only able to show that it is 'locally convex' in the following sense:

For any $$x\in\mathbb{R}^{n}$$ there exists an $$\varepsilon_{x}>0$$ such that for $$y\in\mathbb{R}^{n}$$ where $$\| y-x\|\leq\varepsilon_x$$ it holds that $$f(y)\geq f(x)+\nabla f(x)^{T}(y-x).$$

My question is a rather basic one, can we establish that local convexity of this kind implies global convexity? Are any extra conditions needed?

My intuition suggests that a continuously differentiable function on a convex set which is locally convex everywhere should be globally convex, but I have trouble constructing the argument. Any help is greatly appreciated!

• If $f$ is twice differentiable, your local condition imply that the hessian is positive semidefinite, which again imply global convexity. Jun 2 '20 at 21:30
• Thanks for your comment. Can you give me a hint toward a proof, perhaps via Taylor expansion? Jun 2 '20 at 21:34
• Is the function $C^2$? If so, there is an easy proof. Jun 2 '20 at 21:49
• Yes, it is $C^2$. Jun 2 '20 at 21:59

Here is proof if $$f$$ is assumed $$C^2$$. This is not necessary but simplifies the proof significantly.

It is sufficient to show the $$f''(x) \ge 0$$.

Pick some $$x$$, then there is a neighbourhood $$U$$ of $$x$$ such that $$f(x+h) -f(x) \ge f'(x) h$$ for $$x+h \in U$$.

Since $$f$$ is $$C^2$$, Taylor gives (for $$h$$ sufficiently small) that $$f(x+h) = f(x) + f'(x)h + {1 \over 2} h^T f''(\xi_h)h$$, where $$\xi_h \in [x,x+h]$$. This gives $$h^T f''(\xi_h)h \ge 0$$ for $$h$$ such that $$x+h \in U$$. If $$h \neq 0$$ then $${h^T \over \|h\|} f''(\xi_h) {h \over \|h\|} \ge 0$$, of course.

Pick some unit vector $$v$$, and let $$h = t v$$ for small $$t$$, then we have $$v^T f''(\xi_{tv}) v \ge 0$$, and letting $$t \to 0$$ and using continuity of $$f''$$ we get $$v^T f''(x) v \ge 0$$.

• I am curious. Is the statement true, if $f$ is only $C^1$? Jun 8 '20 at 22:23
• @user251257: I believe so. Jun 8 '20 at 23:42
• any idea how to proof it? I run out of ideas. Jun 8 '20 at 23:47
• @user251257: Yes, did you ask the question somewhere? Jun 9 '20 at 0:36
• now, I did: math.stackexchange.com/q/3711867/251257 Jun 9 '20 at 0:51