A kernel-checkable determinant certificate. See the module docstring.
- triangular
(swaps : List (Nat × Nat))
(transform : List (List Int))
(value : Int)
: DetWitness
A triangularization: the row swaps in application order, the rows of the lower triangular transform (row
iholds itsi + 1leading entries), and the value. - singular
(vec : List Int)
: DetWitness
A nonzero left kernel vector: the value is
0.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
- One or more equations did not get rendered due to their size.
- Hex.Matrix.instDecidableEqDetWitness.decEq (Hex.Matrix.DetWitness.triangular swaps transform value) (Hex.Matrix.DetWitness.singular vec) = isFalse ⋯
- Hex.Matrix.instDecidableEqDetWitness.decEq (Hex.Matrix.DetWitness.singular vec) (Hex.Matrix.DetWitness.triangular swaps transform value) = isFalse ⋯
- Hex.Matrix.instDecidableEqDetWitness.decEq (Hex.Matrix.DetWitness.singular a) (Hex.Matrix.DetWitness.singular b) = if h : a = b then h ▸ isTrue ⋯ else isFalse ⋯
Instances For
The certified value.
Equations
- (Hex.Matrix.DetWitness.triangular swaps transform d).value = d
- (Hex.Matrix.DetWitness.singular vec).value = 0
Instances For
Row i of a row list, [] past the end.
Equations
- Hex.Matrix.DetWitness.nthRow [] x✝ = []
- Hex.Matrix.DetWitness.nthRow (a :: tail) 0 = a
- Hex.Matrix.DetWitness.nthRow (head :: as) i.succ = Hex.Matrix.DetWitness.nthRow as i
Instances For
Entry j of a row, 0 past the end.
Equations
- Hex.Matrix.DetWitness.nthInt [] x✝ = 0
- Hex.Matrix.DetWitness.nthInt (a :: tail) 0 = a
- Hex.Matrix.DetWitness.nthInt (head :: as) j.succ = Hex.Matrix.DetWitness.nthInt as j
Instances For
Row i replaced by r; unchanged past the end.
Equations
- Hex.Matrix.DetWitness.replaceRow [] x✝¹ x✝ = []
- Hex.Matrix.DetWitness.replaceRow (head :: as) 0 x✝ = x✝ :: as
- Hex.Matrix.DetWitness.replaceRow (a :: as) i.succ x✝ = a :: Hex.Matrix.DetWitness.replaceRow as i x✝
Instances For
Rows a and b exchanged.
Equations
Instances For
The swaps applied in order.
Equations
- Hex.Matrix.DetWitness.applySwaps [] x✝ = x✝
- Hex.Matrix.DetWitness.applySwaps ((a, b) :: s) x✝ = Hex.Matrix.DetWitness.applySwaps s (Hex.Matrix.DetWitness.swapRows a b x✝)
Instances For
Every swap exchanges two distinct rows below n.
Equations
Instances For
The sign of the arrangement: (-1)^(number of swaps).
Equations
Instances For
Every row has length m.
Equations
- Hex.Matrix.DetWitness.rowsLen m [] = true
- Hex.Matrix.DetWitness.rowsLen m (r :: rs) = (r.length.beq m && Hex.Matrix.DetWitness.rowsLen m rs)
Instances For
The dot product of two integer lists, stopping at the shorter.
Equations
- Hex.Matrix.DetWitness.dotInt (a :: as) (b :: bs) = (a.mul b).add (Hex.Matrix.DetWitness.dotInt as bs)
- Hex.Matrix.DetWitness.dotInt x✝¹ x✝ = 0
Instances For
Column j of a row list.
Equations
Instances For
Columns j, …, j + k - 1 of a row list.
Equations
Instances For
The m columns of a row list.
Equations
Instances For
The row is orthogonal to every column in the list.
Equations
- Hex.Matrix.DetWitness.zeroDots t [] = true
- Hex.Matrix.DetWitness.zeroDots t (r :: rs) = (decide (Hex.Matrix.DetWitness.dotInt t r = 0) && Hex.Matrix.DetWitness.zeroDots t rs)
Instances For
Some entry is nonzero.
Equations
Instances For
Walk the transform rows against the columns of the arranged matrix. Row
i (with done the i columns already passed, in any order) must have
length i + 1, a nonzero last entry lᵢ, and zero products with the
earlier columns; its product with column i is the diagonal entry uᵢ of
the triangular product. pl and pu accumulate ∏ lᵢ and sign · ∏ uᵢ,
and at the end pl · d = pu is required.
Equations
Instances For
k • q = b entrywise.
Equations
Instances For
Every row of A scaled by its positive scale is the row of B.
Equations
- Hex.Matrix.DetWitness.scaledRows [] [] [] = true
- Hex.Matrix.DetWitness.scaledRows (k :: ks) (q :: qs) (b :: bs) = (Nat.blt 0 k && Hex.Matrix.DetWitness.scaledRow k q b && Hex.Matrix.DetWitness.scaledRows ks qs bs)
- Hex.Matrix.DetWitness.scaledRows x✝² x✝¹ x✝ = false
Instances For
The product of the scales.
Equations
Instances For
The kernel checker. A is the matrix as a list of n rows of length
n. Checks the shape, and then either the triangularization or the left
kernel vector; see the module docstring.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The kernel checker for a rational matrix A given as n rows: the
scales s take the rows of A to the rows of the integer matrix B, which
c certifies, and the value v satisfies v · ∏ s = value c.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The kernel witness of a square integer matrix given as n rows of length
n, by fraction-free elimination on [A | I], or the reason its own check
fails.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The kernel witness of a square integer matrix.