Documentation

CslibFrontier.Foundations.Data.Polynomial.InterpolationCoeff

Coefficients of a polynomial from its values, over an algebra #

Over a field K, a polynomial of degree less than the number of nodes is the Lagrange interpolant of its values (Lagrange.eq_interpolate), so each of its coefficients is a fixed linear combination of its values, with the coefficients of the Lagrange basis polynomials as weights. The same weights recover the coefficients of a polynomial over any commutative K-algebra R from its values at the images of the nodes, although R need not be a field: the identity is linear in the polynomial, and holds for the monomials X ^ k because it holds over K.

This is how a coefficient of a multivariate polynomial in one of its variables is obtained from substitutions of constants for that variable, with R a polynomial ring over K.

Main results #

theorem Lagrange.coeff_eq_sum_coeff_basis_smul_eval {K : Type u_1} {R : Type u_2} {ι : Type u_3} [Field K] [CommSemiring R] [Algebra K R] [DecidableEq ι] {s : Finset ι} {v : ι → K} (hv : Set.InjOn v ↑s) {q : Polynomial R} (hq : q.natDegree < s.card) (i : ℕ) :
q.coeff i = ∑ j ∈ s, (Lagrange.basis s v j).coeff i • Polynomial.eval ((algebraMap K R) (v j)) q

The coefficients of a polynomial over a K-algebra are linear combinations of its values at nodes of K, with the coefficients of the Lagrange basis polynomials as weights: for nodes v injective on s and a polynomial q of degree less than #s over a commutative K-algebra, q.coeff i = ∑ j ∈ s, (Lagrange.basis s v j).coeff i • q.eval (algebraMap K R (v j)).