A kernel-checkable determinant certificate. See the module docstring.
- triangular
{R : optParam Type Int}
(swaps : List (Nat × Nat))
(transform : List (List R))
(value : R)
: DetWitness R
A triangularization: the row swaps in application order, the rows of the lower triangular transform (row
iholds itsi + 1leading entries), and the value. - singular
{R : optParam Type Int}
(vec : List R)
: DetWitness R
A nonzero left kernel vector: the value is
0.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
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 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.Packed.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
zeroDots on packed pairs.
Equations
- Hex.Matrix.DetWitness.zeroDotsPacked W r t [] = true
- Hex.Matrix.DetWitness.zeroDotsPacked W r t (head :: s) = (decide (Hex.Matrix.Packed.dotIntPacked W r t head = 0) && Hex.Matrix.DetWitness.zeroDotsPacked W r t s)
Instances For
triangularCheck with the dot products on packed pairs: tps the packed
rows of the transform alongside its rows ts, done and cs the packed
columns.
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 with the triangularization on packed rows, slot width
W and entry bound k: checkDetList with triangularCheck replaced by
triangularCheckPacked, plus the bounds that make the packed dot products
exact: every entry of the matrix and of the transform below k in absolute
value, k > 0, and n · k² < 2^W. The singular branch is unchanged. A
passing packed check implies a passing checkDetList; see the companion's
checkDetList_of_packed.
Equations
- One or more equations did not get rendered due to their size.
Instances For
checkDetRat with the packed integer check.
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
Independent limits on current elimination blocks and the emitted witness.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
Equations
Instances For
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
Equations
- Hex.Matrix.DetWitness.instBEqLimit.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
Equations
- Hex.Matrix.DetWitness.instBEqError.beq (Hex.Matrix.DetWitness.Error.exhausted a a_1 a_2) (Hex.Matrix.DetWitness.Error.exhausted b b_1 b_2) = (a == b && (a_1 == b_1 && a_2 == b_2))
- Hex.Matrix.DetWitness.instBEqError.beq (Hex.Matrix.DetWitness.Error.malformed a) (Hex.Matrix.DetWitness.Error.malformed b) = (a == b)
- Hex.Matrix.DetWitness.instBEqError.beq Hex.Matrix.DetWitness.Error.rejected Hex.Matrix.DetWitness.Error.rejected = true
- Hex.Matrix.DetWitness.instBEqError.beq x✝¹ x✝ = false
Instances For
Equations
Instances For
Total serialized support, including the value in the triangular case.
Equations
- One or more equations did not get rendered due to their size.
- Hex.Matrix.DetWitness.measure size (Hex.Matrix.DetWitness.singular a) = List.foldl (fun (total : Nat) (x : R) => total + size x) 0 a
Instances For
Fraction-free production with operand admission, block support and witness limits. The final self-check runs only after the witness fits its budget.
Equations
- Hex.Matrix.detWitnessBudgeted quot n size budget check A = Hex.Matrix.DetWitness.validate✝ (check A) (Hex.Matrix.DetWitness.produce✝ quot n size (some budget) A)
Instances For
The unlimited instance of the same producer, retaining the integer API.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every successful producer return has passed its supplied checker. This does not assume the quotient implementation is correct: a rejected witness is returned as an error.
The integer instance of the generic witness producer.
Equations
Instances For
The kernel witness of a square integer matrix.