Contents · Convex Optimization
Part 0 · Convexity
- Convex Sets and Functions
Part 1 · Quadratic Programs
Part 2 · Duality
Part 3 · Cones
Part 4 · Descent
Part 0 · Convexity
Convex Sets and Functions
A set is convex if it contains the whole line segment between any two of its points, and a function is convex if its graph never rises above its own chords. Both reduce to the same test on a segment, and both are why a physics contact solve or a policy-improvement step can be trusted to land on the one right answer instead of a lucky local one.
Convex sets
A set is convex if, for every and every ,
The point traces the segment from (at ) to (at ), so the condition says: pick any two points, and the line between them never leaves the set.
The unit disk is convex. For and , the triangle inequality and homogeneity give
so the whole segment stays in . Numerically, take , , : the midpoint is with norm . Inside, as promised.
Now break it. Let the L-shaped region be , a horizontal arm and a vertical arm sharing a corner. Take in the horizontal arm and in the vertical arm, both in . Their midpoint is
which satisfies neither arm ( rules out the first, rules out the second). One segment escapes the set, so is not convex. A single bad pair is a complete disproof.
- this region
- not convex
- chord AB
- leaves the set
The chord AB leaves the region (red): a single pair of points is enough to prove this set is not convex.
Convex functions
A function is convex if its epigraph is a convex set. Equivalently, for all and ,
This is Jensen's inequality. The right side is the height of the chord from to ; the inequality says the graph lies on or below every such chord.
Take with , , . The left side is ; the right side is . Since , the chord sits above the curve, and because everywhere, the same holds for every pair .
Local means global
Here is the payoff. If is convex over a convex feasible set, then every local minimum is a global minimum.1 Suppose were a local minimum but some feasible had . By convexity the point is feasible, and
for all small , contradicting the assumption that was best in its neighborhood. So a descent method that gets stuck has, by definition, found the answer: no restarts, no seeds, no luck.
That guarantee is engineered into modern solvers on purpose. A rigid-body contact solve is deliberately posed as a convex program: MuJoCo drops the LCP complementarity condition so the contact forces are the unique global solution of a convex optimization (a QP, or a conic program once friction cones are included).2 Drake's SAP casts compliant contact as an unconstrained convex problem, so the same local-equals-global property makes each solve deterministic and restart-free.3 On the learning side, stable policy-optimization steps (trust-region and proximal updates) approximate the improvement as a convex subproblem in the step, so the update has a unique solution and cannot be trapped in a spurious local optimum.
Footnotes
-
Boyd & Vandenberghe, Convex Optimization (2004). ↩
-
MuJoCo docs, Computation. ↩
-
Castro, Permenter, Han, An Unconstrained Convex Formulation of Compliant Contact (2021). ↩