Subproduct Trees and Remainder-Tree Multipoint Evaluation over Commutative Rings #
Balanced subproduct trees, top-down monic remainder-tree evaluation, and bivariate difference
products over an arbitrary commutative ring R. The balanced tree construction
(buildSubproductTree) and top-down remainder traversal (remainderTreeEval /
fastMultipointEval) follow the supermoduli construction and top-down remainder recursion of
[BM74] (§5, Lemma on pp. 372–373 and Algorithm Modular Form on pp. 373–374) and
[vzGG13] (§10.1, p. 295), generalized here from a Euclidean domain with
power-of-two size to an arbitrary commutative ring R and arbitrary list length (reducing p
modulo the current node's polynomial on entry to each internal node rather than pre-reducing by
each child modulus before recursing). fastBivariateDiffProd is an algebraic application computing
the bivariate pairwise difference product via buildSubproductTree and fastMultipointEval.
Because every internal polynomial stored in a multiplicative subproduct tree is monic, Euclidean
division with remainder by monic polynomials (Polynomial.modByMonic, written %ₘ) is exact over
any commutative ring R without requiring R to be a field, an integral domain, or even
nontrivial. In particular, all algebraic identities apply directly to composite residue rings such
as ZMod 6 and quotient algebras AdjoinRoot h for reducible monic polynomials h.
Scope and model boundaries #
The polynomial-valued and evaluation definitions (SubproductTree.rootPoly, SubproductTree.map,
buildSubproductTree, remainderTreeEval, fastMultipointEval, and fastBivariateDiffProd) are
noncomputable, using Mathlib's abstract polynomial operations and Polynomial.modByMonic. The
results proved here are:
- algebraic correctness of ordered multipoint evaluation (
fastMultipointEval_eq_map_eval) and bivariate difference products (fastBivariateDiffProd_eq_prod,fastBivariateDiffProd_eq_zero_iff) over commutative rings, plus naturality under ring homomorphisms (map_buildSubproductTree,map_fastMultipointEval); - structural tree-depth bounds (
depth_buildSubproductTree_le,depth_buildSubproductTree_eq_of_length_eq_pow) and total internal node degree-weight sums (degSum_buildSubproductTree_le_mul_clog,degSum_buildSubproductTree_eq_of_length_eq_pow).
Multiplication and division costs are unmodeled; in particular, this module does not formalize the arithmetic-operation bounds derived from fast polynomial multiplication and division in [BM74] (Theorem 1, p. 372; Corollary 2, p. 375) or [vzGG13] (§10.1, p. 295).
Main definitions #
Cslib.Algorithms.Lean.SubproductTree: binary tree storing monic subproduct polynomials over a commutative ringR, with projectionsrootPoly,points,depth, internal-node degree-weight sumdegSum, functorial pushforwardmap, and multiplicative consistency invariantIsMultiplicative.Cslib.Algorithms.Lean.buildSubproductTree: balanced divide-and-conquer subproduct tree construction overpts : List R.Cslib.Algorithms.Lean.remainderTreeEval,Cslib.Algorithms.Lean.fastMultipointEval: top-down monic remainder-tree traversal and multipoint evaluation computing[p.eval a | a ← pts].Cslib.Algorithms.Lean.fastBivariateDiffProd: bivariate pairwise difference product∏_{s ∈ sPts} ∏_{t ∈ tPts} (s - t)viabuildSubproductTreeandfastMultipointEval.
Main results #
Cslib.Algorithms.Lean.monic_rootPoly_buildSubproductTree,Cslib.Algorithms.Lean.rootPoly_buildSubproductTree_eq_prod,Cslib.Algorithms.Lean.natDegree_rootPoly_buildSubproductTree: monicity, product factorization, and exact degree of(buildSubproductTree pts).rootPoly.Cslib.Algorithms.Lean.fastMultipointEval_eq_map_eval,Cslib.Algorithms.Lean.map_fastMultipointEval: exact agreement offastMultipointEval pts pwithpts.map p.evalover every commutative ringRand naturality under ring homomorphisms.Cslib.Algorithms.Lean.fastBivariateDiffProd_eq_prod,Cslib.Algorithms.Lean.fastBivariateDiffProd_eq_zero_of_mem,Cslib.Algorithms.Lean.fastBivariateDiffProd_eq_zero_iff: algebraic product identity and vanishing characterization forfastBivariateDiffProd.Cslib.Algorithms.Lean.depth_buildSubproductTree_le,Cslib.Algorithms.Lean.depth_buildSubproductTree_eq_of_length_eq_pow,Cslib.Algorithms.Lean.degSum_buildSubproductTree_le_mul_clog,Cslib.Algorithms.Lean.degSum_buildSubproductTree_eq_of_length_eq_pow: logarithmic tree depth and sharp|pts| * ⌈log₂ |pts|⌉internal degree-weight bounds.
References #
Binary tree storing monic subproduct polynomials over a commutative ring R: empty
represents the empty point list with polynomial 1, leaf a represents a singleton point [a]
with linear polynomial X - C a, and node poly left right caches the product polynomial poly
above two subtrees left and right.
- empty {R : Type u_1} [CommRing R] : SubproductTree R
Empty subproduct tree associated with
[]and root polynomial1. - leaf {R : Type u_1} [CommRing R] (a : R) : SubproductTree R
Singleton leaf associated with
[a]and root polynomialX - C a. - node {R : Type u_1} [CommRing R] (poly : Polynomial R) (left right : SubproductTree R) : SubproductTree R
Internal binary node storing a cached polynomial
polyoverleftandright.
Instances For
Canonical inhabited instance for SubproductTree R given by SubproductTree.empty.
Root polynomial associated with a SubproductTree R: 1 on empty, X - C a on leaf a,
and the stored polynomial p on node p l r.
Ordered list of evaluation points stored at the leaves of a SubproductTree R.
Multiplicative consistency predicate on SubproductTree R: every internal node stores the
exact product l.rootPoly * r.rootPoly of its left and right subtree root polynomials.
Recursive characterization of SubproductTree.IsMultiplicative on an internal node.
Pushforward of a SubproductTree R along a ring homomorphism f : R →+* S.
Every multiplicative subproduct tree over a commutative ring has a monic root polynomial.
The root polynomial of any multiplicative subproduct tree equals the ordered product
∏_{a ∈ t.points} (X - C a).
Over a nontrivial commutative ring, the root polynomial of any multiplicative subproduct tree
has natDegree equal to t.points.length.
Pushing a multiplicative subproduct tree forward along a ring homomorphism preserves multiplicativity.
Balanced binary divide-and-conquer construction of the subproduct tree over a point list
pts : List R, splitting lists of length at least 2 at pts.length / 2.
Recursive split equation for buildSubproductTree on any list of length at least 2.
buildSubproductTree pts recovers the exact input point list pts in order.
Every tree built by buildSubproductTree satisfies SubproductTree.IsMultiplicative.
The root polynomial of buildSubproductTree pts is monic over any commutative ring R.
The root polynomial of buildSubproductTree pts equals ∏_{a ∈ pts} (X - C a).
Over any nontrivial commutative ring R, (buildSubproductTree pts).rootPoly has degree
pts.length.
buildSubproductTree commutes with every ring homomorphism f : R →+* S.
Top-down monic remainder-tree evaluation of p : R[X] across a SubproductTree R.
Equation for remainderTreeEval on a singleton leaf.
Pre-reducing p modulo t.rootPoly leaves remainderTreeEval t unchanged on any
multiplicative subproduct tree.
On any multiplicative subproduct tree t, top-down remainder-tree traversal computes the exact
list of polynomial evaluations t.points.map p.eval over any commutative ring R.
Remainder-tree multipoint evaluation of p : R[X] at pts : List R via balanced subproduct
tree construction followed by top-down monic remainder traversal (noncomputable; arithmetic costs
unmodeled).
fastMultipointEval pts p agrees identically with pts.map p.eval over every commutative
ring R.
fastMultipointEval commutes with every ring homomorphism f : R →+* S.
Bivariate pairwise difference product ∏_{s ∈ sPts} ∏_{t ∈ tPts} (s - t) over a commutative
ring R, computed by evaluating (buildSubproductTree tPts).rootPoly at sPts via
fastMultipointEval and multiplying the resulting values (noncomputable; arithmetic costs
unmodeled).
Evaluating (buildSubproductTree tPts).rootPoly at s : R yields ∏_{t ∈ tPts} (s - t).
fastBivariateDiffProd sPts tPts equals the exact iterated product
∏_{s ∈ sPts} ∏_{t ∈ tPts} (s - t) over every commutative ring R.
Multiplicativity of fastBivariateDiffProd in its left point list.
Multiplicativity of fastBivariateDiffProd in its right point list.
Over any commutative ring R, a shared element x ∈ sPts and x ∈ tPts forces
fastBivariateDiffProd sPts tPts = 0.
Over an integral domain R, fastBivariateDiffProd sPts tPts = 0 if and only if sPts and
tPts share a common element.
The depth of buildSubproductTree pts is at most ⌈log₂ |pts|⌉ + 1.
When pts.length = 2 ^ k, buildSubproductTree pts has exact depth k + 1, demonstrating
sharpness of the + 1 term in depth_buildSubproductTree_le.
Total degree weight of internal nodes across a SubproductTree R, summing
l.points.length + r.points.length over all internal .nodes (node-weight sum only; arithmetic
multiplication and division costs are unmodeled).
When pts.length = 2 ^ k, the total internal degree weight (buildSubproductTree pts).degSum
equals k * 2 ^ k identically, showing tightness of degSum_buildSubproductTree_le_mul_clog.