Documentation

CslibFrontier.Computability.Complexity.RealAlgebraic.CoefficientEvaluation

One-counting-level coefficient extraction #

The evaluator receives a modulus, coefficient index, and uniform polynomial evaluation access. It sums weighted evaluations without expanding coefficients. Its fixed-level certificate holds on every input; algebraic correctness requires a prime exceeding the polynomial degree and the requested coefficient index by at least two. Degrees and coefficient indices may have exponential value.

Adapted from lean-canny.

Main definitions #

Main results #

References #

noncomputable def Cslib.Complexity.RealAlgebraic.coefficientResidue (p k : ℕ) (value : ℕ → ℕ) :

Recover a natural coefficient residue by one finite-field Fourier sum. The sum is a specification of a counting computation, not an explicit list constructed by the deterministic realizing program.

Uniform modular evaluations yield indexed coefficients at one higher function level. Both the modulus and index use binary encodings.

theorem Cslib.Complexity.RealAlgebraic.coefficientResidue_cast {p : ℕ} [Fact (Nat.Prime p)] (P : Polynomial (ZMod p)) (k : ℕ) (value : ℕ → ℕ) (hP : P.natDegree < p - 1) (hk : k < p - 1) (hvalue : ∀ z < p, ↑(value z) = Polynomial.eval (↑z) P) :
↑(coefficientResidue p k value) = P.coeff k

The total evaluator represents the actual polynomial coefficient in the field. Correctness uses values only on the canonical representatives below p.

theorem Cslib.Complexity.RealAlgebraic.coefficientResidue_eq_val {p : ℕ} [Fact (Nat.Prime p)] (P : Polynomial (ZMod p)) (k : ℕ) (value : ℕ → ℕ) (hP : P.natDegree < p - 1) (hk : k < p - 1) (hvalue : ∀ z < p, ↑(value z) = Polynomial.eval (↑z) P) :
coefficientResidue p k value = (P.coeff k).val

The returned natural is the canonical representative, including zero coefficients.