Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proposition 6.4.2 — the Farkas lemma geometrically

Proved
MatousekLP.Duality.farkas_geometric

by mikedeng1 · Oct 3, 2026 · Mathlib 0df444a (Lean v4.33.1)

convex-geometryfarkas-lemmap2o-batch-b23bp2o-gran-per-chapterp2o-plan-bookp2o-v1

Let a1,…,an,ba_1,\dots,a_n,ba1​,…,an​,b be vectors in Rm\mathbb{R}^mRm and let C={t1a1+⋯+tnan:t1,…,tn≥0}C=\{t_1a_1+\dots+t_na_n: t_1,\dots,t_n\ge 0\}C={t1​a1​+⋯+tn​an​:t1​,…,tn​≥0} be the convex cone they generate. Then exactly one of the following occurs:

  1. (F1') b∈Cb\in Cb∈C;
  2. (F2') there is y∈Rmy\in\mathbb{R}^my∈Rm with
yTai≥0  for all i=1,…,nandyTb<0,y^{T}a_i\ge 0 \ \text{ for all } i=1,\dots,n \qquad\text{and}\qquad y^{T}b<0,yTai​≥0  for all i=1,…,nandyTb<0,

that is, the hyperplane h={x∈Rm:yTx=0}h=\{x\in\mathbb{R}^m: y^{T}x=0\}h={x∈Rm:yTx=0} through the origin has all of a1,…,ana_1,\dots,a_na1​,…,an​ (and hence CCC) on one side and bbb strictly on the other.

This is the separation-theorem reading of the Farkas lemma: a point outside a finitely generated cone can be separated from it by a hyperplane through the origin.

Formalization Note Points are elements of EuclideanSpace ℝ (Fin m) and yTxy^{T}xyTx is the inner product inner ℝ y x. "Exactly one" is Lean's exclusive or Xor.

Preamble
import Mathlib
import Definitions.Def_MatousekLP_Duality_Cones
Formal statement
namespace MatousekLP.Duality

/-- Matoušek & Gärtner, Proposition 6.4.2 (pp. 89–90), the Farkas lemma geometrically: for
`a₁, …, aₙ, b ∈ ℝ^m` exactly one of (F1') `b` lies in the convex cone `C` generated by
`a₁, …, aₙ`, and (F2') there is `y ∈ ℝ^m` with `yᵀaᵢ ≥ 0` for all `i` and `yᵀb < 0` (the
hyperplane `{x : yᵀx = 0}` through `0` has `C` on one side and `b` strictly on the other). -/
theorem farkas_geometric {m n : ℕ} (a : Fin n → EuclideanSpace ℝ (Fin m))
    (b : EuclideanSpace ℝ (Fin m)) :
    Xor (b ∈ coneGen a)
      (∃ y : EuclideanSpace ℝ (Fin m), (∀ i, 0 ≤ inner ℝ y (a i)) ∧ inner ℝ y b < 0) := by sorry

end MatousekLP.Duality
Source
Matoušek & Gärtner, Understanding and Using Linear Programming, Springer 2007, pp. 89–90, Proposition 6.4.2
Human review
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 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