Core determinant correspondence between executable Hex.Matrix and Mathlib.
This module proves the central bridge lemma det_eq: the executable
Leibniz determinant Hex.Matrix.det equals Matrix.det of the corresponding
Mathlib matrix matrixEquiv M. It first matches Hex permutation vectors to
Mathlib Equiv.Perm (PermutationVector.toPerm, equivs) and the
inversion-count sign to Equiv.Perm.sign (detSign_eq_permSign). Building on
det_eq, it translates matrixEquiv of leading prefixes, bordered minors,
deleted rows/columns, and row updates, and ports the Desnanot-Jacobi and
adjugate row-replacement identities (desnanot_jacobi_deleteRowCol_endpoints,
det_mul_det_setRow_setRow_eq_cofactorRowPairing_mul_sub) into the Hex API,
plus the ordered nMatrix/skipIndex2 row-transport helpers used downstream.
Convert a Hex permutation vector into the corresponding Mathlib permutation.
Equations
- HexMatrixMathlib.PermutationVector.toPerm perm hnodup = Equiv.ofBijective (fun (i : Fin n) => perm[i]) ⋯
Instances For
Hex permutation vectors converted to Mathlib permutations, with proofs attached.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Hex's inversion-count determinant sign agrees with Mathlib's permutation sign.
The executable Leibniz determinant Hex.Matrix.det agrees with Mathlib's
Matrix.det of the corresponding Mathlib matrix matrixEquiv M. This is the
bridge that lets a fact about Matrix.det be discharged by running the
executable determinant, or the executable determinant be reasoned about with
Mathlib's determinant theory.
matrixEquiv sends Hex bordered Bareiss minors to Mathlib submatrices.
Determinant form of matrixEquiv_principalSubmatrix.
Determinant form of matrixEquiv_borderedMinor.
Deleting a row and column in the Hex matrix representation is the same as submatrixing the Mathlib representation by the corresponding skip maps.
Endpoint Hex-minor form of Desnanot-Jacobi. Reindex rows and columns first to use it for an arbitrary two-row/two-column choice.
Desnanot-Jacobi for an arbitrary pair of rows and columns, expressed as a row/column reindexing of a Hex matrix and proved in the Mathlib bridge layer.
Consumers choose row and col so that their two distinguished rows and
columns are sent to 0 and Fin.last; the four one-row minors and the
two-row/two-column interior minor are then the displayed submatrices of the
reindexed matrix.
One-row replacement cofactor identity in the Hex matrix API.
Replacing row r by u and then taking a cofactor along a distinct row s
is controlled by the two cofactor-row pairings of u against the original
matrix. This bridge-layer theorem is the row-replacement form of the
Desnanot-Jacobi/adjugate relation needed by the two-row replacement Plucker
transport.
Two-row replacement determinant identity in the Hex matrix API.
Replacing distinct rows r and s by u and v satisfies the adjugate
two-row determinant relation, stated entirely in terms of Hex determinants
and cofactor-row pairings.
Ordered nMatrix row transport helpers #
Cyclic shift permutation for ordered four-row B[p1] transports #
These helpers package the row permutation that moves B[p1] from position
p1.val past the intermediate rows up to position p_t.val - 1. Together
with Matrix.det_permute, they give signed nDet transports for the
cofactorRowPairing M r? B[p1] pairings used by the ordered four-row
Plucker assembly.
Bridge-layer transport for the ordered four-row Plucker setup.
For p1 < p2 < p3 < q, the cofactor-row pairing
cofactorRowPairing M r2 B[p1] of the ordered base matrix
M = nMatrix B p1 q against B[p1] at row r2 := p2.val - 1 equals the
signed nDet B p2 q minor with sign (-1)^(p2.val - p1.val - 1).
Bridge-layer transport for the ordered four-row Plucker setup.
For p1 < p2 < p3 < q, the cofactor-row pairing
cofactorRowPairing M r3 B[p1] of the ordered base matrix
M = nMatrix B p1 q against B[p1] at row r3 := p3.val - 1 equals the
signed nDet B p3 q minor with sign (-1)^(p3.val - p1.val - 1).
Bridge-layer transport for the ordered four-row Plucker setup.
For p1 < p2 < p3 < q, the cofactor-row pairing
cofactorRowPairing M r2 B[q] of the ordered base matrix
M = nMatrix B p1 q against B[q] at row r2 := p2.val - 1 equals the
signed nDet B p1 p2 minor with sign (-1)^(q.val - p2.val - 1).
Bridge-layer transport for the ordered four-row Plucker setup.
For p1 < p2 < p3 < q, the cofactor-row pairing
cofactorRowPairing M r3 B[q] of the ordered base matrix
M = nMatrix B p1 q against B[q] at row r3 := p3.val - 1 equals the
signed nDet B p1 p3 minor with sign (-1)^(q.val - p3.val - 1).