A support vector machine chooses a separating plane while requiring examples to stay on the correct side of a margin. The objective and the constraints must be solved together. Convexity tells us when a local solution is also globally best.
Spotted in the wild
- “f on a line segment”Used to compare the graph with its chord.
- “H is positive semidefinite”Every quadratic directional curvature is nonnegative.
- “Lagrangian”Objective plus multiplier-weighted constraints.
- “lambda”A multiplier for an inequality or equality, with sign rules depending on the constraint.
- “inequality constraint”Our convention for writing feasible inequalities.
- “complementary slackness”An inequality with positive multiplier must be tight.
| Symbol | Say it | Meaning | LaTeX |
|---|---|---|---|
| “f on a line segment” | Used to compare the graph with its chord. | ||
| “H is positive semidefinite” | Every quadratic directional curvature is nonnegative. | ||
| “Lagrangian” | Objective plus multiplier-weighted constraints. | ||
| “lambda” | A multiplier for an inequality or equality, with sign rules depending on the constraint. | ||
| “inequality constraint” | Our convention for writing feasible inequalities. | ||
| “complementary slackness” | An inequality with positive multiplier must be tight. |
A chord above the graph
On a convex domain, is convex when for every and ,
For a differentiable convex function this is equivalent to the supporting-plane inequality . If the function is twice continuously differentiable on an open convex domain, it is convex exactly when its Hessian is positive semidefinite everywhere.
The word everywhere matters. A positive Hessian at one point says something local. Strict convexity guarantees at most one minimiser; convexity alone permits a flat set of minimisers.
A smooth function has a positive Hessian at one point. Does that prove global convexity?
Why local is global
Suppose were a local minimiser but some feasible had a lower value. Points are arbitrarily close to for small positive . Convexity gives , contradicting local minimality. This argument needs a convex feasible set as well as a convex objective.
For an unconstrained differentiable convex function, therefore certifies a global minimum by the supporting-plane inequality. Under constraints the gradient need not be zero: it may point into forbidden directions.
Equality constraints and tangency
For , define . At a regular constrained optimum, where the constraint gradient is nonzero,
The objective gradient must be perpendicular to every feasible tangent, hence parallel to the constraint normal. These equations find candidates, which still need classification and comparison.
Minimise subject to . Stationarity gives and , so and the value is . The same result follows by substituting and completing the square.
Minimise subject to . What is x?
Inequalities and KKT
For minimisation with inequalities and equalities , the Karush–Kuhn–Tucker conditions are:
- Primal feasibility: obey all constraints.
- Dual feasibility: inequality multipliers satisfy .
- Stationarity: .
- Complementary slackness: for every inequality.
An inactive constraint has a zero multiplier. An active constraint may also have a zero multiplier. Equality multipliers have no sign restriction. KKT conditions require a constraint qualification to be necessary in general; for a convex problem they provide a global optimality certificate when satisfied.
For the SVM write . Stationarity in gives . Positive multipliers can occur only on the margin, explaining the support-vector representation.
An inequality constraint is strictly inactive at a KKT point. What is its multiplier?
Read beyond
Book · free online · ~20 min
Convex OptimizationBoyd & Vandenberghe · Chapters 3–5: convexity, optimisation and duality
Connect the chord definition to first-order conditions and multipliers.
Book · free online · ~20 min
Mathematics for Machine LearningDeisenroth, Faisal & Ong · Chapter 7: continuous optimisation
Work through a Lagrange multiplier example.
Book · free online · ~20 min
Calculus, Volume 3OpenStax · Section 4.8: Lagrange multipliers
Draw the constraint and the objective contours before solving equations.
Read the equation in context
Support-vector networksCorinna Cortes & Vladimir Vapnik · 1995The paper develops support-vector networks including nonseparable data. Here we examine its separable starting point. Both the quadratic objective and the feasible half-spaces are convex. Multipliers identify which training constraints support the final boundary.
Decode the paper · Separable maximum-margin formulation, in modern vector notation
Support-vector networksCorinna Cortes & Vladimir Vapnik · 1995
The paper develops support-vector networks including nonseparable data. Here we examine its separable starting point. Both the quadratic objective and the feasible half-spaces are convex. Multipliers identify which training constraints support the final boundary.
Options
Your turn
Move along a constraint and watch the objective and gradient alignment. Find both constrained extremes for each of three objectives.
Interactive lab
Tangency hunter
x + 2y on the unit circle
Objective
1.75154
Derivative with respect to angle in radians
1.39000
Extremes found: 0/6
Match · Expression ↔ Meaning
KKT roles
Options
Match · Expression ↔ Meaning
Geometry and conditions
Options
Proof puzzle
Local is global
Claim
A local minimum of a convex function on a convex feasible set is global.
Tap lines in the order they should appear. Tap a line in your proof to send it back.
Your proof
- Pick the first line below.
Available lines
Prove it yourself
A constrained minimum without calculus
Claim
Prove whenever , with equality only at x=y=1/2.
Your typeset proof appears here.
Coding problems
Problem 22·Warm-up
Allocate a fixed total
Minimise subject to . Report the minimum value.
Problem 23·Standard
Project onto a budget
Minimise subject to and . Report the first coordinate of the minimiser.
Problem 24·Challenge
Count convex quadratics
For integers , how many functions are convex on ?
Key takeaways
- Convexity controls the whole domain and its feasible line segments.
- Convex local minima are global; strict convexity gives uniqueness.
- Lagrange multipliers enforce tangency under regularity assumptions.
- KKT adds sign and slackness conditions for inequalities.
Checkpoint
Prove it to the labyrinth
Answer every question to clear this chamber. First-try answers earn the most XP.
What does strict convexity guarantee if a minimiser exists?
For subject to , the optimum is x=1. What is the KKT multiplier?
For a differentiable unconstrained convex objective, a zero gradient certifies what?
Which multiplier has no sign restriction?
What is the minimum value of subject to ?
Does an active inequality necessarily have a positive multiplier?
End of the chamber
Clear this chamber
- Questions in this chamber (0/9 solved)Next unsolved
- Bonus: Tangency hunter (+40 XP)
- Bonus: Problem 22: Allocate a fixed total (+20 XP)
- Bonus: Problem 23: Project onto a budget (+35 XP)
- Bonus: Problem 24: Count convex quadratics (+50 XP)
- Bonus: Proof: Local is global (+25 XP)
- Bonus: Proof: A constrained minimum without calculus (+35 XP)
- Bonus: Decode the paper (+25 XP)
- Bonus: Match: KKT roles (+20 XP)
- Bonus: Match: Geometry and conditions (+20 XP)