Convex sets and functions
Use line segments and supporting planes to distinguish a globally tractable problem from a merely smooth one.
On this page
The question for today
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.
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.
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 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.
Work it through
Certify a boundary solution
Minimize subject to . Give a global certificate, not just a stationary-point calculation.
The interval is convex and closed. Since , the objective is strictly convex; continuity on this compact interval also guarantees that a minimizer exists. The unconstrained stationary point is infeasible.
At the right endpoint , the derivative is . Every feasible displacement satisfies , so the first-order term is .
The supporting-line inequality yields . Therefore attains the global minimum value one; strict convexity excludes a second minimizing point.
The constrained optimum is x=2 with value 1. A nonzero gradient is compatible with optimality when every feasible direction points uphill.
The living notebook
Explore the model
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.
- Position x0
- 2
- Objective x²/2
- 2
- Iteration behavior
- Stable step
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.
Pause & reason
Check your understanding
Your turn
Try it yourself
Minimize on 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 , with value one and derivative two. For every , the product is nonnegative. The convex tangent bound therefore gives . Continuity gives existence and strict convexity gives uniqueness; none of these conclusions require the constrained gradient to vanish.
Keep the idea
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.