Documentation

CslibFrontier.Computability.Complexity.Classes.CountingHierarchy.PolynomialEvaluation

Polynomial evaluation from modular coefficient access #

Summing weighted coefficient residues up to a binary degree bound uses one counting level. The correctness statement applies to every positive modulus. Adapted from LeanCanny.CountingHierarchy.binaryPolynomialValue at lean-canny 970f28a5ecefc1327402ade16c068aa4b1b2c183.

noncomputable def Cslib.Complexity.polynomialResidue (p D t : ℕ) (coeff : ℕ → ℕ) :

Evaluate the coefficient stream through index D at t modulo p.

theorem Cslib.Complexity.polynomialResidue_lt {p : ℕ} (hp : 0 < p) (D t : ℕ) (coeff : ℕ → ℕ) :
polynomialResidue p D t coeff < p

A positive modulus gives a canonical natural residue.

Evaluation uses one counting level above its coefficient access. The modulus, evaluation point, degree bound, and coefficient index are binary.

theorem Cslib.Complexity.polynomialResidue_cast {R : Type u_1} [Semiring R] {p : ℕ} (hp : p ≠ 0) (φ : R →+* ZMod p) (P : Polynomial R) (D t : ℕ) (hD : P.natDegree ≤ D) (coeff : ℕ → ℕ) (hc : ∀ k ≤ D, ↑(coeff k) = φ (P.coeff k)) :
↑(polynomialResidue p D t coeff) = Polynomial.eval₂ φ (↑t) P

A complete sequence of mapped coefficients gives evaluation over ZMod p.