A function is called convex if, for all and , we have:

This inequality states that the line segment connecting and lies above or on the graph of .

Equivalent Definitions

For differentiable functions, convexity can also be characterized by:

  1. First Derivative Condition: is convex if for all .
  2. Second Derivative Condition: If is twice differentiable, then is convex if and only if for all .

For functions , convexity is defined similarly:

Key Properties

  1. Local Minimum is Global: For a convex function on a convex set, any local minimum is also a global minimum.
  2. Convexity Preservation: Non-negative weighted sums and pointwise limits of convex functions are also convex.
  3. Jensen’s Inequality: For a convex function and a random variable , we have .

Examples

  1. Quadratic Functions: is convex because .
  2. Exponential Functions: is convex since .
  3. Absolute Value: is convex as it satisfies the convexity inequality.

Geometric Intuition

A convex function curves “upwards,” meaning its graph lies below the line segment connecting any two points on it. This “bowl-shaped” property is essential in optimization, as it guarantees that gradient-based methods converge to global minima.