Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Strong duality adapter: a primal optimum yields a dual optimum of equal value (Fin-indexed)

Proved
PrimalDualOnline.LP.strong_duality_adapter

by moutei · Sep 17, 2026 · Mathlib 0df444a (Lean v4.33.1)

complementary-slacknessdualitylinear-programmingoptimization

Theorem 2.2 of the source, one direction, transported from the platform. For a program whose data is indexed by Fin n (variables) and Fin m (constraints), if xxx is an optimal solution of (P)(P)(P) then there exists a yyy that is an optimal solution of (D)(D)(D) with

∑icixi = ∑jbjyj.\sum_i c_i x_i \ =\ \sum_j b_j y_j.i∑​ci​xi​ = j∑​bj​yj​.

This is not an independent proof of strong duality. The intended route is to import LinearOptimization.lp_strong_duality, which is already proved in this environment for linear programs in Bertsimas-Tsitsiklis general form, and to reconcile the two presentations: the general form bundles the program as a record with a per-row constraint relation and a per-column sign condition, and instantiating those to "≥\ge≥ on every row" and "nonnegative on every column" reproduces exactly the feasibility predicates used here, up to the orientation of the matrix and the choice of index type.

The statement is restricted to Fin indices on purpose. The imported dependency path exists only for Fin-indexed data, and no Fintype.equivFin transport has been carried out, so stating it over arbitrary finite index types would assert more than the available dependency chain supports.

Preamble
import Definitions.Def_PrimalDualOnline_FiniteLP
import Mathlib.Tactic
Formal statement
open PrimalDualOnline.LP

theorem PrimalDualOnline.LP.strong_duality_adapter {m n : ℕ}
    (A : Fin n → Fin m → ℝ) (b : Fin m → ℝ) (c : Fin n → ℝ)
    (x : Fin n → ℝ) (hx : PrimalOptimal A b c x) :
    ∃ y : Fin m → ℝ, DualOptimal A b c y ∧ primalObjective c x = dualObjective b y := by sorry
Source
Niv Buchbinder, Designing Competitive Online Algorithms via a Primal-Dual Approach, PhD thesis, Tel Aviv University, 2008, https://www.tau.ac.il/~nivb/download/phd-thsis.pdf, Section 2.1, Theorem 2.2, p. 8; transported from LinearOptimization.lp_strong_duality (Bertsimas & Tsitsiklis, Introduction to Linear Optimization, general-form LP)
Read-back

What the Lean code literally says, in plain math · claude-opus-5

Read-back — strong_duality_adapter

Setting and binders. The statement is quantified over two natural numbers nnn and mmm (both implicit, with no positivity or nondegeneracy assumption: n=0n = 0n=0 and m=0m = 0m=0 are included), and over four arbitrary data items:

  • a real matrix AAA presented as a function A:{0,…,n−1}×{0,…,m−1}→RA : \{0,\dots,n-1\} \times \{0,\dots,m-1\} \to \mathbb{R}A:{0,…,n−1}×{0,…,m−1}→R, written Ai,jA_{i,j}Ai,j​, whose first index iii ranges over the concretely-chosen index type Fin n\mathrm{Fin}\,nFinn (the canonical type of naturals below nnn) and whose second index jjj ranges over Fin m\mathrm{Fin}\,mFinm — these are the literal index types, not arbitrary finite or fintype-instantiated index types;
  • a vector b:Fin m→Rb : \mathrm{Fin}\,m \to \mathbb{R}b:Finm→R, written bjb_jbj​;
  • a vector c:Fin n→Rc : \mathrm{Fin}\,n \to \mathbb{R}c:Finn→R, written cic_ici​;
  • a vector x:Fin n→Rx : \mathrm{Fin}\,n \to \mathbb{R}x:Finn→R, written xix_ixi​.

No sign, boundedness, rank, or nonzero assumption is imposed on AAA, bbb, or ccc; all entries are arbitrary reals.

