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
def
Hex.Matrix.detTerm
{R : Type u}
[Lean.Grind.Ring R]
{n : Nat}
(M : Matrix R n n)
(perm : Vector (Fin n) n)
:
R
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
@[simp]
theorem
Hex.Matrix.det_principalSubmatrix_zero
{n : Nat}
{R : Type u}
[Lean.Grind.Ring R]
(M : Matrix R n n)
:
The determinant of the empty leading prefix is the Bareiss previous-pivot
convention 1.