Lagrange interpolation #
Main definitions #
- In everything that follows,
s : Finset ιis a finite set of indexes, withv : ι → Fan indexing of the field over some type. We call the image of v on s the interpolation nodes, though strictly unique nodes are only defined when v is injective on s. Lagrange.basisDivisor x y, withx y : F. These are the normalised irreducible factors of the Lagrange basis polynomials. They evaluate to1atxand0atywhenxandyare distinct.Lagrange.basis v iwithi : ι: the Lagrange basis polynomial that evaluates to1atv iand0atv jfori ≠ j.Lagrange.interpolate v rwherer : ι → Fis a function from the fintype to the field: the Lagrange interpolant that evaluates tor iatx ifor alli : ι. Ther iare the values associated with the nodesx i.
Two polynomials, with the same degree and leading coefficient, which have the same evaluation on a set of distinct values with cardinality equal to the degree, are equal.
basisDivisor x y is the unique linear or constant polynomial such that
when evaluated at x it gives 1 and y it gives 0 (where when x = y it is identically 0).
Such polynomials are the building blocks for the Lagrange interpolants.
Equations
Instances For
Lagrange basis polynomials indexed by s : Finset ι, defined at nodes v i for a
map v : ι → F. For i, j ∈ s, basis s v i evaluates to 0 at v j for i ≠ j. When
v is injective on s, basis s v i evaluates to 1 at v i.
Equations
Instances For
Lagrange interpolation: given a finset s : Finset ι, a nodal map v : ι → F injective on
s and a value function r : ι → F, interpolate s v r is the unique
polynomial of degree < #s that takes value r i on v i for all i in s.
Equations
Instances For
This is the characteristic property of the interpolation: the interpolation is the
unique polynomial of degree < Fintype.card ι which takes the value of the r i on the v i.
Lagrange interpolation induces isomorphism between functions from s
and polynomials of degree less than Fintype.card ι.
Equations
Instances For
nodal s v is the unique monic polynomial whose roots are the nodes defined by v and s.
That is, the roots of nodal s v are exactly the image of v on s,
with appropriate multiplicity.
We can use nodal to define the barycentric forms of the evaluated interpolant.
Equations
Instances For
This defines the nodal weight for a given set of node indexes and node mapping function v.
Equations
Instances For
This is the first barycentric form of the Lagrange interpolant.
This is the second barycentric form of the Lagrange interpolant.