A monic polynomial over a nontrivial commutative ring is nonzero.
A product of monic polynomials over a commutative ring is monic.
Root split used by adjacent-pair product levels: the largest power of two
strictly below n.
Equations
- Hex.DensePoly.treeSplit n = 2 ^ (n - 1).log2
Instances For
The adjacent-pair tree split is positive.
An opaque balanced product tree with a cached root and on-demand levels.
- planData : Hex.DensePoly.MulPlan R
- leafData : Array (Hex.DensePoly R)
- rootData : Hex.DensePoly R
Instances For
Build a balanced product tree without retaining intermediate levels. The
empty tree has root 1 and one singleton level containing that root.
Equations
- Hex.DensePoly.ProductTree.build plan leaves = { planData := plan, leafData := leaves, rootData := Hex.DensePoly.buildRoot✝ plan leaves.size leaves.toList }
Instances For
The leaf sequence in its original order.
Equations
- tree.leaves = Hex.DensePoly.ProductTree.leafData✝ tree
Instances For
Number of nonempty balanced levels, including the leaf and root levels.
Equations
- tree.levelCount = if (Hex.DensePoly.ProductTree.leafData✝ tree).size ≤ 1 then 1 else ((Hex.DensePoly.ProductTree.leafData✝ tree).size - 1).log2 + 2
Instances For
Lawful multiplication plan used to build the tree.
Equations
- tree.plan = Hex.DensePoly.ProductTree.planData✝ tree
Instances For
A balanced level reconstructed from the leaves, from leaves upward. The
empty tree has the singleton level [1].
Equations
- One or more equations did not get rendered due to their size.
Instances For
The product represented by the root node.
Equations
- tree.root = Hex.DensePoly.ProductTree.rootData✝ tree
Instances For
The ordered leaf block represented by a node. Invalid level/node pairs
represent the empty block; use nodeProduct? when validity matters.
Equations
- tree.nodeLeaves level index = (Hex.DensePoly.ProductTree.leafData✝ tree).extract (index * 2 ^ level) (min (Hex.DensePoly.ProductTree.leafData✝ tree).size (index * 2 ^ level + 2 ^ level))
Instances For
Product represented by a valid balanced node. The observation is semantic: it folds exactly that node's leaf block, independently of the internal level layout.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every observed node product is the planned product of precisely its represented leaf block.
Building preserves the supplied leaf sequence.
The root is the planned product of all leaves in order.
The root is independent of the selected lawful multiplication kernel.