Farkas's Lemma in Two Dimensions

This Demonstration shows a two-dimensional graphical exposition of Farkas's lemma: let be a matrix and be a vector. Then either (1) there is a vector so that and ; or (2) there is a vector satisfying and . As is well known, geometrically this statement is equivalent to saying that is either in the cone spanned by or not. In this Demonstration, and are shown by green and orange lines and the inside of the cone is filled with light blue if (1) is true and with light red if (2) is true.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


Consider a linear system equation , where is in general an matrix and and are respectively an and an vector. Then Farkas's lemma states that one but not both of the following two statements is true: (1) there is a vector solving the equation; or (2) there is a vector satisfying and , where is the zero vector. Geometrically, this is equivalent to saying that: (1) is in the cone spanned by ; or (2) is not in . To show the equivalence is simple. The first statement requires directly that is in , so that . If (1) does not hold, then is not in ; therefore, we will find a separating hyperplane between and . In that case, we can find a vector whose angles with each row of are at most . Because such a is included in , its angle with must be greater than . In order to understand this lemma intuitively, it is more or less sufficient to understand the two-dimensional case.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.