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

\[\as{ f(wx_1 + (1-w)\x_2) &< wf(\x_1) + (1-w)f(\x_2) \\ &< f(\x_2).}\]

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*}\]

Sufficient conditions

For any function that is twice differentiable, a sufficient condition for (strict) convexity is that its Hessian matrix $H(\x)$ is positive definite for all $\x$ (see concave function for a proof).

The converse is not necessarily true, however.