Lagrange Multipliers
Statement
To find the extrema of subject to the constraint , introduce a multiplier and require:
Geometrically: at the constrained extremum, the level set of and the constraint surface are tangent — their normals are parallel.
Concrete example. Maximise subject to .
Lagrangian: .
First-order conditions: and , so . From : , , .
Visualization
Level curves of (hyperbolas) and the constraint (line):
y
4 *
|\ tangent point at (2,2)
3 | \ xy = 4 (tangent level curve)
| *------
2 | |(2,2) <-- optimum
| | \
1 | | xy = 1
| |
0 +--+--+--*--- x
0 1 2 4
At the optimum : and , so , confirming .
| feasible? | |||
|---|---|---|---|
| 3 | 4 | yes | |
| 4 | 4 | yes (max) | |
| 3 | 4 | yes | |
| 0 | 4 | yes |
Proof Sketch
- Parametrise the constraint: the feasible set is a smooth manifold .
- Tangent condition: at a constrained extremum, must be orthogonal to every tangent vector of , i.e., .
- Linear algebra: iff — so .
- Mathlib:
IsLocalExtrOn.exists_multipliers_of_hasStrictFDerivAt_1dprovides the rigorous 1D-constraint version inMathlib.Analysis.Calculus.LagrangeMultipliers.
For s.t. : verified directly that for all with .
Connections
- KKT ConditionsKKT ConditionsNecessary optimality conditions for constrained optimization via Lagrangian gradient and complementary slacknessRead more → — KKT conditions extend Lagrange multipliers to inequality constraints with sign conditions on
- Mean Value TheoremMean Value TheoremThere exists a point where the instantaneous rate of change equals the average rate of changeRead more → — the proof of Lagrange multipliers uses the MVT to construct the tangent parametrisation
- Cauchy–Schwarz InequalityCauchy–Schwarz InequalityThe inner product of two vectors is bounded by the product of their normsRead more → — Cauchy–Schwarz maximises subject to via Lagrange multipliers
- Spectral TheoremSpectral TheoremEvery real symmetric matrix is orthogonally diagonalizableRead more → — eigenvalue problems are Lagrange multiplier problems: s.t.
Lean4 Proof
import Mathlib.Analysis.InnerProductSpace.Basic
/-- The Lagrange optimum for max xy s.t. x+y=4 is (2,2) with value 4.
Any feasible (x,y) satisfies xy ≤ 4. -/
theorem lagrange_max_product :
∀ x y : ℝ, x + y = 4 → x * y ≤ 4 := by
intro x y hxy
nlinarith [sq_nonneg (x - y)]Referenced by
- KKT ConditionsOptimization