Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Farkas' lemma in inequality form

Proved
LinearOptimization.farkas_inequality_form

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

dualityfarkaslinear-programming

(Theorem 4.7) Suppose that the system of linear inequalities Ax≤bAx \le bAx≤b has at least one solution, and let ddd be some scalar. Then, the following are equivalent:

  • (a) every feasible solution to the system Ax≤bAx \le bAx≤b satisfies c′x≤dc'x \le dc′x≤d;
  • (b) there exists some p≥0p \ge 0p≥0 such that p′A=c′p'A = c'p′A=c′ and p′b≤dp'b \le dp′b≤d.
Preamble
import Mathlib.Data.Matrix.Mul
import Mathlib.Data.Real.Basic


open Matrix

/-- **Bertsimas & Tsitsiklis, Theorem 4.7 (p. 166).** For a solvable system `Ax ≤ b` and a
scalar `d`: every solution of `Ax ≤ b` satisfies `c'x ≤ d` iff some
`p ≥ 0` has `p'A = c'` and `p'b ≤ d`. -/
Formal statement
theorem LinearOptimization.farkas_inequality_form {m n : ℕ} (A : Matrix (Fin m) (Fin n) ℝ)
    (b : Fin m → ℝ) (c : Fin n → ℝ) (d : ℝ)
    (hfeas : ∃ x : Fin n → ℝ, A.mulVec x ≤ b) :
    (∀ x : Fin n → ℝ, A.mulVec x ≤ b → c ⬝ᵥ x ≤ d) ↔
      ∃ p : Fin m → ℝ, 0 ≤ p ∧ Aᵀ.mulVec p = c ∧ p ⬝ᵥ b ≤ d := by
  sorry
Source
Bertsimas & Tsitsiklis, Introduction to Linear Optimization, Athena Scientific, 1997, Theorem 4.7, p. 166
Read-back

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

For all m,n≥0m, n \ge 0m,n≥0, an m×nm \times nm×n real matrix AAA, b∈Rmb \in \mathbb{R}^mb∈Rm, c∈Rnc \in \mathbb{R}^nc∈Rn, and d∈Rd \in \mathbb{R}d∈R, under the standing hypothesis that the system is feasible — some x∈Rnx \in \mathbb{R}^nx∈Rn satisfies Ax≤bA x \le bAx≤b componentwise — the following equivalence holds: (i) every x∈Rnx \in \mathbb{R}^nx∈Rn with Ax≤bA x \le bAx≤b satisfies c⋅x≤dc \cdot x \le dc⋅x≤d; iff (ii) there exists p∈Rmp \in \mathbb{R}^mp∈Rm with p≥0p \ge 0p≥0 componentwise, ATp=cA^{\mathsf T} p = cATp=c (i.e. ∑ipiAij=cj\sum_i p_i A_{ij} = c_j∑i​pi​Aij​=cj​ for every jjj), and p⋅b≤dp \cdot b \le dp⋅b≤d. All inequalities are non-strict, and both directions of the iff are asserted. Without the feasibility hypothesis nothing is claimed.

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