A convex function is one in which, for any two points we choose, the value of the function in between those points is smaller than the value of the line segment connecting the points. Mathematically, a function $f$ is convex if, for any $\x_1, \x_2$, in the domain of $f$,

\[f(w\x_1 + (1-w)\x_2) \le wf(\x_1) + (1-w)f(\x_2)\]

for all $w \in (0,1)$. The function $f$ is strictly convex if

\[f(w\x_1 + (1-w)\x_2) < wf(\x_1) + (1-w)f(\x_2).\]

It is worth mentioning that the domain of $f$ must be a convex set in order for $f$ to be a convex function. Otherwise, the idea of convexity is undefined.

Important properties

A strictly convex function has at most one unique minimum.

Proof: Suppose $\x_1 \neq \x_2$ are both minima of $f$. Then $f(\x_1) = f(\x_2)$ and

\[\begin{align*} f(wx_1 + (1-w)\x_2) &< wf(\x_1) + (1-w)f(\x_2) \\ &< f(\x_2). \end{align*}\]

Thus, $\x_1$ and $\x_2$ do not minimize $f$.

A related idea is that if a strictly convex function has a local minimum, then that point is the global minimum.

Proof: Suppose $\x_2$ is a local minimum, but that there exists a point $\x_1 \ne \x_2$ such that $f(\x_1) < f(\x_2)$. If $\x_2$ is a local minimum, there exists $r: f(\x_2) < f(\x) \,\forall\, \x \in N_r(\x_2)$. Let $\w: w\x_1 + (1-w)\x_2 \in N_r(\x_2)$. Then

\[\begin{alignat*}{2} f(w\x_1 + (1-w)\x_2) &< wf(\x_1) + (1-w)f(\x_2) &\hspace{4em}& f \text{ convex} \\ &< f(\x_2) && f(\x_1) < f(\x_2) \end{alignat*}\]

but

\[\begin{alignat*}{2} f(w\x_1 + (1-w)\x_2) &> f(\x_2) &\hspace{4em}& w\x_1 + (1-w)\x_2 \in N_r(\x_2) \end{alignat*}\]

Second-order conditions

A twice differentiable function on an open convex set is convex if and only if its Hessian matrix is positive semidefinite everywhere, and a positive definite Hessian is sufficient for strict convexity (see concave function for a proof). The converse of the latter is not true: $f(x) = x^4$ is strictly convex, but $f^{\prime\prime}(0) = 0$.