Lagrange Interpolation
Statement
Given distinct nodes in a field and prescribed values , there exists a unique polynomial of degree satisfying for all .
The Lagrange basis polynomial for node is
and the interpolating polynomial is
Visualization
Interpolate through three points , , :
| node | value | basis | |
|---|---|---|---|
| 0 | 0 | 1 | |
| 1 | 1 | 2 | |
| 2 | 2 | 5 |
Summing:
Expanding term-by-term and collecting:
Verification: , , . Degree . Unique.
Proof Sketch
- Existence. Form . By construction , so . Each has degree , so .
- Uniqueness. Suppose also satisfies the conditions and . Then vanishes at all nodes and has degree , so a polynomial of degree with roots must be the zero polynomial.
- Linear map. The assignment is an -linear map; the Lagrange basis is a basis for the space of polynomials of degree .
Connections
Lagrange interpolation generalizes Vieta's FormulasVieta's FormulasRelating the coefficients of a polynomial to the sums and products of its rootsRead more → (which read off coefficients from roots) and underpins Taylor's TheoremTaylor's TheoremApproximate smooth functions by polynomials with explicit error boundsRead more → (the limit as nodes coalesce). The uniqueness argument is the same dimension count as Rank–Nullity TheoremRank–Nullity TheoremThe dimensions of image and kernel of a linear map sum to the domain dimensionRead more →.
Lean4 Proof
-- Mathlib: Mathlib.LinearAlgebra.Lagrange
-- `Lagrange.interpolate s v r` is the unique polynomial of degree < #s
-- interpolating r at the nodes v.
-- We state the two key properties: correct values and degree bound.
open Lagrange in
theorem lagrange_eval_node (F : Type*) [Field F] {ι : Type*} [DecidableEq ι]
(s : Finset ι) (v : ι → F) (r : ι → F)
(hvs : Set.InjOn v s) (hi : ∀ i ∈ s, True) (i : ι) (his : i ∈ s) :
(interpolate s v r).eval (v i) = r i :=
eval_interpolate_at_node r hvs his
open Lagrange in
theorem lagrange_degree_lt (F : Type*) [Field F] {ι : Type*} [DecidableEq ι]
(s : Finset ι) (v : ι → F) (r : ι → F) (hvs : Set.InjOn v s) :
(interpolate s v r).degree < s.card :=
degree_interpolate_lt r hvs