Schwartz-Zippel Lemma #
This file proves the Schwartz-Zippel lemma over finite fields: for a non-zero polynomial φ over ZMod p, a uniformly random point is a root with probability at most deg(φ) / p.
Main theorem #
schwartz_zippel— Pr[φ(x) = 0] ≤ deg(φ) / p for φ ≠ 0
Application #
Used in KZGBatch binding proof: if the adversary outputs inconsistent openings, we extract a non-zero polynomial δ with δ(α) = 0. By Schwartz-Zippel, this happens with probability at most deg(δ) / p.
References #
- [Schwartz 1980, Zippel 1979 — Probabilistic algorithms for sparse polynomials]
- [Mitzenmacher-Upfal, Probability and Computing, §7.2]
Schwartz-Zippel Lemma #
The Schwartz-Zippel lemma: for a non-zero polynomial φ over ZMod p, a uniformly random point is a root with probability at most deg(φ) / p.
Proof outline:
- Use
prTrue_sample_pure_boolto convert probability to fraction - Bound the number of roots using Polynomial.card_roots'
- Divide by p to get the bound
Corollary: Polynomial Identity Testing #
Polynomial identity testing (direct corollary of Schwartz-Zippel): for distinct polynomials φ ≠ ψ over ZMod p, a uniformly random point satisfies φ(x) = ψ(x) with probability at most max(deg φ, deg ψ) / p.
Proof: apply schwartz_zippel to the nonzero polynomial φ - ψ, then
use natDegree_add_le + natDegree_neg to bound its degree.