Fourier-Motzkin elimination and Farkas' lemma over ℚ #
Fourier-Motzkin (FM) elimination is a variable-elimination procedure for rational linear inequalities: given a system Ax ≤ b in n+1 variables, eliminate the last variable by combining pairs of constraints (one with positive last coefficient, one with negative) to produce an equisatisfiable system in n variables.
From FM equisatisfiability we derive Farkas' lemma over ℚ: a rational linear
system is either feasible or admits a nonneg certificate of infeasibility. This
is the core duality theorem for rational linear programming — no topology, no
completeness, no ℝ detour. (Mathlib's Farkas, ProperCone.hyperplane_separation,
is the topological hyperplane-separation version over ℝ; this constructive ℚ
development is complementary.)
Main declarations #
Polyhedral.fmElim— one step of FM elimination (eliminate last variable)Polyhedral.fmElim_equisat— FM step preserves feasibilityPolyhedral.farkas— Farkas' lemma: feasible ∨ infeasibility certificate
Rational linear inequalities #
Dot product of two rational vectors indexed by Fin n.
Equations
- Polyhedral.dot u v = ∑ i : Fin n, u i * v i
Instances For
A linear inequality constraint: lhs · x ≤ rhs.
- lhs : Fin n → ℚ
- rhs : ℚ
Instances For
A constraint is satisfied by a point x when lhs · x ≤ rhs.
Equations
- c.sat x = (Polyhedral.dot c.lhs x ≤ c.rhs)
Instances For
A system of linear inequalities (a list of constraints).
Equations
- Polyhedral.System n = List (Polyhedral.Ineq n)
Instances For
Fourier-Motzkin Elimination Step #
The last coefficient of a constraint in n+1 variables.
Instances For
Combine a positive-last and negative-last constraint, eliminating the last variable.
Equations
Instances For
One step of FM elimination: partition constraints by sign of the last coefficient, project the zero ones, combine all positive × negative pairs.
Equations
- One or more equations did not get rendered due to their size.
Instances For
FM Equisatisfiability #
FM equisatisfiability: the original system (n+1 variables) is feasible iff the reduced system (n variables) is feasible.
Forward: project out last coordinate. Backward: find t in the interval defined by positive (upper bound) and negative (lower bound) constraints; the P×N combinations guarantee the interval is nonempty.
Farkas' Lemma #
An infeasibility certificate: nonneg weights (indexed by constraint position) such that the weighted combination of constraints yields 0·x ≤ negative.
- ws : Fin (List.length S) → ℚ
Instances For
Farkas' lemma over ℚ: a rational linear system is either feasible or has a nonneg certificate of infeasibility.
Proof by induction on n (number of variables), using FM elimination. Base case (0 variables): each constraint is 0 ≤ rhs. Inductive step: FM-eliminate → IH → extend backward or lift certificate.