Lagrangian Duality and the KKT Conditions
Weak and strong duality, Slater's condition, and the five KKT conditions — set up so that the SVM derivation is a direct application.
The primal problem and its Lagrangian
Consider
The Lagrangian is
with and . The dual function is
and the dual problem is .
is concave on , regardless of any property of . It may take the value .
Key idea
This is remarkable and is the practical reason duality matters: the dual of an arbitrarily nasty problem is a concave maximisation, hence a convex problem. Sometimes the dual is tractable when the primal is not, and sometimes — as in the SVM — the dual is where the interesting structure (kernels, support vectors) becomes visible.
, with no assumptions on .
Suppose are convex, the are affine, and there exists a strictly feasible point: some in the relative interior of the domain with for all with not affine, and . Then , and if is finite the dual optimum is attained.
Quoted from Boyd–Vandenberghe, where it is proved via a separating-hyperplane argument applied to the set . Slater's condition is mild and is satisfied by every problem in this laboratory that uses duality — in particular by the soft-margin SVM, where any large enough is strictly feasible.
The KKT conditions
Suppose are differentiable and strong duality holds with both optima attained, at and . Then
Conversely, if the problem is convex and satisfies (1)–(4), then is primal optimal, is dual optimal, and the duality gap is zero.
At an optimum, for each ,
Key idea
Complementary slackness is the mathematical origin of sparsity in the dual. In the SVM the constraints are , one per training point. Complementary slackness says only for points with — the points exactly on the margin. Every other point has and drops out of the solution entirely. "Support vector" is not a heuristic notion; it is the name for a constraint with a non-zero multiplier.
Worked example: the dual of a quadratic program
Dual of min ½xᵀQx + cᵀx subject to Ax ≤ b, with Q ≻ 0
Form the Lagrangian with multiplier α ≥ 0 for the inequality constraints.
Q ≻ 0 makes the Lagrangian strictly convex in x, so the inner minimisation is solved by setting the gradient to zero.
Substitute back. The quadratic evaluates to minus half the squared Q-inverse norm of the combined linear term.
The dual problem is a maximisation of a concave quadratic over the non-negative orthant — itself a quadratic program, but with the inequality constraints replaced by simple sign constraints.
.
Slater's condition holds whenever some x satisfies Ax < b, so the gap is zero and the primal solution is recovered from the dual optimum through the stationarity map of step 2.
Note the structural change: the primal has general linear inequality constraints; the dual has only . The constraint complexity has moved into the quadratic form . That trade is exactly what the SVM dual exploits, where becomes the kernel matrix.
Problems
Weak duality holds without convexityProof · Beginner · 15 min Derive the dual of a quadratic programProof · Intermediate · 30 min Complementary slackness and active constraintsProof · Intermediate · 30 min A convex problem with a duality gapProof · Advanced · 30 minReferences
- BookStephen Boyd and Lieven Vandenberghe (2004). Convex OptimizationChapter 5 is the standard treatment; Slater's theorem is proved there and quoted here.
- BookR. Tyrrell Rockafellar (1970). Convex AnalysisThe foundational reference for conjugate duality.
- BookDimitri P. Bertsekas (2016). Nonlinear Programming
These works are cited as sources to read, not reproduced. All exposition, examples and problems on this site are written independently; where an argument is standard, the citation points to a canonical treatment.
Results stated on this page
- TheoremWeak dualityproof includedThe dual optimum never exceeds the primal optimum, with no convexity assumed.
- PropositionThe dual function is always concaveproof includedThe dual is a pointwise infimum of affine functions, hence concave regardless of the primal problem.
- TheoremStrong duality under Slater's conditionFor a convex problem with a strictly feasible point the duality gap is zero.
- TheoremKarush–Kuhn–Tucker conditionsproof includedUnder strong duality the five KKT conditions are necessary, and for convex problems they are also sufficient.
- CorollaryComplementary slacknessproof includedAt optimum, every inactive constraint has zero multiplier and every nonzero multiplier marks an active constraint.