Schwartz–Zippel lemma

From HandWiki
Short description: Tool used in probabilistic polynomial identity testing

In mathematics, the Schwartz–Zippel lemma (also called the DeMillo–Lipton–Schwartz–Zippel lemma) is a tool commonly used in probabilistic polynomial identity testing, i.e. in the problem of determining whether a given multivariate polynomial is the 0-polynomial[clarification needed] (or identically equal to 0). It was discovered independently by Jack Schwartz,[1] Richard Zippel,[2] and Richard DeMillo and Richard J. Lipton, although DeMillo and Lipton's version was shown a year prior to Schwartz and Zippel's result.[3] The finite field version of this bound was proved by Øystein Ore in 1922.[4]

Statement and proof of the lemma

Theorem 1 (Schwartz, Zippel). Let

[math]\displaystyle{ P\in R[x_1,x_2,\ldots,x_n] }[/math]

be a non-zero polynomial of total degree d ≥ 0 over an integral domain R. Let S be a finite subset of R and let r1r2, ..., rn be selected at random independently and uniformly from S. Then

[math]\displaystyle{ \Pr[P(r_1,r_2,\ldots,r_n)=0]\leq\frac{d}{|S|}. }[/math]

Equivalently, the Lemma states that for any finite subset S of R, if Z(P) is the zero set of P, then

[math]\displaystyle{ | Z(P) \cap S^n | \leq d \cdot |S|^{n-1}. }[/math]

Proof. The proof is by mathematical induction on n. For n = 1, as was mentioned before, P can have at most d roots. This gives us the base case. Now, assume that the theorem holds for all polynomials in n − 1 variables. We can then consider P to be a polynomial in x1 by writing it as

[math]\displaystyle{ P(x_1,\dots,x_n)=\sum_{i=0}^d x_1^i P_i(x_2,\dots,x_n). }[/math]

Since P is not identically 0, there is some i such that [math]\displaystyle{ P_i }[/math] is not identically 0. Take the largest such i. Then [math]\displaystyle{ \deg P_i\leq d-i }[/math], since the degree of [math]\displaystyle{ x_1^iP_i }[/math] is at most d.

Now we randomly pick [math]\displaystyle{ r_2,\dots,r_n }[/math] from S. By the induction hypothesis, [math]\displaystyle{ \Pr[P_i(r_2,\ldots,r_n)=0]\leq\frac{d-i}{|S|}. }[/math]

If [math]\displaystyle{ P_i(r_2,\ldots,r_n)\neq 0 }[/math], then [math]\displaystyle{ P(x_1,r_2,\ldots,r_n) }[/math] is of degree i (and thus not identically zero) so

[math]\displaystyle{ \Pr[P(r_1,r_2,\ldots,r_n)=0|P_i(r_2,\ldots,r_n)\neq 0]\leq\frac{i}{|S|}. }[/math]

If we denote the event [math]\displaystyle{ P(r_1,r_2,\ldots,r_n)=0 }[/math] by A, the event [math]\displaystyle{ P_i(r_2,\ldots,r_n)=0 }[/math] by B, and the complement of B by [math]\displaystyle{ B^c }[/math], we have

[math]\displaystyle{ \begin{align} \Pr[A] & =\Pr[A\cap B]+\Pr[A\cap B^c] \\ &=\Pr[B]\Pr[A|B]+\Pr[B^c]\Pr[A|B^c] \\ &\leq \Pr[B]+\Pr[A|B^c] \\ &\leq \frac{d-i}{|S|}+\frac{i}{|S|}=\frac{d}{|S|} \end{align} }[/math]

Applications

The importance of the Schwartz–Zippel Theorem and Testing Polynomial Identities follows from algorithms which are obtained to problems that can be reduced to the problem of polynomial identity testing.

Zero testing

For example, is

[math]\displaystyle{ (x_1 + 3x_2 - x_3)(3x_1 + x_4 - 1) \cdots (x_7 - x_2) \equiv 0\  ? }[/math]

To solve this, we can multiply it out and check that all the coefficients are 0. However, this takes exponential time. In general, a polynomial can be algebraically represented by an arithmetic formula or circuit.

Comparison of two polynomials

Given a pair of polynomials [math]\displaystyle{ p_1(x) }[/math] and [math]\displaystyle{ p_2(x) }[/math], is

[math]\displaystyle{ p_1(x) \equiv p_2(x) }[/math]?

This problem can be solved by reducing it to the problem of polynomial identity testing. It is equivalent to checking if

[math]\displaystyle{ [p_1(x) - p_2(x)] \equiv 0. }[/math]

Hence if we can determine that

[math]\displaystyle{ p(x) \equiv 0, }[/math]

where

[math]\displaystyle{ p(x) = p_1(x)\;-\;p_2(x), }[/math]

then we can determine whether the two polynomials are equivalent.

