A(X)=n−1∏i=0(X−xi)
A′(X)=n−1∑j=0∏i≠j(X−xi)
f(z)=A(z)n−1∑i=0fiA′(xi)1z−xi
Let ω be an n-th root of unity satisfying A(X)=Xn−1=0.
Let f(X) be a polynomial defined by its evaluations fi=f(ωi) (n values). We want to check that f(X) is of degree at most n/2−1.
Let g(X) be the polynomial function resulting from interpolating f0,f2,f4,… and h(X) the same by interpolating f1,f3,f5,…. If g(X)==h(X), then the degree of f(X) must be less than n/2−1.
We sample a random point r and use the barycentric formular to evaluat g(X) and h(X) at r. If g(r)=h(r) then with large probability g(X)=h(X) (Schwartz-Zippel Lemma). In order to compute this we use the barycentric formula for g(r) and h(r):
B(X)=Xn2−1
B′(X)=n2Xn2−1
g(r)=B(r)n−1∑i=0i evenfiB′(ωi)1r−ωi=2nn−1∑i=0i evenfiωi(n2−1)rn2−1r−ωi
C(X)=Xn2+1
C′(X)=n2Xn2−1=B′(X)
h(r)=C(r)n−1∑i=0i oddfiC′(ωi)1r−ωi=2nn−1∑i=0i oddfiωi(n2−1)rn2+1r−ωi
So to check that f(X) is of low degree verify that
g(r)−h(r)=2nn−1∑i=0fiωi(n2−1)(−1)irn2−1r−ωi=0
By contradiction. Assume that there does not exist a polynomial of degree n−1 or less that interpolates all fi.
g(X) and h(X) are both of degree at most n−1; if g(X)=h(X) then they would both interpolate all the points, which thus cannot be true. Thus g(X)≠h(X).
This means that p(X)=g(X)−h(X) is a polynomial of degree at most n−1 and not identical to 0; accordingly it has at most n−1 zeros in Fp. The probability that p(r)=0 for a random r is thus ≤n−1p and thus negligible.
More generally, how can we check that n points are on a polynomial of degree d, where d is not necessarily \(\frac{n}{2} - 1\)?
We can still do this by applying the barycentric formular to (1) and d+1 points and (2) all n points.
B(X)=d∏i=0(X−ωi)
B′(X)=d∑j=0∏i≠j(X−ωi)
g(r)=B(r)d∑i=0fiB′(ωi)1r−ωi
C(X)=Xn−1
C′(X)=nXn−1
h(r)=C(r)n−1∑i=0fiC′(ωi)1r−ωi=1nn−1∑i=0fiωi(n−1)rn−1r−ωi
g(r)−h(r)=d∑i=0fir−ωi(B(r)B′(ωi)−rn−1nωi(n−1))−n−1∑i=dfir−ωirn−1nωi(n−1)
The main downside of this formular is that computing the B′(ωi) takes quadratic time and this is not a linear algorithm anymore. However when d and n are known beforehand this can be precomputed.