Definition:Convex Real Function

Definition
Let $f$ be a real function which is defined on a real interval $I$.

Then $f$ is convex on $I$ iff:


 * $\forall x, y \in I: \forall \alpha, \beta \in \R: \alpha > 0, \beta > 0, \alpha + \beta = 1: f \left({\alpha x + \beta y}\right) \le \alpha f \left({x}\right) + \beta f \left({y}\right)$

Equivalently:


 * $\forall x, y \in I: \forall t \in \left(0 . . 1\right) : f \left({tx + (1-t)y}\right) \le t f\left({x}\right) + \left(1-t\right) f\left({y}\right)$

The function $f$ is strictly convex on $I$ if, in the above inequalities, equality cannot hold unless $x = y$.


 * [[File:ConvexFunction1.png]]

The geometric interpretation is that any point on the chord drawn on the graph of any convex function always lies on or above the graph.

Alternative Definition
A real function $f$ defined on a real interval $I$ is convex on $I$ iff:


 * $\displaystyle \forall x_1, x_2, x_3 \in I: x_1 < x_2< x_3: \frac {f \left({x_2}\right) - f \left({x_1}\right)} {x_2 - x_1} \le \frac {f \left({x_3}\right) - f \left({x_2}\right)} {x_3 - x_2}$

or:


 * $\displaystyle \forall x_1, x_2, x_3 \in I: x_1 < x_2< x_3: \frac {f \left({x_2}\right) - f \left({x_1}\right)} {x_2 - x_1} \le \frac {f \left({x_3}\right) - f \left({x_1}\right)} {x_3 - x_1}$.

The function $f$ is strictly convex on $I$ if, in the above inequalities, equality cannot hold.


 * ConvexFunction2.png ConvexFunction3.png

Hence a geometrical interpretation:
 * In the left hand image above, the slope of $P_1 P_2$ is less than that of $P_2 P_3$.
 * In the right hand image above, the slope of $P_1 P_2$ is less than that of $P_1 P_3$.

Equivalence of Definitions
These two definitions can be seen to be equivalent from Equivalence of Convex and Concave Definitions.

Note
Compare concave function. It is immediately obvious from the definition that $f$ is convex on $I$ iff $-f$ is concave on $I$.