The hypothesis, fully expanded. The single hypothesis is that xxx is primal optimal, which unfolds to the conjunction of:

  1. Primal feasibility of xxx:
∀j∈Fin m,bj≤∑i∈Fin nAi,j xiand∀i∈Fin n,0≤xi.\forall j \in \mathrm{Fin}\,m,\quad b_j \le \sum_{i \in \mathrm{Fin}\,n} A_{i,j}\, x_i \qquad\text{and}\qquad \forall i \in \mathrm{Fin}\,n,\quad 0 \le x_i .∀j∈Finm,bj​≤i∈Finn∑​Ai,j​xi​and∀i∈Finn,0≤xi​.

(Note the inequality direction: the weighted column sums are bounded below by bbb, with a non-strict ≤\le≤, and xxx is componentwise nonnegative.)

  1. Minimality of xxx among all primal-feasible points: for every function x′:Fin n→Rx' : \mathrm{Fin}\,n \to \mathbb{R}x′:Finn→R — the inner quantifier ranges over all real-valued functions on Fin n\mathrm{Fin}\,nFinn, restricted only by feasibility, with no locality, boundedness, or proximity restriction — if x′x'x′ satisfies the same two feasibility conditions (bj≤∑iAi,jxi′b_j \le \sum_i A_{i,j} x'_ibj​≤∑i​Ai,j​xi′​ for all jjj, and 0≤xi′0 \le x'_i0≤xi′​ for all iii), then
∑i∈Fin nci xi  ≤  ∑i∈Fin nci xi′.\sum_{i \in \mathrm{Fin}\,n} c_i\, x_i \;\le\; \sum_{i \in \mathrm{Fin}\,n} c_i\, x'_i .i∈Finn∑​ci​xi​≤i∈Finn∑​ci​xi′​.

So xxx minimizes ∑icixi\sum_i c_i x_i∑i​ci​xi​ over the primal-feasible set. Since xxx is itself feasible, xxx is one of the admissible x′x'x′, so this clause is reflexively satisfied at x′=xx' = xx′=x.

The conclusion, fully expanded. There exists a vector y:Fin m→Ry : \mathrm{Fin}\,m \to \mathbb{R}y:Finm→R (mere existence, not unique existence, and no formula or construction for yyy is asserted) such that both:

  1. yyy is dual optimal, i.e.
    • dual feasibility: ∀i∈Fin n, ∑j∈Fin mAi,j yj≤ci\forall i \in \mathrm{Fin}\,n,\ \sum_{j \in \mathrm{Fin}\,m} A_{i,j}\, y_j \le c_i∀i∈Finn, ∑j∈Finm​Ai,j​yj​≤ci​ (row sums bounded above by ccc, non-strict) and ∀j∈Fin m, 0≤yj\forall j \in \mathrm{Fin}\,m,\ 0 \le y_j∀j∈Finm, 0≤yj​;
    • maximality: for every function y′:Fin m→Ry' : \mathrm{Fin}\,m \to \mathbb{R}y′:Finm→R satisfying those same two dual-feasibility conditions,
∑j∈Fin mbj yj′  ≤  ∑j∈Fin mbj yj,\sum_{j \in \mathrm{Fin}\,m} b_j\, y'_j \;\le\; \sum_{j \in \mathrm{Fin}\,m} b_j\, y_j ,j∈Finm∑​bj​yj′​≤j∈Finm∑​bj​yj​,
 i.e. $y$ *maximizes* $\sum_j b_j y_j$ over the dual-feasible set (note the reversed direction relative to the primal clause: primal optimality is minimization, dual optimality is maximization);

2. the two objective values coincide exactly:

∑i∈Fin nci xi  =  ∑j∈Fin mbj yj.\sum_{i \in \mathrm{Fin}\,n} c_i\, x_i \;=\; \sum_{j \in \mathrm{Fin}\,m} b_j\, y_j .i∈Finn∑​ci​xi​=j∈Finm∑​bj​yj​.

