Schwartz-Zippel bounds for two-dimensional products

We prove bounds on intersections of algebraic varieties in $\mathbb{C}^4$ with Cartesian products of finite sets from $\mathbb{C}^2$, and we point out connections with several classic theorems from combinatorial geometry. Consider an algebraic variety $X$ in $\mathbb{C}^4$ of degree $d$, such that the polynomials defining $X$ are not all of the form $F(x,y,s,t) = G(x,y)H(x,y,s,t) + K(s,t)L(x,y,s,t)$. Let $P$ and $Q$ be finite subsets of $\mathbb{C}^2$ of size $n$. If $X$ has dimension one or two, then we prove $|X\cap (P\times Q)| = O_d(n)$, while if $X$ has dimension three, then $|X\cap (P\times Q)| =O_{d,\varepsilon}(n^{4/3+\varepsilon})$ for any $\varepsilon>0$. Both bounds are best possible in this generality (except for the $\varepsilon$). These bounds can be viewed as different generalizations of the Schwartz-Zippel lemma, where we replace a product of"one-dimensional"finite subsets of $\mathbb{C}$ by a product of"two-dimensional"finite subsets of $\mathbb{C}^2$. The bound for three-dimensional varieties generalizes the Szemer\'edi-Trotter theorem. A key ingredient in our proofs is a two-dimensional version of a special case of Alon's combinatorial Nullstellensatz. As corollaries of our two bounds, we obtain bounds on the number of repeated and distinct values of polynomials and polynomial maps of pairs of points in $\mathbb{C}^2$, with a characterization of those maps for which no good bounds hold. These results generalize known bounds on repeated and distinct Euclidean distances.


