Fourier-Motzkin elimination in two variables
ProvedSmaleNinth.two_variable_lp_fourier_motzkinWrite the constraints of a two-variable system as for , where and . Then the system has a solution if and only if the following one-variable system in the unknown has a solution:
This is Fourier–Motzkin elimination of the variable . In one direction, each inequality of the reduced system is a nonnegative combination of the original ones: the pair inequality is times constraint plus times constraint , in which the terms cancel. In the other direction, a solution of the reduced system is extended to a solution of the original one by choosing between the largest lower bound and the smallest upper bound ; the pair inequalities say exactly that every lower bound is at most every upper bound, and the degenerate cases where one or both families are empty are immediate.
The reduced system has at most inequalities in one variable, so the elimination turns a two-variable feasibility question into a one-variable one at quadratic cost. Combined with a one-variable decision procedure it gives a polynomial-time algorithm for two-variable linear programming in a machine model with indirect addressing, which is the first nontrivial case of the fixed-dimension results of Megiddo and Dyer. For the general problem the elimination is of no use, since eliminating variables in turn can square the number of constraints each time; that blow-up is precisely why Smale's ninth problem is not settled by this classical method.
import Definitions.Def_Polyhedron /-! Fourier-Motzkin elimination in two variables: feasibility of a two-variable system is equivalent to feasibility of a one-variable system built from the constraints with zero second coefficient and from the pairs of constraints with opposite second coefficients. Source: J. B. J. Fourier (1826) and T. Motzkin (1936); see A. Schrijver, *Theory of Linear and Integer Programming*, Wiley 1986, Section 12.2, and Bertsimas-Tsitsiklis, *Introduction to Linear Optimization*, Athena Scientific 1997, Section 2.8. -/ open Matrix LinearOptimization /-- **Fourier-Motzkin elimination, two variables.** The system `Ax >= c` in two variables is feasible if and only if the one-variable system obtained by eliminating the second variable is feasible. -/
theorem SmaleNinth.two_variable_lp_fourier_motzkin {m : ℕ} (A : Matrix (Fin m) (Fin 2) ℝ)
(c : Fin m → ℝ) :
(polyhedron A c).Nonempty ↔
∃ t : ℝ,
(∀ i : Fin m, A i 1 = 0 → c i ≤ A i 0 * t) ∧
(∀ i j : Fin m, 0 < A i 1 → A j 1 < 0 →
A i 1 * c j - A j 1 * c i ≤ (A i 1 * A j 0 - A j 1 * A i 0) * t) := by sorry