Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Weak duality

Proved
LinearOptimization.lp_weak_duality

by Shuze Chen · Aug 5, 2026 · Mathlib c5ea003 (Lean v4.30.0)

dualitylinear-programmingweak-duality

(Theorem 4.3, weak duality) If xxx is a feasible solution to the primal problem and ppp is a feasible solution to the dual problem, then

p′b≤c′x.p'b \le c'x.p′b≤c′x.
Preamble
import Definitions.Def_LinearOptimization_DualLP


open Matrix

/-- **Bertsimas & Tsitsiklis, Theorem 4.3 (p. 146).** Weak duality for the general-form
primal/dual pair: any primal-feasible `x` and dual-feasible `p` satisfy
`p'b ≤ c'x`. -/
Formal statement
theorem LinearOptimization.lp_weak_duality {m n : ℕ} (P : GeneralFormLP m n)
    (x : Fin n → ℝ) (hx : x ∈ generalFeasibleSet P)
    (p : Fin m → ℝ) (hp : p ∈ generalFeasibleSet (dualLP P)) :
    p ⬝ᵥ P.b ≤ P.c ⬝ᵥ x := by
  sorry
Source
Bertsimas & Tsitsiklis, Introduction to Linear Optimization, Athena Scientific, 1997, Theorem 4.3, p. 146
Read-back

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

Weak duality. Here a general-form linear program PPP with mmm rows and nnn variables (m,n≥0m, n \ge 0m,n≥0 arbitrary natural numbers) is a data record consisting of an m×nm\times nm×n real matrix AAA, vectors b∈Rmb \in \mathbb{R}^mb∈Rm and c∈Rnc \in \mathbb{R}^nc∈Rn, a relation symbol from {≥,≤,=}\{\ge, \le, =\}{≥,≤,=} attached to each row iii, and a sign restriction from {nonnegative, nonpositive, free} attached to each variable jjj. A point x∈Rnx \in \mathbb{R}^nx∈Rn is feasible for PPP iff for every row iii the number Ai⋅xA_i \cdot xAi​⋅x (dot product of row iii with xxx) stands in that row's relation to bib_ibi​ (Ai⋅x≥biA_i \cdot x \ge b_iAi​⋅x≥bi​, ≤bi\le b_i≤bi​, or =bi= b_i=bi​), and every coordinate xjx_jxj​ obeys its sign restriction (xj≥0x_j \ge 0xj​≥0, xj≤0x_j \le 0xj​≤0, or unrestricted). The dual of PPP is again a general-form LP: matrix −AT-A^{\mathsf T}−AT (nnn rows, mmm variables), right-hand side −c-c−c, cost vector −b-b−b; its row jjj carries relation ≥\ge≥ / ≤\le≤ / === according as variable jjj of PPP is nonnegative / nonpositive / free, and its variable iii is nonnegative / nonpositive / free according as row iii of PPP has relation ≥\ge≥ / ≤\le≤ / ===. Unwinding, p∈Rmp \in \mathbb{R}^mp∈Rm is dual-feasible iff for every jjj: (ATp)j≤cj(A^{\mathsf T}p)_j \le c_j(ATp)j​≤cj​ when variable jjj of PPP is nonnegative, (ATp)j≥cj(A^{\mathsf T}p)_j \ge c_j(ATp)j​≥cj​ when nonpositive, (ATp)j=cj(A^{\mathsf T}p)_j = c_j(ATp)j​=cj​ when free (the row constraint of the dual literally reads −(ATp)jR−cj-(A^{\mathsf T}p)_j \mathrel{R} -c_j−(ATp)j​R−cj​); and for every iii: pi≥0p_i \ge 0pi​≥0 when row iii of PPP is a ≥\ge≥-row, pi≤0p_i \le 0pi​≤0 when a ≤\le≤-row, pip_ipi​ unrestricted when an ===-row. The theorem asserts: for every m,n≥0m, n \ge 0m,n≥0, every general-form LP PPP as above, every x∈Rnx \in \mathbb{R}^nx∈Rn feasible for PPP, and every p∈Rmp \in \mathbb{R}^mp∈Rm feasible for the dual of PPP, one has p⋅b≤c⋅xp \cdot b \le c \cdot xp⋅b≤c⋅x (non-strict). Nothing is asserted about optimality, attainment, or the values of the programs; when either feasible set is empty the statement is vacuous for that side.

Human review
  • Endorsed by Community (Bot) · Aug 5, 2026

  • Endorsed by Shuze Chen · Aug 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