Introduction
A special case of the well-known Schwartz-Zippel 1 lemma states that for an algebraic curve C ⊂ C 2 of degree d and two finite sets A, B ⊂ C, we have 2 In other words, it bounds the size of the intersection of an algebraic curve with a Cartesian product of "one-dimensional" sets (let us informally call a finite set k-dimensional if it is given as a subset of C k ). The full Schwartz-Zippel lemma generalizes this statement to polynomials over any field in any number of variables. A related statement is Alon's combinatorial Nullstellensatz [1], which (in this case) says that C contains all of A × B if and only if it is defined by a polynomial of the form g(x)h(x, y) + k(y)l(x, y), with g vanishing on A and k vanishing on B.
In this paper we study generalizations of these statements to Cartesian products of twodimensional sets. More precisely, given a variety 3 X ⊂ C 4 and two finite sets P, Q ⊂ C 2 , we prove upper bounds on the size of the intersection and we determine which X can contain a whole product P ×Q. Unlike in the one-dimensional case, we cannot expect a good bound on (2) for all varieties. Take for instance X = Z(F ) with F (x, y, s, t) = xs + yt; if we take P on the y-axis and Q on the s-axis, then X contains all of P ×Q. This example is generalized in the following definition, which appears to be new. Note the similarity with the special form in the version of Alon's Nullstellensatz mentioned above.
with H, L ∈ C[x, y, s, t]; F is Cartesian if there are non-constant G, K such that F is (G, K)-Cartesian. Let X be a variety in C 4 and let I(X) be its defining ideal. Then X is Cartesian if there are G ∈ C[x, y]\C, K ∈ C[s, t]\C such that every F ∈ I(X) is (G, K)-Cartesian. Note that a reducible variety is Cartesian if one of its components is Cartesian, since the ideal of a union of varieties is the intersection of the ideals of the components.
If X is Cartesian, then we cannot give a better bound on (2) than the trivial |P ||Q|. Indeed, given G and K, we can arbitrarily choose finite subsets P ⊂ Z(G) ⊂ C 2 and Q ⊂ Z(K) ⊂ C 2 . Then for any polynomial F of the form (3) we have F (p, q) = 0 for all (p, q) ∈ P × Q, which means that |X ∩ (P × Q)| = |P ||Q|.
Our two main theorems show that, as long as X is not Cartesian, much better bounds hold. Moreover, it turns out that there is a dichotomy between varieties of dimension three and varieties of dimension less than three 4 . When X has dimension one or two, our first main theorem gives a linear bound, which perhaps makes this statement the most natural generalization of the one-dimensional Schwartz-Zippel bound (1). Theorem 1.2. Let X be a variety in C 4 of degree d and dimension one or two, and let P, Q ⊂ C 2 be finite sets. Then unless X is Cartesian.
Our second main theorem concerns varieties of dimension three, where we observe a very different bound. Theorem 1.3. Let X be a variety in C 4 of degree d and dimension three, and let P, Q ⊂ C 2 be finite sets. Then 5 |X ∩ (P × Q)| = O d,ε |P | 2/3+ε |Q| 2/3 + |P | + |Q| , unless X is Cartesian. When P, Q ⊂ R 2 , the ε can be omitted.
The ε in Theorem 1.3 could of course just as well be placed in the exponent of |Q|. It comes from the incidence bound of Sheffer and Zahl [22] that we use. We expect that this ε can be removed in general, but current techniques do not quite allow for this; see the discussion in Section 6. The statement holds for P, Q ⊂ R 2 without the ε, but it should be understood that the variety is still considered as a complex variety, and in particular we should take its complex dimension (which may differ from the real dimension of the corresponding real variety). Similarly, our definition of a polynomial F being Cartesian is only formulated over C, i.e., the polynomials G, H, K, L could be complex polynomials even when F is real. With a little more work we could obtain a fully real statement, but we currently do not see much benefit to that.
We note that many instances of Theorem 1.3 have long been known. Most notably, the Szemerédi-Trotter theorem [26], which bounds the number of incidences between points and lines in R 2 , can be rephrased as the case F = xs − y + t of Theorem 1.3; indeed, the point (a, b) lies on the line y = cx + d if and only if F (a, b, c, d) = 0. Another familiar example is the polynomial F = (x − s) 2 + (y − t) 2 − 1, which we discuss in Section 5.1. More generally, Theorem 1.3 can be seen as a variant of the Pach-Sharir theorem [13], and that theorem plays a crucial role in the proof; see the discussion in Section 6.
Our proofs of Theorems 1.2 and 1.3 rely on two-dimensional versions of the special case of Alon's Nullstellensatz mentioned at the start of this introduction. Specifically, instead of asking when a two-variable polynomial vanishes on an entire product A × B ⊂ C × C, we ask when a four-variable polynomial vanishes on an entire product P × Q ⊂ C 2 × C 2 . These two-dimensional versions come in several forms, and to avoid overloading this introduction we state them as we prove them in Section 2. Alon's Nullstellensatz has many applications in combinatorics, but it is not yet clear if our two-dimensional generalizations have similar applications, other than the theorems in this paper.
We will give some applications of Theorems 1.2 and 1.3 concerning repeated and distinct values of polynomials and polynomial maps. We generalize well-known bounds on the squared Euclidean distance function (x − s) 2 + (y − t) 2 to arbitrary polynomials F (x, y, s, t), with exceptions related to the Cartesian form. Again to avoid overloading the introduction, we present these applications and their background in Section 5.
Constructions. Theorems 1.2 and 1.3 are best possible for statements of this generality (except for the ε in the complex case of Theorem 1.3). Let us make clear what we mean by this.
First we consider Theorem 1.2. Let X be any variety in C 4 of dimension one or two. Define projections by π 1 (x, y, s, t) = (x, y) and π 2 (x, y, s, t) = (s, t). For any n, we can choose a generic subset R ⊂ X of size n such that |π 1 (R)| = n and |π 2 (R)| = n. Then setting P = π 1 (R) and Q = π 2 (R) gives |X ∩ (P × Q)| ≥ |R| = n. This shows that the bound of Theorem 1.2 is tight, in the sense that the exponents cannot be improved, at least when |P | = |Q|. When |P | and |Q| are far apart, this construction gives the lower bound min{|P |, |Q|}, whereas the upper bound in Theorem 1.2 is max{|P |, |Q|}. Theorem 1.3 is only tight in the following weaker sense: There exist polynomials F of any degree and point sets P, Q for which the bound is tight (aside from the ε). This follows from a construction of Elekes [6] (based on an earlier construction of Erdős) that shows the Szemerédi-Trotter bound to be tight. Consider F = xs − y + t (it is not hard to verify that this polynomial is not Cartesian). For parameters λ, µ, set Then |P | = λ 2 µ and |Q| = λµ 2 , and all sizes |P |, |Q| can be approximately obtained in this way. Moreover, for Ω(λ 2 µ) of the points (x, y) ∈ P there are Ω(µ) points (s, t) ∈ Q such that This construction is easily extended to polynomials of any degree; for instance, take the polynomial F = xs + y d − t d and points of the form (i, j 1/d ). Another example of a tight construction is given by Valtr [28], for the polynomial F = (x − s) 2 + y − t.
On the other hand, it is conjectured that for F = (x − s) 2 + (y − t) 2 − 1 (see also Section 5), the bound |Z(F ) ∩ (P × P )| = O(|P | 4/3 ) is not tight. Erdős [7] conjectured the bound O ε (|P | 1+ε ), but no better bound than O(|P | 4/3 ) is known for this or any other polynomial. It would be interesting to know what the distinction is between the polynomials for which the bound is tight, and those for which the bound is not tight.
Outline. In Section 2, we prove our variants of Alon's Nullstellensatz for two-dimensional products, which are key tools in our later proofs. In Section 3 we prove Theorem 1.2 and in Section 4 we prove Theorem 1.3. The applications to repeated and distinct values of polynomials and polynomial maps follow in Section 5. Finally, in Section 6, we discuss some related results and possible extensions.
2 Nullstellensätze for two-dimensional products

