A-10 Lagrange’s Polynomial Interpolation

Suppose we are given n + 1 two-dimensional coordinates (x0,y0),(x1,y1),⋯,(xn,yn), where all x values are distinct, but y values are not necessarily distinct. Lagrange’s polynomial interpolation is a technique to find a unique polynomial of degree at most n that passes through such n + 1 coordinates. The given points (xi,yi) may lie either in ℂ2 (the complex plane, which includes the real numbers) or in ℤp2 for some prime p.

⟨Theorem A-10⟩ Lagrange’s Polynomial Interpolation

Suppose we are given n + 1 two-dimensional coordinates (x0,y0),(x1,y1),⋯,(xn,yn), whereas all X values are distinct but the Y values don’t need to be distinct. The domain of (X,Y ) can be either: (xi,yi) ∈ ℂ2 (which includes the real domain) or (xi,yi) ∈ ℤp2 (where p is a prime). Then, there exists a unique polynomial f(X) of degree at most n that passes through these n + 1 coordinates. Such a polynomial f(X) is computed as follows:

f(X) = ∑ ⁡ j=0n (X −x0) ⋅(X −x1)⋯(X −xj−1) ⋅(X −xj+1)⋯(X −xn) (xj −x0) ⋅(xj −x1)⋯(xj −xj−1) ⋅(xj −xj+1)⋯(xj −xn) ⋅yj

f(X) = ∑ ⁡ j=0n (∏ 0≤k≤n k≠j X −xk xj −xk ⋅yj)

Proof.

1.
First, we will show that there exists an n-degree (or lesser degree) polynomial f(X) that passes through the n + 1 distinct coordinates: (x0,y0),(x1,y1),…,(xn,yn). Such a polynomial f(X) is designed as follows:

f(X) = ∑ ⁡ j=0n (X −x0) ⋅(X −x1)⋯(X −xj−1) ⋅(X −xj+1)⋯(X −xn) (xj −x0) ⋅(xj −x1)⋯(xj −xj−1) ⋅(xj −xj+1)⋯(xj −xn) ⋅yj

f(X) = ∑ ⁡ j=0n (∏ 0≤k≤n k≠j X −xk xj −xk ⋅yj)

f(X) = ∑ ⁡ j=0nℓj(X) ⋅yj ▹ where ℓj(X) = ∏ ⁡ 0≤k≤n k≠j X −xk xj −xk

We call {ℓ0(X),ℓ1(X),…,ℓn(X)} the Lagrange basis for polynomials of degree ≤n. Given this design of f(X), notice that for each of (xi,yi) ∈{(x0,y0),(x1,y1),…,(xn,yn)}, ℓi(xi′) = 1 for i′ = i, and ℓi(xi′) = 0 for i′≠i. Therefore, f(xi) = ∑ ⁡ j=0nℓj(xi) ⋅yj = 1 ⋅yi = yi for 0 ≤i ≤n. In other words, f(X) passes through the n + 1 distinct coordinates: {(x0,y0),(x1,y1),…,(xn,yn)}. Such a satisfactory f(X) can be computed in the case where the domain of (X,Y ) is either: (xi,yi) ∈ ℂ2 (i.e., real and complex numbers), or (xi,yi) ∈ ℤp2 (where p is a prime). Especially, a valid f(X) can be computed also in the mod p domain, because as we learned from Fermat’s Little Theorem in Theorem A-4.2.4 (§A-4.2), ap−1 ≡1 mod p if and only if a and p are co-prime, and this means that if p is a prime, then ap−1 ≡1 mod p for all a ∈ ℤp× (i.e., ℤp without {0}). Since every value in ℤp× has an inverse, we can perform each division in the formula for f(X) = ∑ ⁡ j=0n (X −x0) ⋅(X −x1)⋯(X −xj−1) ⋅(X −xj+1)⋯(X −xn) (xj −x0) ⋅(xj −x1)⋯(xj −xj−1) ⋅(xj −xj+1)⋯(xj −xn) ⋅yj by multiplying with the corresponding inverses of those denominators.

2.
Next, we will prove that no two distinct n-degree (or lesser degree) polynomials f1(X) and f2(X) can pass through the same n + 1 distinct (X,Y ) coordinates. Suppose there exist such two polynomials f1(X) and f2(X). Then f1−2(X) = f1(X) −f2(X) will be a new n-degree (or lesser degree) polynomial that passes through (x0,0),(x1,0),⋯,(xn,0). This means that f1−2(X) has n + 1 distinct roots. In other words, f1−2(X) is an n + 1-degree (or higher-degree) polynomial. However, this contradicts the assumption that f1−2(X) is an n-degree (or lesser degree) polynomial. Therefore, there exist no two polynomials f1(X) and f2(X) that pass through the same n + 1 distinct (X,Y ) coordinates.
3.
We have shown that there exists some n-degree (or lesser degree) polynomial f(X) that passes through n + 1 distinct (X,Y ) coordinates, and no such two or more distinct polynomials exists. Therefore, there exists only a unique polynomial that satisfies this requirement.
□

A-10.1 The Field Condition for Unique Interpolation