Theorem (first-order condition of convex functions)

A differentiable function $f: \R^n \to \R$ is convex iff for all $\v x,\v y\in\R^n$, $$ \begin{align*} f(\v y) \geq f(\v x) + \nabla f(x)^T (\v y-\v x) \end{align*} $$

Proof