At least one entry is nonzero.
Equations
- ops.anyNonzero [] = false
- ops.anyNonzero (x_1 :: xs) = (!ops.beq x_1 ops.zero || ops.anyNonzero xs)
Instances For
Map all entries of a witness, for conversion from executable entries to their serialized representation.
Equations
Instances For
A row of a serialized matrix, with the empty row beyond its end.
Equations
- Hex.Matrix.DetWitness.row [] x✝ = []
- Hex.Matrix.DetWitness.row (r :: tail) 0 = r
- Hex.Matrix.DetWitness.row (head :: rs) i.succ = Hex.Matrix.DetWitness.row rs i
Instances For
Replace a row, leaving out-of-range indices unchanged.
Equations
- Hex.Matrix.DetWitness.replace [] x✝¹ x✝ = []
- Hex.Matrix.DetWitness.replace (head :: rs) 0 x✝ = x✝ :: rs
- Hex.Matrix.DetWitness.replace (r :: rs) i.succ x✝ = r :: Hex.Matrix.DetWitness.replace rs i x✝
Instances For
Exchange two rows. Bounds and distinctness are checked separately.
Equations
Instances For
Apply row swaps in their recorded order.
Equations
- Hex.Matrix.DetWitness.permute [] x✝ = x✝
- Hex.Matrix.DetWitness.permute ((a, b) :: ss) x✝ = Hex.Matrix.DetWitness.permute ss (Hex.Matrix.DetWitness.swap a b x✝)
Instances For
Verify the number of entries in every row.
Equations
- Hex.Matrix.DetWitness.rowLengths n [] = true
- Hex.Matrix.DetWitness.rowLengths n (r :: rs) = (r.length.beq n && Hex.Matrix.DetWitness.rowLengths n rs)
Instances For
def
Hex.Matrix.checkDetPolyList
{R : Type}
(ops : DetOps R)
(n : Nat)
(A : List (List R))
:
DetWitness R → Bool
A determinant checker parameterized by serialized entry arithmetic. Canonicality, shapes and swap bounds are checked before the arithmetic. For nonempty triangular witnesses, the diagonal walk requires the first transform diagonal to be one and each later one to equal the preceding product diagonal. The empty case requires the value one.
Equations
- One or more equations did not get rendered due to their size.