hex

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.

🔗theorem
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.det
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.det

Row-pivoted Bareiss over an exact-division commutative ring agrees with Hex's executable determinant.

The matching theorem against Mathlib's determinant is available directly, without unfolding the generic loop or relying on definitional equality.

🔗theorem
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).det
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).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.

🔗theorem
HexMatrixMathlib.bareiss_eq_det {n : } (M : Hex.Matrix n n) : M.bareiss = M.det
HexMatrixMathlib.bareiss_eq_det {n : } (M : Hex.Matrix n n) : M.bareiss = M.det

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.

🔗theorem
HexMatrixMathlib.bareissDet_eq_det {n : } (M : Hex.Matrix n n) : M.bareiss = (HexMatrixMathlib.matrixEquiv M).det
HexMatrixMathlib.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.