Core Leibniz-formula definitions for the dense determinant.
This module defines the determinant det of a dense square matrix as the
permutationVectors-indexed sum of signed Leibniz terms, built from detSign
(the inversion-parity sign of a permutation vector), detProduct (the unsigned
diagonal product), and detTerm (their product). It records the small base
cases det_one_by_one, det_two_by_two, and det_principalSubmatrix_zero, and
provides the reusable foldl-arithmetic toolkit (scalar factoring, additive
splitting, permutation invariance, single-index scaling) plus the
Fin.castSucc/Fin.last inversion-count lemmas used by the recursive
determinant proofs in the sibling modules.
The sign of a permutation vector, computed from inversion parity.
Equations
- Hex.Matrix.detSign perm = if Hex.Matrix.inversionCount perm.toList % 2 = 0 then 1 else -1
Instances For
The Leibniz summand associated to a permutation vector.
Equations
- M.detTerm perm = Hex.Matrix.detSign perm * M.detProduct perm
Instances For
The determinant of a dense square matrix, defined by the Leibniz formula.
Equations
- M.det = List.foldl (fun (acc : R) (perm : Vector (Fin n) n) => acc + M.detTerm perm) 0 (Hex.Matrix.permutationVectors n)
Instances For
The determinant of the empty leading prefix is the Bareiss previous-pivot
convention 1.