[Math] Hessian matrix for convexity of multidimensional function

calculusconvex-analysishessian-matrixmatricespositive-semidefinite

To prove that a one dimensional differentiable function $f(x)$ is convex, it is quite obvious to see why we would check whether or not its second derivative is $>0$ or $<0.$

What is the intuition behind the claim that, if the Hessian $H$ of a multidimensional differentiable function $f(x_1,…,x_n)$ is positive semi-definite, it must be convex$?$

Is there a way I interpret this requirement, $y'H(x)y \ge 0\, \forall y$, geometrically$?$ (as in the case of one dimensional $f(x)$) How to interpret vector $y$ here$?$

Best Answer

Recall that a fixed matrix $H\in\mathbb{R}^{n\times n}$ is positive semidefinite if $y^THy\geq 0$ for all $y\in\mathbb{R}^n$, and positive definite if and only if $y^THy>0$ for all nonzero $y$.

Now consider the function $g_{x,y}(t)=f(x+ty)$, where $f$ is a function on $\mathbb{R}^n$ and $x,y$ are fixed vectors. The derivatives at $t=0$ are $$g_{x,y}'(0) = y^T \nabla f(x), \qquad g_{x,y}''(0) = y^T \nabla^2 f(x) y$$ Of course if $g_{x,y}''(0)\geq 0$, then $g_{x,y}$ is convex at the origin. If $g_{x,y}''(0)\geq 0$ for all $y$, then $f$ is convex at $x$. Finally, if $g_{x,y}''(0)\geq 0$ for all $x,y$, then $f$ is convex.

So the intiution is this: a multivariate function is convex if and only if it is convex along every line. The vector $y$ represents the direction of the test line.