advanced24 min studyLesson 41 in Mathematics

Convex sets and functions

Use line segments and supporting planes to distinguish a globally tractable problem from a merely smooth one.

On this page

What you’ll understand

  • Check convexity of a feasible set using its definition.
  • Use first-order inequalities to certify global optimality.
  • Distinguish strict convexity, existence, and uniqueness.

An optimizer should answer two different questions: where should we move, and how do we know a better answer is not hiding elsewhere? Convexity connects local information to global conclusions. It is a property of the objective together with its domain, rather than a synonym for a bowl-shaped picture. This lesson builds certificates that remain meaningful when the decision variable has millions of coordinates and drawing the landscape is impossible.

Start with the feasible geometry

A set is convex when the entire line segment joining any two of its points stays inside the set. A disk, a half-space, and an affine plane pass this test. The exterior of a disk fails: two allowed points on opposite sides have a forbidden midpoint. Intersections preserve convexity because a segment lying in every constituent set also lies in their intersection. Unions generally do not have this property.

A convex function is defined on a convex domain and lies below each chord joining two points of its graph. This definition compares function values, not slopes, so it includes nonsmooth functions such as absolute value. A convex optimization problem minimizes a convex objective over a convex feasible set. In the standard inequality description, convex constraint functions and affine equalities provide a useful sufficient construction; arbitrary nonlinear equalities need separate geometric checking.

f((1−t)x+ty)≤(1−t)f(x)+tf(y),0≤t≤1f((1-t)x+ty)\leq (1-t)f(x)+tf(y),\qquad 0\leq t\leq1
The inequality must hold for every pair x,y in the convex domain and every interpolation weight t, not just selected sample points.↔ Scroll wide equations horizontally.

A local plane gives a global bound

For a differentiable convex function on an open convex domain, its tangent plane is a global lower bound. Thus a zero gradient certifies a global minimizer without requiring a search through every other point. Under constraints, the gradient need not vanish: it can point toward forbidden locations. The corresponding first-order certificate asks whether its inner product with every feasible displacement is nonnegative. Convexity then turns that directional statement into a value comparison.

For twice continuously differentiable functions on an open convex domain, positive semidefiniteness of the Hessian everywhere characterizes convexity. Testing the Hessian at one candidate only describes local curvature. A function may have a positive Hessian near one minimum and a deeper minimum elsewhere. Likewise, a collection of sampled nonnegative second derivatives is evidence about the samples, not a proof about all unsampled points of a continuous domain.

f(y)≥f(x)+∇f(x)T(y−x)f(y)\geq f(x)+\nabla f(x)^{\mathsf T}(y-x)
For differentiable convex f this bound holds for all domain points. If the linear term is nonnegative for every feasible y, x is globally optimal over that feasible set.↔ Scroll wide equations horizontally.

Separate three kinds of guarantee

Strict convexity replaces the chord inequality by a strict inequality for distinct points and interior interpolation weights. It ensures that a convex feasible set has at most one minimizer, but does not make a minimizer exist. The strictly convex function exe^x on the real line has infimum zero and never attains it. Existence follows, for example, from continuity on a nonempty compact feasible set. In finite dimensions, a lower-semicontinuous coercive objective on a nonempty closed feasible set also attains its infimum, provided at least one feasible point has finite value.

The interactive quadratic is one particularly friendly convex problem, not a test of arbitrary objective functions. Change its initial position and ask whether the destination depends on which side you start from. Then change the step size beyond two: divergence reflects an unstable algorithm, despite the objective remaining convex with a unique minimizer. Geometry of the problem and behavior of a chosen iteration are different claims that should be reported separately.

Certify a boundary solution

Minimize f(x)=(x−3)2f(x)=(x-3)^2 subject to 0≤x≤20\leq x\leq2. Give a global certificate, not just a stationary-point calculation.

  1. The interval is convex and closed. Since f′′(x)=2>0f''(x)=2>0, the objective is strictly convex; continuity on this compact interval also guarantees that a minimizer exists. The unconstrained stationary point x=3x=3 is infeasible.

  2. At the right endpoint x∗=2x_*=2, the derivative is f′(2)=−2f'(2)=-2. Every feasible displacement satisfies y−2≤0y-2\leq0, so the first-order term is −2(y−2)≥0-2(y-2)\geq0.

  3. The supporting-line inequality yields f(y)≥f(2)−2(y−2)≥1f(y)\geq f(2)-2(y-2)\geq1. Therefore x∗=2x_*=2 attains the global minimum value one; strict convexity excludes a second minimizing point.

The result

The constrained optimum is x=2 with value 1. A nonzero gradient is compatible with optimality when every feasible direction points uphill.

Explore the model

Interactive lab

Interactive lab · optimization

Convex objective, unstable algorithm?

For the fixed objective f(x)=x²/2, set a nonzero initial position and compare step sizes 0.5, 1.5, and 2.2. Predict whether iterates contract before pressing Play. This lab changes neither the domain nor the objective and does not implement constraints.

Convex objective, unstable algorithm?Gradient descent on f(x) = x²/2: xₙ = (1 − η)ⁿx₀. Playback advances two discrete iterations per second. Values outside |x| ≤ 4 are explicitly reported. Current readings: Position x0: 2; Objective x²/2: 2; Iteration behavior: Stable step. All parameters are adjustable with the labeled controls below.−4−202402.174.356.528.7Parameter xf(x) = x²/2n = 0
ObjectiveDiscrete iterate
Position x0
2
Objective x²/2
2
Iteration behavior
Stable step
n = 0 · t = 0 s

Gradient descent on f(x) = x²/2: xₙ = (1 − η)ⁿx₀. Playback advances two discrete iterations per second. Values outside |x| ≤ 4 are explicitly reported. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forConvexity gives an optimality certificate; it does not make every gradient-descent step size stable.

Check your understanding

What does strict convexity alone guarantee on a nonempty convex feasible set?

Try it yourself

Minimize f(x)=x2f(x)=x^2 on [1,4][1,4] and verify the first-order feasible-direction certificate at your answer.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

The stationary point zero is infeasible. At the left endpoint, examine the sign of y−1 for every allowed y.

Compare with the solution

The candidate is x∗=1x_*=1, with value one and derivative two. For every y∈[1,4]y\in[1,4], the product 2(y−1)2(y-1) is nonnegative. The convex tangent bound therefore gives y2≥1+2(y−1)≥1y^2\geq1+2(y-1)\geq1. Continuity gives existence and strict convexity gives uniqueness; none of these conclusions require the constrained gradient to vanish.

Take it with you

  • Convexity compares every chord within a convex domain.
  • A supporting plane converts a feasible directional condition into a global certificate.
  • Existence, uniqueness, and convergence of an algorithm require different assumptions.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.