Exact integer tableau pivoting and lexicographic minimum-ratio rule #
This module implements division-exact (Bareiss-style) integer tableau pivoting and the
lexicographic minimum-ratio test for linear systems A z = b, z ≥ 0
([vS07], Sections 3.5–3.6, eqs. (3.11)–(3.19), Exercises 3.8 and 3.10).
Given an integer constraint matrix A : Matrix (Fin r) ι ℤ and right-hand side b : Fin r → ℤ,
an IntegerTableau r ι maintains an ordered array of basic variables basis : Fin r → ι, an
integer tableau matrix mat : Matrix (Fin r) ι ℤ, an integer right-hand side rhs : Fin r → ℤ,
and a positive basis determinant detVal : ℤ. The validity invariant (IntegerTableau.IsValid)
asserts that with B := A.submatrix id T.basis and σ := B.det.sign, B.det ≠ 0,
detVal = σ * B.det > 0, mat = (σ • B.adjugate) * A, and rhs = (σ • B.adjugate) *ᵥ b, so
that the basic columns of mat equal detVal • 1 ([vS07], eq. (3.17)).
When pivoting on leaving row pRow and entering variable enter with positive pivot element
p = T.mat pRow enter > 0, row pRow is kept unchanged, and every other row i ≠ pRow is
replaced by (p * row_i - T.mat i enter * row_pRow) / T.detVal ([vS07], Exercise 3.8).
The algebraic identity F * C = d • C' proves that T.detVal divides every numerator exactly
(IsValid.detVal_dvd_pivotMat, IsValid.detVal_dvd_pivotRhs), that pivot preserves IsValid
(IsValid.pivot), and that all intermediate integer entries satisfy the factorial determinant
bound r! * H ^ r (IsValid.abs_mat_le, IsValid.abs_rhs_le).
When A contains an identity slack block A.submatrix id slack = 1, the cofactor matrix
C = σ • B.adjugate is stored verbatim in the slack columns T.mat.submatrix id slack
([vS07], eq. (3.19)). Ordering the augmented right-hand side rows (rhs i, C i 0, ..., C i (r - 1)) lexicographically (lexRow, IsLexFeasible) resolves degeneracy without cycling:
invertibility of C makes the integer cross-multiplied lexico-minimum ratio test
(lexMinRatioRow?, [vS07], Exercise 3.10) yield a unique leaving row whenever the
entering column has a positive entry (IsValid.lexMinRatioRow?_eq_some_iff), preserves
lexicographic feasibility (IsValid.isLexFeasible_pivot), depends only on the basis set
(IsValid.lex_perm), and is an exact involution (IsValid.lexPivot_involutive).
Main definitions #
Cslib.Algorithms.Lean.Simplex.LexLt: computable strict lexicographic order onFin n → ℤ.Cslib.Algorithms.Lean.Simplex.IntegerTableau: integer tableau with ordered basic-variable array.Cslib.Algorithms.Lean.Simplex.IntegerTableau.init,pivot: initialization and exact pivot.Cslib.Algorithms.Lean.Simplex.IntegerTableau.IsValid: cofactor/determinant invariant (3.17).Cslib.Algorithms.Lean.Simplex.IntegerTableau.basicSolRat: rational basic solution overℚ.Cslib.Algorithms.Lean.Simplex.IntegerTableau.lexRow,IsLexFeasible,lexRatioLt,lexMinRatioRow?: lexicographic perturbation (3.19) and ratio test (Exercise 3.10).
Main results #
Cslib.Algorithms.Lean.Simplex.IntegerTableau.IsValid.detVal_dvd_pivotMat,IsValid.detVal_dvd_pivotRhs: exact integer divisibility of pivot numerators (Section 3.5, Exercise 3.8).Cslib.Algorithms.Lean.Simplex.IntegerTableau.IsValid.pivot: pivoting preservesIsValid.Cslib.Algorithms.Lean.Simplex.IntegerTableau.IsValid.abs_mat_le,IsValid.abs_rhs_le: Leibniz/Cramer magnitude boundr! * H ^ ron all tableau entries.Cslib.Algorithms.Lean.Simplex.IntegerTableau.IsValid.lexMinRatioRow?_eq_some_iff,IsValid.isLexFeasible_pivot,IsValid.lexPivot_involutive: uniqueness, feasibility preservation, and exact reversibility of lexicographic integer pivoting (Section 3.6, Exercise 3.10).
References #
- B. von Stengel, Equilibrium Computation for Two-Player Games in Strategic and Extensive Form, Sections 3.5–3.6 (pp. 63–66) and Exercises 3.8, 3.10 (p. 78)
Exact integer tableau #
An exact integer pivoting tableau for A z = b with r rows and variable index type ι
([vS07], Sections 3.5–3.6, eqs. (3.17) and (3.19), Exercise 3.10).
Exact integer pivot on leaving row pRow and entering variable enter
([vS07], Section 3.5, Exercise 3.8): row pRow stays unchanged, and every row i ≠ pRow
is replaced by (p * row_i - T.mat i enter * row_pRow) / T.detVal where p = T.mat pRow enter.
The finite set of basic variables of T.
Validity invariant of an integer tableau for (A, b) ([vS07], eq. (3.17)):
with basis matrix B = A.submatrix id T.basis and sign σ = B.det.sign, B.det ≠ 0,
detVal = σ * B.det > 0, mat = (σ • adjugate B) * A, and rhs = (σ • adjugate B) *ᵥ b.
The basis set has cardinality r.
When A.submatrix id slack = 1, the slack columns of T.mat store the cofactor matrix
σ • adjugate B ([vS07], eq. (3.19)).
Two valid tableaux with the same ordered basis are identical.
Permuting the ordered basis permutes the rows of a valid tableau without changing detVal.
Exact pivot divisibility and invariant preservation (Section 3.5, Exercise 3.8) #
Exact integer divisibility of tableau pivot numerators ([vS07], Section 3.5,
pp. 64–65, Exercise 3.8): for every non-pivot row i ≠ pRow and column j, the previous
determinant T.detVal divides T.mat pRow enter * T.mat i j - T.mat i enter * T.mat pRow j.
Exact integer divisibility of right-hand side pivot numerators ([vS07], Section 3.5, Exercise 3.8).
Integer pivoting preserves validity ([vS07], Section 3.5, eq. (3.17)):
pivoting on a positive pivot element T.mat pRow enter > 0 yields a valid tableau for (A, b).
Coefficient magnitude bound for integer tableau entries ([vS07], Section 3.5,
p. 65): if every entry of A has absolute value at most H, then every entry of T.mat has
absolute value at most r! * H ^ r.
Coefficient magnitude bound for integer tableau right-hand sides ([vS07], Section 3.5, p. 65).
Rational basic solution and edge rays #
The rational basic solution z : ι → ℚ of T: rhs i / detVal on basis i, and 0 on
nonbasic variables.
The rational basic solution of a valid tableau satisfies A *ᵥ z = b over ℚ.
The nonbasic ray direction rayRat T enter obtained by increasing a nonbasic variable enter:
it places 1 on enter, -T.mat k enter / T.detVal on T.basis k, and 0 elsewhere.
For any nonbasic enter ∉ T.basisSet, rayRat T enter lies in the kernel of A over ℚ
and satisfies rayRat T enter enter = 1.
If the homogeneous cone {z ≥ 0 | A z = 0} is trivial, then every nonbasic column enter
has at least one strictly positive entry in any valid tableau.
Lexicographic perturbation and lexico-minimum ratio test (Section 3.6, Exercise 3.10) #
The (r + 1)-tuple (T.rhs i, C i 0, ..., C i (r - 1)) representing the lexicographically
perturbed right-hand side of row i in eq. (3.19) of [vS07], where C is read directly
from the slack columns T.mat i (slack k).
Lexicographic feasibility of an integer tableau ([vS07], Section 3.6, eq. (3.19)):
every perturbed right-hand side row (T.rhs i, C i 0, ..., C i (r - 1)) is lexicographically
positive.
Instances For
Lexicographic feasibility implies ordinary nonnegativity 0 ≤ T.rhs i.
Lexicographic feasibility implies ordinary nonnegativity 0 ≤ T.basicSolRat j.
init is lexicographically feasible whenever 0 ≤ b and A.submatrix id slack = 1.
Cross-multiplied integer lexicographic ratio comparison between rows i₁ and i₂ for
entering column enter ([vS07], Section 3.6, Exercise 3.10): represents
(1 / T.mat i₁ enter) • lexRow i₁ <_{lex} (1 / T.mat i₂ enter) • lexRow i₂ without fractions.
Instances For
Because the slack submatrix C = σ • adjugate B is nonsingular, no two distinct rows can tie
in the lexicographic ratio test.
Distinct positive-pivot rows are strictly ordered by lexRatioLt.
Computable lexicographic minimum-ratio leaving-row selector ([vS07], Section 3.6,
Exercise 3.10): returns the unique row minimizing (1 / T.mat i enter) • lexRow i lexicographically
among all rows with 0 < T.mat i enter, or none if no positive pivot entry exists.
Specification of lexMinRatioRow?: it returns some pRow iff pRow is the unique strict
lexicographic minimum-ratio row among rows with positive pivot entry
([vS07], Section 3.6, Exercise 3.10).
In a bounded system, lexMinRatioRow? always selects a leaving row for any nonbasic entering
variable.
Scaled update law for lexRow under an exact integer pivot: for i ≠ pRow,
T.detVal • (T.pivot pRow enter).lexRow slack i = T.mat pRow enter • T.lexRow slack i - T.mat i enter • T.lexRow slack pRow.
Lexicographic feasibility is preserved by a lexico-minimum-ratio pivot ([vS07], Section 3.6, eq. (3.19)).
Exact involution of lexicographic integer pivoting: if enter enters and leave = T.basis pRow leaves via lexMinRatioRow?, then pivoting leave back into T.pivot pRow enter chooses
the exact same row pRow and restores the exact tableau T.
Lexicographic feasibility and the leaving variable chosen by lexMinRatioRow? are invariant
under permuting the ordered basis array.