Farkas' lemma over linearly ordered fields #
A finite system of linear inequalities over a linearly ordered field has no solution exactly when
some nonnegative combination of its rows reads 0 ≤ c with c < 0. The proofs eliminate all
variables by Fourier–Motzkin elimination (Matrix.FourierMotzkin.exists_projection), so they hold
over every linearly ordered field, including ℚ, and need no topology.
Mathlib proves a topological Farkas lemma for closed convex cones in real locally convex spaces
(ProperCone.hyperplane_separation). Its algebraic cone duality PointedCone.dual has no Farkas
or Minkowski–Weyl theorem for finitely generated cones. The polyhedral statements below cover
that gap for matrices over an arbitrary linearly ordered field.
See also [DK24], an independent Lean 4 formalization of Farkas-type theorems and linear-programming duality over linearly ordered fields, with extensions to infinite values.
Main results #
Matrix.exists_mulVec_le_iff:A *ᵥ x ≤ bis solvable iff0 ≤ y ⬝ᵥ bfor everyy ≥ 0withy ᵥ* A = 0.Matrix.not_exists_mulVec_le_iff: the certificate form,A *ᵥ x ≤ bis infeasible iff there isy ≥ 0withy ᵥ* A = 0andy ⬝ᵥ b < 0.Matrix.exists_nonneg_mulVec_eq_iff: the equality form,A *ᵥ x = bhas a solutionx ≥ 0iff0 ≤ y ⬝ᵥ bwhenever0 ≤ y ᵥ* A.Matrix.not_exists_nonneg_mulVec_eq_iff: its certificate form.
References #
Farkas' lemma for systems of inequalities: A *ᵥ x ≤ b has a solution iff every
nonnegative combination y of the rows with y ᵥ* A = 0 satisfies 0 ≤ y ⬝ᵥ b
[Schrijver1986, Corollary 7.1e].
Farkas' lemma, certificate form: A *ᵥ x ≤ b is infeasible iff some y ≥ 0 has
y ᵥ* A = 0 and y ⬝ᵥ b < 0 [Schrijver1986, Corollary 7.1e].
Farkas' lemma, equality form: A *ᵥ x = b has a solution x ≥ 0 iff 0 ≤ y ⬝ᵥ b for
every y with 0 ≤ y ᵥ* A [Schrijver1986, Corollary 7.1d].
Farkas' lemma, equality certificate form: A *ᵥ x = b has no solution x ≥ 0 iff some
y has 0 ≤ y ᵥ* A and y ⬝ᵥ b < 0 [Schrijver1986, Corollary 7.1d].