Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.No dents, no holes
A shape is convex if you can stretch a rubber band between any two points inside it and the band never leaves the shape. A disk or a triangle is convex. A ring or a star is not, because the band crosses the empty middle or cuts across a gap between points.
A function is convex if its graph is shaped like a bowl. Draw a straight line between any two points on the graph, and the line always sits on or above the curve.
Why care? In a bowl there’s only one bottom. Walk downhill from anywhere and you’ll find it.
Powered-descent landing guidance, model predictive control, portfolio-style resource allocation, sparse regression and support vector machines are all convex problems, solved to global optimality in milliseconds with certificates. Recognizing (or creating) convexity is one of the most valuable skills in engineering optimization.
- 1. Which shape is convex?
- 2. For a convex function, a chord between two points on the graph lies…
- 3. A convex function has how many separate valley bottoms?
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.Convex sets
is convex if and imply . Examples:
- Hyperplanes and halfspaces .
- Polyhedra .
- Norm balls for any norm.
- Ellipsoids, the PSD cone , and the probability simplex.
Intersections of convex sets are convex. Unions generally aren’t.
Convex functions
is convex if its domain is convex and
Equivalently, its epigraph is a convex set. It’s concave if is convex. Examples: , , , , any norm, , and log-sum-exp .
- 1. The intersection of two convex sets is…
- 2. Is the union of two disjoint disks convex?
- 3. f is convex iff its epigraph is…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.Tests for convexity
- First-order (differentiable ): for all . The tangent plane is a global under-estimator. Consequence: implies a global minimum.
- Second-order (twice differentiable): everywhere. Example: log-sum-exp has , where is the softmax.
- Restriction to a line: is convex iff is convex for every .
Operations that preserve convexity
- Non-negative weighted sums: with .
- Affine pre-composition: . So and the logistic loss are convex in .
- Pointwise maximum: and . Hinge loss and the largest eigenvalue are examples.
- Composition: is convex if is convex and non-decreasing and is convex. Example: .
- Partial minimization: over a convex set is convex in .
This calculus is the basis of disciplined convex programming (CVX, CVXPY): build problems from atoms using these rules, and convexity is certified automatically.
Projections
For a closed convex , every point has a unique nearest point , characterized by for all . Projections are non-expansive: .
- 1. For differentiable convex f, ∇f(x*) = 0 implies x* is…
- 2. The pointwise maximum of convex functions is…
- 3. ‖Ax − b‖₂ is convex in x because…
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.Proof: the first-order condition implies convexity
Suppose for all . Let . Apply the inequality at toward and toward , multiply by and , and add. The gradient terms cancel because , leaving . ∎ The converse follows by taking in the definition.
Proof: projections onto convex sets are unique
If were both nearest points at distance , their midpoint would be in (by convexity). By the parallelogram law, , a contradiction. ∎ For a circle (non-convex), the centre has infinitely many nearest points, and nearby points get torn apart.
Hessian of log-sum-exp
With : . For any , . ∎ This is why softmax cross-entropy is convex in the logits.
Exercise 3.1: Is f(x, y) = x²/y convex for positive y?
Yes. . It’s the perspective of .
- 1. The quadratic form of ∇² log-sum-exp equals…
- 2. Projection onto a closed convex set is…
- 3. x²/y on y > 0 is…
Level 4: Expert
★★★★★ Expert⏱ 35 minResearchers: original papers and open problems.The nearest safe point for a drone
A drone must stay inside a 5 m circular geofence, above a no-fly line and to the right of a building. Each constraint is convex, so the safe region is their intersection: convex, and every outside point has a unique nearest safe point. Alternating projections (POCS) find a safe point. Dykstra’s algorithm finds the nearest one, here the corner (0.5, 1), which matches a brute-force grid search. A safety filter that snaps commands to the nearest safe command uses exactly this projection (Ames et al., 2019, control barrier functions).
Convexity in AI, robotics and aerospace
- Powered-descent guidance: lossless convexification turns a non-convex landing problem into a second-order cone program, flown on board for Mars landing studies and reusable rockets (Açıkmeşe and Ploen, 2007; Blackmore, 2016).
- Safety filters: control barrier function QPs project desired inputs onto a convex safe set at kilohertz rates (Ames et al., 2019).
- Convex losses in ML: least squares, logistic regression, SVMs and lasso all have global optima and strong theory (A6.2-6, A6.2-7).
- Convex relaxations give certificates for non-convex problems, as in SDP relaxations for SLAM and pose estimation (Rosen et al., 2019).
References
- S. Boyd, L. Vandenberghe (2004). Convex Optimization. Cambridge University Press. Ch. 2–3.
- R. T. Rockafellar (1970). Convex Analysis. Princeton University Press.
- M. Grant, S. Boyd, Y. Ye (2006). “Disciplined convex programming.” In Global Optimization, Springer.
- S. Diamond, S. Boyd (2016). “CVXPY: a Python-embedded modeling language for convex optimization.” JMLR, 17.
- R. Dykstra (1983). “An algorithm for restricted least squares regression.” JASA, 78(384).
- H. Bauschke, P. Combettes (2017). Convex Analysis and Monotone Operator Theory in Hilbert Spaces, 2nd ed. Springer.
- B. Açıkmeşe, S. Ploen (2007). “Convex programming approach to powered descent guidance for Mars landing.” Journal of Guidance, Control, and Dynamics, 30(5).
- L. Blackmore (2016). “Autonomous precision landing of space rockets.” The Bridge (NAE), 46(4).
- A. Ames et al. (2019). “Control barrier functions: theory and applications.” European Control Conference.
- D. Rosen, L. Carlone, A. Bandeira, J. Leonard (2019). “SE-Sync: a certifiably correct algorithm for synchronization over the special Euclidean group.” IJRR, 38(2–3).