Bareiss fraction-free Gauss–Jordan elimination and Sylvester minor identities #
This module develops the pure matrix theory behind fraction-free (Bareiss / Edmonds) Gauss–Jordan elimination and reduced row echelon form over fields and the integers:
- Bordering determinants (
Matrix.border) satisfy the Schur-complement expansionMatrix.det_border, yielding both the 2×2 Sylvester / Desnanot–Jacobi identity (Matrix.det_mul_det_fromBlocks_fin2) and the upward Gauss–Jordan minor identity (Matrix.det_mul_det_border_updateCol). - For a matrix
A : Matrix (Fin m) (Fin n) Rand pivot selectionsS : Fin k → Fin m,C : Fin k → Fin n,Matrix.bareissMatrix A S Cstores the exactk × kminor determinants on pivoted rowsS aand(k + 1) × (k + 1)minor determinants on unpivoted rows. - Over
ℤ, every Bareiss–Jordan step preserves exact integer divisibility bypivotDet A S C(Matrix.pivotDet_dvd_bareissStep_int), computes the next minor viaInt.ediv(Matrix.bareissStep_ediv_eq_int), and obeys the Hadamard/factorial minor bound (Matrix.abs_bareissMatrix_le). - Over any field
K, scaling by(pivotDet A S C)⁻¹yieldsMatrix.rrefOfBareiss A S C, which preserves row space, rank, and kernel, produces aLinearIndependentrow basis, aLinearIndependentkernel basis (Matrix.kernelBasisVec) spanningLinearMap.ker A.mulVecLin, aMatrix.IsReducedRowEchelon/Matrix.IsPivotedBypresentation under row permutation, and a canonical solution vectorMatrix.solveVec A S C bwheneverA *ᵥ x = bis consistent.
References #
- A. Schrijver, Theory of Linear and Integer Programming [Sch86].
Block bordering and Sylvester / Cramer–Jordan determinant identities #
Sylvester / Desnanot–Jacobi 2×2 determinant identity: multiplying a (k + 2) × (k + 2)
block matrix determinant by its invertible k × k leading principal minor equals the 2×2
determinant of its (k + 1) × (k + 1) bordered minors.
Cramer–Jordan upward elimination minor identity: updating column a of an invertible
(k + 1) × (k + 1) bordered matrix M = border A b₁ c d₁ by (b₂, d₂) satisfies the
fraction-free Gauss–Jordan identity
A.det * det M' = det M * det (A[a ↦ b₂]) - det(border A b₂ c d₂) * det (A[a ↦ b₁]).
Minor-scaled Bareiss–Jordan matrices #
The minor-scaled Bareiss–Jordan matrix associated with pivot rows S and pivot columns C.
For a pivoted row i = S a, entry (i, j) is the k × k minor obtained by replacing column C a
with j. For an unpivoted row i ∉ range S, entry (i, j) is the (k + 1) × (k + 1) minor
obtained by bordering A.submatrix S C with row i and column j.
Entry of bareissMatrix A S C on a pivoted row S a.
On a pivoted row S a, every other pivot column C b (a ≠ b) vanishes.
Main Bareiss–Jordan identity over any field K: appending a pivot (p, q) with
p ∉ range S and bareissMatrix A S C p q ≠ 0 updates every row i ≠ p via the Sylvester /
Cramer–Jordan quotient by pivotDet A S C, and keeps row p unchanged.
Over ℤ, every Bareiss–Jordan update identity holds identically, giving exact divisibility by
pivotDet A S C.
Exact integer divisibility in a Bareiss–Jordan elimination step.
Exact quotient (Int.ediv) in a Bareiss–Jordan elimination step recovers
bareissMatrix A (Fin.snoc S p) (Fin.snoc C q) i j.
Any predicate Q on rows that includes the new pivot row p and already makes column j
vanish in bareissMatrix A S C continues to make column j vanish after pivoting on (p, q).
Hadamard / factorial minor bounds over ℤ #
Entry magnitude bound on pivoted rows of bareissMatrix over ℤ: k! * B ^ k.
Entry magnitude bound on unpivoted rows of bareissMatrix over ℤ:
(k + 1)! * B ^ (k + 1).
Rational RREF, row space, rank, row basis, kernel basis, and linear solver #
Entries of rrefOfBareiss A S C in other pivot columns vanish on pivot rows.
Entries of rrefOfBareiss A S C in pivot columns vanish on unpivoted rows.
The selected pivot rows A ∘ S are linearly independent whenever pivotDet A S C ≠ 0.
When all unpivoted rows vanish in bareissMatrix, the pivot rows A ∘ S span the entire
row space of A.
When all unpivoted rows vanish, A.rank = k.
Under a row permutation σ placing the pivot rows S in positions 0, …, k - 1, strictly
increasing pivot columns C, and vanishing left-of-pivot entries hzero, the permuted
rrefOfBareiss is in Mathlib's Matrix.IsPivotedBy and Matrix.IsReducedRowEchelon form.
Canonical right-kernel basis vector associated with a non-pivot column j: has -U (S a) j in
each pivot column C a, 1 at coordinate j, and 0 at every other non-pivot column.
Every kernelBasisVec associated with a non-pivot column j lies in ker A.mulVecLin.
The kernelBasisVec vectors over non-pivot columns span LinearMap.ker A.mulVecLin.
At termination, finrank K (LinearMap.ker A.mulVecLin) = n - k.
solveVec A S C b solves A *ᵥ x = b iff A *ᵥ x = b is consistent.
The Bareiss–Jordan reduction of [A | b] at (S, Fin.castSucc ∘ C) yields solveVec A S C b
on pivot rows in the last column, and vanishes on unpivoted rows iff A *ᵥ solveVec A S C b = b.