Exact complementary slackness implies optimality of both members of the pair
ProvedPrimalDualOnline.LP.exact_cs_optimalThe case, stated as an optimality result rather than as an inequality. If is primal feasible, is dual feasible, and the pair satisfies complementary slackness exactly - every positive has a tight dual constraint and every positive has a tight primal constraint - then is an optimal solution of and is an optimal solution of .
Both conclusions are attainment statements: no feasible primal point has smaller cost, and no feasible dual point has larger value. Note that this direction needs no strong duality; the optimality of each member is certified by the other through weak duality.
import Definitions.Def_PrimalDualOnline_FiniteLP import Mathlib.Tactic
open PrimalDualOnline.LP
theorem PrimalDualOnline.LP.exact_cs_optimal
{I J : Type*} [Fintype I] [Fintype J]
(A : I → J → ℝ) (b : J → ℝ) (c : I → ℝ) (x : I → ℝ) (y : J → ℝ)
(hp : PrimalFeasible A b x) (hd : DualFeasible A c y)
(hpcs : PrimalApproxCS 1 A c x y) (hdcs : DualApproxCS 1 A b x y) :
PrimalOptimal A b c x ∧ DualOptimal A b c y := by sorryRead-back
What the Lean code literally says, in plain math · claude-opus-5
Read-back 3 — exact_cs_optimal
Setting and binders. Types and , implicit and at arbitrary universes, each assumed finite (Fintype), with no nonemptiness assumption. Universally quantified data: a real matrix , vectors , , and candidate vectors , . No sign or structural hypothesis on , , .
The four hypotheses, fully expanded.
- — is primal-feasible: for every , and for every . (Feasibility only; no optimality is assumed of .)
- — is dual-feasible: for every , and for every . (Feasibility only.)
- — the approximate-complementary-slackness predicate for the primal, with its parameter instantiated at the literal . Written out, it says: for every ,
Since , the two inequalities sandwich the same quantity from both sides, so at this hypothesis says exactly: for every index with strictly positive, the -th dual row sum equals , i.e. — the -th dual constraint is tight. The upper inequality here duplicates what already gives for all ; the substantive content at is the lower inequality. The condition is triggered only by strictly positive coordinates: for any with nothing at all is asserted about beyond dual feasibility. (Under , coordinates of are , so "" and "" coincide here; nevertheless the predicate as written keys on strict positivity.) 4. — the approximate-complementary-slackness predicate for the dual, with its parameter instantiated at the literal . Written out: for every ,
Since , at this says exactly: for every index with strictly positive, the -th primal constraint holds with equality, i.e. . Here the lower inequality duplicates what already gives for all ; the substantive content is the upper inequality. Again only strictly positive coordinates trigger the condition: for with nothing beyond primal feasibility is asserted about .
So hypotheses 3 and 4 together are the exact (unrelaxed) complementary-slackness conditions in both directions, each conditioned on strict positivity of the corresponding coordinate of the other problem's... more precisely: positivity of forces tightness of dual constraint , and positivity of forces tightness of primal constraint . Nothing asserts that any coordinate is positive, so both hypotheses are vacuously satisfied when and respectively.
Conclusion — a conjunction of two optimality claims. The statement concludes that both of the following hold.
- is primal-optimal: is primal-feasible (as in ) and for every satisfying for all and for all ,
So attains the minimum of over the whole primal-feasible set — an attained global minimum, not a local or approximate one, and with no multiplicative or additive slack.
- is dual-optimal: is dual-feasible (as in ) and for every satisfying for all and for all ,
So attains the global maximum of over the whole dual-feasible set.
Both quantifiers range over the entire function spaces and , with feasibility as the hypothesis of the implication. The conclusion does not state the equality of the two optimal values; it states only the two optimality properties. Uniqueness of optima is not claimed.
Degenerate cases silently included.
- empty: every sum over is ; is the unique empty function. Then reduces to for all ; 's first clause is vacuous, leaving only ; is vacuous (no index exists). says: for each with , and , i.e. . The conclusion then asserts that the empty minimizes the value over the primal-feasible set (a one-point set here) and that maximizes over all .
- empty: every sum over is ; is the unique empty function. Then reduces to for all ; reduces to for all ; is vacuous (no index ); says: for each with , and , i.e. . The conclusion then asserts that minimizes over all and that the empty maximizes the value .
- Both empty: all four hypotheses are vacuous or trivially true, both objectives are , and both optimality claims are over one-point feasible sets.
- and/or (allowed whenever feasible): the corresponding slackness hypothesis carries no content, and the conclusion still asserts full global optimality of that vector.
Confirmed by the mission captain (proposal self-audit).