Documentation

CslibFrontier.Foundations.Data.MvPolynomial.FiniteFieldCoefficients

Coefficients from finite-field evaluations #

A polynomial of degree strictly below card K - 1 has its indexed coefficients recovered by one weighted sum over the field. The exponent is positive, so the zero evaluation point contributes zero and needs no special case. Multivariate extraction takes one sum over the complete grid, including the unique empty point at zero variables.

This module proves the algebraic identity; its short-index computation and counting-level bound are separate from the finite field's mathematical sum. Adapted from lean-canny.

Main results #

theorem Polynomial.coeff_eq_neg_sum_eval {K : Type u_1} [Field K] [Fintype K] (P : Polynomial K) (k : ℕ) (hP : P.natDegree < Fintype.card K - 1) (hk : k < Fintype.card K - 1) :
P.coeff k = -∑ x : K, eval x P * x ^ (Fintype.card K - 1 - k)

One field sum recovers any coefficient below the multiplicative period. The condition on k is independent of the actual degree, so coefficients above the degree are correctly recovered as zero.

theorem Polynomial.coeff_eq_neg_sum_range_eval {p : ℕ} [Fact (Nat.Prime p)] (P : Polynomial (ZMod p)) (k : ℕ) (hP : P.natDegree < p - 1) (hk : k < p - 1) :
P.coeff k = -∑ z ∈ Finset.range p, eval (↑z) P * ↑z ^ (p - 1 - k)

Least natural representatives enumerate the same extraction sum over a prime field.

theorem MvPolynomial.coeff_eq_signed_sum_eval {K : Type u_1} [Field K] [Fintype K] {n : ℕ} (P : MvPolynomial (Fin n) K) (β : Fin n →₀ ℕ) (hP : P.totalDegree < Fintype.card K - 1) (hβ : ∀ (i : Fin n), β i < Fintype.card K - 1) :
P.coeff β = (-1) ^ n * ∑ z : Fin n → K, (eval z) P * ∏ i : Fin n, z i ^ (Fintype.card K - 1 - β i)

Simultaneous multivariate coefficient extraction uses one grid sum, rather than an input-dependent nesting of coefficient-extraction procedures. This includes zero variables and coefficient indices outside the polynomial support.