A polynomial whose coefficients vanish from n onward has size at most
n.
Addition cannot increase size beyond the larger operand.
Subtraction cannot increase size beyond the larger operand.
A proof-carrying implementation of full, square, and clipped dense
polynomial multiplication. slice lo len a b stores coefficients beginning
at degree lo, shifted down to degree zero.
A complete normalized product.
A specialized square.
lencoefficients beginning at product degreelo, shifted down.Full multiplication agrees with the reference product.
Squaring agrees with the reference product.
- coeff_slice (lo len : Nat) (a b : DensePoly R) (i : Nat) : (self.slice lo len a b).coeff i = if i < len then (a * b).coeff (lo + i) else 0
The slice contains exactly the selected product coefficients.
Instances For
Kernel-facing clipped schoolbook product. The definition is phrased by
the semantic product so its coefficient law is immediate; compiled code uses
schoolbookSliceImpl, which evaluates the requested schoolbook coefficient
folds directly and never materializes the full product.
Equations
- Hex.DensePoly.schoolbookSlice lo len a b = Hex.DensePoly.ofList (List.map (fun (i : Nat) => (a * b).coeff (lo + i)) (List.range len))
Instances For
Coefficient law for a clipped schoolbook product.
Fold one product diagonal. The left operand is the loop driver; callers put the shorter operand there. Indices outside the valid convolution diagonal perform no coefficient operation.
Equations
Instances For
The direct diagonal kernel agrees with the schoolbook product fold.
Allocation-conscious runtime implementation of schoolbookSlice.
Requests beyond the product support are discarded before entering the
coefficient folds, and the shorter operand drives each diagonal fold.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The bounded coefficient-fold implementation agrees with the semantic clipped product.
Compiled clipped schoolbook products use direct coefficient folds.
The reference plan backed by the existing allocation-conscious schoolbook multiplication.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Multiply using an explicit plan.
Equations
- Hex.DensePoly.mulWith plan a b = plan.mul a b
Instances For
Square using an explicit plan.
Equations
- Hex.DensePoly.squareWith plan a = plan.square a
Instances For
Keep the first len coefficients of a planned product.
Equations
- Hex.DensePoly.mulLow plan len a b = plan.slice 0 len a b
Instances For
Keep len coefficients beginning at product degree lo.
Equations
- Hex.DensePoly.mulSlice plan lo len a b = plan.slice lo len a b
Instances For
The standard middle product for operands of sizes m ≥ n > 0.
The result contains product degrees n - 1 through m - 1, shifted down.
Equations
Instances For
Checked middle product. Operands are ordered by size; an empty operand has zero middle product.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Planned multiplication has the existing dense-polynomial semantics.
Planned squaring has the existing dense-polynomial semantics.
Coefficient law for the standard proof-taking middle product.