Existence vs. assumption. This statement assumes existence of a primal optimum (it is handed a specific optimal xxx) and asserts existence of a dual optimum. It is therefore a conditional existence claim, not an unconditional one.

Degenerate cases.

  • n=0n = 0n=0 (no primal variables): Fin 0\mathrm{Fin}\,0Fin0 is empty, xxx is the unique empty function, and every sum over iii is the empty sum 000. The hypothesis then forces bj≤0b_j \le 0bj​≤0 for all jjj; the componentwise-nonnegativity clause and the minimality clause are vacuous/trivial (the only feasible x′x'x′ is xxx itself, and 0≤00 \le 00≤0). The primal objective is 000, so the conclusion demands a yyy with 0≤yj0 \le y_j0≤yj​ for all jjj (the dual constraint clause, quantified over i∈Fin 0i \in \mathrm{Fin}\,0i∈Fin0, is vacuous), maximal ∑jbjyj\sum_j b_j y_j∑j​bj​yj​ over all such yyy, and ∑jbjyj=0\sum_j b_j y_j = 0∑j​bj​yj​=0. If instead some bj>0b_j > 0bj​>0 while n=0n = 0n=0, the hypothesis is unsatisfiable and the statement is vacuous for that data.
  • m=0m = 0m=0 (no constraints): the first feasibility clause (quantified over j∈Fin 0j \in \mathrm{Fin}\,0j∈Fin0) is vacuous, so primal feasibility reduces to xi≥0x_i \ge 0xi​≥0 for all iii, and the hypothesis says x≥0x \ge 0x≥0 minimizes ∑icixi\sum_i c_i x_i∑i​ci​xi​ over the nonnegative orthant. The witness yyy is the unique empty function, its dual-feasibility reduces to 0≤ci0 \le c_i0≤ci​ for all iii (empty row sums) with the nonnegativity clause vacuous, its maximality is 0≤00 \le 00≤0, and the value equality reduces to ∑icixi=0\sum_i c_i x_i = 0∑i​ci​xi​=0.
  • n=m=0n = m = 0n=m=0: all feasibility and optimality clauses are vacuous or trivial, and the value equality reduces to 0=00 = 00=0.

Relation to the other two statements. As written, this statement implies the left-to-right direction of strong_duality_iff_fin (from a primal optimum it produces a dual optimum). It also implies strong_duality_value_fin: given any primal optimum xxx and any dual optimum yyy, this statement yields some dual optimum y0y_0y0​ with ∑icixi=∑jbjy0,j\sum_i c_i x_i = \sum_j b_j y_{0,j}∑i​ci​xi​=∑j​bj​y0,j​, and applying the maximality clause of dual optimality in both directions (once with y′=y0y' = y_0y′=y0​ against yyy, once with y′=yy' = yy′=y against y0y_0y0​) forces ∑jbjyj=∑jbjy0,j\sum_j b_j y_j = \sum_j b_j y_{0,j}∑j​bj​yj​=∑j​bj​y0,j​. It does not imply the right-to-left direction of the biconditional.

Not asserted. No claim that yyy is unique; no construction, formula, sign pattern, or complementary-slackness relation for yyy; no claim that a primal optimum exists for any given A,b,cA, b, cA,b,c; no claim that the primal-feasible or dual-feasible sets are nonempty, closed, or bounded; no claim about the case where xxx is merely feasible but not optimal; no claim about unbounded or infeasible instances; no weak-duality statement in its own right; no statement about arbitrary finite index types other than Fin n\mathrm{Fin}\,nFinn and Fin m\mathrm{Fin}\,mFinm; and no assertion that the constructed yyy is related to xxx in any way beyond the stated equality of objective values.


Human review
  • Endorsed by Shuze Chen · Sep 17, 2026

  • Endorsed by moutei · Sep 17, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me