First Nullstellensatz for two-dimensional products
Here is the form of Alon's combinatorial Nullstellensatz that we will prove a variant of. We say that a polynomial is squarefree if it has no repeated factors. This statement is a special (but crucial) case of [1, Theorem 1.1]; the general theorem applies to any field and any number of variables, and comes with bounds on the degrees of h and l. Most applications of the combinatorial Nullstellensatz use [1, Theorem 1.2], which is a consequence of [1, Theorem 1.1]; the key observation behind this consequence is that one can tell from a single coefficient of f that f does not have the special form.
The combinatorial Nullstellensatz is of course named after Hilbert's Nullstellensatz (see for instance [20]), which states that if a polynomial f vanishes on the zero set Z(I) of an ideal I, then some power of f lies in I. In other words, if I = (g 1 , . . . , g ℓ ), then Z(I) ⊂ Z(f ) implies f m = g i h i for some integer m and polynomials h i . Theorem 2.1 thus gives the slightly more precise information that we can take m = 1 in the case where I = (g, k) and g, k are univariate polynomials in different variables.
Our first Nullstellensatz is an analogue of Theorem 2.1 for two-dimensional products.
Proof. One direction is obvious: For the other direction, we do the following, using terminology from [5,Chapter 2]. Fix an arbitrary monomial ordering on the variables x, y, s, t, and apply the multivariate division algorithm ([5, Theorem 2.3.3]) to the polynomials F (x, y, s, t) and G(x, y). The division algorithm tells us that there exist polynomials H(x, y, s, t) and R(x, y, s, t) such that and no monomial of R(x, y, s, t) is divisible by the leading monomial of G(x, y). For a fixed q = (s q , t q ) ∈ Z(K), the fact that Z(G) × Z(K) ⊂ Z(F ) implies that Z(G) is contained in the zero set of F (x, y, s q , t q ). Because G is squarefree, it follows that G(x, y) divides F (x, y, s q , t q ), so by (4) it also divides R(x, y, s q , t q ). Suppose that R(x, y, s q , t q ) ≡ 0; then the leading monomial of G(x, y) divides some monomial of R(x, y, s q , t q ). But a monomial of R(x, y, s q , t q ) necessarily divides some monomial of R(x, y, s, t), so we would have the leading monomial of G(x, y) dividing a monomial of R(x, y, s, t), contradicting the stated property of R. Thus we have R(x, y, s q , t q ) ≡ 0 for every q ∈ Z(K).
If we expand R(x, y, s, t) as Although Theorem 2.2 is a direct generalization of Theorem 2.1, there is one essential difference. The zero sets Z(g) and Z(k) in Theorem 2.1 are finite sets, while Z(G) and Z(K) in Theorem 2.2 are algebraic curves. Our second Nullstellensatz (Theorem 2.5 below) concerns finite subsets of C 2 , and is thus perhaps closer in spirit to Theorem 2.1.

Curves and dual curves
We require the following terminology of curves 6 and dual curves, which we will also use in later proofs. Given F ∈ C[x, y, s, t] and a point q = (s q , t q ) ∈ C 2 , we define an algebraic curve in C 2 by Note that it is possible that C q is not a curve but equal to C 2 ; take for instance F = xs+yt and (s q , t q ) = (0, 0). Fortunately, this cannot happen often if F is not Cartesian, as we show in Lemma 2.4 below. We will abuse terminology somewhat and always refer to C q as a "curve", although of course we will be careful about this during our proofs.
To help us analyze the curves C q , we define a "dual" curve for each p = (x p , y p ) ∈ C 2 by The curves are dual in the sense that p ∈ C q if and only if q ∈ C * p (and this is still true if one of the sets equals C 2 ).
To study these curves we need the following slight generalization of Bézout's inequality. The difference with the usual Bézout's inequality is that this statement applies to arbitrary collections of curves, and that it gives a lower bound on |C 0 ∩ I|.

Lemma 2.3. Let S be a (possibly infinite) set of curves in C 2 of degree at most d, and suppose that their intersection
Proof. The fact that there is a curve contained in ∩ C∈S C is proved in [16,Lemma 3.10]. It remains to be proved that there is such a curve We can choose C 0 to be the union of all curves contained in ∩ C∈S C. For each C ∈ S, we let C ′ be the curve that remains after removal of C 0 ; in other words, it is the Zariski closure of C\C 0 (which could be empty, but that would imply I ⊂ C 0 and we would be done). Let S ′ be the set of all such curves C ′ . Each curve C ′ ∈ S ′ has degree at most d − 1, since we removed a curve of degree at least one. Applying the first part of the lemma to S ′ , we get With this lemma, we can prove that there are not many points for which C q is not a curve, unless F is Cartesian. A very similar fact is proved in [17].
By Lemma 2.3, either we have |I| ≤ d 2 , or the curves Z(F ij ) have a common curve, which means that the polynomials F ij (s q , t q ) have a nontrivial common factor K(s, t). In the second case, F would be Cartesian. To be precise, it would have the form K(s, t)L(x, y, s, t), so it would be (G, K)-Cartesian for any G, by choosing H = 0.

