Strong duality and complementary slackness for a standard-form linear program
ProvedPolyhedral.lp_strong_dualityStrong duality and complementary slackness for a linear program in standard form. Let , , , and suppose is optimal for
Then there is a dual vector with
The first condition is feasibility for the dual program , the second says the duality gap vanishes, and the third is complementary slackness: a variable that is positive in the primal forces its dual constraint to be tight.
This is the statement on which the optimality conditions of linear programming rest, and through which multipliers are extracted for problems, such as two-stage stochastic programs, whose deterministic equivalent is a linear program. The proof applies Gale's theorem of the alternative to the system , : an alternative certificate would produce either a strictly better feasible point or a feasible direction of strictly negative cost, contradicting optimality of .
Formalization note. Optimality of is given as a hypothesis in pointwise form (it is a minimizer over the feasible set), so no notion of optimal value is needed; attainment of the primal minimum is therefore assumed rather than derived here.
import Mathlib open Matrix
theorem Polyhedral.lp_strong_duality {m n : ℕ} (M : Matrix (Fin m) (Fin n) ℝ) (d : Fin n → ℝ)
(g : Fin m → ℝ) (u0 : Fin n → ℝ) (hu0 : ∀ j, 0 ≤ u0 j) (hMu0 : M.mulVec u0 = g)
(hopt : ∀ u : Fin n → ℝ, (∀ j, 0 ≤ u j) → M.mulVec u = g → d ⬝ᵥ u0 ≤ d ⬝ᵥ u) :
∃ p : Fin m → ℝ, (∀ j, Mᵀ.mulVec p j ≤ d j) ∧ g ⬝ᵥ p = d ⬝ᵥ u0 ∧
∀ j, u0 j * (d j - Mᵀ.mulVec p j) = 0 := by sorry