Row-pivoted Bareiss over an exact-division commutative ring agrees with Hex's executable determinant.
23.6. The Mathlib correspondence
Everything above is executable and Mathlib-free. HexBareissMathlib
connects it to Mathlib. The final public umbrella exposes the correspondence
over any commutative coefficient ring supplied with an exact quotient. The
single law says that quotient cancels a known nonzero right factor; no public
domain or nontriviality hypothesis is added.
HexMatrixMathlib.bareissWith_eq_det.{u} {R : Type u} [CommRing R] [DecidableEq R] {n : ℕ} (quot : R → R → R) (hquot : ∀ (a b : R), b ≠ 0 → quot (a * b) b = a) (M : Hex.Matrix R n n) : Hex.Matrix.bareissWith quot M = M.detHexMatrixMathlib.bareissWith_eq_det.{u} {R : Type u} [CommRing R] [DecidableEq R] {n : ℕ} (quot : R → R → R) (hquot : ∀ (a b : R), b ≠ 0 → quot (a * b) b = a) (M : Hex.Matrix R n n) : Hex.Matrix.bareissWith quot M = M.det
The matching theorem against Mathlib's determinant is available directly, without unfolding the generic loop or relying on definitional equality.
HexMatrixMathlib.bareissWith_eq_mathlib_det.{u} {R : Type u} [CommRing R] [DecidableEq R] {n : ℕ} (quot : R → R → R) (hquot : ∀ (a b : R), b ≠ 0 → quot (a * b) b = a) (M : Hex.Matrix R n n) : Hex.Matrix.bareissWith quot M = (HexMatrixMathlib.matrixEquiv M).detHexMatrixMathlib.bareissWith_eq_mathlib_det.{u} {R : Type u} [CommRing R] [DecidableEq R] {n : ℕ} (quot : R → R → R) (hquot : ∀ (a b : R), b ≠ 0 → quot (a * b) b = a) (M : Hex.Matrix R n n) : Hex.Matrix.bareissWith quot M = (HexMatrixMathlib.matrixEquiv M).det
Row-pivoted Bareiss over any commutative ring with an exact quotient agrees with Mathlib's determinant.
For integer matrices, Hex.Matrix.bareiss remains the specialization
using the native exact-division primitive. Its original theorem names and
premise-free statements remain the convenient compatibility surface.
The row-pivoted Bareiss determinant equals the executable Leibniz
determinant on integer square matrices. Proven Mathlib-side by composing
bareiss_eq_mathlib_det with det_eq, so it holds unconditionally (with no
side hypothesis) and is the preferred surface for downstream Mathlib-side callers.
Composed with the determinant
correspondence, this also identifies the Bareiss determinant with
Mathlib's Matrix.det.
HexMatrixMathlib.bareissDet_eq_det {n : ℕ} (M : Hex.Matrix ℤ n n) : M.bareiss = (HexMatrixMathlib.matrixEquiv M).detHexMatrixMathlib.bareissDet_eq_det {n : ℕ} (M : Hex.Matrix ℤ n n) : M.bareiss = (HexMatrixMathlib.matrixEquiv M).det
Row-pivoted Bareiss determinant soundness, exposed against Mathlib's determinant for downstream Mathlib-side callers.