I have a question. I have just been introduced to the subject of convex sets and convex functions.
I read this in wikipedia that a practical test for convexity is –
to check whether the 2nd derivative (Hessian matrix) of a continuous differentiable function in the interior of the convex set is non-negative (positive semi-definite).
So how to check for the convexity of functions like $f(x)=|x|$ which is differentiable at all points except at $x=0$ which coincidentally is actually its global minimum?
Thanks all for answering.
Best Answer
One option is to check directly that the definition of a convex function is satisfied.
It's useful to know that any norm on $\mathbb R^n$ is a convex function. Proof: If $x,y \in \mathbb R^n$ and $0 \leq \theta \leq 1$, then \begin{align*} \| \theta x + (1 - \theta) y \| & \leq \| \theta x \| + \| (1 - \theta) y \| \\ &= \theta \| x \| + (1 - \theta) \| y \|. \end{align*} This shows that the definition of a convex function is satisfied.
When $n = 1$, the $2$-norm is just the absolute value function $f(x) = | x |$. This shows that the absolute value function is convex.
A bunch of other techniques for recognizing convex functions are explained in the book Boyd and Vandenberghe (free online).