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 #
Lagrange.coeff_eq_sum_coeff_basis_smul_eval: for a polynomialqover aK-algebra of degree less than#s, and nodesvinjective ons,q.coeff i = ∑ j ∈ s, (Lagrange.basis s v j).coeff i • q.eval (algebraMap K R (v j)).
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)).