Skip to main content

Proof of Theorem 48 (Schwartz-Zippel Lemma)

We prove the theorem by induction on nn (the number of variables). When n=1n=1, this is exactly the univariate case so the polynomial has at most dd roots, and therefore the probability of at most d/Sd/|S| follows trivially.

Now assume that the claim is true for up to (n1)(n-1) variables and consider a polynomial p(x1,,xn)p(x_1,\ldots, x_n). Let \ell be the highest degree of xnx_n among all the terms in pp. We can write

p(x1,,xn)=xnq(x1,,xn1)+r(x1,,xn)p(x_1,\ldots, x_n) = x_n^{\ell}\cdot q(x_1,\ldots, x_{n-1}) + r(x_1,\ldots, x_n) where the degree of xnx_n in rr is at most (1)(\ell-1).

Let EpE_p be the event that we are interested in, i.e., the event that p(a1,,an)=0p(a_1,\ldots, a_n) = 0 and EqE_q be the event that q(a1,,an1)=0q(a_1,\ldots, a_{n-1}) = 0.

P[Ep]=P[EpEq]+P[EpEq]P[Eq]+P[EpEq]{\mathbb P}[E_p] = {\mathbb P}[E_p \cap E_q] + {\mathbb P} [E_p \cap \overline{E}_q] \leq {\mathbb P}[E_q] + {\mathbb P}[E_p \cap \overline{E}_q]

Since qq has n1n-1 variables and deg(q)d\deg(q) \le d-\ell (do you see why?), we use the induction hypothesis to say that P[Eq](d)/S{\mathbb P}[E_q] \leq (d-\ell)/|S|. The following claim will complete the proof of the theorem.

Claim 1

P[EpEq]/S{\mathbb P}[E_p \cap \overline{E}_q] \leq \ell/|S|.

Proof:

Notice that the event Eq\overline{E}_q depends on the values of a1,,an1a_1,\ldots, a_{n-1}, so we can further partition Eq\overline{E}_q based on the values of these aia_i's. Let F(α1,,αn1)=Eq{(a1,,an1):(i[n1]) ai=αi}F(\alpha_1,\ldots, \alpha_{n-1}) = \overline{E}_q \cap \{(a_1,\ldots, a_{n-1}): (\forall i \in [n-1])\ a_i = \alpha_i\} (these are disjoint events that Eq\overline{E}_q holds for a given choice of aia_i's). Therefore,

P[EpEq]=(α1,,αn1)P[EpF(α1,,αn1)](α1,,αn1)P[EpF(α1,,αn1)]P[F(α1,,αn1)]{\mathbb P}[E_p \cap \overline{E}_q] = \sum_{(\alpha_1,\ldots, \alpha_{n-1})} {\mathbb P}[E_p \cap F(\alpha_1,\ldots, \alpha_{n-1})] \leq \sum_{(\alpha_1,\ldots, \alpha_{n-1})} {\mathbb P}[E_p \mid F(\alpha_1,\ldots, \alpha_{n-1})] \cdot {\mathbb P}[F(\alpha_1,\ldots, \alpha_{n-1})]

The key is that, in the conditional term P[EpF(α1,,αn1)]{\mathbb P}[E_p \mid F(\alpha_1,\ldots, \alpha_{n-1})], the values of a1,,an1a_1,\ldots, a_{n-1} are all fixed (they are equal to the αi\alpha_i's). Therefore, p(α1,,αn1,xn)p(\alpha_1,\ldots, \alpha_{n-1}, x_n) is a univariate polynomial of degree \ell. By the base case, we have that the probability is at most /S\ell/|S|.

Exercise 130

Benjawan claims the following version of the Schwartz-Zippel lemma: Let fFp[x1,,xn]f \in {\mathbb F}_p[x_1,\ldots, x_n] be a polynomial. For this ff, define the sequence d1,,dnd_1,\ldots, d_n as follows:

  • dnd_n is the maximum exponent of xnx_n in ff, and qn(x1,,xn1)q_n(x_1,\ldots, x_{n-1}) is the coefficient of xndnx_n^{d_n} in ff.
  • dn1d_{n-1} is the maximum exponent of xn1x_{n-1} in qnq_n and qn1(x1,,xn2)q_{n-1}(x_1,\ldots, x_{n-2}) is the coefficient of xn1dn1x_{n-1}^{d_{n-1}} in qnq_n
  • and so on until we have completely defined d1d_1.

Now perform a random process where each aia_i is chosen uniformly at random from some set SiFpS_i \subseteq {\mathbb F}_p. Then,

P[f(a1,,an)=0]idi/Si{\mathbb P}[f(a_1,\ldots, a_n) = 0] \leq \sum_{i} d_i/|S_i|

Is this claim true? Prove or disprove it. In case it is true, is this stronger or weaker than the original Schwartz-Zippel lemma?