A variant of the Schwartz–Zippel lemma Let $f \in \mathbb{F}[x_1,\ldots,x_n]$ be a nonzero polynomial. Let $d_1$ be the maximum exponent of $x_1$ in $f$ and let $f_1$ be the coefficient of $x_1^{d_1}$ in $f.$ Let $d_2$ be the maximal exponent of $x_2$ in $f_1$ and so on for $d_3,\ldots,d_n.$
I would like to show that if $S_1, \ldots, S_n \subseteq \mathbb{F}$ are arbitrary subsets and $r_i \in S_i$ are chosen uniformly at random then $$ Pr[f(r_1,\ldots,r_n) = 0] \leq \frac{d_1}{|S_1|} + \cdots + \frac{d_n}{|S_n|}.$$
The claim is obviously true for $n = 1$ but for multivariate polynomials I don't see how to prove the claim since I don't see how to handle the fact that we disregard from $f$ all the terms containing $x_1^{k}$ for $k < d_1.$
 A: I think the following should do it
We prove the claim by induction on $n.$ For $n = 1$ the statement reduces to the well known fact that a polynomial (of a single variable) of degree $d$ has at most $d$ roots. Assume thus that the claim holds for all polynomials with less than $n$ variables and let $f(x_1,\ldots,x_n) \in \mathbb{F}[x_1,\ldots,x_n]$ be a nonzero polynomial with degree sequence $(d_1,\ldots,d_n).$ By definition of the degree sequence we may write $f$ as $$f(x_1,\ldots,x_n) = \sum_{i=0}^{d_1} x_1^i f_i(x_2,\ldots,x_n).$$
Observe that (again, by the definition of the degree sequence) $f_{d_1}$ is not identical to zero. Let $(r_2,\ldots,r_n) \in S_2 \times \cdots \times S_n$ be chosen uniformly at random. By the induction hypothesis $$Pr[f_{d_1}(r_2,\ldots,r_n) = 0] \leq \frac{d_2}{|S_2|} + \cdots + \frac{d_n}{|S_n|}.$$ Now if $f_{d_1}(r_2,...,r_n) \ne 0$ then $x_1$ has degree $d_1$ in $$f_1(x_1,r_2,\ldots,r_n)$$ and hence $$Pr[f(r_1,\ldots,r_n) = 0 | f_{d_1}(r_2,...,r_n) \ne 0] \leq \frac{d_1}{|S_1|}.$$ 
Let us now denote by $E$ the event that $f(r_1,\ldots,r_n) = 0$ and by $F$ the event $f_{d_1}(r_2,\ldots,r_n) = 0.$ We obtain $$Pr[E] = Pr[E \cap F]+Pr[E \cap \overline{F}] = Pr[F] Pr[E|F]+Pr[\overline{F}]Pr[E|\overline{F}] \leq Pr[F]+Pr[E|\overline{F}] \leq \sum_{i=1}^n d_i/|S_i|.$$
A: This "variant of the Schwartz-Zippel Lemma" is in fact Lemma 1 from Jack Schwartz's original paper.
Note that although it looks nice to phrase the statement and/or the proof in probabilistic language, it is certainly not necessary to do so: Schwartz phrases it as a pure counting argument, which is (even) shorter than Jernej's (nice) solution above.  I mention this because the first time I saw this kind of proof of the Schwartz-Zippel Lemma, I think I took the probabilistic stuff a bit too seriously: it really is a way of phrasing the argument rather than a proof technique.   
I hope the textbook gives some indication of the provenance of this "exercise"!