Second Nullstellensatz for two-dimensional products
We can now improve on Theorem 2.2 by using the duality between the curves C q and the curves C * p to show that F being Cartesian is equivalent to Z(F ) containing a sufficiently large finite product I × J. This statement will play a crucial role in the proofs of our main theorems. The proof is similar to that of [16,Lemma 3.11].
Suppose that F is not Cartesian, and that I × J ⊂ Z(F ) and |I|, |J| > d 2 . Then for all p ∈ I and q ∈ J we have F (p, q) = 0, or in other words p ∈ C q . So I ⊂ C q for all q ∈ J.
Let J 1 be the set of q ∈ J for which C q is a curve, and let J 2 be the set of q ∈ J for which C q = C 2 . By Lemma 2.4, the assumption that F is not Cartesian, and the fact that |J| > d 2 , the set J 1 is not empty. The curves C q for q ∈ J 1 have degree at most d and we have |I| > d 2 , so by Lemma 2.3, there is a curve C such that C ⊂ C q for all q ∈ J 1 . We trivially have C ⊂ C q for all q ∈ J 2 , so we can say that C ⊂ C q for all q ∈ J.
For p ∈ C and q ∈ J we have p ∈ C q , so by duality q ∈ C * p ; in other words, we have J ⊂ C * p for all p ∈ C. Again by Lemma 2.3 and Lemma 2.4, it follows that there is a curve C * such that C * ⊂ C * p for all p ∈ C. Thus for all p ∈ C and all q ∈ C * we have q ∈ C * p , i.e., F (p, q) = 0. Therefore C × C * ⊂ Z(F ), which by Theorem 2.2 is equivalent to F being Cartesian.
As we said, Theorem 2.5 is closer to Theorem 2.1 than Theorem 2.2 is, because it concerns finite sets. However, it differs in another way: The connection between the Cartesian product I × J and the G, K in the Cartesian form is less clear. It is not necessarily the case that if I × J ⊂ Z(F ), then F is (G, K)-Cartesian with I ⊂ Z(G) and J ⊂ Z(K). The best we can say is the following refinement of Theorem 2.5, which follows directly by using the last claim of Lemma 2.3 in the proof of Theorem 2.5.
Let us discuss a bit further how Theorem 2.2 differs from Alon's Nullstellensatz. As remarked at the start of this section, most applications of Theorem 2.1 use the fact that one can see from a single coefficient of f that f does not have the special form g(x)h(x, y) + k(y)l(x, y). This requires the more detailed information, given in [1, . This implies that any leading terms of g(x)h(x, y) + k(y)l(x, y) are divisible by x deg(g) or by y deg(k) . If f has a leading term x deg(g)−1 y deg(k)−1 (say) with a nonzero coefficient, then f cannot have the special form.
In the proof of Theorem 2.2, we could also obtain information on the degrees of H and L. In fact, in whatever monomial ordering we do the multivariate division (4), the multidegree (see [5,Chapter 2]) of H is at most the multidegree of F minus that of G.
If we choose an ordering that respects the total degree of the polynomials, then we get However, unlike in the one-dimensional case, we cannot say much about the degree of G or K, which may be as small as one. Indeed, we could have I × J ⊂ Z(F ) with I and J each contained in a line, so that G and K are linear polynomials. Then it seems hard to deduce anything about the coefficients of G(x, y)H(x, y, s, t) + K(s, t)L(x, y, s, t).

