A nonzero monic polynomial suitable as a remainder-tree leaf.
- poly : DensePoly R
Leaf divisor.
The divisor is monic.
The divisor is nonzero.
Instances For
RemainderSpec origin leaves results states that results contains, in
order, the canonical-size remainder of origin at every corresponding leaf.
The divisibility and size conditions uniquely characterize a monic
remainder.
- nil {R : Type u} [DecidableEq R] [Lean.Grind.CommRing R] {origin : DensePoly R} : origin.RemainderSpec [] []
- cons {R : Type u} [DecidableEq R] [Lean.Grind.CommRing R] {origin : DensePoly R} {leaf : MonicLeaf R} {r : DensePoly R} {leaves : List (MonicLeaf R)} {results : List (DensePoly R)} (head : leaf.poly ∣ origin - r ∧ r.size ≤ leaf.poly.size - 1) (tail : origin.RemainderSpec leaves results) : origin.RemainderSpec (leaf :: leaves) (r :: results)
Instances For
An opaque balanced remainder tree whose root has fixed reciprocal capacity and whose proper nodes use the degree of their sibling subtree.
- mulData : Hex.DensePoly.MulPlan R
- capacityData : Nat
- leavesData : Array (Hex.DensePoly.MonicLeaf R)
- nodeData : Option (RemainderNode R)
- nodeLeaves (node : RemainderNode R) : nodeData self = some node → RemainderNode.leaves node = (leavesData self).toList
- nodeWellFormed (node : RemainderNode R) : nodeData self = some node → RemainderNode.WellFormed node
- nodeCapacity (node : RemainderNode R) : nodeData self = some node → (RemainderNode.plan node).capacity = capacityData self
- nodeDegree (node : RemainderNode R) : nodeData self = some node → (RemainderNode.root node).poly.size - 1 = leafDegreeSum (leavesData self).toList
Instances For
Build a cached remainder tree. capacity is the reciprocal capacity of the
root; every proper node derives the exact worst-case capacity it needs from its
sibling subtree. The empty leaf sequence is represented without an internal
root.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Leaf divisors in their original order.
Equations
- tree.leaves = Array.map (fun (x : Hex.DensePoly.MonicLeaf R) => x.poly) (Hex.DensePoly.RemainderTree.leavesData✝ tree)
Instances For
Proof-carrying leaf entries in their original order.
Equations
- tree.entries = Hex.DensePoly.RemainderTree.leavesData✝ tree
Instances For
Number of leaf divisors.
Equations
- tree.size = (Hex.DensePoly.RemainderTree.leavesData✝ tree).size
Instances For
Reciprocal capacity cached at the root.
Equations
Instances For
Degree of the root product, computed as the sum of the leaf degrees.
Equations
Instances For
Compute all leaf remainders with the cached reciprocal plans. Returns
none exactly when the input needs more reciprocal precision than the root
capacity. Proper-node capacities are sufficient by construction.
Equations
- tree.remainders? p = match Hex.DensePoly.RemainderTree.nodeData✝ tree with | none => some #[] | some node => Option.map List.toArray (Hex.DensePoly.RemainderTree.runNode?✝ node p)
Instances For
A caller-supplied root capacity covering the input above the root degree makes the entire traversal succeed. Every proper-node guard follows from the sibling-degree capacities recorded by construction.
Every successful traversal returns, in leaf order, the canonical-size remainder of the input modulo each leaf polynomial.