Fourier-Motzkin Elimination, Farkas' Lemma, and Cancellation #
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.
Cancellation conditions for comparative probability #
@cite{kraft-pratt-seidenberg-1959}
Scott's cancellation framework for representability of comparative probability orderings by finitely additive measures. A comparative probability ordering ≿ is representable by a finitely additive measure iff it satisfies the cancellation property: no valid neutral portfolio has a strict member.
The hard direction (cancellation → representable) is an instance of LP duality / Farkas' lemma: the feasibility polytope {p ≥ 0 : Σpᵢ = 1, ordering constraints} is nonempty iff no dual certificate of infeasibility exists, and such a certificate corresponds exactly to a neutral portfolio with a strict member.
Main results #
Polyhedral.fmElim— one step of FM elimination (eliminate last variable)Polyhedral.fmElim_equisat— FM step preserves feasibilityPolyhedral.farkas— Farkas' lemma: feasible ∨ infeasibility certificaterepresentable_implies_cancellation— easy direction: measure existence → cancellationcancellation_implies_representable— hard direction: cancellation → measure existence (viafeasibleWeights,cancellation_nonempty,feasible_to_measure)fa_cancellation_fin3— FA axioms imply cancellation on Fin 3fa_cancellation_fin4— FA axioms imply cancellation on Fin 4 (inCancellation88.lean)theorem8a_fin3'— KPS Theorem 8a for n = 3 (via cancellation)
A system of linear inequalities (a list of constraints).
Equations
Instances For
Combine a positive-last and negative-last constraint, eliminating the last variable.
Equations
Instances For
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.
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.
A portfolio is a list of weighted comparisons.
Equations
Instances For
The weighted sum of comparison vectors at atom i.
Equations
- P.weightedSum i = (List.map (fun (wc : Core.Scale.WComparison n) => wc.weight * ↑(Core.Scale.comparisonVec n wc.left wc.right i)) P).sum
Instances For
A portfolio is neutral if weighted vectors sum to zero at every atom.
Equations
- P.isNeutral = ∀ (i : Fin n), P.weightedSum i = 0
Instances For
Easy direction: If μ represents the ordering, no neutral portfolio has a strict member. Each comparison contributes wⱼ·(μ(Aⱼ)−μ(Bⱼ)) ≥ 0 to the portfolio value; if any is strict, the value is positive. But by the interchange lemma, the value also equals Σᵢ μ({i})·weightedSum(i) = 0 by neutrality.
The feasibility polytope for measure representation: probability vectors
p : Fin n → ℚ that are nonneg, normalized, and faithfully encode the
ordering on disjoint pairs — exactly sys.ge ↑A ↑B ↔ A.sum p ≥ B.sum p.
The ↔ (rather than →) is essential: the forward direction ensures the
measure respects the ordering, while the backward direction ensures
strictness is preserved (no spurious ties).
Equations
Instances For
Scott's theorem (hard direction): if no valid neutral portfolio has a strict member, then a finitely additive measure exists representing the ordering. Decomposes into two steps:
cancellation_nonempty: Farkas / LP duality shows the feasibility polytope is nonempty when cancellation holds.feasible_to_measure: a feasible weight vector constructs a representingFinAddMeasure.
FA on Fin 3 implies the cancellation property.
Derived from the direct measure construction (theorem8a_fin3 in Defs.lean)
composed with the easy direction of Scott's theorem.
Cancellation follows from a "forward + strict" witness: positive weights p summing to 1 such that every valid comparison has p-value ≥ 0 and every strict comparison has p-value > 0. This avoids constructing a full representing measure.
Wrapper around cancellation_from_weights that replaces the two universally-quantified
obligations (hfwd, hstrict) with a single contrapositive condition:
for every disjoint pair (A, B) where A.sum p < B.sum p, we have ¬sys.ge ↑A ↑B.
Equal-sum pairs need bidirectionality (heq).
The proof of cancellation_from_weights does the hfwd/hstrict dispatch once;
each chamber only provides the ~5-10 ¬ge facts for "wrong-direction" pairs.
Pre-computed pair variant of cancellation_from_weights_fin4.
Instead of 256-case dispatch via finset_fin4_eq, the caller provides
explicit lists of critical (A,B) pairs and proves coverage via native_decide.
Empty-set cases are handled internally via ge_empty_contra.
When weights are generic (no two nonempty disjoint subsets have equal sum), cancellation reduces to a single forward obligation: sys.ge ↑A ↑B → A.sum p ≥ B.sum p. The strict direction and equal-sum bidirectionality are both free:
- strict: contrapositive of hfwd (if A.sum p < B.sum p then ¬sys.ge ↑A ↑B)
- heq: vacuously true (genericity rules out equal-sum disjoint pairs)
Classify all Finset (Fin 4) into one of 16 explicit values.
¬ge({1,3}, {0,2}) from singleton hypotheses via additive decomposition. Route A (¬ge({1},{0})): ge({1,3},{0,2}) → additive ge({0,2},{0,3}) via ge({2},{3}) → trans → ge({1,3},{0,3}) → additive → ge({1},{0}) → contradiction. Route B (¬ge({3},{2})): ge({1,3},{0,2}) → additive ge({0,2},{1,2}) via ge({0},{1}) → trans → ge({1,3},{1,2}) → additive → ge({3},{2}) → contradiction.
¬ge({2,3}, {0,1}) from singleton hypotheses via additive decomposition. Route A (¬ge({2},{0})): ge({2,3},{0,1}) → additive ge({0,1},{0,3}) via ge({1},{3}) → trans → ge({2,3},{0,3}) → additive → ge({2},{0}) → contradiction. Route B (¬ge({3},{1})): ge({2,3},{0,1}) → additive ge({0,1},{1,2}) via ge({0},{2}) → trans → ge({2,3},{1,2}) → additive → ge({3},{1}) → contradiction.
Cancellation transfers through permutations (via representability).
Theorem 8a for Fin 3 (via cancellation): every FA system on Fin 3 is representable by a finitely additive probability measure.