EconCSLib.Math.LinearAlgebra.Farkas #
Formalises Farkas' Lemma [MFoGT, Section 2.8, Exercise 8] in its objective-bound (LP-style) form, over any linearly ordered field.
Given a finite-row system A x ≥ b with S = { x | A x ≥ b } nonempty,
the following are equivalent:
- (Primal bound.) For every feasible
x, the linear objective⟨c, x⟩ ≥ d. - (Dual certificate.) There exists
u : I → 𝕜withu ≥ 0,uᵀA = c, and⟨u, b⟩ ≥ d.
Proof structure #
The (←) direction is the standard weighted-sum argument.
The (→) direction homogenises the problem: introduce a slack variable t
and the augmented system
A x - b·t ≥ 0 (m rows) t ≥ 0 (1 row) -⟨c, x⟩ + d·t ≥ 1 (1 row, encodes ⟨c, x⟩ < d·t strictly)
Show this is infeasible by case-splitting on t = 0 (recession direction
contradicts the primal bound via y ∈ S) vs t > 0 (rescale to a primal
point with ⟨c, x⟩ < d, contradicts the primal bound). Apply the Theorem
of the Alternative to obtain a Farkas certificate of the augmented system;
extract the coefficient β on the strict-bound row, divide by it, and
read off the desired u.
Blueprint #
docs/knowledge/nodes/core/linear_algebra.farkas_lemma.md
Augmented system construction #
Sum.inl i(fori : I): original rowA i x - b i t ≥ 0.Sum.inr false: slack rowt ≥ 0.Sum.inr true: strict-bound row-⟨c, x⟩ + d t ≥ 1.
Column index Fin (n+1) where j.castSucc is x_j and Fin.last n is t.
Row index of the augmented Farkas system.
Equations
Instances For
Augmented matrix A_aug : FarkasAugRow I → Fin (n+1) → 𝕜.
Equations
- EconCSLib.LinearAlgebra.farkasAugA A b c d (Sum.inl i) x✝ = Fin.lastCases (-b i) (fun (j' : Fin n) => A i j') x✝
- EconCSLib.LinearAlgebra.farkasAugA A b c d (Sum.inr false) x✝ = Fin.lastCases 1 (fun (x : Fin n) => 0) x✝
- EconCSLib.LinearAlgebra.farkasAugA A b c d (Sum.inr true) x✝ = Fin.lastCases d (fun (j' : Fin n) => -c j') x✝
Instances For
Augmented RHS b_aug : FarkasAugRow I → 𝕜.
Equations
Instances For
Simp lemmas for farkasAugA and farkasAugB #
Augmented row evaluation at (x, t) = (xt ∘ castSucc, xt (last n)) #
Each row of the augmented system has a clean form in terms of the original matrix/vector data. We collect these as private lemmas.
Farkas Lemma #
Farkas' Lemma (objective-bound form). For a finite linear system
A x ≥ b with S = {x | A x ≥ b} nonempty, the primal bound
"∀ x ∈ S, ⟨c, x⟩ ≥ d" is equivalent to the existence of a nonneg dual
certificate u with uᵀA = c and ⟨u, b⟩ ≥ d.