Let P be a non-zero polynomial on n variables of degree d.
Let S be the set of size at least d+1.
We randomly sample n values, a1,a2,…,ai from S independently, uniformly and randomly. The theorem states that
P[P(a1,a2,…,an)=0]≤∣S∣d
Proof
Proof using mathematical induction on n. Base Case -n=1
We know that a d-degree polynomial can have at most d roots (Fundamental theorem of algebra). Hence, the bound holds true for n=1 variable polynomials. Induction state - Assume it’s true for n≤k−1, prove for n=k
We have the variables x1,x2,…,xn
We can restructure the n variable polynomial in terms of coefficients of x1
P(x1,…,xn)=i=0∑dx1iPi(x2,…,xn)
From our initial assumption, it’s known that P is not identically 0, therefore we find the largesti such that Pi is not identically 0.
Note that for any i, degPi≤d−i, as the degree of x1iPi is at most d
We aim to prove the bound defined by the lemma using this structure
Where ri are independently, uniformly, and randomly (i.u.a.r) sampled from S.
P[B]
We know that the degree of Pi is ≤d−i. Therefore, by the induction hypothesis, for an n−1 variable polynomial we get
P[Pi(r2,r3,…,rn)=0]≤∣S∣d−i
P[A∣Bc]
If Pi(r2,r3,…,rn)=0, Bc occurs, we now know that the degree of the polynomial P is i, since all the Pj≡0,∀j>i. We can plug in the values of r2,r3,…,rn, and get an i-degree univariate polynomial in terms of xi.
Therefore, with the help of the induction hypothesis, for a univariate polynomial we can say that
Using this lemma, we can test if two multivariate polynomials f,g are equal by identity testing polynomial h=f−g.
Randomized Algorithm for Polynomial Identity Testing
Pick a set S of size αd, where α>1
Evaluate at a point aˉ (a vector of size n) whose corrdinates are sample i.u.a.r from S.
If f(aˉ)=0 assert f≡0, else f≡0 .
P[Error]≤∣S∣d=α1
The possible error is that a non-zero polynomial is asserted as a zero-polynomial.
Verifying Matrix Multiplication
An application of Polynomial Identity Testing is verifying matrix multiplication
Given matrices A,B,C, we need to verify if AB=C.
This can be done in O(nw) (w is the matrix multiplication exponent), but we can speed this up using randomization.
Let S be a finite subset of R, and we choose xˉ=(x1,x2,…,xn) i.u.a.r
We then verify if ABx=Cx. If true, we say that AB=C, else return AB=C.
Running this takes O(n2) time, as finding Bx, A(Bx) and Cx are all O(n2) time operations.
Probability Analysis
ABx,Cx are both vectors, whose entries are linear forms in x.
If AB=C, then we know that ∀xˉ,ABxˉ=Cxˉ, which essentially means ∀1≤i≤n,Li(xˉ)−Li′(xˉ)=0
If AB=C, then there exists some vector xˉ such that Li(xˉ)−Li′(xˉ)=0
Lemma - For any linear polynomial L(x)
P[L(aˉ)=0]≤∣S∣1
Proof - We can arrive to this result using the principle of deferred decision.
We know that we can represent L(x) as
L(x)=i=1∑nbixi
Assume we randomly pick the first n−1 values for x as a1,a2,…,an−1, we’d get
L(x)=bnxn+i=1∑n−1biai
For L(x)=0,
bnxn=−i=1∑n−1biai
There is at max 1 possible value for xn in S for which this equality holds true, hence the probability of this being true is ≤∣S∣1.
Claim - If AB=C, then P[ABx=Cx]≤∣S∣1 Proof -
When AB=C, we say a bad event is when Li(xˉ)−Li′(xˉ)=0∀i∈[n], i.e we picked a vector such that ABx=Cx event when AB=C, which causes us to incorrectly say that AB=C.
The probability of the bad event occurring is bounded by