Farkas' Lemma and the Theorems of the Alternative
Anchor (Master): Rockafellar 1970 Convex Analysis (Princeton) §22 (Helly, Farkas, the theorems of the alternative); Schrijver 1986 Theory of Linear and Integer Programming (Wiley) §7; Ben-Tal & Nemirovski 2001 Lectures on Modern Convex Optimization (SIAM) §1
Intuition Beginner
You have a pile of arrows, all sticking out from the same point. By stacking them with non-negative amounts — you may scale an arrow up, leave it out, but never flip it backwards — you can reach a whole fan-shaped region of the plane. That reachable region is the cone of your arrows. Now someone hands you a target arrow and asks a yes-or-no question: can I build this target by stacking my arrows with non-negative amounts?
Farkas' lemma says there are exactly two possibilities, and never both at once. Either the target sits inside the fan, so you can build it. Or the target sits outside the fan, and then there is a clean, decisive reason it cannot be built: a flat dividing wall passes through the starting point with every one of your arrows on one side and the target strictly on the other side.
So a "no" answer is never a vague failure. A "no" always comes with a certificate — the dividing wall — that anyone can check in a moment. Either you exhibit the recipe that builds the target, or you exhibit the wall that proves no recipe exists. There is no murky middle ground where you simply could not find a recipe but also have no proof one is impossible.
This is the everyday face of a deep fact. Questions of the form "does a solution exist?" get replaced by a sharper pair: "here is a solution" versus "here is a proof that none exists." That swap is the engine behind why linear programs always have a matching price problem, and why constrained-optimization problems always come with multipliers.
Visual Beginner
Picture two arrows pinned at the origin, opening up a wedge between them. Every arrow you can build with non-negative amounts lands somewhere inside that wedge (the shaded fan). A target arrow either lands inside the fan — built — or outside it. When it lands outside, a single straight wall slides through the origin so the whole wedge is on one side and the target is on the other.
target (outside) target (inside)
^ \
\ wall \ . . . . .
\ | \ . fan .
arrow a2 \ | arrow a2 \. shaded .
\ \| \ X. . . . .
\ X-------- arrow a1 \ / arrow a1
\ /| \ /
\ / | <- everything X------------>
\ / | buildable lies origin
--------- X---+---- on one side of
origin the wall;
target on the other
Worked example Beginner
Work in the plane with the two building arrows and . Non-negative combinations are with and — exactly the upper-right quarter-plane.
Target one: . Can we build it with non-negative amounts? Take and . Both amounts are at least , and . Built. The target was inside the fan, so a recipe exists and we just wrote it down.
Target two: . Try to build it: we would need and , but is a backwards amount, which is not allowed. So no non-negative recipe exists. Farkas promises a dividing wall. Use the direction . Check each arrow against it: paired with gives , and paired with gives . Both are at most , so every buildable arrow lands on the "" side. Now pair with the target: paired with gives , which is greater than . The target is strictly on the other side.
What this tells us. The wall direction is a one-line proof that cannot be built: every building arrow scores against , while the target scores . A non-negative recipe would have to score too, so none can exist.
Check your understanding Beginner
Formal definition Intermediate+
Fix with columns , and . The finitely generated cone generated by the columns is
where means for every coordinate. This is a convex cone: closed under addition and under multiplication by non-negative scalars. The pairing is the standard inner product on .
A theorem of the alternative asserts that for a pair of systems and , exactly one is solvable: has a solution if and only if has none. The solution of the unsolvable system's dual is a certificate of infeasibility.
Definition (Farkas alternative). The two systems
are called the Farkas pair. System asks whether ; system asks for a separating direction that scores against every column yet strictly positive against .
A polyhedral cone is a set of the form for some matrix (a finite intersection of homogeneous half-spaces). The Minkowski-Weyl theorem identifies polyhedral cones with finitely generated cones; the half of that identity used below is that is closed in — the new content of this unit, since separation of a point from a convex set requires the set to be closed.
Counterexamples to common slips
- The cone must be closed for separation to certify infeasibility. Convex sets that are not closed can fail to be separated from a boundary point by a strict inequality. Example: the set is convex but not closed, and the origin cannot be strictly separated from it. Finitely generated cones avoid this pathology precisely because they are always closed — this is what makes Farkas a clean dichotomy rather than an approximate one.
- Not every closed convex cone is finitely generated. The ice-cream (second-order) cone is closed and convex but is not the conic hull of finitely many vectors; Farkas as stated applies to finitely generated (equivalently polyhedral) cones. The conic generalisation needs the closed-cone separation argument but loses the rational/finite certificate.
- Equality vs inequality form changes the dual sign pattern. The system (inequality form) has Farkas dual . Mixing up which side carries the sign constraint is the most common error; track which primal variable is sign-constrained and which primal row is an inequality.
Key theorem with proof Intermediate+
We prove Farkas' lemma. The geometric separating-hyperplane theorem of 02.11.02 is the engine; the finite-dimensional closedness of is the content that makes separation applicable.
Theorem (Farkas' lemma). Let and . Exactly one of the following holds:
there exists with and ;
there exists with and .
Proof that both cannot hold. Suppose and held simultaneously. Then , because each and each . This contradicts . So at most one of the systems is solvable.
Lemma (finitely generated cones are closed). is a closed subset of .
Proof of the lemma. Argue by induction on the number of generators . For the cone is , closed. Carathéodory's theorem for cones states that every point of is a non-negative combination of a linearly independent subset of the columns: if with and the active columns are dependent, a dependency lets one decrease some to zero while keeping fixed and all coefficients non-negative, reducing the support. Hence
a finite union over the subsets whose columns are linearly independent. For each such , the map is a linear isomorphism onto its image, so it is a closed map on the closed set , and is closed. A finite union of closed sets is closed.
Proof of the dichotomy. Assume fails, that is . The cone is non-empty (it contains ), convex, and closed by the lemma. The singleton is compact and convex and disjoint from . The second geometric Hahn-Banach theorem 02.11.02 strictly separates them: there exist and scalars with
Because , taking gives , hence , so . It remains to show , i.e. for each column. Fix a column and a scalar ; then , so . Letting forces (otherwise the left side diverges to , exceeding the fixed bound ). Thus and , which is exactly . So whenever fails, holds, completing the dichotomy.
Bridge. This dichotomy builds toward the whole of linear-programming duality and appears again in the constraint-qualification analysis of nonlinear optimization. This is exactly the statement that a vector either lies in a finitely generated cone or is strictly separated from it, and the foundational reason the alternative is clean — never both, never neither — is the closedness lemma: separation of a point from a convex set certifies non-membership only when the set is closed, and finite generation forces closedness. The geometric step is dual to the membership question — the supporting functional produced by Hahn-Banach is precisely the dual variable that prices infeasibility. Putting these together, the columns become constraint gradients and becomes an objective gradient, so that Farkas reads "either the objective gradient is a non-negative combination of active constraint gradients (a KKT multiplier vector exists) or there is a feasible improving direction"; that reading generalises to the Karush-Kuhn-Tucker conditions under a linear constraint qualification.
Exercises Intermediate+
Advanced results Master
The fundamental theorem of linear inequalities and Carathéodory bounds
For , exactly one holds: either with , or there is a hyperplane containing linearly independent vectors from , with for all and . This sharpened Farkas — due to the column-geometry analysis systematised by Schrijver [Schrijver §7] — produces a combinatorial certificate: the separating hyperplane may be taken to pass through a basis of columns. The conic Carathéodory bound is its quantitative shadow: any is a non-negative combination of at most linearly independent columns. Both refinements come from the same independent-subset decomposition used to prove closedness; the certificate is rational whenever the data are rational, which is why Farkas underwrites exact infeasibility proofs for rational linear programs.
The Minkowski-Weyl equivalence
A convex cone is finitely generated ( for some ) if and only if it is polyhedral ( for some ). One direction: is polyhedral by inspection, and Exercise 5 gives , so is the dual of a polyhedral cone — which is again finitely generated by applying the first computation to a generating matrix of the polyhedral cone. The equivalence is the cone-level statement of LP duality: representing a cone by generators versus by constraints are dual descriptions, interchanged by polarity, and Farkas is the membership-test bridge between them [Rockafellar §19].
Helly's theorem and the alternative
Farkas sits inside a family of dichotomies governed by Helly's theorem: in , if every members of a finite family of convex sets have a common point, then all of them do. Rockafellar [Rockafellar §22] derives the theorems of the alternative and Helly from the same separation core. The Helly number matches the Carathéodory bound and the basis size in the fundamental theorem; all three count the same intrinsic dimension. Infeasibility of a system of linear inequalities is thereby locally certifiable: a system is infeasible iff some sub-system of at most inequalities already is, the LP analogue of compactness reducing global to finite.
Conic and semi-infinite generalisations
Replacing the non-negative orthant by a general closed convex cone with dual gives the conic Farkas lemma: provided a Slater interior-point condition holds (or the image cone is closed), exactly one of or is solvable. Without closedness — the generic situation for the semidefinite cone — the alternative degrades to an approximate form and strong duality can fail, exactly the gap repaired by constraint qualifications. The polyhedral case is the one place the dichotomy is unconditional, because finite generation forces closedness for free; every richer cone pays for separation with a regularity hypothesis.
Synthesis. Farkas' lemma is exactly the assertion that a vector either lies in a finitely generated cone or is strictly separated from it, and the central insight organising this unit is that the clean two-way alternative rests on one structural fact — finitely generated cones are closed — which is dual to the membership question through the bipolar identity . The foundational reason the polyhedral case needs no constraint qualification, while the conic case does, is that finite generation supplies closedness automatically whereas the second-order and semidefinite cones do not, so putting these together the Minkowski-Weyl equivalence, the Carathéodory and Helly bounds, and LP strong duality are all the same separation theorem read through different descriptions of the same cone. The result generalises the smooth Lagrange-multiplier picture to the non-smooth polyhedral setting and appears again in the Karush-Kuhn-Tucker conditions, where the columns are active constraint gradients and the separating functional is the multiplier vector. The bridge is polarity: generators and constraints are conjugate descriptions of a cone, Farkas is the test that passes between them, and duality theory is what that test becomes once an objective is attached.
Full proof set Master
Proposition 1 (homogeneous Farkas / closed-cone separation). Let and . Then , or there exists with for all and , and not both.
Proof. This is the Key theorem restated; the proof there established closedness of via the finite union over linearly independent column subsets (Carathéodory reduction), then strictly separated the compact set from the closed convex by the second geometric Hahn-Banach theorem 02.11.02, and used the cone scaling for all to push the separating functional to satisfy . Mutual exclusivity is the pairing when .
Proposition 2 (affine / inequality Farkas). Exactly one of (in ) and is solvable.
Proof. Feasibility of is equivalent to after introducing slacks and splitting with . Concretely, has a solution iff the standard-form system with has a solution. Apply Proposition 1 to the augmented matrix . The dual condition unpacks to , i.e. and ; together with and the sign flip this is precisely .
Proposition 3 (Gordan). Exactly one of and is solvable.
Proof. is solvable iff there are with and . The system in variables with the objective of maximising is a linear program; its optimal value exceeds iff has a solution. By Proposition 2 applied to the constraints, the value is iff there is a dual multiplier on the rows of with and the normalisation row giving , hence . Exclusivity: and force .
Proposition 4 (Stiemke). Exactly one of and is solvable.
Proof. The existence of with is equivalent to lying in the relative interior of together with being a linear subspace along the support — equivalently, no supporting hyperplane of at is proper. Its negation produces, by the supporting-hyperplane corollary of 02.11.02, a functional with for all and strict inequality for at least one (else the hyperplane would be improper), i.e. . Exclusivity: and give since every and some .
Proposition 5 (Carathéodory bound for cones). Every is a non-negative combination of at most linearly independent columns of .
Proof. Among all representations with , choose one with minimal. If the columns were linearly dependent, there is with ; assume some (else negate ). For , , and increasing to drives one coefficient to while keeping all coefficients , contradicting minimality of . So the active columns are independent, hence .
Connections Master
The separating-hyperplane engine is the geometric Hahn-Banach theorem of
02.11.02: the closed convex cone and the external point are strictly separated by exactly the second geometric form, and the supporting functional it returns is the Farkas certificate . Where that unit works in a general normed space and needs Zorn's lemma, the finite-dimensional specialisation here trades the choice principle for the explicit closedness lemma proved by Carathéodory reduction.The membership question is a non-negative solvability question for the linear system , sharpening the unrestricted solvability theory of
01.01.06: Kronecker-Capelli tests solvability with free via rank equality, while Farkas tests solvability under the sign constraint via cone membership, and the column-space geometry both rest on is the rank-nullity picture of01.01.05.The separating object is an affine hyperplane in the sense of
01.01.18: the wall that isolates from the cone is precisely a hyperplane, and the homogeneous cone case places it through the origin, making Farkas the constrained-feasibility incarnation of the affine-subspace separation studied there.Linear-programming strong duality and the Karush-Kuhn-Tucker multiplier theorem are the two headline consumers: LP duality is Farkas applied to the augmented "value " system (Exercise 7), and KKT existence under a linear constraint qualification is Farkas applied to the objective gradient against the active-constraint gradients, identifying the cone-membership coefficients as the multipliers.
Historical & philosophical context Master
Gyula Farkas published the lemma in its definitive form in Theorie der einfachen Ungleichungen [Farkas 1902] (Journal für die reine und angewandte Mathematik 124, 1-27), having developed it through the 1890s in connection with the mechanical principle of virtual work and Fourier's earlier study of systems of linear inequalities; Farkas sought to characterise exactly when a force can be expressed as a non-negative combination of constraint reaction forces. The strict-inequality alternative now bearing Gordan's name appeared earlier, in Paul Gordan's Über die Auflösung linearer Gleichungen mit reellen Coefficienten [Gordan 1873] (Mathematische Annalen 6, 23-28), in the context of invariant theory. Erich Stiemke gave the complementary strictly-positive-solution alternative in 1915, and Theodore Motzkin's 1936 Basel dissertation [Motzkin 1936] unified the family into the transposition theorem that contains Farkas, Gordan, and Stiemke as special cases.
The results were absorbed into convex analysis through the systematic separation-theorem treatments of Fenchel and, definitively, Rockafellar's Convex Analysis (1970), which placed Farkas, Helly, and the theorems of the alternative on the common foundation of separating hyperplanes for polyhedral convex sets. The practical reach widened with the rise of linear programming: Dantzig's simplex method (1947), the von Neumann duality theory of zero-sum games, and Kuhn and Tucker's 1951 nonlinear-programming paper all rest on the Farkas dichotomy, which supplies the constraint qualification under which multipliers provably exist. Schrijver's Theory of Linear and Integer Programming (1986) records the combinatorial and complexity-theoretic refinements, including the rational-certificate property that places linear-inequality infeasibility in the complexity class .
Bibliography Master
@article{farkas1902einfachen,
author = {Farkas, Gyula},
title = {Theorie der einfachen Ungleichungen},
journal = {Journal f\"ur die reine und angewandte Mathematik},
volume = {124},
pages = {1--27},
year = {1902}
}
@article{gordan1873aufloesung,
author = {Gordan, Paul},
title = {\"Uber die Aufl\"osung linearer Gleichungen mit reellen Coefficienten},
journal = {Mathematische Annalen},
volume = {6},
pages = {23--28},
year = {1873}
}
@phdthesis{motzkin1936beitraege,
author = {Motzkin, Theodore Samuel},
title = {Beitr\"age zur Theorie der linearen Ungleichungen},
school = {University of Basel},
year = {1936}
}
@book{rockafellar1970convex,
author = {Rockafellar, R. Tyrrell},
title = {Convex Analysis},
series = {Princeton Mathematical Series},
number = {28},
publisher = {Princeton University Press},
year = {1970}
}
@book{boyd2004convex,
author = {Boyd, Stephen and Vandenberghe, Lieven},
title = {Convex Optimization},
publisher = {Cambridge University Press},
year = {2004}
}
@book{schrijver1986theory,
author = {Schrijver, Alexander},
title = {Theory of Linear and Integer Programming},
series = {Wiley-Interscience Series in Discrete Mathematics},
publisher = {John Wiley \& Sons},
year = {1986}
}
@book{bental2001lectures,
author = {Ben-Tal, Aharon and Nemirovski, Arkadi},
title = {Lectures on Modern Convex Optimization},
series = {MPS-SIAM Series on Optimization},
publisher = {SIAM},
year = {2001}
}