Raw Univariate Polynomial Operations #
Operations and evaluation lemmas for raw computable univariate polynomials.
Evaluates a CPolynomial.Raw at x : S using a ring homomorphism f : R →+* S.
Computes f(a₀) + f(a₁) * x + f(a₂) * x² + ... where aᵢ are the coefficients.
TODO: define an efficient version of this with caching
Instances For
Evaluates a CPolynomial.Raw at a given value
Instances For
Exponentiation of a CPolynomial.Raw by a natural number n via repeated multiplication.
This is the specification; powBySq is the efficient O(log n) implementation.
Instances For
Exponentiation via repeated squaring: $ O(\log n) $ multiplications instead of $ O(n) $.
For $ n > 0 $, computes $ p ^ n $ by recursing on $ n / 2 $:
- If $ n $ is even: $ (p ^ {n/2})^2 $
- If $ n $ is odd: $ p \cdot (p ^ {n/2})^2 $
Instances For
Convert degreeBound to a natural number by sending ⊥ to 0.
Instances For
Pseudo-division by X: removes the constant term and shifts remaining coefficients left.