First-Order and Stochastic Optimization Methods for Machine Learning I: The Separation Theorem, Strong Duality and the KKT ConditionsTextbook
Motivation
Every convex optimization algorithm in machine learning — from projected gradient descent to support vector machines to the mirror-descent methods of later chapters of this book — is justified by a small set of optimality certificates: a checkable condition on a candidate solution that guarantees it actually solves the problem, without searching the whole feasible set. The most widely used such certificate is the Karush–Kuhn–Tucker (KKT) system: a set of gradient and complementary-slackness equations that a solution of a convex program with differentiable data must satisfy, and that (under a mild constraint qualification) is also sufficient. It is the tool a practitioner reaches for to check optimality of a numerical solver's output, and the tool a theorist reaches for to derive an algorithm (dual ascent, augmented Lagrangian, interior point methods) in the first place. Every convex machine learning model introduced in Chapter 1 of this book — regularized least squares, support vector machines, logistic regression with constraints — is an instance of the general convex program these milestones analyze.
The result traces back to Kuhn and Tucker's 1951 paper Nonlinear Programming, with Karush's 1939 unpublished thesis establishing the same conditions independently and earlier; Slater's 1950 unpublished note is the source of the constraint qualification that bears his name and that makes the necessity direction possible. Lan's Chapter 2 gives a compact, modern, purely finite-dimensional derivation of the whole chain — separation, duality, saddle points, KKT — from first principles, self-contained in about twenty pages, aimed squarely at the convex programs that appear in machine learning.
Setting
Fix and work in with its standard inner product . A convex program (2.3.16) is
where is a nonempty closed convex set, are convex, and are affine. A point is feasible if it satisfies every and ; is optimal if it is feasible and for every feasible .
The normal cone of at is — the set of directions that make an obtuse angle with every direction into from ; it is when , recovering unconstrained first-order optimality. The Lagrangian is for multipliers , ; the Lagrange dual value is , and the Lagrange dual problem is . Weak duality, , holds unconditionally by construction. Slater's condition asks for with , ; the restricted Slater condition weakens the interior requirement to the relative interior while keeping strict inequality for every (here: every) nonlinear constraint.
Formalization targets
Goal — Theorem 2.8(b), KKT necessity
Companion — Theorem 2.8(a), KKT sufficiency
Supporting milestones, in attack order
- Theorem 2.1 (separation): a point outside a closed convex set is strictly separated from it by a hyperplane.
- Proposition 2.9 (Convex Theorem on Alternative): insolvability of a strict-inequality system, plus a Slater point, forces solvability of a dual multiplier system.
- Theorem 2.6 (strong duality): under Slater's condition, and the dual is solvable.
- Theorem 2.7(a)/(b) (saddle points): is optimal iff it extends to a saddle point of (the "only if" needs Slater's condition; the "if" needs nothing beyond the saddle inequalities).
Each of these five is stated the way the book states it — no constant is hard-coded, no O(·) is involved, and every hypothesis (closedness, convexity, Slater/restricted-Slater) is exactly the one the corresponding proof uses.
Significance
The KKT system is the interface between convex optimization theory and every algorithm that
exploits it: primal-dual methods track approximate KKT residuals as a stopping criterion, and the
derivation of the Lagrange dual (used throughout the book's later treatment of composite and
constrained problems) rests on strong duality, milestone strong_duality here. The saddle-point
characterization (saddle_point_sufficient/saddle_point_necessary) is the standard route to
designing an algorithm: a method that provably drives a pair to a saddle point
of is provably convergent to an optimal , without ever needing to verify optimality
directly against the primal problem.
None of the six substantive results here has a machine-checked proof on Prove2Me. The platform
holds a genuinely weaker unconstrained-in- condition (OnlineConvexOpt.ConvexBasics. kkt_optimality, Hazan's Theorem 2.2: for ,
with no inequality/equality constraints or multipliers at all) and a structurally different,
strictly more general cone-based Lagrange-duality development (VectorSpaceOpt.lagrange_duality
and VectorSpaceOpt.lagrangian_saddle_sufficient_pointed, from Luenberger, which bundle all
constraints into a single map into a convex cone in a general normed space, rather than Lan's
explicit inequality / equality split). Formalizing this mission
produces the finite-dimensional convex-program version of KKT in exactly the shape it is used and
taught: separate multiplier vectors for inequality and equality constraints, an explicit normal
cone rather than a cone-map abstraction, and both directions of the necessity/sufficiency split.
Difficulty
The separation theorem (Theorem 2.1) itself is routine once the projection onto a closed convex set is available. The real difficulty is entirely in the direction of the Convex Theorem on Alternative that Proposition 2.9 states: the naive idea — "insolvability of (I) should give a separating hyperplane between and directly" — fails, because these are sets in and separating them there does not produce a sign-definite multiplier vector. Lan's proof instead lifts to and separates the epigraph-like set from the open orthant-like set ; only in this lifted space does the separating normal's sign constraint (forced by 's unboundedness in the positive directions) translate into . Getting the sign of the -th coordinate strictly positive — needed to normalize and divide — is itself a small separate argument using the Slater subsystem's solution. The KKT necessity direction (the goal) then chains three of these already-nontrivial results (separation → CTA → strong duality → saddle necessity) before translating the saddle-point condition on into the gradient/normal-cone form via differentiability of at .
Formalization scope
All milestones are stated over EuclideanSpace ℝ (Fin n) with Convex/ConvexOn from Mathlib.
Affine equality constraints are represented by explicit witnesses with , so that is
available without a separate affine-differentiability lemma. The normal cone is Lan's
own primal-space object (normalCone); the restricted Slater condition uses Mathlib's
intrinsicInterior ℝ X for , distinct from the plain interior X used by
the un-restricted Slater condition of Theorems 2.6/2.7(b). Primal optimal values and Lagrange dual
values are stated via IsGLB/pointwise-inequality forms rather than raw sInf, so that no
hypothesis is silently made true by an empty or unbounded set defaulting sInf to a junk value —
in every milestone here the relevant set is guaranteed nonempty by the Slater-point hypothesis
already present.
A trivializing formalization this mission rules out: stating kkt_necessary/kkt_sufficient
with (no set constraint) and empty (no functional constraints) would
collapse the normal-cone condition to and make the whole KKT apparatus vacuous
of any duality content; the milestones here keep , and as genuine free parameters (the
theorems are stated for arbitrary m, p : ℕ, including but not restricted to the degenerate case)
so that the constrained content of Lan's theorem is what gets proved.
Reusable beyond this mission: normalCone and lagrangian are generic enough that any later
chapter of this book needing Lagrangian duality or normal-cone stationarity (none of the current
first-wave chapters 03/06 needs them directly) could import them once published rather than
redeclaring. Contributions most welcome on the two hardest milestones,
cta_solvable_of_insolvable and kkt_necessary, since they carry the mission's real difficulty;
separation_point_closed can likely be discharged quickly via Mathlib's
geometric_hahn_banach_point_closed.
Selected references
- G. Lan, First-Order and Stochastic Optimization Methods for Machine Learning, Springer Series in the Data Sciences, Springer 2020, Chapter 2. https://doi.org/10.1007/978-3-030-39568-1
- H. W. Kuhn and A. W. Tucker, "Nonlinear Programming," Proceedings of the Second Berkeley Symposium on Mathematical Statistics and Probability, 1951, pp. 481–492.
- W. Karush, "Minima of Functions of Several Variables with Inequalities as Side Constraints," M.Sc. thesis, University of Chicago, 1939.
- R. T. Rockafellar, Convex Analysis, Princeton University Press, 1970 (standard modern reference for the separation theorem and Lagrangian duality used throughout).