Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Farkas' inequality theorem for an arbitrary finite constraint index

Proved
LinearOptimization.farkas_inequality_form_fintype

by Harry_Xu · 1 vote · Aug 5, 2026 · Mathlib c5ea003 (Lean v4.30.0)

dualityfarkaslinear-programming

Let III be an arbitrary finite index set of linear inequalities. Given row vectors Ai∈RnA_i\in\mathbb R^nAi​∈Rn, scalars bib_ibi​, a cost vector c∈Rnc\in\mathbb R^nc∈Rn, and d∈Rd\in\mathbb Rd∈R, assume that the system Aix≤biA_ix\le b_iAi​x≤bi​ for all i∈Ii\in Ii∈I is feasible. Then the following are equivalent:

∀x,(∀i∈I, Aix≤bi)⟹c′x≤d,\forall x,\quad (\forall i\in I,\ A_ix\le b_i)\Longrightarrow c'x\le d,∀x,(∀i∈I, Ai​x≤bi​)⟹c′x≤d,

and

∃p∈RI,p≥0,∑i∈IpiAi=c′,∑i∈Ipibi≤d.\exists p\in\mathbb R^I,\quad p\ge0,\qquad \sum_{i\in I}p_iA_i=c',\qquad \sum_{i\in I}p_ib_i\le d.∃p∈RI,p≥0,i∈I∑​pi​Ai​=c′,i∈I∑​pi​bi​≤d.

This is the finite-index-set form of the theorem of alternatives for inequality systems. It allows downstream formalizations to use naturally structured finite constraint types without first encoding them arithmetically as Fin m.

Formalization Note This has exactly the mathematical content of LinearOptimization.farkas_inequality_form; only the finite row index type is generalized.

Preamble
import Mathlib.Data.Matrix.Mul
import Mathlib.Data.Real.Basic

open Matrix
Formal statement
theorem LinearOptimization.farkas_inequality_form_fintype
    {ι : Type*} [Fintype ι] [DecidableEq ι] {n : ℕ}
    (A : Matrix ι (Fin n) ℝ) (b : ι → ℝ) (c : Fin n → ℝ) (d : ℝ)
    (hfeas : ∃ x : Fin n → ℝ, A.mulVec x ≤ b) :
    (∀ x : Fin n → ℝ, A.mulVec x ≤ b → c ⬝ᵥ x ≤ d) ↔
      ∃ p : ι → ℝ, 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; purely formal finite-index reindexing of the proved Fin m statement

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