Comparison of polynomials has applications for branching programs (also called binary decision diagrams). A read-once branching program can be represented by a multilinear polynomial which computes (over any field) on {0,1}-inputs the same Boolean function as the branching program, and two branching programs compute the same function if and only if the corresponding polynomials are equal. Thus, identity of Boolean functions computed by read-once branching programs can be reduced to polynomial identity testing.

Comparison of two polynomials (and therefore testing polynomial identities) also has applications in 2D-compression, where the problem of finding the equality of two 2D-texts A and B is reduced to the problem of comparing equality of two polynomials [math]\displaystyle{ p_A(x,y) }[/math] and [math]\displaystyle{ p_B(x,y) }[/math].

Primality testing

Given [math]\displaystyle{ n \in \mathbb{N} }[/math], is [math]\displaystyle{ n }[/math] a prime number?

A simple randomized algorithm developed by Manindra Agrawal and Somenath Biswas can determine probabilistically whether [math]\displaystyle{ n }[/math] is prime and uses polynomial identity testing to do so.

They propose that all prime numbers n (and only prime numbers) satisfy the following polynomial identity:

[math]\displaystyle{ (1+z)^n = 1+z^n (\mbox{mod}\;n). }[/math]

This is a consequence of the Frobenius endomorphism.

Let

[math]\displaystyle{ \mathcal{P}_n(z) = (1+z)^n - 1 -z^n. }[/math]

Then [math]\displaystyle{ \mathcal{P}_n(z) = 0\;(\mbox{mod}\;n) }[/math] iff n is prime. The proof can be found in [4]. However, since this polynomial has degree [math]\displaystyle{ n }[/math], where [math]\displaystyle{ n }[/math] may or may not be a prime, the Schwartz–Zippel method would not work. Agrawal and Biswas use a more sophisticated technique, which divides [math]\displaystyle{ \mathcal{P}_n }[/math] by a random monic polynomial of small degree.

Prime numbers are used in a number of applications such as hash table sizing, pseudorandom number generators and in key generation for cryptography. Therefore, finding very large prime numbers (on the order of (at least) [math]\displaystyle{ 10^{350} \approx 2^{1024} }[/math]) becomes very important and efficient primality testing algorithms are required.

Perfect matching

Let [math]\displaystyle{ G = (V, E) }[/math] be a graph of n vertices where n is even. Does G contain a perfect matching?

Theorem 2 (Tutte 1947): A Tutte matrix determinant is not a 0-polynomial if and only if there exists a perfect matching.

A subset D of E is called a matching if each vertex in V is incident with at most one edge in D. A matching is perfect if each vertex in V has exactly one edge that is incident to it in D. Create a Tutte matrix A in the following way:

[math]\displaystyle{ A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1\mathit{n}} \\ a_{21} & a_{22} & \cdots & a_{2\mathit{n}} \\ \vdots & \vdots & \ddots & \vdots \\ a_{\mathit{n}1} & a_{\mathit{n}2} & \ldots & a_{\mathit{nn}} \end{bmatrix} }[/math]

where

[math]\displaystyle{ a_{ij} = \begin{cases} x_{ij}\;\;\mbox{if}\;(i,j) \in E \mbox{ and } i\lt j\\ -x_{ji}\;\;\mbox{if}\;(i,j) \in E \mbox{ and } i\gt j\\ 0\;\;\;\;\mbox{otherwise}. \end{cases} }[/math]

The Tutte matrix determinant (in the variables xij, [math]\displaystyle{ i\lt j }[/math] ) is then defined as the determinant of this skew-symmetric matrix which coincides with the square of the pfaffian of the matrix A and is non-zero (as polynomial) if and only if a perfect matching exists. One can then use polynomial identity testing to find whether G contains a perfect matching. There exists a deterministic black-box algorithm for graphs with polynomially bounded permanents (Grigoriev & Karpinski 1987).[5]

In the special case of a balanced bipartite graph on [math]\displaystyle{ n =m + m }[/math] vertices this matrix takes the form of a block matrix

[math]\displaystyle{ A = \begin{pmatrix} 0 & X \\ -X^t & 0 \end{pmatrix} }[/math]

if the first m rows (resp. columns) are indexed with the first subset of the bipartition and the last m rows with the complementary subset. In this case the pfaffian coincides with the usual determinant of the m × m matrix X (up to sign). Here X is the Edmonds matrix.

Determinant of a matrix with polynomial entries

Let

[math]\displaystyle{ p(x_1,x_2, \ldots, x_n) }[/math]

be the determinant of the polynomial matrix.

Currently, there is no known sub-exponential time algorithm that can solve this problem deterministically. However, there are randomized polynomial algorithms whose analysis requires a bound on the probability that a non-zero polynomial will have roots at randomly selected test points.

Notes

  1. Schwartz 1980.
  2. Zippel 1979.
  3. DeMillo & Lipton 1978.
  4. Ö. Ore, Über höhere Kongruenzen. Norsk Mat. Forenings Skrifter Ser. I (1922), no. 7, 15 pages.
  5. Grigoriev & Karpinski 1987.

References

External links