In mathematics, Farkas' lemma is a solvability theorem for a finite system of linear inequalities. It was originally proven by the Hungarian mathematician Gyula Farkas.[1]
Farkas' lemma is the key result underpinning the linear programming duality and has played a central role in the development of mathematical optimization (alternatively, mathematical programming). It is used amongst other things in the proof of the Karush–Kuhn–Tucker theorem in nonlinear programming.[2]
Remarkably, in the area of the foundations of quantum theory, the lemma also underlies the complete set of Bell inequalities in the form of necessary and sufficient conditions for the existence of a local hidden-variable theory, given data from any specific set of measurements.[3]
Generalizations of the Farkas' lemma are about the solvability theorem for convex inequalities,[4] i.e., infinite system of linear inequalities. Farkas' lemma belongs to a class of statements called "theorems of the alternative": a theorem stating that exactly one of two systems has a solution.[5]
There are a number of slightly different (but equivalent) formulations of the lemma in the literature. The one given here is due to Gale, Kuhn and Tucker (1951).[6]
Here, the notation
means that all components of the vector
are nonnegative.
Let m, n = 2,
and
The lemma says that exactly one of the following two statements must be true (depending on b1 and b2):
- There exist x1 ≥ 0, x2 ≥ 0 such that 6x1 + 4x2 = b1 and 3x1 = b2, or
- There exist y1, y2 such that 6y1 + 3y2 ≥ 0, 4y1 ≥ 0, and b1 y1 + b2 y2 < 0.
Here is a proof of the lemma in this special case:
- If b2 ≥ 0 and b1 − 2b2 ≥ 0, then option 1 is true, since the solution of the linear equations is
and
Option 2 is false, since
so if the right-hand side is positive, the left-hand side must be positive too.
- Otherwise, option 1 is false, since the unique solution of the linear equations is not weakly positive. But in this case, option 2 is true:
- If b2 < 0, then we can take e.g. y1 = 0 and y2 = 1.
- If b1 − 2b2 < 0, then, for some number B > 0, b1 = 2b2 − B, so:
Thus we can take, for example, y1 = 1, y2 = −2.
Consider the closed convex cone
spanned by the columns of A; that is,
![{\displaystyle C(\mathbf {A} )=\{\mathbf {A} \mathbf {x} \mid \mathbf {x} \geq 0\}.}](//wikimedia.org/api/rest_v1/media/math/render/svg/f2cf29da9cff36ac7648a71884a94c28f851c520)
Observe that
is the set of the vectors b for which the first assertion in the statement of Farkas' lemma holds. On the other hand, the vector y in the second assertion is orthogonal to a hyperplane that separates b and
The lemma follows from the observation that b belongs to
if and only if there is no hyperplane that separates it from ![{\displaystyle C(\mathbf {A} ).}](//wikimedia.org/api/rest_v1/media/math/render/svg/ee0d9bf0e2589e36c2c776e951ae0b2814935437)
More precisely, let
denote the columns of A. In terms of these vectors, Farkas' lemma states that exactly one of the following two statements is true:
- There exist non-negative coefficients
such that ![{\displaystyle \mathbf {b} =x_{1}\mathbf {a} _{1}+\dots +x_{n}\mathbf {a} _{n}.}](//wikimedia.org/api/rest_v1/media/math/render/svg/43c8c5efccc41891dcacf9dbafffa9a433f1d1a0)
- There exists a vector
such that
for
and ![{\displaystyle \mathbf {b} ^{\top }\mathbf {y} <0.}](//wikimedia.org/api/rest_v1/media/math/render/svg/8f9e3df3b3a20f8a50b6e3109c4a97fbb08504d3)
The sums
with nonnegative coefficients
form the cone spanned by the columns of A. Therefore, the first statement tells that b belongs to ![{\displaystyle C(\mathbf {A} ).}](//wikimedia.org/api/rest_v1/media/math/render/svg/ee0d9bf0e2589e36c2c776e951ae0b2814935437)
The second statement tells that there exists a vector y such that the angle of y with the vectors ai is at most 90°, while the angle of y with the vector b is more than 90°. The hyperplane normal to this vector has the vectors ai on one side and the vector b on the other side. Hence, this hyperplane separates the cone spanned by
from the vector b.
For example, let n, m = 2, a1 = (1, 0)T, and a2 = (1, 1)T. The convex cone spanned by a1 and a2 can be seen as a wedge-shaped slice of the first quadrant in the xy plane. Now, suppose b = (0, 1). Certainly, b is not in the convex cone a1x1 + a2x2. Hence, there must be a separating hyperplane. Let y = (1, −1)T. We can see that a1 · y = 1, a2 · y = 0, and b · y = −1. Hence, the hyperplane with normal y indeed separates the convex cone a1x1 + a2x2 from b.
A particularly suggestive and easy-to-remember version is the following: if a set of linear inequalities has no solution, then a contradiction can be produced from it by linear combination with nonnegative coefficients. In formulas: if
is unsolvable then
has a solution.[7] Note that
is a combination of the left-hand sides,
a combination of the right-hand side of the inequalities. Since the positive combination produces a zero vector on the left and a −1 on the right, the contradiction is apparent.
Thus, Farkas' lemma can be viewed as a theorem of logical completeness:
is a set of "axioms", the linear combinations are the "derivation rules", and the lemma says that, if the set of axioms is inconsistent, then it can be refuted using the derivation rules.[8]: 92–94
Farkas' lemma implies that the decision problem "Given a system of linear equations, does it have a non-negative solution?" is in the intersection of NP and co-NP. This is because, according to the lemma, both a "yes" answer and a "no" answer have a proof that can be verified in polynomial time. The problems in the intersection
are also called well-characterized problems. It is a long-standing open question whether
is equal to P. In particular, the question of whether a system of linear equations has a non-negative solution was not known to be in P, until it was proved using the ellipsoid method.[9]: 25
The Farkas Lemma has several variants with different sign constraints (the first one is the original version):[8]: 92
- Either
has a solution
or
has a solution
with ![{\displaystyle \mathbf {b} ^{\top }\mathbf {y} <0.}](//wikimedia.org/api/rest_v1/media/math/render/svg/8f9e3df3b3a20f8a50b6e3109c4a97fbb08504d3)
- Either
has a solution
or
has a solution
with ![{\displaystyle \mathbf {b} ^{\top }\mathbf {y} <0}](//wikimedia.org/api/rest_v1/media/math/render/svg/05c214ea5f2132966fb5e131af26d98c6a7a41b1)
- Either
has a solution
or
has a solution
with
.
- Either
has a solution
or
has a solution
with ![{\displaystyle \mathbf {b} ^{\top }\mathbf {y} \neq 0.}](//wikimedia.org/api/rest_v1/media/math/render/svg/0b7f3a6c44e147d8cd6237088e43f03b5c065eb7)
The latter variant is mentioned for completeness; it is not actually a "Farkas lemma" since it contains only equalities. Its proof is an exercise in linear algebra.
There are also Farkas-like lemmas for integer programs.[9]: 12--14 For systems of equations, the lemma is simple:
- Assume that A and b have rational coefficients. Then either
has an integral solution
or there exists
such that
is integral and
is not integral.
For system of inequalities, the lemma is much more complicated. It is based on the following two rules of inference:
- Given inequalities
and coefficients
, infer the inequality
.
- Given an inequality
, infer the inequality
.
The lemma says that:
- Assume that A and b have rational coefficients. Then either
has an integral solution
, or it is possible to infer from
using finitely many applications of inference rules 1,2 the inequality
.
The variants are summarized in the table below.
More information
,
...
System |
Constraints on x |
|
Alternative system |
Constraints on y |
![{\displaystyle \mathbf {Ax} =\mathbf {b} }](//wikimedia.org/api/rest_v1/media/math/render/svg/e68388b7df59f536a3bef4e70def2f2bb36f48c0) |
![{\displaystyle \mathbf {x} \in \mathbb {R} ^{n},x\geq 0}](//wikimedia.org/api/rest_v1/media/math/render/svg/21433b91462c00977b227a6dd713792cad2f7f7b) |
|
, ![{\displaystyle \mathbf {b} ^{\top }\mathbf {y} <0}](//wikimedia.org/api/rest_v1/media/math/render/svg/05c214ea5f2132966fb5e131af26d98c6a7a41b1) |
![{\displaystyle \mathbf {y} \in \mathbb {R} ^{m}}](//wikimedia.org/api/rest_v1/media/math/render/svg/bf090a9d337583d991036e368ae28901426943c2) |
![{\displaystyle \mathbf {Ax} \leq \mathbf {b} }](//wikimedia.org/api/rest_v1/media/math/render/svg/365216d03c123c74bd4affa0f3ec64180a78f64a) |
![{\displaystyle \mathbf {x} \in \mathbb {R} ^{n},x\geq 0}](//wikimedia.org/api/rest_v1/media/math/render/svg/21433b91462c00977b227a6dd713792cad2f7f7b) |
|
, ![{\displaystyle \mathbf {b} ^{\top }\mathbf {y} <0}](//wikimedia.org/api/rest_v1/media/math/render/svg/05c214ea5f2132966fb5e131af26d98c6a7a41b1) |
, ![{\displaystyle \mathbf {y} \geq 0}](//wikimedia.org/api/rest_v1/media/math/render/svg/bc982183a9d28a32329f866818d46de967051bb2) |
![{\displaystyle \mathbf {Ax} \leq \mathbf {b} }](//wikimedia.org/api/rest_v1/media/math/render/svg/365216d03c123c74bd4affa0f3ec64180a78f64a) |
![{\displaystyle \mathbf {x} \in \mathbb {R} ^{n}}](//wikimedia.org/api/rest_v1/media/math/render/svg/f33c7feddfbe1e5c87647a55639651d9fb2f23de) |
|
, ![{\displaystyle \mathbf {b} ^{\top }\mathbf {y} <0}](//wikimedia.org/api/rest_v1/media/math/render/svg/05c214ea5f2132966fb5e131af26d98c6a7a41b1) |
, ![{\displaystyle \mathbf {y} \geq 0}](//wikimedia.org/api/rest_v1/media/math/render/svg/bc982183a9d28a32329f866818d46de967051bb2) |
![{\displaystyle \mathbf {Ax} =\mathbf {b} }](//wikimedia.org/api/rest_v1/media/math/render/svg/e68388b7df59f536a3bef4e70def2f2bb36f48c0) |
![{\displaystyle \mathbf {x} \in \mathbb {R} ^{n}}](//wikimedia.org/api/rest_v1/media/math/render/svg/f33c7feddfbe1e5c87647a55639651d9fb2f23de) |
|
, ![{\displaystyle \mathbf {b} ^{\top }\mathbf {y} \neq 0}](//wikimedia.org/api/rest_v1/media/math/render/svg/71b83760f839c147245cb9d72b0aa5cf83b82534) |
![{\displaystyle \mathbf {y} \in \mathbb {R} ^{m}}](//wikimedia.org/api/rest_v1/media/math/render/svg/bf090a9d337583d991036e368ae28901426943c2) |
![{\displaystyle \mathbf {Ax} =\mathbf {b} }](//wikimedia.org/api/rest_v1/media/math/render/svg/e68388b7df59f536a3bef4e70def2f2bb36f48c0) |
![{\displaystyle \mathbf {x} \in \mathbb {Z} ^{n}}](//wikimedia.org/api/rest_v1/media/math/render/svg/2ded1eb9833ca54d0bcec19f2b2d707e238cd7cb) |
|
integral, not integral |
![{\displaystyle \mathbf {y} \in \mathbb {R} ^{n}}](//wikimedia.org/api/rest_v1/media/math/render/svg/78d65a808875b2392b1c67d1dcada12c42479d70) |
![{\displaystyle \mathbf {Ax} \leq \mathbf {b} }](//wikimedia.org/api/rest_v1/media/math/render/svg/365216d03c123c74bd4affa0f3ec64180a78f64a) |
![{\displaystyle \mathbf {x} \in \mathbb {Z} ^{n},x\geq 0}](//wikimedia.org/api/rest_v1/media/math/render/svg/844d1d1d1095bddd437be936b7458d78fac1b7d5) |
|
can be inferred from ![{\displaystyle \mathbf {Ax} \leq \mathbf {b} }](//wikimedia.org/api/rest_v1/media/math/render/svg/365216d03c123c74bd4affa0f3ec64180a78f64a) |
|
Close
Generalized Farkas' lemma can be interpreted geometrically as follows: either a vector is in a given closed convex cone, or there exists a hyperplane separating the vector from the cone; there are no other possibilities. The closedness condition is necessary, see Separation theorem I in Hyperplane separation theorem. For original Farkas' lemma,
is the nonnegative orthant
hence the closedness condition holds automatically. Indeed, for polyhedral convex cone, i.e., there exists a
such that
the closedness condition holds automatically. In convex optimization, various kinds of constraint qualification, e.g. Slater's condition, are responsible for closedness of the underlying convex cone ![{\displaystyle C(\mathbf {A} ).}](//wikimedia.org/api/rest_v1/media/math/render/svg/ee0d9bf0e2589e36c2c776e951ae0b2814935437)
By setting
and
in generalized Farkas' lemma, we obtain the following corollary about the solvability for a finite system of linear equalities:
Farkas's lemma can be varied to many further theorems of alternative by simple modifications,[5] such as Gordan's theorem: Either
has a solution x, or
has a nonzero solution y with y ≥ 0.
Common applications of Farkas' lemma include proving the strong duality theorem associated with linear programming and the Karush–Kuhn–Tucker conditions. An extension of Farkas' lemma can be used to analyze the strong duality conditions for and construct the dual of a semidefinite program. It is sufficient to prove the existence of the Karush–Kuhn–Tucker conditions using the Fredholm alternative but for the condition to be necessary, one must apply von Neumann's minimax theorem to show the equations derived by Cauchy are not violated.
Grötschel, Martin; Lovász, László; Schrijver, Alexander (1993), Geometric algorithms and combinatorial optimization, Algorithms and Combinatorics, vol. 2 (2nd ed.), Springer-Verlag, Berlin, doi:10.1007/978-3-642-78240-4, ISBN 978-3-642-78242-8, MR 1261419