Skip to 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/∣S∣d/|S| follows trivially.

Now assume that the claim is true for up to (n−1)(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)=xnℓ⋅q(x1,…,xn−1)+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,…,an−1)=0q(a_1,\ldots, a_{n-1}) = 0.

P[Ep]=P[Ep∩Eq]+P[Ep∩E‾q]≤P[Eq]+P[Ep∩E‾q]{\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 n−1n-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[Ep∩E‾q]≤ℓ/∣S∣{\mathbb P}[E_p \cap \overline{E}_q] \leq \ell/|S|.

Proof:

Notice that the event E‾q\overline{E}_q depends on the values of a1,…,an−1a_1,\ldots, a_{n-1}, so we can further partition E‾q\overline{E}_q based on the values of these aia_i's. Let F(α1,…,αn−1)=E‾q∩{(a1,…,an−1):(∀i∈[n−1]) 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 E‾q\overline{E}_q holds for a given choice of aia_i's). Therefore,

P[Ep∩E‾q]=∑(α1,…,αn−1)P[Ep∩F(α1,…,αn−1)]≤∑(α1,…,αn−1)P[Ep∣F(α1,…,αn−1)]⋅P[F(α1,…,αn−1)]{\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[Ep∣F(α1,…,αn−1)]{\mathbb P}[E_p \mid F(\alpha_1,\ldots, \alpha_{n-1})], the values of a1,…,an−1a_1,\ldots, a_{n-1} are all fixed (they are equal to the αi\alpha_i's). Therefore, p(α1,…,αn−1,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 f∈Fp[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,…,xn−1)q_n(x_1,\ldots, x_{n-1}) is the coefficient of xndnx_n^{d_n} in ff.
  • dn−1d_{n-1} is the maximum exponent of xn−1x_{n-1} in qnq_n and qn−1(x1,…,xn−2)q_{n-1}(x_1,\ldots, x_{n-2}) is the coefficient of xn−1dn−1x_{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 Si⊆FpS_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?

Toolbox by Hilmy Abiyyu Asad from the Noun Project. © 2026 Me. Built with VitePress.