Lagrange interpolation over a commutative ring #
Mathlib's Lagrange.interpolate works over a field. Over a commutative ring R, interpolation at
nodes v i, i ∈ s, still works when the nodes have unit differences: every v i - v j with
i ≠ j is a unit. Galois rings such as (ℤ / 2 ^ p)[U] / (f) are the motivating example; they
are not domains, but lifts of distinct residue-field elements differ by units.
The Lagrange basis polynomial at i is ∏_{j ∈ s, j ≠ i} (X - v j) / (v i - v j), where the
division is multiplication by Ring.inverse (v i - v j) (Lagrange.ringBasis). It is one at
v i and zero at the other nodes, so Lagrange.ringInterpolate s v r = ∑ i ∈ s, r i • basis i
takes the value r i at v i. A polynomial of degree less than #s that vanishes at all nodes is
zero, because the factors X - v i are pairwise coprime; hence every polynomial of degree less
than #s is the interpolant of its values (Lagrange.eq_ringInterpolate). Over a field these
are Mathlib's Lagrange.basis and Lagrange.interpolate
(Lagrange.ringInterpolate_eq_interpolate).
Main definitions #
Lagrange.ringBasis: the Lagrange basis polynomial, withRing.inversefor division.Lagrange.ringInterpolate: Lagrange interpolation over a commutative ring, as a linear map.
Main results #
Lagrange.eval_ringInterpolate_at_node: the interpolant takes the prescribed values.Lagrange.degree_ringInterpolate_lt: it has degree less than the number of nodes.Lagrange.eq_zero_of_degree_lt_of_eval_eq_zero: uniqueness at nodes with unit differences.Lagrange.eq_ringInterpolate: a polynomial of degree less than#sis the interpolant of its values.Lagrange.ringInterpolate_eq_interpolate: over a field, this isLagrange.interpolate.
The Lagrange basis polynomial ∏_{j ∈ s, j ≠ i} (X - v j) / (v i - v j) over a commutative
ring, where division by v i - v j is multiplication by Ring.inverse (v i - v j). When the nodes
have unit differences it is one at v i and zero at the other nodes.
Lagrange interpolation over a commutative ring: ∑ i ∈ s, r i • ringBasis s v i. At nodes
with unit differences, it is the unique polynomial of degree less than #s taking the value r i
at v i.
The basis polynomial at i is one at its own node.
The basis polynomial at i vanishes at every other node.
The interpolant has degree less than the number of nodes.
The interpolant takes the prescribed values at nodes with unit differences.
Uniqueness of interpolation over a commutative ring. A polynomial of degree less than
#s that vanishes at nodes with unit differences is zero: the factors X - v i are pairwise
coprime, so their product, of degree #s, divides it.
Every polynomial of degree less than #s is the interpolant of its values at nodes with
unit differences.
Over a field, ringBasis is Mathlib's Lagrange.basis.
Over a field, ringInterpolate is Mathlib's Lagrange.interpolate.