Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Duality theorem (§6.1) — the duality theorem of linear programming

Proved
MatousekLP.Duality.duality_theorem

by mikedeng1 · Oct 3, 2026 · Mathlib 0df444a (Lean v4.33.1)

dualitylinear-programmingp2o-batch-b23bp2o-gran-per-chapterp2o-plan-bookp2o-v1

Let AAA be a real matrix with mmm rows and nnn columns, b∈Rmb\in\mathbb{R}^mb∈Rm and c∈Rnc\in\mathbb{R}^nc∈Rn, and consider the linear programs

(P)maximize cTx  subject to Ax≤b, x≥0,(D)minimize bTy  subject to ATy≥c, y≥0.\text{(P)}\quad \text{maximize } c^{T}x \ \text{ subject to } Ax\le b,\ x\ge 0, \qquad\qquad \text{(D)}\quad \text{minimize } b^{T}y \ \text{ subject to } A^{T}y\ge c,\ y\ge 0.(P)maximize cTx  subject to Ax≤b, x≥0,(D)minimize bTy  subject to ATy≥c, y≥0.

Then exactly one of the following four possibilities occurs:

  1. neither (P) nor (D) has a feasible solution;
  2. (P) is unbounded and (D) has no feasible solution;
  3. (P) has no feasible solution and (D) is unbounded (from below);
  4. both (P) and (D) have a feasible solution; then both have an optimal solution, and for every optimal solution x∗x^*x∗ of (P) and every optimal solution y∗y^*y∗ of (D)
cTx∗=bTy∗.c^{T}x^*=b^{T}y^*.cTx∗=bTy∗.

That is, whenever both programs are feasible, the maximum of (P) is attained and equals the minimum of (D), which is attained as well. This is the central theorem of linear programming duality; weak duality (Proposition 6.1.1) supplies the inequality cTx≤bTyc^{T}x\le b^{T}ycTx≤bTy, and the content of the theorem is that the dual guards the primal perfectly.

Formalization Note The four cases are the predicate DualityCase A b c k of the definition module MatousekLP.Duality.PrimalDual, with the book's case kkk at index k−1∈{0,1,2,3}k-1\in\{0,1,2,3\}k−1∈{0,1,2,3}; "exactly one occurs" is ∃! k : Fin 4, DualityCase A b c k. Optimal solutions are feasible points whose objective value is at least (for (P)) or at most (for (D)) that of every feasible point; no supremum or infimum is used.

Preamble
import Mathlib
import Definitions.Def_MatousekLP_Duality_PrimalDual
Formal statement
namespace MatousekLP.Duality

/-- Matoušek & Gärtner, §6.1, p. 83, Duality theorem of linear programming: for
(P) maximize `cᵀx` s.t. `Ax ≤ b`, `x ≥ 0` and (D) minimize `bᵀy` s.t. `Aᵀy ≥ c`, `y ≥ 0`,
exactly one of the four possibilities `DualityCase A b c k` (`k = 0, 1, 2, 3` for the book's
cases 1–4) occurs. -/
theorem duality_theorem {m n : ℕ} (A : Matrix (Fin m) (Fin n) ℝ) (b : Fin m → ℝ)
    (c : Fin n → ℝ) :
    ∃! k : Fin 4, DualityCase A b c k := by sorry

end MatousekLP.Duality
Source
Matoušek & Gärtner, Understanding and Using Linear Programming, Springer 2007, §6.1, p. 83, Duality theorem of linear programming
Human review
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 5, 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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me