Under the nonnegative-pairing convention for the dual cone, follows from . Conversely, if , separation from a closed convex cone gives a separating nonnegative on all generators and negative on . That is a copositive matrix, so . This proves the displayed equality using closedness of the completely positive cone.
Farkas' lemma Created 2026-10-07 Updated 2026-10-14
For a real matrix and a vector , exactly one of the following systems has a solution:
The linear inequalities here are componentwise. In the first system is nonnegative; in the second system is unrestricted in sign. The second system is a certificate that the first has no feasible point. This nonnegative-equations alternative is developed in Boyd and Vandenberghe, Convex Optimization slides, §5.34.
Build the target, or separate it. Write the columns of as . Then is a conic combination: its coefficients must be nonnegative, but need not sum to one. The obtainable targets form the finitely generated cone
A solution explains how to build from those columns. A certificate instead defines a linear functional . The condition says that its dot product with every generating column is nonnegative, and hence with every point of . But places the target strictly on the other side of the hyperplane . Thus belongs to the dual cone of and rules out every allowed conic combination at once.
A certificate that can be checked by eye. Take the identity matrix
Here is the nonnegative orthant. The equation forces , violating . The certificate gives
The linear functional simply reads the first coordinate: all allowed column combinations have a nonnegative first coordinate, while has first coordinate . For comparison, the target is obtained with .
Figure 1.
Nonnegative column combinations lie in a cone, while a Farkas certificate separates the target
. For , the shaded nonnegative orthant is the conic hull of the two columns. The hyperplane for is the vertical axis; lies strictly on its negative side. The obtainable target illustrates the other alternative. Details.
Why this is useful and striking. A successful search can exhibit one feasible point; an unsuccessful search alone cannot explain why every candidate fails. Farkas' lemma guarantees an equally concrete witness of impossibility for this finite linear problem. Once is supplied, verification needs only matrix multiplication, sign tests and one dot product. The same idea gives a Farkas certificate for linear inequalities and underlies linear programming duality.
Brief geometric proof. The two systems cannot both hold, because they would imply
For existence of a certificate when , closedness of finitely generated cones makes a closed convex cone, so separation from a closed convex cone supplies and for every . Testing each column gives . Concretely, let be the Euclidean projection onto a convex set of onto and set . The projection inequality gives for . Testing and gives , whence . In the example, and . Alternatively, the Fenchel-Moreau theorem applied to the cone's indicator functional proves the same separation through its polar cone.
An original historical source is Julius Farkas's [ref]. The linked archival record verifies the author, title and publication details.
If , let be a nearest point of the closed convex cone to . Existence follows by minimizing the continuous squared distance on a sufficiently large compact ball. The first-order minimization inequality is for every . Set . Taking and , both in the cone, gives . Consequently
The cone's test-weight characterization again yields almost surely. This is separation from a closed convex cone with the sign needed for
The strict benefit is already available at the initial date, even if the terminal payoff happens to be zero.
Let the finite primal supremum be . First it is attained. The set
is a finitely generated cone, hence closed by the argument in the root Solution. For a sequence of primal feasible points whose values approach , the pairs belong to . Their limit therefore belongs to . It gives a feasible point with , so necessarily .
Let index the tight primal inequalities at and let index its zero coordinates. Consider the closed convex cone generated by for and for . If were outside this cone, separation from a closed convex cone would give a direction with
For sufficiently small positive , remains a feasible point: the active constraints have the required signs, and every inactive constraint retains its positive slack. Its larger objective contradicts optimality. Therefore there are , supported on , and , supported on , such that
This makes a dual feasible point. Moreover, the support restrictions give
Together with weak duality, this proves strong duality and dual attainment:
For a convex cone in an inner product space, use the nonnegative-pairing convention
Here the pairing is the Frobenius inner product on real symmetric matrices. Let be the conic hull of the nonnegative rank-one matrices , and let . For , . This extends to conic combinations, and by continuity to their limits. Hence .
For the converse, if , separation from a closed convex cone supplies a symmetric with
In particular for every , so . The negative pairing then excludes from . Therefore
The same generator test gives . This is the duality of copositive and completely positive cones; the next argument removes the closure.