Varieties of dimension one and two
Before proving Theorem 1.2, we establish the following intermediate version, which is a Schwartz-Zippel bound for a Cartesian product of one-dimensional sets similar to that in (1) in Section 1, but now the one-dimensional sets are finite subsets of algebraic curves.
so it suffices to bound |C q ∩ P | for each q ∈ Q. We set Q 1 = {q ∈ Q : Z(G) ⊂ C q } and Q 2 = Q\Q 1 . Note that if C q = C 2 , then q ∈ Q 1 , and this will not be a problem. For q ∈ Q 2 we have |C q ∩ P | ≤ |C q ∩ Z(G)| ≤ d · δ by Bézout's inequality (see for instance Lemma 2.3) and the fact that G is irreducible. As a result we have If |Q 1 | ≤ 2d 2 , then we can use the trivial bound |C q ∩ P | ≤ |P | to get Otherwise, we can set J = Q 1 ⊂ Z(K) and let I be any subset of Z(G) with 2d 2 elements. Then we have I × J ⊂ Z(F ) and |I|, |J| > d 2 , so Corollary 2.6 tells us that F is (G ′ , K ′ )-Cartesian for some G ′ , K ′ of degree at most d, and moreover we have Thus |Z(G) ∩ Z(G ′ )| > d 2 , so by Bézout's inequality and the fact that G is irreducible, G divides G ′ , and similarly K divides K ′ . Hence F is (G, K)-Cartesian.
As an aside, we obtain a bound on the number of repeated values of a polynomial on an algebraic curve. This is a one-dimensional version of the question that we consider in Section 5.1. See [27] for a discussion of the related question on the number of distinct values on curves.
Corollary 3.2 (Repeated values of polynomials on curves). Let C ⊂ C 2 be an algebraic curve of degree δ and let F ∈ C[x, y, s, t]\{0} be a polynomial of degree d. Then for any a ∈ C and finite set P ⊂ C, the number of times F takes the value a on P satisfies |{(x, y, s, t) ∈ P × P : Before we get back to varieties in C 4 of dimension at most two, we need the following technical lemma from algebraic geometry. A qualitative version of the lemma can be found for instance in [20, Theorem I.6.3.7] (where it is called "The theorem on the dimension of the fibers"). However, we need a quantitative version where the dependence on the degree of the variety is specified. Such a statement is proved in [4,Lemma 3.7], although the argument there is very general and the dependence on d is not given explicitly. In this particular case, it would not be hard to show by a direct argument that W has degree O(d 2 ). Lemma 3.3. Let π : C 4 → C 2 be the projection defined by π(x, y, s, t) = (s, t). Let X ⊂ C 4 be a variety of degree d and dimension at most two. Then there is a curve W ⊂ C 2 of degree O d (1) such that, for every (s, t) ∈ W , π −1 (s, t) ∩ X is a finite set of size at most d.
We are now ready to bound |X ∩ (P × Q)| when X has dimension at most two.
Proof of Theorem 1.2. Let π 1 , π 2 be the projections defined by π 1 (x, y, s, t) = (x, y) and Let P 1 = P \V and P 2 = P ∩ V , and similarly Q 1 = Q\W and Q 2 = Q ∩ W . Then and similarly |X ∩ (P × Q 1 )| = O d (|Q|). It remains to bound |X ∩(P 2 ×Q 2 )|. Let Z(G 1 ), . . . , Z(G v ) be the irreducible components of V , and let Z(K 1 ), . . . , Z(K w ) be the irreducible components of W . Note that v, w = O d (1). We have Consider any pair G i , K j . By Lemma 3.1, for each F ∈ I(X) we have unless F is (G i , K j )-Cartesian. In other words, if some F ∈ I(X) is not (G i , K j )-Cartesian, then we have this bound, or else all F ∈ I(X) are (G i , K j )-Cartesian, which implies that X is Cartesian. Thus, if X is not Cartesian, then for every pair i, j we have the bound (7). Summing the bound in (7) over the O d (1) pairs i, j as in (6), and combining with (5), we obtain the stated bound.
We note that in Theorem 1.2, the dependence of the bound on d could be determined from our proof, if one makes the degree O d (1) of W in Lemma 3.3 explicit. For Theorem 1.3 this would be more difficult, because its proof relies on Theorem 4.1 below, in which the degree dependence is not made explicit.

Varieties of dimension three
We now consider three-dimensional varieties X ⊂ C 4 . We reduce our problem of bounding |X ∩ (P × Q)| to the problem of bounding incidences between points and curves, and then apply a well-known incidence bound. To show that the conditions of this bound are met, we again use the curve duality introduced in Section 2. This duality was similarly used in combination with incidence bounds in a number of recent papers, including [14,16,21]. The challenge in our situation is to convert the combinatorial condition of the incidence bound to an algebraic condition on the polynomials defining X.
Our main tool is the following incidence bound. The statement was proved by Pach and Sharir [13] in R 2 , and this was generalized to C 2 by Sheffer and Zahl [22], at the cost of an ε. The incidence graph defined by a set P of points and a set C of curves is the bipartite graph with vertex sets P and C, with an edge between p ∈ P and C ∈ C if p ∈ C. We denote the number of edges in this graph by I(P, C); in other words, I(P, C) is the number of incidences between P and C. We denote by K s,t the complete bipartite graph on s and t vertices.
Theorem 4.1. Let P ⊂ C 2 and let C be a set of algebraic curves of degree at most d. If the incidence graph of P and C contains no K 2,M or K M,2 , then If P ⊂ R 2 , then the ε can be omitted.
In Theorem 1.3 we are given a polynomial F ∈ C[x, y, s, t] and finite sets P, Q ⊂ C 2 . Recall from Section 2 that for each q = (s q , t q ) ∈ Q we define a curve C q = {(x, y) ∈ C 2 : F (x, y, s q , t q ) = 0}, and for each p = (x p , y p ) ∈ P we define a dual curve C * p = {(s, t) ∈ C 2 : F (x p , y p , s, t) = 0}. Let C Q = {C q : q ∈ Q} be the multiset of curves defined by Q.
Note that we have to be careful when we pass from the point set Q to the curves C q , because two different points q, q ′ ∈ Q may define the same curve C q = C q ′ (viewed as sets). For this reason we deal with C Q as a multiset, and we extend the notion of incidence graph to multisets in the obvious way (distinct q, q ′ give distinct vertices, even if C q = C q ′ ). Although Theorem 4.1 is not stated for multisets of curves, our Corollary 4.2 below is.
We now show that for points and curves defined in this way, we can use the duality to obtain a stronger version of Theorem 4.1 for our situation. Specifically, the condition on the excluded complete bipartite graph is much weaker. A similar argument was used in [14,Lemma 3.4]. A comparable statement was proved in a very different way by Fox et al. [8]; see also the discussion in Section 6. If P, Q ⊂ R 2 , then the ε can be omitted.
Proof. First note that we can assume that M > d 2 , since if M ≤ d 2 and the incidence graph contains no K M,M , then it also contains no K d 2 +1,d 2 +1 , so we can replace M by d 2 + 1.
We claim that we can partition P into O d,M (1) subsets P i , and Q into O d,M (1) subsets Q j , so that the following holds. Each C Q j is a set, and for each pair i, j, the incidence graph of P i and C Q j contains no K 2,2dM or K 2dM,2 . Given this claim, we can apply Theorem 4.1 to the points P i and the curves C Q j to get Summing up these bounds for the O d,M (1) pairs i, j proves the corollary.
The rest of the proof concerns the claim that such a partition exists. Construct a graph G with vertex set P and an edge between two points p, p ′ ∈ P if there are at least 2dM points q ∈ Q such that p, p ′ ∈ C q . By duality, if G has an edge between p and p ′ , then the intersection of the curves C * p and C * p ′ contains a set I of at least 2dM points of Q. Since 2dM > d 2 , Lemma 2.3 implies that C * p and C * p ′ contain a common curve C 0 , and moreover |C 0 ∩I| ≥ |I|−(d−1) 2 > dM. This curve has degree at most d and thus at most d irreducible components, one of which contains at least M points of Q. To summarize, an edge between p and p ′ implies the existence of a common irreducible component of C * p and C * p ′ that contains at least M points of Q.
We can use this observation to bound the maximum degree of a vertex of G by dM. Suppose that a vertex p ∈ P has degree greater than dM. Since C * p has at most d irreducible components, there must be an irreducible component C 1 of C * p that contains at least M points of Q, and that is shared with the curve C * p ′ for at least M neighbors p ′ of p. Then there would be a K M,M in the incidence graph of P and C Q , with on one side these M neighbors p ′ , and on the other side any M points of Q on C 1 . This contradicts the assumption, so the degree of a vertex of G is at most dM.
By basic graph theory 7 , we can color G with dM + 1 colors, or in other words, we can partition P into dM + 1 = O d,M (1) subsets P i such that no two vertices in the same subset are adjacent in G. Since an edge in G corresponds to a K 2,2dM in the incidence graph, this means that the incidence graph of P i and C Q contains no K 2,2dM .
Let Q 0 be the subset of q ∈ Q for which C q contains fewer than 2dM points of P . The curves in C Q 0 together give O d,M (|Q|) incidences with P . Using the dual of the procedure above, we can partition Q\Q 0 into O d,M (1) subsets Q j such that the incidence graph of P with each multiset C Q j contains no K 2dM,2 . It follows that each C Q j is a set, because if C q = C q ′ for two q, q ′ ∈ Q j , then the fact that q, q ′ ∈ Q 0 implies that C q = C q ′ contains at least 2dM points of P , which would give a K 2dM,2 in the incidence graph of P and C Q j . Hence, each Q j is a set, and each of the O d,M (1) pairs P i , C Q j defines an incidence graph without K 2,2dM or K 2dM,2 . This proves the existence of the claimed partition.
We now have all the pieces in place to prove Theorem 1.3.
Proof of Theorem 1.3. If X has components of dimension less than three, we apply Theorem 1.2 to them, which gives a bound better than that in Theorem 1.3, unless one of these components is Cartesian. As noted in Definition 1.1, if any component of X is Cartesian, then so is X. Therefore, we can assume that every component of X is three-dimensional, so that we can write X = Z(F ) (see for instance [20,Theorem 1.21] for the fact that any variety of codimension one is the zero set of a single polynomial). If F is chosen to have the minimum degree with this property, then it follows that deg(F ) ≤ d. If F is not Cartesian, then by Theorem 2.5, there are no I, J ⊂ C 2 with |I|, |J| > d 2 such that I × J ⊂ Z(F ). Setting M = d 2 + 1, it follows that the incidence graph of P and C Q contains no K M,M . Corollary 4.2 then gives the bound in Theorem 1.3.

Repeated and distinct values of polynomial maps
We now give our applications of Theorems 1.2 and 1.3 to value sets of polynomial maps. We first consider polynomial maps C 4 → C defined by one polynomial, and then polynomial maps C 4 → C 2 defined by two polynomials. We could also consider maps defined by more polynomials, but this seems less interesting.

Repeated values of polynomials
Erdős [7] asked for the maximum number of unit distances that can occur between the points in a finite set P ⊂ R 2 . The best known upper bound is O(|P | 4/3 ), due to Spencer, Szemerédi, and Trotter [24]. We can rephrase this statement as follows. Let so that F (x, y, s, t) equals the squared Euclidean distance between (x, y) and (s, t). Then the number of pairs in P × P ⊂ R 2 × R 2 on which F can take the value 1 is O(|P | 4/3 ). Of course, the same statement holds for any value other than 1. Theorem 1.3 tells us to which other polynomials this bound can be generalized. Compare this statement with Corollary 3.2, where a sharper bound is proved for a point set contained in and algebraic curve of bounded degree.
Corollary 5.1. Let F ∈ C[x, y, s, t], let P ⊂ C 2 be a finite set, and let a ∈ C. Then the number of times F takes the value a on P satisfies |{(x, y, s, t) ∈ P × P : F (x, y, s, t) = a}| = O d,ε (|P | 4/3+ε ), unless the polynomial F − a is Cartesian. Over R, the ε can be omitted.
The condition that F − a is not Cartesian is necessary, since if F − a is (G, K)-Cartesian, then we can take half of the points of P in Z(G) and the other half in Z(K), to get Ω(|P | 2 ) repeated values. As in Theorem 1.3, the bound is best possible in general. That the bound is best possible for certain "distances" was already observed by Valtr [28], who constructed a strictly convex norm, based on the polynomial F = (x − s) 2 + y − t, for which the upper bound O(|P | 4/3 ) is tight. On the other hand, it is a major open problem in discrete geometry to show that for the Euclidean distance, this bound is not tight. Erdős [7] also asked for the minimum number of distinct distances determined by a finite set P ⊂ R 2 . Guth and Katz [10] proved an almost tight bound Ω(|P |/ log |P |). It is natural to ask the same question for other functions of pairs of points in the plane. Roche-Newton and Rudnev [18] proved the same lower bound for the "Minkowski distance" (x − s) 2 − (y − t) 2 , and Rudnev and Selig [19] extended it to other quadratic distances. Garibaldi, Iosevich, and Senger [9, Chapter 9] considered the dot product xs + yt, but only proved the bound Ω(|P | 2/3 ) for the number of distinct dot products determined by P ; improving this bound is an interesting open problem. Iosevich, Roche-Newton, and Rudnev [11] proved the slightly better bound Ω(|P | 9/13 ) for the number of distinct values of xt − ys. We are not aware of other such polynomials for which any bound has been proved.

Distinct values of polynomials
As a corollary of Corollary 5.1, we obtain a bound on the number of distinct values of a polynomial, for any polynomial for which it could hold. The bound is basically Ω(|P | 2/3 ), so relatively weak, but we do not know any more elementary proof of such a bound for general polynomials. Any such proof would have to deal with the fact that there are exceptional polynomials that are related to the Cartesian property, so techniques like ours seem to be necessary.
Corollary 5.2. Let F ∈ C[x, y, s, t] and let P ⊂ C 2 be a finite set. Then the number of distinct values of F on P satisfies unless there exists an a ∈ C such that F − a is Cartesian. Over R, the ε can be omitted.
Proof. If every value of F is repeated at most T times, then the |P | 2 pairs in P × P must give at least |P | 2 /T distinct values. For every a ∈ F (P × P ), the fact that F − a is not Cartesian lets us apply Corollary 5.1 to conclude that F has the value a for O d,ε (|P | 4/3+ε ) pairs in P × P . The stated bound follows.
Note that if F − a is (G, G)-Cartesian for a ∈ C, then P ⊂ Z(G) gives F (P × P ) = {a}, so there cannot be a good lower bound on the number of distinct values of F . However, if F − a is (G, K)-Cartesian with G = K, this construction does not work. Thus the right exception in Corollary 5.2 would probably be "unless there exist a ∈ C and G ∈ C[x, y] such that F − a is (G, G)-Cartesian"; unfortunately, this does not quite seem to follow from our proof. The proof of Corollary 5.2 gives a somewhat stronger statement: There exists p ∈ P such that |F (p × P )| = Ω d,ε (|P | 2/3−ε ), unless some F − a is Cartesian.

Repeated values of polynomial maps
Just as Theorem 1.3 gives us bounds on the number of repeated and distinct values of a single polynomial, Theorem 1.2 can give us such bounds for polynomial maps defined by two polynomials. We focus on the case of polynomial maps F : C 4 → C 2 of the form F (x, y, s, t) = (F 1 (x, y, s, t), F 2 (x, y, s, t)) with F 1 , F 2 ∈ C[x, y, s, t]. Note that for a finite set P ⊂ C 2 and a point (a, b) ∈ C 2 , is the set of pairs (x, y), (s, t) ∈ P for which F (x, y, s, t) = (a, b). Corollary 5.3. Let F 1 , F 2 ∈ C[x, y, s, t] be two polynomials of degree at most d, and let F : C 4 → C 2 be the polynomial map defined by F (x, y, s, t) = (F 1 (x, y, s, t), F 2 (x, y, s, t)). For P ⊂ C 2 and (a, b) ∈ C 2 , we have Proof. If F 1 −a and F 2 −b do not have a common factor, then Z(F 1 −a, F 2 −b) has dimension two, so that we can apply Theorem 1.
Both exceptions are necessary. As before, if F 1 − a and F 2 − b are both (G, K)-Cartesian, then we can get |Z(

Distinct values of polynomial maps
Finally, we consider distinct values of polynomial maps C 4 → C 2 . We say that F 1 and F 2 are inner equivalent if there exist ϕ 1 , ϕ 2 ∈ C[z] and ψ ∈ C[x, y, s, t] such that F 1 = ϕ 1 • ψ and F 2 = ϕ 2 •ψ. Note that if F 1 and F 2 are inner equivalent, then the map F = (F 1 , F 2 ) : C 4 → C 2 factors into ψ : C 4 → C and (ϕ 1 , ϕ 2 ) : C → C 2 . In this case, the number of distinct values of F is essentially the same as that of ψ, and thus Corollary 5.2 is the relevant statement.
Corollary 5.4. Let F 1 , F 2 ∈ C[x, y, s, t] be two polynomials of degree at most d, and let F : C 4 → C 2 be the polynomial map defined by F (x, y, s, t) = (F 1 (x, y, s, t), F 2 (x, y, s, t)).
unless F 1 and F 2 are inner equivalent, or there is an (a, b) ∈ C 2 such that F 1 − a and F 2 − b are both (G, K)-Cartesian.
Proof. We use a generalization of Stein's theorem [25] to more variables, a proof of which can be found for instance in [2]. It states that for a non-composite polynomial F over C in any number of variables, the number of λ ∈ C for which the polynomial F − λ is reducible is at most 2 deg(F ) 2 (a polynomial is composite if there is a nonlinear univariate polynomial ϕ and a polynomial ψ such that F = ϕ • ψ). We can assume that F 1 , F 2 are non-composite, because if F 1 = ϕ • ψ, then we have |F 1 (P × P )| ≥ 1 d |ψ(P × P )|, and similarly for F 2 , so the number of distinct values of F is asymptotically unchanged by removing the outside functions. Thus there are sets S 1 , S 2 ⊂ C of size at most 2d 2 , such that for a ∈ S 1 , F 1 − a is irreducible, and for b ∈ S 2 , F 2 − b is irreducible. Consider (a, b) ∈ S 1 × S 2 . Let F 3 be the greatest common divisor of F 1 − a and F 2 − b, and set F 1 = (F 1 − a)/F 3 and F 2 = (F 2 − b)/F 3 . By Corollary 5.1, there are O d,ε (|P | 4/3+ε ) pairs (p, q) ∈ P × P for which F 3 (p, q) = 0. If one of F 1 and F 2 is constant, then the variety Z( F 1 , F 2 ) is empty. Otherwise, F 1 and F 2 are coprime and Z( F 1 , F 2 ) has dimension at most two, so by Corollary 5.3 there are O d (|P |) pairs (p, q) ∈ P × P for which F 1 (p, q) = 0 and F 2 (p, q) = 0. Altogether, there are fewer than 1 8d 4 |P | 2 pairs (p, q) ∈ P × P for which F (p, q) = (a, b), and fewer than 1 2 |P | 2 pairs for which F (p, q) ∈ S 1 × S 2 . Consequently, there are at least 1 2 |P | 2 pairs (p, q) ∈ P × P for which F (p, q) ∈ S 1 × S 2 . Now consider (a, b) ∈ S 1 × S 2 . We have F 1 − a and F 2 − b both irreducible, which implies that they do not have a common factor, unless F 1 = αF 2 + β for some α, β ∈ C. But that would mean that F 1 and F 2 are inner equivalent (moreover, they were inner equivalent before we removed any outside functions). Thus F 1 −a and F 2 −b do not have a common factor, and Z(F 1 − a, F 2 − b) has dimension two. By Corollary 5.3, there are O d (|P |) pairs (p, q) ∈ P × P such that F (p, q) = (a, b), unless F 1 − a and F 2 − b are both (G, K)-Cartesian for some G, K.
Since there are at least 1 2 |P | 2 pairs (p, q) ∈ P × P for which F (p, q) ∈ S 1 × S 2 , there must be There are maps for which the bound in Corollary 5.4 is tight. Consider the vector addition map F (p, q) = p + q = (x + s, y + t). Clearly, if P is a set of points in arithmetic progression (and thus on a line), then |F (P × P )| = O(|P |). The polynomials F 1 = x + s and F 2 = y + t are not inner equivalent, and F 1 − a and F 2 − b are never both (G, K)-Cartesian (both are Cartesian, but with different G, K).

Discussion
Tightness. The main open question regarding Theorem 1.3 is for which varieties the bound is tight, and for which it can be improved. As mentioned in the Introduction, the bound is tight for various varieties, while for others it is conjectured that improvement is possible. Of course, this is just a generalization of the well-known unit distance problem, but this view does raise some new possibilities. It may be possible to find a polynomial for which the bound can be improved more easily than for the Euclidean distance polynomial. It would also be interesting to find and classify more polynomials for which the bound is tight.
About the ε. Note that Theorem 4.1 is conjectured to hold without the ε, which would imply the same for our main theorem. Zahl [29] did prove such a bound without ε, but with more restrictive conditions. Specifically, his theorem requires that the incidences occur at transversal intersection points of the curves, and that the curves are smooth.
We believe we can handle the first condition in our situation, because for our curves common tangent lines should be relatively rare. We could handle the second condition if we assume Z(F ) to be nonsingular, because then only a relatively small subset of our curves could be singular. However, if Z(F ) is singular, then it could be that all our curves are singular, in which case we do not see a way to apply Zahl's theorem.
About the Cartesian form. We currently do not have a good method or algorithm for proving that a polynomial is not Cartesian, and we do not know any instance where our algebraic condition (that F is not Cartesian) is easier to establish than the combinatorial condition of Theorem 4.1 (that the incidence graph does not contain certain complete bipartite subgraphs). Question 6.2. Is there an algorithm that determines if a polynomial F ∈ C[x, y, s, t] is Cartesian, i.e., if it can be written as F (x, y, s, t) = G(x, y)H(x, y, s, t) + K(s, t)L(x, y, s, t)?
Related results. Theorem 1.3 can be thought of as a variant of the Pach-Sharir incidence bound, where a combinatorial condition is replaced by an algebraic one. Specifically, Theorem 4.1 gives a bound on I(P, C) if the incidence graph of P and C does not contain a K 2,M or K M,2 . In most algebraic applications of this theorem, there is a polynomial F ∈ R[x, y, s, t] such that the curves in C are of the form {p : F (p, q i ) = 0} for fixed q i in some finite set Q; see for instance [15,21,23]. In such applications, our theorem replaces the combinatorial condition on the incidence graph by the purely algebraic condition that F is not Cartesian.
Yet another way to view Theorem 1.3 is as follows. An algebraic graph on R 2 × R 2 is a bipartite graph whose two parts are finite sets P, Q ⊂ R 2 , with edges defined by a polynomial F ∈ R[x, y, s, t], i.e., there is an edge between p ∈ P and q ∈ Q if and only if F (p, q) = 0. Fox et al. [8] proved that if an algebraic graph on R 2 × R 2 contains no K t,t , then the number of edges is bounded by O t (|P | 2/3 |Q| 2/3 + |P | + |Q|) (in fact, they proved much more general statements for semialgebraic graphs with vertex sets in R d ). Again, Theorem 1.3 states the same bound, but replaces the combinatorial condition by an algebraic condition.
Possible extensions. In this paper, we have intentionally not looked beyond C 4 , but there are natural questions to ask for other Cartesian products. We mention a few, without going into too much detail.
We can consider varieties X ⊂ C D × C E and try to bound the intersection |X ∩ (P × Q)| for P ⊂ C D , Q ⊂ C E . There will be exceptions for X defined by "Cartesian" polynomials of the form GH + KL, with G a polynomial in the first D variables and K a polynomial in the last E variables. In analogy with Theorem 1.2, we would expect that in the case D = E = dim(X) the bound will be O(|P | + |Q|). For X of intermediate dimension, we would expect intermediate exponents, probably related to those in higher-dimensional incidence theorems.
In another direction, we can take X ⊂ (C 2 ) k and consider |X ∩ k i=1 P i | for P i ⊂ C 2 . There will be exceptional varieties X defined by polynomials of the form k i=1 G i H i , with each G i a function of the i-th pair of variables. In analogy with the general Schwartz-Zippel lemma, we expect that if dim(X) = 2ℓ, then the bound will be O(|P | ℓ ).
Of course one can combine these two directions and look at arbitrary products C D i . All such results would come with corresponding corollaries for value sets of polynomial maps.
Another direction to proceed in is to ask the same questions for other fields, in particular finite fields. Our proof of Theorem 1.2 seems to carry through for arbitrary fields, but we have restricted ourselves to C for simplicity. Theorem 1.3, however, relies on the incidence bound in Theorem 4.1, which does not yet have any analogue over finite fields (at least not with the same algebraic flexibility).