A convex function is a function whose value between two inputs never exceeds the straight-line interpolation of its values at those inputs. In one dimension, its graph lies on or below every chord joining two graph points. Convexity extends to functions of several variables and does not require differentiability. It is fundamental to mathematical analysis and convex optimization, where it connects geometric structure with global optimality. (stanford.edu)
Definition and geometric interpretation
Let be a convex set in a real vector space. A function is convex if, for all and ,
The domain condition is essential: every line segment joining points of must remain in . A function is concave if the inequality is reversed, equivalently if is convex. An affine function, such as , satisfies equality and is both convex and concave. (stanford.edu)
An equivalent geometric characterization uses the epigraph, the set
A function is convex exactly when its epigraph is convex. Its sublevel sets, , are also convex. The converse is weaker: convex sublevel sets characterize a quasiconvex function, which need not satisfy the convexity inequality. (stanford.edu)
Examples and differential tests
Elementary examples include , , and on , and on . The absolute-value function demonstrates that convex functions may have corners. In several dimensions, a norm is convex, as is the squared Euclidean norm. A quadratic function , with symmetric matrix , is convex exactly when is positive semidefinite. (web.stanford.edu)
For differentiable functions on an open convex domain, convexity is equivalent to the first-order condition
Thus the affine approximation determined by the gradient is a global lower bound, not merely a local approximation. Geometrically, it defines a supporting hyperplane beneath the graph. (web.stanford.edu)
For twice continuously differentiable functions, convexity is equivalent to the Hessian matrix being positive semidefinite everywhere. In one dimension this becomes ; equivalently, when the derivative exists throughout an interval, it is nondecreasing. These tests concern the whole convex domain, not just curvature at a single point. (web.stanford.edu)
Strict and strong convexity
A function is strictly convex when its defining inequality is strict whenever and . Strict convexity excludes affine behavior along any nontrivial segment. A positive-definite Hessian everywhere is sufficient, but not necessary: is strictly convex on , although its second derivative vanishes at zero. (stanford.edu)
Strong convexity is a quantitative strengthening. Relative to the Euclidean norm, is -strongly convex, for , if is convex. Equivalently,
Strong convexity implies strict convexity, whereas strict convexity need not provide any uniform positive curvature bound. (web.mit.edu)
Operations and inequalities
Nonnegative weighted sums of convex functions are convex. Convexity is also preserved by composition with an affine map, by pointwise maxima, and by pointwise suprema wherever these define suitable functions. Consequently, functions of the form are convex, despite generally being nondifferentiable at transitions between pieces. Products and pointwise minima of convex functions, however, need not be convex. (live.ocw.mit.edu)
Repeated application of the definition gives Jensen’s inequality:
Its probabilistic form is , under appropriate domain and integrability conditions. Here is a random variable and denotes expectation. The inequality connects convexity with bounds on averages and measures of dispersion. (live.ocw.mit.edu)
Nondifferentiability and optimization
A subgradient of a convex function at is a vector satisfying
for every in the domain. Subgradients generalize gradients by allowing multiple supporting slopes at a corner. For , the subgradients at zero comprise the interval . At a differentiable point, the only subgradient is the ordinary gradient. (people.csail.mit.edu)
In mathematical optimization, minimizing a convex objective function over a convex feasible set has an important consequence: every local minimum is global. Strict convexity guarantees at most one minimizer, but does not guarantee that a minimum is attained. For example, is strictly convex on , yet its infimum, zero, is never reached. For an unconstrained differentiable convex function, a zero gradient certifies global optimality; the nonsmooth analogue is . (web.mit.edu)
These properties underpin methods such as gradient descent and subgradient algorithms, whose convergence requires additional assumptions and suitable step sizes. Convex models are used in machine learning, statistics, resource allocation, engineering design, and control. Convexity must be established for the variables actually being optimized; a component’s convexity alone does not establish that of an entire model. (web.mit.edu)