Complementary slackness
ProvedConvexOptimization.complementary_slacknessComplementary slackness — condition (5.48) of Boyd & Vandenberghe.
For the standard problem, let be feasible, let with and , and suppose the duality gap vanishes, , where is the Lagrange dual function. Then
Equivalently: and . A constraint that is slack at the optimum carries no price, and a constraint with a positive price is active.
Beyond being one of the four KKT conditions, this is the result that gives dual variables their economic reading as shadow prices, and in practice it is what lets an algorithm identify the active set from a dual solution. No convexity is required: the hypothesis is a zero gap, however obtained.
Formalization Note The zero-gap hypothesis equates the EReal-valued dual function with the coercion of the real number , which also encodes finiteness of ; feasibility of is membership in the mission's feasible-set definition. Source: B&V §5.5.2, p. 242, eq. (5.48).
import Mathlib import Definitions.Def_ConvexOptimization_lagrangeDuality open scoped RealInnerProductSpace ENNReal open MeasureTheory
theorem ConvexOptimization.complementary_slackness {n mm p : ℕ}
(f₀ : EuclideanSpace ℝ (Fin n) → ℝ)
(fc : Fin mm → EuclideanSpace ℝ (Fin n) → ℝ)
(a : Fin p → EuclideanSpace ℝ (Fin n)) (b : Fin p → ℝ)
(xs : EuclideanSpace ℝ (Fin n)) (hxs : xs ∈ feasibleSet fc a b)
(lam : Fin mm → ℝ) (hlam : ∀ i, 0 ≤ lam i) (nu : Fin p → ℝ)
(hzero : dualFunction f₀ fc a b lam nu = (f₀ xs : EReal)) :
∀ i, lam i * fc i xs = 0 := by
sorry