Unit content
Convex sets and convex functions
A set $C$ is convex when the line segment between any two of its points stays inside the set:
$$x,y\in C,\ 0\le t\le1\quad\Rightarrow\quad tx+(1-t)y\in C.$$
A function $f$ defined on a convex set is convex when
$$f(tx+(1-t)y)\le t f(x)+(1-t)f(y).$$
Geometrically, the value of a convex function between two points never rises above the straight chord joining the endpoint values.
Affine functions are convex, and the one-dimensional quadratic
$$f(x)=x^2$$
is a familiar strictly convex example. A function can be convex without being strictly convex; a flat region can therefore contain many minimizers.
Convexity is a global geometric property. It can be defined without derivatives and applies equally to smooth, nonsmooth and linear optimization problems.