Theorem (second-order condition of convex functions)

A twice differentiable function $f: \R^n \to \R$ is convex iff $\nabla^2 f(\v x)$ $\succeq 0$ for all $\v x\in\R^n$.

Proof for sufficiency