                                               QUARTIC POLYNOMIALS IN TWO VARIABLES DO NOT REPRESENT
                                                             ALL NON-NEGATIVE INTEGERS

                                                                      STANLEY YAO XIAO AND SHUNTARO YAMAGISHI


                                                  Abstract. In this paper, we prove that there does not exist F ∈ Q[x, y] of degree 4 such that
                                                  F (Z2 ) = Z≥0 . In particular, this answers a question by John S. Lew and Bjorn Poonen for quartic
arXiv:2307.05712v2 [math.NT] 13 Jul 2023




                                                  polynomials.




                                                                                         1. Introduction

                                             Representation of integers by polynomials is a fundamental problem in number theory that goes
                                           back at least to the time of Gauß and Lagrange. Regarded as one of the most important theorems in
                                           additive number theory, Lagrange proved that every non-negative integer is a sum of four squares.
                                           Given a polynomial F in n variables, let us define the set
                                                                        F (Zn ) = {F (x1 , . . . , xn ) : (x1 , . . . , xn ) ∈ Zn }.
                                           Then we may reformulate Lagrange’s theorem as follows.
                                           Theorem 1.1 (Lagrange, 1770). Let L(w, x, y, z) = w2 + x2 + y 2 + z 2 . Then
                                                                                            L(Z4 ) = Z≥0 .

                                              The problem of representing integers becomes more challenging with fewer variables. Considered
                                           one of the classical results in number theory, Gauß proved that every non-negative integer is a sum
                                           of three triangular numbers.
                                           Theorem 1.2 (Gauß, 1796). Let G(x, y, z) = x(x+1)
                                                                                         2   + y(y+1)
                                                                                                  2   + z(z+1)
                                                                                                           2   . Then
                                                                                             G(Z3 ) = Z≥0 .

                                              These results by Lagrange and Gauß are special cases of what is known as Cauchy’s polygonal
                                           number theorem, for which we refer the reader to [11] for a summary. More generally, these results
                                           are all within an important area in number theory called additive bases, which includes problems
                                           such as Goldbach’s conjecture and Waring’s problem. We refer to [12] for a comprehensive intro-
                                           duction to this topic. One consequence of these results is the following: Given n > 2, there exists a
                                           rational polynomial F in n variables such that
                                                                                            F (Zn ) = Z≥0 .
                                           It is clear that such F does not exist when n = 1. Therefore, it is natural to ask what happens
                                           when n = 2, which is precisely the question of John S. Lew and Bjorn Poonen.
                                           Question 1.3 (Lew-Poonen). Does there exist F ∈ Q[x, y] such that
                                                                                            F (Z2 ) = Z≥0 ?

                                              This question was asked by Bjorn Poonen on the popular website MathOverflow1 in 2009 and has
                                           generated a great deal of interest from many mathematicians active on the website. Despite this,
                                           there has been no progress (at least that we are aware of). In fact, the problem goes back at least
                                           to 1981. In an investigation of computer storage of multi-dimensional arrays, finding a polynomial
                                             1https://mathoverflow.net/questions/9731/polynomial-representing-all-nonnegative-integers


                                                                                                     1
2                           STANLEY YAO XIAO AND SHUNTARO YAMAGISHI

in two variables that is “approximately” a bijection from (Z≥0 )2 → Z≥0 was important, and in this
relation Question 1.3 was posed by Lew in [9]. Inspired by this question, Richard Stanley also asked2
the following regarding the growth rate of these polynomials. Given any set B ⊆ R, let us define
                                        RF (B) = F (Z2 ) ∩ B.
Question 1.4 (Stanley). Suppose F ∈ Q[x, y] satisfies
                                            F (Z2 ) ⊆ Z≥0 .
Does it then follow that
                                                              N
                                      #RF ([1, N ]) ≪ √            ?
                                                             log N
  We remark that the bound given is best possible as the well-known result by Landau [7] establishes
that if F (x, y) = x2 + y 2 , then there exists C(F ) > 0 such that
                                                               N
                                      #RF ([1, N ]) ∼ C(F ) √       .
                                                              log N
   It is an easy exercise to see that there does not exist F satisfying the condition in Question 1.3
if deg F is odd. The same conclusion holds when deg F = 2 as well (see Corollary 5.3). Therefore,
the first real challenge of Question 1.3 is when deg F = 4, which is what we answer in this paper.
Theorem 1.5. There does not exist F ∈ Q[x, y] of degree 4 such that
                                            F (Z2 ) = Z≥0 .

    As a consequence of our method, we also answer Question 1.4 for irreducible quartic polynomials.
Theorem 1.6. Suppose F ∈ Q[x, y] of deg F = 4 is irreducible over Q and satisfies
                                            F (Z2 ) ⊆ Z≥0 .
Then
                                                              N
                                      #RF ([1, N ]) ≪ √            .
                                                             log N
   We remark that the counting function #RF ([−N, N ]) in the case when F ∈ Z[x, y] is a form has
been the subject of an intensive study. We refer the reader to [13] for a summary, in which the first
author and Stewart established the asymptotic formula for #RF ([−N, N ]) when deg F ≥ 3 and the
discriminant of F is non-zero.

1.1. Outline of the proof. For the remainder of the paper, we always assume F ∈ Z[x, y] is of
degree 4 with F (0, 0) = 0, and denote
                                                    4
                                                    X
                                       F (x, y) =         Fi (x, y),
                                                    i=1
where Fi is the homogeneous degree i part of F (possibly the zero polynomial). In order to prove
Theorem 1.5, it is sufficient to show that given any F , there do not exist C ∈ N and D ∈ Z such
that
(1.1)                          F (Z2 ) = (CZ)≥D = {Cn : n ≥ D/C}.
Our main strategy is to show that (1.1) can not occur due to one of the following three reasons:
     (1) Large negative value (we have that inf (x,y)∈Z2 F (x, y) = −∞).
     (2) Density (we have that #RF ([N, 2N ]) = o(N )).
     (3) Reducibility of F (the polynomial F factors and RF (N) does not contain the set of prime
         numbers).
    2https://mathoverflow.net/questions/45511/density-of-values-of-polynomials-in-two-variables
                                                                                                           3

It is clear that if any of these three conditions occur, then (1.1) does not hold. For a “random” F ,
showing (1.1) is a relatively simple task. We proceed by eliminating these simple cases and arrive
at F with “structure”.
   If F4 is positive semi-definite, then we let Fe4 = F4 /P0 , where P0 is the positive definite integral
form of the largest degree such that P0 |F4 and Fe4 is a primitive integral form. For simplicity, let us
say F is linked if F4 is positive semi-definite, gcd(Fe4 , F3 ) 6= 1 and gcd(Fe4 , F3 , F2 ) = 1.
  We prove three main propositions in this paper, from which Theorem 1.5 follows.
Proposition 1.7. Let F ∈ Z[x, y] be of degree 4 with F (0, 0) = 0 which is not linked. Then
                                            F (Z2 ) 6= (CZ)≥D
for any C ∈ N and D ∈ Z.
Proposition 1.8. Let F ∈ Z[x, y] be of degree 4 with F (0, 0) = 0 which is linked. Given any
irreducible primitive integral form H which divides gcd(Fe4 , F3 ), let us denote n4 (H) and n3 (H) to
be the largest integers such that H n4 (H) |Fe4 and H n3 (H) |F3 respectively. If n3 (H) 6= n4 (H)/2 for all
H, then
                                             F (Z2 ) 6= (CZ)≥D
for any C ∈ N and D ∈ Z.

   After establishing Propositions 1.7 and 1.8 in Sections 2 and 3 respectively, the remaining F are
of the form
(1.2)         F (x, y) = H(x, y)2r G4 (x, y) + H(x, y)r G3 (x, y) + F2 (x, y) + F1 (x, y),
where r ∈ {1, 2}, F4 = H 2r G4 is positive semi-definite, H is either a primitive integral linear
form or an indefinite irreducible primitive integral quadratic form, G4 and G3 are integral forms
and H ∤ G4 , G3 , F2 . Let us call these polynomials given by (1.2) quadratically composed. We
then establish the following proposition by combining the main results of Sections 4 and 5, namely
Propositions 4.1, 4.2 and 5.5.
Proposition 1.9. Let F ∈ Z[x, y] be of degree 4 with F (0, 0) = 0. If F is quadratically composed,
then
                                       F (Z2 ) 6= (CZ)≥D
for any C ∈ N and D ∈ Z.

   As we shall see, quadratically composed F are the most challenging to deal with, and the tech-
niques from Sections 2 and 3 struggle to yield the desired conclusions. As such, we need to take
a different path for this final case, a more algebraic approach which makes use of the additional
structure; this is achieved in Sections 4 and 5. Finally, it is a natural question to ask whether our
approach generalizes to higher degrees. This will be the content of our forthcoming paper.
   Acknowledgements. The second author was supported by the NWO Veni Grant 016.Veni.192.047
during his time at Utrecht University and by the FWF grant P 36278 at the Institute of Science
and Technology Austria while working on this paper. The first author would like to thank Samir
Siksek for introducing the problem to him. The material in Section 6 is a result of discussing with
many people, and the second author is very grateful to Tim Browning, Stephanie Chan, Jakob Glas,
Jakub Löwit, Mirko Mauri, Marta Pieropan, Mike Roth, Matteo Verzobio and Victor Wang for tak-
ing their time to answer his questions and their valuable suggestions. We thank Tim Browning,
Yijie Diao and Ana Marija Vego for their comments on an earlier version of the paper.
   Conventions and Notations. We will use the convention that N is always a sufficiently large
positive integer and B a sufficiently large positive real number, even if it is not explicitly stated
so. We also use the convention that the degree of the zero polynomial is 0. Throughout we use ≪
and ≫ to denote Vinogradov’s well-known notation. By f ≍ g we mean f ≪ g and f ≫ g. We
4                                STANLEY YAO XIAO AND SHUNTARO YAMAGISHI

also make use of the O-notation and o-notation due to Landau. Given (x, y) ∈ R2 \ {0}, we denote
arg(x, y) to be the unique θ ∈ [0, 2π) satisfying
                               x                         y
                          p           = cos(θ) and p            = sin(θ).
                             x2 + y 2                  x2 + y 2
A form is a homogeneous polynomial and a primitive integral form is a form whose greatest common
divisor of the coefficients is 1. Recall that given an integral form G and F = R or Z, we say G is
positive semi-definite, negative semi-definite or indefinite over F if G(x, y) ≥ 0 for all (x, y) ∈ F2 ,
G(x, y) ≤ 0 for all (x, y) ∈ F2 or we have F (x1 , y1 ) > 0 and F (x2 , y2 ) < 0 for some (x1 , y1 ) and
(x2 , y2 ) ∈ F2 \ {0} respectively. The definition of positive (or negative) definiteness is the same as
that of positive (or negative) semi-definiteness except it is with a strict inequality. We note that3
given an integral form whether it is positive semi-definite, negative semi-definite or indefinite over
R is equivalent to that over Z. By irreducible we mean irreducible over Q, unless stated otherwise.

                                        2. Proof of Proposition 1.7

  Our goal in this section is to establish some basic results and prove Proposition 1.7. We begin
with the following simple observation, which we leave as a basic exercise to the reader.
Lemma 2.1. Suppose there exists a polynomial F ∈ Q[t] of degree d ≥ 2 and G ∈ Q[x, y] such that
F = F ◦ G. Then
                                                       1
                                   #RF ([N, 2N ]) ≪ N d .
Lemma 2.2. Suppose F4 is positive definite. Then
                                                                         √
                                              #RF ([N, 2N ]) ≪               N.

Proof. Since F4 is positive definite, there exists a constant c > 0 such that
                                            F4 (x, y) ≥ c max{|x|, |y|}4
for all (x, y) ∈ Z2 . It is clear that
                                    F (x, y) = F4 (x, y) + O(max{|x|, |y|}3 ).
Let N be a sufficiently large positive integer. Then we obtain
                        #RF ([N, 2N ])       =#{(x, y) ∈ Z2 : N ≤ F (x, y) ≤ 2N }
                                                n                                1
                                                                                   o
                                            ≤ # (x, y) ∈ Z2 : max{|x|, |y|} ≪ N 4
                                              √
                                            ≪  N.
                                                                                                                    
Lemma 2.3. Suppose F4 is negative semi-definite or indefinite. Then
                                                 inf      F (x, y) = −∞.
                                               (x,y)∈Z2


Proof. Since F4 is negative definite or indefinite, there exists (x0 , y0 ) ∈ Z2 such that
                                                   F4 (x0 , y0 ) < 0.
It is clear that
                                    F (N x0 , N y0 ) = N 4 F4 (x0 , y0 ) + O(N 3 ),
and the result follows.                                                                                             
    3This follows easily from the fact that if there exists (x , y ) ∈ R2 such that the form is positive (or negative),
                                                                 1   1
then there also exists (x2 , y2 ) ∈ Z2 with the same property.
                                                                                                                 5

   We conclude from Lemmas 2.2 and 2.3 that F4 must be positive semi-definite. For the remainder
of the paper, we will assume that this is the case. We leave the following fact as an exercise to the
reader. Furthermore, we define Fe4 to be as in the statement4.
Lemma 2.4. If F4 is positive semi-definite, then there exists a positive definite integral form P0
(possibly a positive constant) such that Fe4 = F4 /P0 is a non-empty product of irreducible primitive
integral forms H with a non-trivial real zero and the multiplicity of each H is even.

  Next we deal with the case gcd(Fe4 , F3 ) = 1.
Lemma 2.5. Suppose F4 is positive semi-definite and gcd(Fe4 , F3 ) = 1. Then
                                                inf     F (x, y) = −∞.
                                             (x,y)∈Z2

Proof. We begin by noting that the hypotheses of the statement ensure that F3 is not the zero
polynomial. Let (cos(ξ), sin(ξ)) be a zero of Fe4 , which we know to exist by Lemma 2.4, and write
                                          L(x, y) = sin(ξ)x − cos(ξ)y
and
                                      F4 (x, y) = L(x, y)2r F4 (x, y),
where r ∈ N and L ∤ F4 . In particular, since gcd(Fe4 , F3 ) = 1, we have L ∤ F3 . By Dirichlet’s theorem
on Diophantine approximation, there exist infinitely many (u, v) ∈ Z2 satisfying
                                                                 1
                                  | sin(ξ)u − cos(ξ)v| ≪ √              .
                                                               u2 + v 2
For these (u, v), we have
            F4 (u, v) = L(u, v)2r F4 (u, v) ≪ (u2 + v 2 )−r (u2 + v 2 )2−r ≪ (u2 + v 2 )2−2r ≪ 1,
                                                3
                  |F3 (u, v)| ≫ (u2 + v 2 ) 2 and |F2 (u, v) + F1 (u, v)| ≪ u2 + v 2 .
Therefore, we obtain
                                  F (u, v) = F3 (u, v) + O(u2 + v 2 ).
By replacing (u, v) with (−u, −v) if necessary, it follows that
                                                                                3
                                 F (u, v) < 0 and |F (u, v)| ≫ (u2 + v 2 ) 2 ,
           √
provided    u2 + v 2 is sufficiently large, and the result follows.                                             

  By Lemma 2.5 we may assume that gcd(Fe4 , F3 ) 6= 1 from this point on. We now deal with the case
gcd(Fe4 , F3 , F2 ) 6= 1 but gcd(Fe4 , F3 , F2 , F1 ) = 1. We are then left with the cases gcd(Fe4 , F3 , F2 ) = 1,
that is F is linked, and gcd(Fe4 , F3 , F2 , F1 ) 6= 1.
Lemma 2.6. Suppose F4 is positive semi-definite, gcd(Fe4 , F3 , F2 ) 6= 1 and gcd(Fe4 , F3 , F2 , F1 ) = 1.
Then
                                     inf F (x, y) = −∞.
                                             (x,y)∈Z2

Proof. We begin by noting that the hypotheses of the statement ensure that F1 is not the zero
polynomial. Let (cos(ξ), sin(ξ)) be a zero of gcd(Fe4 , F3 , F2 ). We write
                                          L(x, y) = sin(ξ)x − cos(ξ)y,
                  F4 (x, y) = L(x, y)2r F4 (x, y) and F2 (x, y) = L(x, y)t F2 (x, y),
where r, t ∈ N and L ∤ F4 , F2 (If F2 happens to be the zero polynomial, then we set t = 0 and F2 to
be the zero polynomial.).
  4This definition is equivalent to that given in Section 1.1.
6                            STANLEY YAO XIAO AND SHUNTARO YAMAGISHI

   By Dirichlet’s theorem on Diophantine approximation, there exist infinitely many (u, v) ∈ Z2
satisfying
                                                           1
                                | sin(ξ)u − cos(ξ)v| ≪ √        .
                                                          2
                                                         u + v2
For these (u, v), we have
           F4 (u, v) = L(u, v)2r F4 (u, v) ≪ (u2 + v 2 )−r (u2 + v 2 )2−r ≪ (u2 + v 2 )2−2r ≪ 1,
                                                            t                 t
          |F2 (u, v)| = |L(u, v)|t |F2 (u, v)| ≪ (u2 + v 2 )− 2 (u2 + v 2 )1− 2 ≪ (u2 + v 2 )1−t ≪ 1
and                               p                              p
                                      u2 + v 2 ≪ |F1 (u, v)| ≪       u2 + v 2 .
Therefore, we obtain
                                 F (u, v) = F3 (u, v) + F1 (u, v) + O(1).
If {F3 (u, v) + F1 (u, v) : (u, v)} is an unbounded set, then by replacing (u, v) with (−u, −v) if
necessary, our result follows. Suppose otherwise, i.e. |F3 (u, v) + F1 (u, v)| ≪ 1 for all (u, v) in
consideration, which implies
                                   p                       p
                                     u2 + v 2 ≪ F3 (u, v) ≪ u2 + v 2 .
Given any M > 1, we have
                          F (M u, M v) = M 3 F3 (u, v) + M F1 (u, v) + O(M 4 ).
Therefore, by setting M = ⌊(u2 + v 2 )ε0 /2 ⌋ with ε0 > 0 sufficiently small, and again replacing (u, v)
with (−u, −v) if necessary, we obtain our result in this case as well.                                

   Recall that the remaining cases are F is linked and gcd(Fe4 , F3 , F2 , F1 ) 6= 1. We will prove the
following in Section 6, which completes our proof of Proposition 1.7.
Proposition 2.7. Suppose F4 is positive semi-definite and gcd(Fe4 , F3 , F2 , F1 ) 6= 1. Let C ∈ N and
D ∈ Z. Then
                                      F (Z2 ) 6= (CZ)≥D .

   In this case, F is reducible over Q and the proof of Proposition 2.7 requires several results from
Diophantine geometry. We note that the material in Sections 3-5 are independent of that in Section
6.

                                    3. Proof of Proposition 1.8

  Our goal in this section is to prove Proposition 1.8. We begin by setting some notations for the
remainder of the paper. Let F4 be positive semi-definite and gcd(Fe4 , F3 ) 6= 1. Let T = R/(2πZ).
We define Ξ to be the set of all ξ ∈ T such that
                         Fe4 (cos(ξ), sin(ξ)) = 0 and F3 (cos(ξ), sin(ξ)) = 0.
Let ξ ∈ Ξ and H be the irreducible primitive integral form H satisfying H(cos(ξ), sin(ξ)) = 0. By
Lemma 2.4, it follows that H divides F4 with an even order, which we denote by 2rξ ; when we
are working with a fixed choice of ξ, we will drop the subscript and simply denote r for a clearer
exposition. We define
                                                                  
                                                             − 2r1
                             Θξ (B) = θ ∈ T : |θ − ξ| < cξ B ξ ,

where cξ > 0 is a sufficiently large constant. Then we have the following simple estimate, which we
leave as an exercise to the reader.
                                                                                                         7

Lemma 3.1. Let F be as in this section. Then there exists C1 > 0 such that we have
(3.1)                               F (B cos(θ), B sin(θ)) ≥ C1 B 3 ,
for all                                                  [
                                             θ ∈ T\            Θξ (B).
                                                         ξ∈Ξ

  The idea is that once we are sufficiently “far” from the zeros of F4 , the situation is easy to control,
and the challenge comes from “near” the zeros. We now observe the following fact, which we will
make use of throughout the remainder of the paper.
Proposition 3.2. Let F be as in this section. Let E ⊆ Z2 . Suppose for each ξ ∈ Ξ, there exists
Cξ > 0 such that
(3.2)     F4 (B cos(θ), B sin(θ)) + F3 (B cos(θ), B sin(θ)) + F2 (B cos(θ), B sin(θ)) > Cξ B 2 ,
for all
                                 (B cos(θ), B sin(θ)) ∈ Z2 \ E
with θ ∈ Θξ (B) and B ≫ 1. Then there exists λ > 0 such that
                      #RF ([N, 2N ]) ≪ N 1−λ + #({F (x, y) : (x, y) ∈ E} ∩ [N, 2N ]).

  We note that Cξ depends on cξ from the definition of Θξ (B), but it is independent of B. Also, we
shall take E in the statement to be the empty set for all applications of this result in this section.

Proof. Let (x, y) ∈ Z2 and suppose N ≤ F (x, y) ≤ 2N . By (3.1) it follows that
                                                     3
                                       C1 (x2 + y 2 ) 2 ≤ F (x, y) ≤ 2N
if                                                       [         p
                                     arg(x, y) ∈ T \           Θξ ( x2 + y 2 ).
                                                         ξ∈Ξ
On the other hand, by (3.2) it follows that there exists C2 > 0 satisfying
                                       C2 (x2 + y 2 ) ≤ F (x, y) ≤ 2N
if (x, y) 6∈ E and                                   [         p
                                       arg(x, y) ∈         Θξ ( x2 + y 2 ).
                                                     ξ∈Ξ
Let
                                                R = max rξ .
                                                         ξ∈Ξ
Therefore, we obtain
                #RF ([N, 2N ]) − #({F (x, y) : (x, y) ∈ E} ∩ [N, 2N ])
           ≤ #{(x, y) ∈ Z2 \ E : N ≤ F (x, y) ≤ 2N }
                            p                     1
           ≪ #{(x, y) ∈ Z2 : x2 + y 2 ≤ (2N/C1 ) 3 }
               X                  p                   1                                       1
             +    #{(x, y) ∈ Z2 : x2 + y 2 ≤ (2N/C2 ) 2 , | arg(x, y) − ξ| < cξ (x2 + y 2 )− 4R }
                  ξ∈Ξ
                  2         1
           ≪ N 3 + N 1− 4R ,
where the second term in the final inequality may be obtained as follows. Let
                                           p                                     1
              Z(T ) = #{(x, y) ∈ Z2 : T ≤ x2 + y 2 ≤ 2T, | arg(x, y) − ξ| ≪ T − 2R }.
This quantity is bounded by the sum of the area of the region and the length of the boundary, to
be more precise
                                                   1
                                     Z(T ) ≪ T 2− 2R + T.
8                             STANLEY YAO XIAO AND SHUNTARO YAMAGISHI

Then by considering dyadic intervals, we obtain
                               p                   1                                       1
               #{(x, y) ∈ Z2 : x2 + y 2 ≤ (2N/C2 ) 2 , | arg(x, y) − ξ| < cξ (x2 + y 2 )− 4R }
                  X                  1
          ≪             Z((2N/C2 ) 2 2−j )
                 1≤j≪log N
                      1        1
            ≪ N 1− 4R + N 2 .
                                                                                                    
Remark 3.3. The way we use this proposition is as follows. We will prove that for each ξ ∈ Ξ,
either (3.2) holds or we have
                                   inf F (x, y) = −∞.
                                          (x,y)∈Z2

If the latter happens for at least one ξ, then we are done. Otherwise, it means (3.2) holds for all
ξ ∈ Ξ, in which case by Proposition 3.2 it follows that there exists λ > 0 such that
                   #RF ([N, 2N ]) ≪ N 1−λ + #({F (x, y) : (x, y) ∈ E} ∩ [N, 2N ]).

  From this point on, we assume that F is linked. In particular, it follows that F2 is not the zero
polynomial while F3 may be. We begin with a simple consequence of Proposition 3.2, which deals
with the case when F3 is the zero polynomial.
Lemma 3.4. Suppose F2 (cos(ξ), sin(ξ)) < 0 for some ξ ∈ Ξ. Then
                                            inf      F (x, y) = −∞.
                                          (x,y)∈Z2

Furthermore, if F2 (cos(ξ), sin(ξ)) > 0 for all ξ ∈ Ξ and F3 is the zero polynomial, then there exists
λ > 0 such that
                                       #RF ([N, 2N ]) ≪ N 1−λ .

Proof. Suppose F2 (cos(ξ), sin(ξ)) < 0 for some ξ ∈ Ξ. By Dirichlet’s theorem on Diophantine
approximation, there exist infinitely many (u, v) ∈ Z2 satisfying
                                                                1
(3.3)                              | sin(ξ)u − cos(ξ)v| ≪ √            .
                                                              u2 + v 2
For these (u, v), a similar argument as in the proof of Lemma 2.6 yields
                                                            p
                                F4 (u, v) ≪ 1, |F3 (u, v)| ≪ u2 + v 2
and
                                           |F2 (u, v)| ≫ u2 + v 2 .
Furthermore, by the mean value theorem and (3.3) we have
                                                                                          1
        |F2 (cos(ξ), sin(ξ)) − F2 (cos(arg(u, v)), sin(arg(u, v)))| ≪ |ξ − arg(u, v)| ≪ 2     .
                                                                                       u + v2
                                                          √
In particular, it follows that F2 (u, v) < 0, provided u2 + v 2 is sufficiently large. Therefore, we
obtain                                                      p
                                   F (u, v) = F2 (u, v) + O( u2 + v 2 ),
from which it easily follows that
                                            inf      F (x, y) = −∞.
                                          (x,y)∈Z2

  Next we suppose F2 (cos(ξ), sin(ξ)) > 0 for all ξ ∈ Ξ and F3 is the zero polynomial. In particular,
we have
(3.4)                     F2 (B cos(θ), B sin(θ)) = B 2 F2 (cos(θ), sin(θ)) > 0
                                                                                                       9

for all θ ∈ Θξ (B). Then it is clear that there exists C3 > 0 satisfying
                F4 (B cos(θ), B sin(θ)) + F3 (B cos(θ), B sin(θ)) + F2 (B cos(θ), B sin(θ))
              ≥ F2 (B cos(θ), B sin(θ))
              > C3 B 2
for all θ ∈ Θξ (B) and ξ ∈ Ξ. Therefore, we obtain that (3.2) holds for all ξ ∈ Ξ and the conclusion
follows by Proposition 3.2.                                                                        

  For the remainder of this section, we assume that F2 (cos(ξ), sin(ξ)) > 0 for all ξ ∈ Ξ and F3 is
not the zero polynomial. In particular, we have (3.4) for all θ ∈ Θξ (B). Let us fix a choice of ξ ∈ Ξ.
We now set more notations for the remainder of the paper. We denote
                                      L(x, y) = sin(ξ)x − cos(ξ)y,
                   F4 (x, y) = L(x, y)2r F4 (x, y) and F3 (x, y) = L(x, y)s F3 (x, y),
where r = rξ , s = sξ ∈ N and L ∤ F4 , F3 , F2 . In particular, we have
                               F4 (cos(ξ), sin(ξ)), F3 (cos(ξ), sin(ξ)) 6= 0.
We also remark that F4 and F3 depend on the choice of ξ. For simplicity, we define
                                             log |L(cos(θ), sin(θ))|
                             δ = δ(θ, B) =
                                                     log B
so that
                                 B δ(θ,B) = |L(cos(θ), sin(θ))|.
                                                               1
Recalling the definition Θξ (B) = {θ ∈ T : |θ − ξ| < cξ B − 2r }, it is clear that
                                                                                                       1
|L(cos(θ), sin(θ))| = |L(cos(ξ), sin(ξ))−L(cos(θ), sin(θ))| ≤ | cos(ξ)−cos(θ)|+| sin(ξ)−sin(θ)| ≪ B − 2r
for all θ ∈ Θξ (B). Consequently, δ(·, B) is a continuous function in θ ∈ Θξ (B) \ {ξ} with range
                                                           
                                                  1
(3.5)                             Iξ = −∞, − + oB (1) .
                                                  2r
With these notations, we have
                  F4 (B cos(θ), B sin(θ)) ≍ B 4+2rδ ,   F3 (B cos(θ), B sin(θ)) ≍ B 3+sδ
and
                                      F2 (B cos(θ), B sin(θ)) ≍ B 2
for all θ ∈ Θξ (B).
  We begin by considering the two cases when either |F4 (B cos(θ), B sin(θ))| or |F2 (B cos(θ), B sin(θ))|
dominates |F3 (B cos(θ), B sin(θ))|. Then we consider the case when |F3 (B cos(θ), B sin(θ))| domi-
nates the other two terms. Here we take the general approach described in Remark 3.3.
   Let ε > 0 be sufficiently small and B sufficiently large with respect to ε. Suppose θ ∈ Θξ (B)
satisfies
                                                1+ε
(3.6)                                   δ<−          ,
                                                  s
which is equivalent to
                                         2 > 3 + sδ + ε.
Then we have
(3.7)            F4 (B cos(θ), B sin(θ)) + F3 (B cos(θ), B sin(θ)) + F2 (B cos(θ), B sin(θ))
             = B 4+2rδ F4 (cos(θ), sin(θ)) + B 3+sδ F3 (cos(θ), sin(θ)) + B 2 F2 (cos(θ), sin(θ))
                                             B2
             ≥ B 4+2rδ F4 (cos(θ), sin(θ)) +    F2 (cos(θ), sin(θ))
                                              2
             ≫ B 4+2rδ + B 2 .
10                             STANLEY YAO XIAO AND SHUNTARO YAMAGISHI

Next suppose θ ∈ Θξ (B) satisfies
(3.8)                                     (2r − s)δ > −1 + ε,
which is equivalent to
                                            4 + 2rδ > 3 + sδ + ε.
Then we have
(3.9)              F4 (B cos(θ), B sin(θ)) + F3 (B cos(θ), B sin(θ)) + F2 (B cos(θ), B sin(θ))
              =    B 4+2rδ F4 (cos(θ), sin(θ)) + B 3+sδ F3 (cos(θ), sin(θ)) + B 2 F2 (cos(θ), sin(θ))
                B 4+2rδ
              ≥         F4 (cos(θ), sin(θ)) + B 2 F2 (cos(θ), sin(θ))
                   2
              ≫ B 4+2rδ + B 2 .

     With these estimates, we can collect the following.
Lemma 3.5. For ξ ∈ Ξ with rξ < sξ , we have that (3.2) holds.

Proof. Clearly, the inequality
                                          1                 1+ε
                                           − + oB (1) < −
                                          2r                 s
holds for r, s ∈ N if and only if 2r < s. Therefore, if 2r < s, then
                                                            
                                                        1+ε
                                         Iξ ⊆ −∞, −            ,
                                                          s
that is every θ ∈ Θξ (B) satisfies (3.6). Thus for ξ ∈ Ξ with 2rξ < sξ , we have that (3.2) holds.
  Next it is easy to see that every θ ∈ Θξ (B) satisfies (3.8) if 2r = s; therefore, for ξ ∈ Ξ with
2rξ = sξ , we have that (3.2) holds.
   We are left to deal with the case 2r > s. Since the inequality
                                            1+ε          1−ε
                                          −         ≤−
                                               s        2r − s
is equivalent to
                                              r − s ≥ −εr,
it is clear that r, s ∈ N, with 2r > s, satisfy the former if and only if r ≥ s. This means if r < s,
then given any z ∈ R we have that either
                                          1+ε                   1−ε
                                    z<−            or z > −
                                             s                 2r − s
holds. In particular, every θ ∈ Θξ (B) satisfies either (3.6) or (3.8). Therefore, for ξ ∈ Ξ with rξ < sξ
and 2rξ > sξ , we have that (3.2) holds.                                                               

   Thus the remaining case is r ≥ s. Let us suppose r > s. We recall (3.5) and note that the
following inequalities
                                 1       1       1        1
                                − <−       1 <− <−
                                 s     s+ 2      r     2r − s
hold in this case. Suppose θ0 ∈ Θξ (B) satisfies
                                                        1
(3.10)                                         δ0 +          < ε,
                                                      s + 12
where δ0 = δ(θ0 , B). In particular, δ0 satisfies
                                           1           1
                                         − < δ0 < −        ,
                                           s        2r − s
                                                                                                               11

which implies
                                            4 + 2rδ0 + ε0 < 3 + sδ0
and
                                            2 + ε0 < 3 + sδ0 ,
for ε0 > 0 sufficiently small. In this case, we have
(3.11)        F4 (B cos(θ0 ), B sin(θ0 )) + F3 (B cos(θ0 ), B sin(θ0 )) + F2 (B cos(θ0 ), B sin(θ0 ))
          = B 4+2rδ0 F4 (cos(θ0 ), sin(θ0 )) + B 3+sδ0 F3 (cos(θ0 ), sin(θ0 )) + B 2 F2 (cos(θ0 ), sin(θ0 ))
          = B 3+sδ0 F3 (cos(θ0 ), sin(θ0 )) + O(B 4+2rδ0 + B 2 )
          = F3 (B cos(θ0 ), B sin(θ0 )) + O(B 4+2rδ0 + B 2 ).
Lemma 3.6. Suppose rξ > sξ for some ξ ∈ Ξ. Then
                                               inf     F (x, y) = −∞.
                                            (x,y)∈Z2

Proof. We shall consider two cases depending on whether cos(ξ)/ sin(ξ) ∈ Q ∪ {∞} or not. Let us
begin with the case cos(ξ)/ sin(ξ) ∈
                                   / Q∪{∞}. Let ε > 0 be sufficiently small. By Roth’s theorem and
Dirichlet’s theorem on Diophantine approximation, there exist infinitely many (u, v) ∈ Z2 satisfying
                                           1     cos(ξ) u     1
                                           2+ε
                                               ≪        −   < 2,
                                        |v|      sin(ξ)   v  |v|
which implies
                                              1                  1
                                                  ≪ |L(u, v)| <     .
                                           |v|1+ε               |v|
For simplicity, we denote                                 p
                                             R(u, v) =        u2 + v 2 .
We now set
                                                  M = ⌊R(u, v)2s ⌋
so that
                                          M                       2
                                                ≍ R(M u, M v)1− 2s+1 .
                                        R(u, v)
Then we have
                             2           M                      M                     2
          R(M u, M v)1− 2s+1 −ε ≪             ≪ |L(M u, M v)| ≪     ≪ R(M u, M v)1− 2s+1
                                                                                         .
                                       |v|1+ε                   |v|
In particular, θ0 = arg(M u, M v) with B = R(M u, M v) satisfies (3.10), provided R(u, v) is suffi-
ciently large, which implies (3.11). By replacing (u, v) with (−u, −v) if necessary, it follows that
                                               inf     F (x, y) = −∞.
                                            (x,y)∈Z2

   On the other hand, let us now suppose cos(ξ)/ sin(ξ) ∈ Q ∪ {∞}. Without loss of generality we
assume L(1, 0) 6= 0. Let (x0 , y0 ) ∈ Z2 \ {0} be a zero of L. Let M ∈ N be sufficiently large and
                                                           2
                                                                    
                                  (x, y) = M x0 + ⌊M 1− 2s+1 ⌋, M y0 .
Then we have
                                     R(x, y) = M R(x0 , y0 )(1 + oM (1))
and                              2            2                            2                 2
                 R(x, y)1− 2s+1 ≪ M 1− 2s+1 ≪ L(x, y) ≪ M 1− 2s+1 ≪ R(x, y)1− 2s+1 .
In particular, θ0 = arg(x, y) with B = R(x, y) satisfies (3.10), provided R(x, y) is sufficiently large,
which implies (3.11). Therefore, by replacing (x, y) with (−x, −y) if necessary, the result follows. 

  Finally, we combine all the work in this section, and recalling Remark 3.3, to deduce the following.
12                             STANLEY YAO XIAO AND SHUNTARO YAMAGISHI

Proposition 3.7. Let F be as in this section (with the additional assumptions described after the
proof of Lemma 3.4.). Suppose rξ 6= sξ for all ξ ∈ Ξ. Then either there exists λ > 0 such that
                                          #RF ([N, 2N ]) ≪ N 1−λ ,
or we have
                                              inf     F (x, y) = −∞.
                                           (x,y)∈Z2

   It is clear that Proposition 3.7 implies Proposition 1.8. Therefore, the final case we are left with
is the following: there exists ξ ∈ Ξ such that
                F (x, y) = L(x, y)2r F4 (x, y) + L(x, y)r F3 (x, y) + F2 (x, y) + F1 (x, y),
from which it follows that we may rewrite F as in (1.2). We deal with these in the following two
sections. In this case, it is possible that δ = −1/r, which implies
             |F4 (B cos(θ), B sin(θ))|, |F3 (B cos(θ), B sin(θ))|, |F2 (B cos(θ), B sin(θ))| ≍ B 2 ,
that is the three terms are of the same magnitude. Since this allows for the possibility of cancellation
among the three terms, the techniques from this and the previous sections struggle to yield the
desired conclusions. However, by making a full use of the quadratically composed structure of F ,
we can obtain the result.

                   4. Quadratically composed polynomials with H linear

     It follows from (1.2) that there are three cases to consider:
      (1) H is a linear form and r = 1.
      (2) H is a linear form and r = 2.
      (3) H is an indefinite quadratic form and r = 1.
We shall treat these three cases separately. In this section, we prove Propositions 4.1 and 4.2 which
deal with (1) and (2) respectively, and Proposition 5.5 which deals with (3) in the next section. We
will prove these in a slightly more general setting than in (1.2). It is easy to see that Proposition
1.9 from Propositions 4.1, 4.2 and 5.5.
Proposition 4.1. Let
                  F (x, y) = H(x, y)2 G4 (x, y) + H(x, y)G3 (x, y) + F2 (x, y) + F1 (x, y),
where H is a primitive integral linear form, G4 and G3 are integral quadratic forms such that
H ∤ G4 , G3 , there does not exist a primitive integral linear form L ∤ H such that L2 |G3 and no
further assumptions on F2 and F1 (In particular, this contains F as in (1.2) with H a linear form
and r = 1.). Then either there exists λ > 0 such that
                                          #RF ([N, 2N ]) ≪ N 1−λ ,
or we have
                                              inf     F (x, y) = −∞.
                                           (x,y)∈Z2

Proof. Let H(x, y) = ax + by. Since gcd(a, b) = 1, there exist c, d ∈ Z such that ad − bc = 1. Let
us define the matrix                                
                                                 a b
                                         A=            .
                                                 c d
In particular, if                                 
                                          u         x
                                              =A        ,
                                           v        y
then we have u = H(x, y). Let G = F ◦ A−1 and denote
(4.1)                     G(u, v) = u2 G4 (u, v) + uG3 (u, v) + G2 (u, v) + G1 (u, v),
                                                                                                           13

where G4 , G3 are integral quadratic forms not divisible by u, and G2 and G1 are integral forms
(possibly the zero polynomial) of degrees 2 and 1 respectively. We know that G4 is positive semi-
definite; therefore, either it is positive definite or a positive integer multiplied by square of a primitive
integral linear form.
  Since G4 is positive semi-definite, it follows that its v 2 -coefficient is positive (it can not be zero
because u ∤ G4 ). Therefore, we may rewrite (4.1) as
(4.2)                              G(u, v) = v 2 g2 (u) + vg1 (u) + g0 (u),
where g2 , g1 , g0 are integral polynomials in u. Furthermore, the u2 -coefficient of g2 is positive. Let
us denote
                                              g1 (u)2 − 4g0 (u)g2 (u)
                                      D(u) =                          .
                                                      4g2 (u)
By completing the square, we obtain the expression
                                                                
                                                           h(u) 2
(4.3)                       G(u, v) = g2 (u) v + q(u) +             − D(u),
                                                         2g2 (u)
where q and h are integral polynomials such that g1 (u) = 2g2 (u)q(u) + h(u) and deg h ≤ 1. Fur-
thermore, since deg g1 ≤ 3, it follows that deg q ≤ 1.
    We consider two cases based on whether the set
                                      S = {D(u) : u ∈ Z, g2 (u) > 0}
is bounded or not.
    Let ξ ∈ Ξ be such that H(cos(ξ), sin(ξ)) = 0. For each θ ∈ Θξ (B), we let
                                                       "                   1
                                                                                               #
    uθ        B cos(θ)          cos(ξ) + (cos(θ) − cos(ξ))                 O(B 2 )
         =A              = BA                               =                               1    ,
    vθ        B sin(θ)          sin(ξ) + (sin(θ) − sin(ξ))     B(c cos(ξ) + d sin(ξ)) + O(B 2 )
where c cos(ξ) + d sin(ξ) 6= 0. Since A ∈ GL2 (Z), we have that (uθ , vθ ) ∈ Z2 if and only if
(B cos(θ), B sin(θ)) ∈ Z2 .
    Let us suppose S is bounded. Then
                                                                      2
                                                      h(u)
                         G(u, v) = g2 (u) v + q(u) +                        + O(1).
                                                     2g2 (u)
Therefore, there exists C0 > 0 such that
                                                                             1
(4.4)               F (B cos(θ), B sin(θ)) = G(uθ , vθ ) > C0 (B + B 2 )2 > C0 B 2 ,
for (uθ , vθ ) ∈ Z2 with θ ∈ Θξ (B) such that g2 (uθ ) > 0. It is easy to see that for w ∈ Z satisfying
g2 (w) = 0, if it exists, we have
(4.5)            #{F (x, y) : w = ax + by, (x, y) ∈ Z2 } = #{G(w, v) : v ∈ Z} ≪ 1.
We will be making use of Proposition 3.2 with
                                   [
                            E=          {(x, y) ∈ Z2 : w = ax + by}.
                                           w∈Z
                                         g2 (w)=0

If there exists w ∈ Z such that g2 (w) < 0, then we easily obtain
(4.6)                           inf      F (x, y) =       inf    G(u, v) = −∞.
                              (x,y)∈Z2                (u,v)∈Z2

    On the other hand, let us now suppose S is unbounded. In this case, we have
                                              deg(g12 − 4g0 g2 ) > 2.
First we assume
                                                    lim D(u) = ∞.
                                                    u→∞
14                               STANLEY YAO XIAO AND SHUNTARO YAMAGISHI

Let us recall that q is an integral polynomial and set v = −q(u). Then (4.3) becomes
                                                   
                                             r(u) 2
                         G(u, v) = g2 (u)             − D(u) = −D(u) + O(1),
                                            2g2 (u)
provided |u| is sufficiently large, since deg r ≤ 1 and deg g2 = 2; therefore, we obtain (4.6). Next we
assume
                                             lim D(u) = −∞.
                                                u→∞
If deg(g12 − 4g0 g2 ) is odd, then
                                                   lim D(u) = ∞,
                                                u→−∞
and the same analysis from the previous case implies (4.6). On the other hand, if deg(g12 − 4g0 g2 )
is even, then the set {u ∈ R : D(u) > 0} is bounded. Let
                                                          
                                     m = min 0, max D(u) .
                                                            u∈R

Therefore, from (4.3) it follows that
                                                                             
                                                                     r(uθ ) 2
                               G(uθ , vθ ) ≥ g2 (uθ ) vθ + q(uθ ) +             − m,
                                                                    2g2 (uθ )
and by the same argument as above in the case S is bounded, we also obtain (4.4), (4.5) and (4.6).
Therefore, this completes proof of the case when G4 is positive definite (In this case, #Ξ = 2 which
corresponds to the zeros of H.). If G4 = a4 L2 with a4 ∈ N and L a primitive integral linear form
such that L ∤ H, then we are also done if L ∤ G3 (In this case, we still have #Ξ = 2.). On the other
hand, if L|G3 , then we may repeat the above argument to obtain the desired conclusion (In this
case, #Ξ = 4 which corresponds to the zeros of H and L.).                                         
Proposition 4.2. Let
                     F (x, y) = a4 H(x, y)4 + H(x, y)2 G3 (x, y) + F2 (x, y) + F1 (x, y),
where H is a primitive integral linear form, a4 ∈ N and G3 is an integral linear form such that
H ∤ G3 and no further assumptions on F2 and F1 (In particular, this contains F as in (1.2) with
H a linear form and r = 2.). Then we have either
                                                    N
                        #RF ([N, 2N ]) ≪ √                  or      inf      F (x, y) = −∞.
                                                   log N          (x,y)∈Z2

Proof. By applying a GL2 (Z)-change of variables if necessary, we may assume F is of the form
(4.7)                    F (x, y) = a4 x4 + a3 x2 (cx + dy) + F2 (x, y) + F1 (x, y),
where a3 , d ∈ Z6=0 and c ∈ Z. In particular, we have Ξ = {π/2, 3π/2} in the notation of Section 3.
     Our goal is to establish
                                                                   N
(4.8)                                   #RF ([N, 2N ]) ≪ √              ,
                                                                  log N
by showing (3.2) holds for each ξ ∈ Ξ or other means, unless
(4.9)                                        inf      F (x, y) = −∞.
                                           (x,y)∈Z2

     Let us rewrite (4.7) as
(4.10)                                  F (x, y) = by 2 + yg1 (x) + g0 (x),
where b ∈ Z and g1 , g0 are integral polynomials in x. In particular, we have deg g1 = 2. If b ≤ 0,
then we easily obtain (4.9) by setting x = x0 where g1 (x0 ) 6= 0. Therefore, we assume b > 0 for the
remainder of the proof.
                                                                                              15

  Let us denote
                                            g1 (x)2 − 4g0 (x)b
                                        D(x) =                 .
                                                     4b
By completing the square, we obtain the following expression
                                                     
                                                g1 (x) 2
                             F (x, y) = b y +            − D(x).
                                                  2b

  We consider three cases based on deg D. We begin with the case deg D = 0, i.e. D(x) ≡ C0 for
some C0 ∈ Q. Then it follows from Lemma 2.1 that
                                                    √
                                    #RF ([N, 2N ]) ≪ N .
                                                          (x)
  Next we suppose deg D is odd. Then by setting y = −⌊ g12b   ⌋ we have
                                        F (x, y) = −D(x) + O(1).
Therefore, it is easy to see that (4.9) holds in this case.
  Finally, we suppose deg D is even, that is deg D ∈ {2, 4}. If
                                                lim D(x) = ∞,
                                            |x|→∞

then by setting y = −⌊ g12b(x) ⌋ again we obtain (4.9). Therefore, we assume
                                             lim D(x) = −∞.
                                           |x|→∞

First we assume deg D = 2. Let us denote
                                                                           2
                                    ex2 + f x + g   e                f
                             D(x) =               =               x+             − C0 ,
                                         4b         4b               2e
where e ∈ Z<0 , f, g ∈ Z and
                                                       f 2 − 4eg
                                                C0 =             .
                                                          16be
Therefore, we obtain
                                         (2by + g1 (x))2 (2ex + f )2
                         F (x, y) =                      −             + C0
                                                4b             16be
                                         (2by + g1 (x))2 (2ex + f )2
                                    =                    +             + C0
                                                4b            16b|e|
                                         |e|(4by + 2g1 (x))2 + (2ex + f )2
                                    =                                      + C0 .
                                                       16b|e|
Let us define
                                          Q(u, v) = |e|u2 + v 2 .
It follows that
                                                  1
                  {F (x, y) : (x, y) ∈ Z2 } ⊆          {Q(u, v) + 16b|e|C0 : (u, v) ∈ Z2 }.
                                                16b|e|
Therefore, by Theorem 5.2 we obtain
                                                                   N
                                        #RF ([N, 2N ]) ≪ √              .
                                                                  log N
  Next we assume deg D = 4. Clearly, we have
                                     1
                         F (x, y) >    max{(2by + g1 (x))2 , |D(x)|},
                                    4b
16                             STANLEY YAO XIAO AND SHUNTARO YAMAGISHI

for |x| sufficiently large. Since deg g1 = 2, given y = ±B + O(B 3/4 ), there exist C2 > C1 > 0 such
that                                                         √
                                          2       if |x| ≤ C1 B,
                                        y               √            √
                             F (x, y) ≫ |D(x)| if C1 B < |x| < C2 B,
                                        
                                                             √
                                          g1 (x)2 if |x| ≥ C2 B.
Let ξ ∈ Ξ. Then we have
                                              1                                1
(4.11)                   cos(θ) = O(B − 4 ) and        sin(θ) = sin(ξ) + O(B − 4 )
for θ ∈ Θξ (B). Therefore, it follows that there exists C3 > 0 satisfying
                                        F (B cos(θ), B sin(θ)) > C3 B 2
for all θ ∈ Θξ (B), which implies (3.2). Since this estimate holds for all ξ ∈ Ξ, we obtain from
Proposition 3.2 that (4.8) holds.
                                                                                                           

                 5. Quadratically composed polynomials with H quadratic

  In this section, we treat quadratically composed polynomials with H an indefinite irreducible
quadratic form.
Lemma 5.1. Let Q ∈ Q[x, y] be a quadratic polynomial. Let Q2 be the degree 2 homogeneous part
of Q, and suppose that Q2 is an integral quadratic form with non-zero discriminant. Then there
exist q1 , q2 , q3 ∈ Q, depending only on Q, such that
                                      Q(x, y) = Q2 (x + q1 , y + q2 ) + q3 .

Proof. Let us write
                                 Q(x, y) = ax2 + bxy + cy 2 + dx + ey + f,
where a, b, c ∈ Z with b2 − 4ac 6= 0 and d, e, f ∈ Q. Let q1 , q2 ∈ Q to be determined in due course.
Since
     Q2 (x + q1 , y + q2 ) = a(x + q1 )2 + b(x + q1 )(y + q2 ) + c(y + q2 )2
                           = ax2 + bxy + cy 2 + (2aq1 + bq2 )x + (bq1 + 2cq2 )y + aq12 + bq1 q2 + cq22 ,
we set
                                         q3 = f − (aq12 + bq1 q2 + cq22 ).
Therefore, we obtain
                                      Q(x, y) = Q2 (x + q1 , y + q2 ) + q3
provided we choose q1 and q2 to satisfy
                                               
                                        d   2a b q1
                                          =           .
                                        e    b 2c q2
Since the determinant of the matrix is non-zero, this system can be solved uniquely as follows
                                                         
                                  q1       −1       2c −b d
                                      = 2                       .
                                  q2     b − 4ac −b 2a e
Finally, it is clear that q1 , q2 , q3 ∈ Q.                                                                

   We now answer Question 1.3 for quadratic polynomials. In order to achieve this, we will also need
the following estimate by Bernays [1] (for the statement of the result in English, see for example
[2, 10]), which is a generalization of the well-known result by Landau [7].
                                                                                                        17

Theorem 5.2 (Bernays). Suppose Q2 ∈ Z[x, y] is a positive definite primitive integral quadratic
form. Then there exists C(Q2 ) > 0, depending only on the discriminant of Q2 , such that
                                                                     N
                                    #RQ2 ([1, N ]) ∼ C(Q2 ) √             .
                                                                    log N
Corollary 5.3. Let Q ∈ Q[x, y] be a quadratic polynomial. Then we have either
                                          N
                       #RQ ([N, 2N ]) ≪ √                or      inf     Q(x, y) = −∞.
                                         log N                (x,y)∈Z2

Proof. For the purpose of this proof, we may assume without loss of generality that Q is an integral
quadratic polynomial with Q(0, 0) = 0. Let Q2 be the degree 2 homogeneous part of Q. Suppose
Q2 is negative semi-definite or indefinite. Then there exists (x0 , y0 ) ∈ Z2 such that Q2 (x0 , y0 ) < 0.
Since
                               Q(N x0 , N y0 ) = N 2 Q2 (x0 , y0 ) + O(N ),
it follows that
(5.1)                                      inf      Q(x, y) = −∞.
                                         (x,y)∈Z2

Therefore, we only need to consider when Q2 is positive semi-definite. Suppose Q2 is not positive
definite, in which case it follows5 that Q2 = aL2 for some a ∈ N and L a primitive integral linear
form. By applying a GL2 (Z)-change of variables if necessary, we may assume that Q is of the form
                                          Q(x, y) = ax2 + dx + ey,
where d, e ∈ Z. If e 6= 0, then we easily obtain (5.1) by setting x = 0. On the other hand, if e = 0,
then the result follows by Lemma 2.1.
  Finally, we suppose Q2 is positive definite. Then by Lemma 5.1 we obtain
                                        1
                            Q(x, y) = 2 Q2 (dx + m1 , dx + m2 ) + q3 ,
                                       d
where d ∈ N, m1 , m2 ∈ Z and q3 ∈ Q. Therefore, it follows that
                                                                                     N
                  #RQ ([N, 2N ]) ≪ #RQ2 ([d2 (N − q3 ), d2 (2N − q3 )]) ≪ √               ,
                                                                                    log N
where the second inequality follows from Theorem 5.2.                                                   
Lemma 5.4. Let H be an indefinite irreducible integral quadratic form. Let ξ ∈ T be such that
                                           H(cos(ξ), sin(ξ)) = 0.
Let m1 , m2 ∈ Z and d ∈ N. Then there exists an infinite sequence of pairs of integers {(xi , yi )}∞
                                                                                                   i=1
such that
                                 |H(dxi + m1 , dyi + m2 )| ≪ 1
and
                                                                  1
                                     | arg(xi , yi ) − ξ| ≪ q               .
                                                                x2i + yi2

Proof. We shall make use of the following version of Dirichlet’s theorem on Diophantine approxima-
tion [5]. Let m1 , m2 ∈ Z and d ∈ N. Given any irrational α, there exist infinitely many (xi , yi ) ∈ Z2
satisfying
                                         dyi + m2       2d2
(5.2)                              α−             ≤              .
                                         dxi + m1   (dxi + m1 )2
  5This is the same idea as Lemma 2.4.
18                               STANLEY YAO XIAO AND SHUNTARO YAMAGISHI

We apply this result with α = sin(ξ)/ cos(ξ). As a result, we obtain
                                                                                        1
                          | sin(ξ)(dxi + m1 ) − cos(ξ)(dyi + m2 )| ≪                           .
                                                                                   |dxi + m1 |

It then follows that
                                        |H(dxi + m1 , dyi + m2 )| ≪ 1.
It also follows from (5.2) that

                    sin(ξ)   yi       2d2        dyi + m2   yi      1
                           −    ≤            2
                                               +          −    ≪q          .
                    cos(ξ) xi     (dxi + m1 )    dxi + m1 xi      x2 + y 2                      i   i

Therefore, by the mean value theorem, we obtain
                                                                     1
                                        |ξ − arg(xi , yi )| ≪ q                .
                                                                   x2i + yi2

                                                                                                             

Proposition 5.5. Let

                       F (x, y) = a4 H(x, y)2 + H(x, y)L(x, y) + F2 (x, y) + F1 (x, y),

where H is an indefinite irreducible primitive integral quadratic form, a4 ∈ N, L is an integral linear
form and no further assumptions on F2 and F1 (In particular, this contains F as in (1.2) with H
an indefinite quadratic form and r = 1.). Then either there exists λ > 0 such that

                                           #RF ([N, 2N ]) ≪ N 1−λ ,

or we have
                                               inf      F (x, y) = −∞.
                                             (x,y)∈Z2


Proof. First we complete the square and write
                                                                                      2
                             2                                           L(x, y)                L(x, y)2
                a4 H(x, y) + H(x, y)L(x, y) = a4               H(x, y) +                    −            .
                                                                          2a4                     4a4

Then by Lemma 5.1 we can write

                                             L(x, y)
                                 H(x, y) +           = H(x + q1 , y + q2 ) + q3 ,
                                              2a4
for some q1 , q2 , q3 ∈ Q depending only on the coefficients of F . It follows that

(5.3)                        F (x, y) = a4 (H(x + q1 , y + q2 ) + q3 )2 + Q(x, y),

where
                                   L(x, y)2
                  Q(x, y) = −               + F2 (x, y) + F1 (x, y) = Q2 (x, y) + F1 (x, y).
                                     4a4
We now consider each case deg Q ∈ {0, 1, 2} separately, where we further split the case deg Q = 2
into two subcases H ∤ Q2 and H|Q2 .
                                                                                                  19

5.1. deg Q = 2 and H ∤ Q2 . Let ξ ∈ Ξ. Then Q2 (cos(ξ), sin(ξ)) 6= 0 and it follows that
                                           |Q2 (cos(θ), sin(θ))| ≫ 1
for all θ ∈ Θξ (B); therefore, we have
                       |Q(B cos(θ), B sin(θ))| ≫ |Q2 (B cos(θ), B sin(θ))| ≫ B 2
for θ ∈ Θξ (B). Suppose Q2 (cos(θ), sin(θ)) > 0 for all θ ∈ Θξ (B). Since
                                      a4 (H(x + q1 , y + q2 ) + q3 )2 ≥ 0,
it follows that there exists C0 > 0 satisfying
                                       F (B cos(θ), B sin(θ)) > C0 B 2
for all θ ∈ Θξ (B), which implies (3.2). On the other hand, suppose Q2 (cos(θ), sin(θ)) < 0 for all
θ ∈ Θξ (B). Then by Lemma 5.4 there exist infinitely many pairs of integers
                                                         q
                                   (xi , yi ) ∈ Z2 ∩ Θξ ( x2i + yi2 )
such that
(5.4)                              a4 (H(xi + q1 , yi + q2 ) + q3 )2 ≪ 1.
Since                                                                        q
                       F (xi , yi ) = Q(xi , yi ) + O(1) = Q2 (xi , yi ) + O( x2i + yi2 )
and Q2 (xi , yi ) < 0, we obtain
(5.5)                                       inf     F (x, y) = −∞
                                         (x,y)∈Z2

in this case. Therefore, either we have Q2 (cos(ξ), sin(ξ)) > 0 for each ξ ∈ Ξ, in which case by
Proposition 3.2 there exists λ > 0 such that
                                          #RF ([N, 2N ]) ≪ N 1−λ ,
or (5.5) holds.

5.2. deg Q = 1. In this case, Q is an integral linear form. Let ξ ∈ Ξ. Then Q(cos(ξ), sin(ξ)) 6= 0
and it follows that |Q(cos(θ), sin(θ))| ≫ 1 for all θ ∈ Θξ (B); therefore, we have
                                        |Q(B cos(θ), B sin(θ))| ≫ B
for all θ ∈ Θξ (B). Again, by Lemma 5.2 we find infinitely many pairs of integers
                                                       q
                                                2
                                  (xi , yi ) ∈ Z ∩ Θξ ( x2i + yi2 )

satisfying (5.4). It follows that
                                        F (xi , yi ) = Q(xi , yi ) + O(1).
If Q(xi , yi ) > 0 for i sufficiently large, then by considering ξ + π instead of ξ, we may replace,
without loss of generality, (xi , yi ) with (−xi , −yi ), from which we see that (5.5) holds.

5.3. deg Q = 0. In this case, we have that Q is the zero polynomial. Therefore, we may write
                            F (x, y) = q0 (m0 H(dx + m1 , dy + m2 ) + m3 )2 ,
for some q0 ∈ Q>0 , d ∈ N and m0 , m1 , m2 , m3 ∈ Z. Then it follows from Lemma 2.1 that
                                                        √
                                       #RF ([N, 2N ]) ≪ N .
20                              STANLEY YAO XIAO AND SHUNTARO YAMAGISHI

5.4. deg Q = 2 and H|Q2 . Finally, we consider the case H|Q2 . In this case, we may write
       Q2 (x, y) = q0 H((x + q1 ) − q1 , (y + q2 ) − q2 ) = q0 (H(x + q1 , y + q2 ) + q3 ) + M (x, y) + c0 ,
where q0 , c0 ∈ Q and M is either a rational linear form or the zero polynomial. Therefore, by
completing the square, we obtain
                                                            
                                                          q0 2   q2
                F (x, y) = a4 H(x + q1 , y + q2 ) + q3 −       − 0 + M (x, y) + c0 .
                                                         2a4    4a4
If deg M = 1, then we may argue in the same manner as in Section 5.2 and obtain the same
conclusion. On the other hand, if deg M = 0, i.e. M is the zero polynomial, then the same
argument as in Section 5.3 yields                          √
                                     #RF ([N, 2N ]) ≪ N .
                                                                                             

                                      6. Proof of Proposition 2.7

   Recall that the hypotheses of Proposition 2.7 are F4 is positive semi-definite and gcd(Fe4 , F3 , F2 , F1 ) 6=
1. We now collect a few fundamental results from Diophantine geometry. Our main reference for
this material is [6]. By an affine algebraic curve, we mean a geometrically irreducible affine variety
of dimension 1. Given an affine algebraic curve C ⊆ An defined over Q, by its genus g(C) we mean
the genus of any smooth projective model of C.
Theorem 6.1 (Siegel’s theorem). Let P ∈ Q[x, y] be irreducible over Q and C = {(x, y) ∈ A2 :
P (x, y) = 0}. If g(C) > 0, then C(Z) is finite.
Lemma 6.2. Let P and C be as in Theorem 6.1. Suppose g(C) = 0 and C(Q) is infinite. Then C is
birational over Q to A1 . In particular, there exist polynomials R1 , R2 , Q1 , Q2 ∈ Q[t] such that the
two sets                                                                        
                                       R1 (t) R2 (t)
                      C(Q) and               ,         : t ∈ Q, Q1 (t), Q2 (t) 6= 0
                                      Q1 (t) Q2 (t)
are equal up to finitely many elements.

Proof. It is known that any affine algebraic curve is birational to a smooth projective curve [6,
Theorem A.4.1.4]. Furthermore, since C is defined over Q, it follows that6 in fact C is birational
over Q to a smooth projective curve Ce defined over Q. It is clear that C(Q) e    6= ∅, because C(Q) is
infinite (also see [6, Exercise A.1.2]). Therefore, Ce is isomorphic over Q to P1 [6, Theorem A.4.3.1].
Finally, recalling that P1 is birational over Q to A1 , we obtain our result.                        

     We leave the details of the following lemma to the reader.
Lemma 6.3. Let P ∈ Q[x, y] be irreducible over Q, but reducible over Q, and C = {(x, y) ∈ A2 :
P (x, y) = 0}. Then C(Q) is finite.

   We need the following explicit version of Hilbert’s irreducibility theorem (see [8, Chapter 9] for a
general introduction to this theorem). The proof can be found in [4, Theorem 2.5] and an overview
of related results in [3].
Theorem 6.4 (Hilbert’s irreducibility theorem). Given Y ∈ Q[x, u] irreducible over Q, let
                        E(B) = #{t ∈ Z ∩ [−B, B] : Y (x, t) is reducible over Q}.
Then                                                    √
                                              E(B) ≪        B log B.
    6One way to achieve this is to first consider the normalization of C in Am [6, Exercise A.1.15] and then take
its closure in Pm , which basically amounts to homogenizing the defining equations. It can be verified that both
procedures are defined over Q.
                                                                                                           21

   We also need the following two simple technical lemmas. We leave the details of the first lemma
to the reader.
Lemma 6.5. Let Q, R ∈ Z[t] be such that gcd(Q, R) = 1. Then the polynomial xQ(t)−R(t) ∈ Q[x, t]
is irreducible over Q.
Lemma 6.6. Let G, H ∈ Z[x, y] be non-constant forms. If gcd(G, H) = 1, then
                                                                        1
                            max{|G(x, y)|, |H(x, y)|} ≫ (x2 + y 2 ) 2 min{deg G,deg H}
for all (x, y) ∈ Z2 .

Proof. If G does not have a non-trivial real zero, then the result follows easily. Let us suppose other-
wise and let θ1 , . . . , θm ∈ T be all the values such that G(cos(θi ), sin(θi )) = 0. Since gcd(G, H) = 1,
it follows that H(cos(θi ), sin(θi )) 6= 0 for all 1 ≤ i ≤ m. Let ε > 0 be sufficiently small. If |θ −θi | < ε
for some 1 ≤ i ≤ m, then we have
                        |H(B cos(θ), B sin(θ))| = B deg H |H(cos(θ), sin(θ))| ≫ B deg H .
Otherwise, we have
                        |G(B cos(θ), B sin(θ))| = B deg G |G(cos(θ), sin(θ))| ≫ B deg G .
                                                                                                           

   We prove Proposition 2.7 by considering each case deg gcd(Fe4 , F3 , F2 , F1 ) ∈ {1, 2, 3, 4} separately.
If deg gcd(Fe4 , F3 , F2 , F1 ) = 4, then the statement of Proposition 2.7 follows easily from the definition
of Fe4 ; therefore, we omit the details for this case. We have the following two lemmas for the
remaining cases.
  Given C ∈ N, we denote
                                              C℘ = {Cp : p ∈ ℘},
where ℘ is the set of prime numbers.
Lemma 6.7. Suppose F4 is positive semi-definite and deg gcd(Fe4 , F3 , F2 , F1 ) = 2. Let C ∈ N and
D ∈ Z. Then
                                     F (Z2 ) 6= (CZ)≥D .

Proof. Our assumptions imply that F can be expressed in the form
(6.1)                                      F (x, y) = H(x, y)G(x, y),
where H is a primitive integral quadratic form and G is an integral quadratic polynomial. Let G2
denote the homogeneous degree 2 part of G.
  If gcd(H, G2 ) = 1, then we see from Lemma 6.6 that
                                                                           p
   |F (x, y)| ≫ max{|H(x, y)|, |G(x, y)|} = max{|H(x, y)|, |G2 (x, y)| + O( x2 + y 2 )} ≫ x2 + y 2
for all (x, y) ∈ Z2 such that F (x, y) 6= 0. Therefore, either
                                               inf      F (x, y) = −∞
                                             (x,y)∈Z2

holds or we are done by Proposition 3.2 with E = {(x, y) ∈ Z2 : F (x, y) = 0}. Otherwise, we must
have gcd(H, G2 ) 6= 1. Since H is a factor of Fe4 , either H is an indefinite irreducible quadratic form
or L1 L2 , where L1 and L2 are primitive integral linear forms (possibly equal to each other).
   First let us suppose H is indefinite and irreducible. If the linear term of G is non-zero, then
Proposition 5.5 applies and we are done. On the other hand, if the linear term of G is zero, then the
result follows easily from Lemma 2.1. Next we suppose H = L1 L2 . If F (x, y) = Cp for some prime
22                               STANLEY YAO XIAO AND SHUNTARO YAMAGISHI

p, then there exist i ∈ {1, 2} and d ∈ Z such that d|C and Li (x, y) = d. Without loss of generality
let us say Li (x, y) = ax + by and
                        {(x, y) ∈ Z2 : Li (x, y) = d} = {(x0 − bz, y0 + az) : z ∈ Z}.
We define
                                 FLi ,d (z) = F (x0 − bz, y0 + az).
Suppose for some i ∈ {1, 2} and d|C, we have that deg FLi ,d = 1. Then
                           inf      F (x, y) ≤      inf       F (x, y) = inf FLi ,d (z) = −∞.
                         (x,y)∈Z2                (x,y)∈Z2                   z∈Z
                                                 Li (x,y)=d

Therefore, let us suppose deg FLi ,d 6= 1 for all i ∈ {1, 2} and d|C. In this case, by Lemma 2.1 we
obtain                                         XX                               √
                  #(F (Z2 ) ∩ C℘ ∩ [1, N ]) ≤          #(FLi ,d (Z) ∩ [1, N ]) ≪ N ,
                                                          i=1,2 d|C
which completes our proof.                                                                                    
Lemma 6.8. Suppose F4 is positive semi-definite and deg gcd(Fe4 , F3 , F2 , F1 ) ∈ {1, 3}. Let C ∈ N.
Then we have either
                                     √
                 #RF (C℘ ∩ [1, N ]) ≪ N log N or         inf F (x, y) = −∞.
                                                                            (x,y)∈Z2

Proof. By applying a GL2 (Z)-change of variables if necessary, we may rewrite F as
                                              F (x, y) = (ax + b)K(x, y),
where a ∈ Z6=0 , b ∈ Z and K is a degree 3 primitive integral polynomial. If F (x, y) = Cp for some
prime p, then there exists (d1 , d2 ) ∈ Z2 satisfying C = d1 d2 such that ax + b = d2 and K(x, y) = d1 p
or vice versa. Let
                 (1)
               Zd1 ,d2 (N ) = #{p ∈ ℘ ∩ [1, N/C] : ax + b = d2 , K(x, y) = d1 p, (x, y) ∈ Z2 }
and
                 (2)
               Zd1 ,d2 (N ) = #{p ∈ ℘ ∩ [1, N/C] : ax + b = d1 p, K(x, y) = d2 , (x, y) ∈ Z2 }.
We will show that given any i ∈ {1, 2} and (d1 , d2 ) ∈ Z2 such that C = d1 d2 , we have either
                        (i)         √
                      Zd1 ,d2 (N ) ≪ N log N or          inf F (x, y) = −∞.
                                                                      (x,y)∈Z2

As a consequence, it follows that either
                                                   √
                       #RF (C℘ ∩ [1, N ]) ≪            N log N        or      inf       F (x, y) = −∞
                                                                            (x,y)∈Z2

holds, as desired.
                                                                      (1)
     Let us fix d1 and d2 as above. First we deal with Zd1 ,d2 (N ). Let K ′ (y) = K((d2 − b)/a, y). Since
 (1)
                               / Z, we assume (d2 − b)/a ∈ Z. If deg K ′ is odd, then we obtain
Zd1 ,d2 (N ) = 0 if (d2 − b)/a ∈
                                        inf     F (x, y) ≤ inf d2 K ′ (y) = −∞.
                                     (x,y)∈Z2                 y∈Z

On the other hand, if deg K ′ is even, then
                                                                                  (√
                  (1)                                                                   N   if deg K ′ = 2,
                 Zd1 ,d2 (N ) ≪ #({K ′ (y) : y ∈ Z} ∩ [−N, N ]) ≪
                                                                                    1       if deg K ′ = 0.
                         (2)
     Next we consider Zd1 ,d2 (N ). Let us define
                                                P (x, y) = K(x, y) − d2
and C = {(x, y) ∈ A2 : P (x, y) = 0}. We have four different cases to deal with:
                                                                                                   23

   (1) P is irreducible over Q, but reducible over Q.
   (2) P is irreducible over Q and g(C) > 0.
   (3) P is irreducible over Q and g(C) = 0.
   (4) P is reducible over Q.

6.1. P is irreducible over Q, but reducible over Q. In this case, we obtain by Lemma 6.3 that
                                          (2)
                                        Zd1 ,d2 (N ) ≤ #C(Z) ≪ 1.

6.2. P is irreducible over Q and g(C) > 0. In this case, by Siegel’s theorem (Theorem 6.1) we
know that C(Z) is finite. Therefore, it follows that
                                          (2)
                                        Zd1 ,d2 (N ) ≤ #C(Z) ≪ 1.

6.3. P is irreducible over Q and g(C) = 0. If C(Q) is finite, then we are done. Otherwise, by
Lemma 6.2 we have that C is birational to A1 . Therefore, there exist R1 , R2 , Q1 , Q2 ∈ Z[t] such
that the two sets
                                                                            
                                   R1 (t) R2 (t)
                   C(Q) and              ,         : t ∈ Q, Q1 (t), Q2 (t) 6= 0
                                   Q1 (t) Q2 (t)
are equal up to finitely many elements. Without loss of generality we may assume that gcd(R1 , Q1 ) =
gcd(R2 , Q2 ) = 1. Let π be the projection onto the first coordinate. Clearly, if x ∈ π(C(Z)) (except
for at most finitely many choices of x), then there exists t0 ∈ Q such that
                                         xQ1 (t0 ) − R1 (t0 ) = 0.
We now obtain a bound for
                 E(B) = #{x ∈ Z ∩ [−B, B] : xQ1 (t0 ) − R1 (t0 ) = 0 for some t0 ∈ Q}.
It is clear that for all but finitely many choices of x0 ∈ Z, the degree of x0 Q1 (t) − R1 (t) is
max{deg Q1 , deg R1 }. Suppose max{deg Q1 , deg R1 } > 1. Then the existence of t0 ∈ Q such
that x0 Q1 (t0 ) − R1 (t0 ) = 0 implies x0 Q1 (t) − R1 (t) is reducible over Q. Therefore, we have
              E(B) ≤ #{x ∈ Z ∩ [−B, B] : xQ1 (t) − R1 (t) is reducible over Q} + O(1)
in this case. We know by Lemma 6.5 that the polynomial xQ1 (t) − R1 (t) ∈ Q[x, t] is irreducible
over Q. Therefore, by Hilbert’s irreducibility theorem (Theorem 6.4) it follows that
                                                                √
                       #(π(C(Z)) ∩ [−B, B]) ≤ E(B) + O(1) ≪ B log B.
Consequently, we obtain
           (2)
         Zd1 ,d2 (N )   ≤   #{x ∈ Z ∩ [−2N, 2N ] : ax + b = d1 p, K(x, y) = d2 , p ∈ ℘, y ∈ Z}
                        ≤ #{x ∈ Z ∩ [−2N, 2N ] : P (x, y) = 0, y ∈ Z}
                        ≤ #(π(C(Z)) ∩ [−2N, 2N ])
                          √
                        ≪   N log N.
  Let us now suppose max{deg Q1 , deg R1 } ∈ {0, 1}. Let
                                                R1 (t)   rt + s
                                                       =        .
                                                Q1 (t)   ut + v
It is clear that if x = R1 (t)/Q1 (t), then
                                                   s − vx
(6.2)                                             t=      .
                                                   ux − r
Since gcd(R1 , Q1 ) = 1, it follows that (s − vx)/(ux − r) is a non-constant rational function. If
r = u = 0, then it is immediate that
                                            (2)
                                           Zd1 ,d2 (N ) ≪ 1.
24                                 STANLEY YAO XIAO AND SHUNTARO YAMAGISHI

Therefore, we assume at least one of r or u is non-zero. Let us denote
                                                                               
            e                m     s − vx             e                m   s − vx
            R2 (x) = (ux − r) R2                and Q2 (x) = (ux − r) Q2            ,
                                   ux − r                                  ux − r
                                                                 e2 ) = 1 and the identity
                                                            e2 , Q
where m = max{deg Q2 , deg R2 }. In particular, we have gcd(R
(6.3)                                                     e 2 (x) = Res(R
                                             e2 (x) + B(x)Q
                                         A(x)R                               e2 ),
                                                                        e2 , Q
                               e2 ) ∈ Z6=0 is the resultant of R
                          e2 , Q
where A, B ∈ Z[x] and Res(R                                           e 2 . If deg Q
                                                               e2 and Q            e 2 ≥ 1, then it
follows that
          (2)
        Zd1 ,d2 (N )    ≤     #(π(C(Z)) ∩ [−2N, 2N ])
                        ≤     #{x ∈ Z ∩ [−2N, 2N ] : R2 (t)/Q2 (t) ∈ Z, t = (s − vx)/(ux − r)} + O(1)
                        ≤                            e2 (x)/Q
                              #{x ∈ Z ∩ [−2N, 2N ] : R       e2 (x) ∈ Z} + O(1)
                                                             e2 , Q
                                                 e 2 (x)|Res(R
                        ≤ #{x ∈ Z ∩ [−2N, 2N ] : Q                e2 )} + O(1)
                        ≪ 1.

  It is a basic exercise to check that deg Qe2 = 0 if and only if deg R2 = deg Q2 = 0. Let us denote
R2 (t) = R2 and Q2 (t) = Q2 . It is clear that if R2 /Q2 ∈
                                                         / Z, then
                                                       (2)
                                                     Zd1 ,d2 (N ) ≪ 1.
On the other hand, if R2 /Q2 ∈ Z, then the two sets
                       π(C(Z))     and {x ∈ Z : x = (rt + s)/(ut + v), t ∈ Q, ut + v 6= 0}
are equal up to finitely many elements. It is easy to see from (6.2) that the latter set contains x,
positive or negative, with arbitrarily large |x|, which implies
                  inf       F (x, y) =     inf (ax + b)K(x, y) ≤         inf    (ax + b)d2 = −∞.
                (x,y)∈Z2                 (x,y)∈Z2                   (x,y)∈Z2
                                                                    K(x,y)=d2


6.4. P is reducible over Q. Suppose P factors over Q, which we denote by P (x, y) = (hx + ky +
ℓ)G(x, y). Then K(x, y) = d2 if and only if hx + ky + ℓ = 0 or G(x, y) = 0. In the former case, we
consider the set
                                 {x ∈ Z : hx + ky + ℓ = 0, y ∈ Z},
                                                                                                   (2)
which is either empty or infinite. If the set is empty, then it does not contribute to Zd1 ,d2 (N ). On
the other hand, if the set is infinite, then it contains x, positive or negative, with arbitrarily large
|x|, which implies
(6.4)             inf       F (x, y) =     inf (ax + b)K(x, y) ≤         inf    (ax + b)d2 = −∞.
                (x,y)∈Z2                 (x,y)∈Z2                   (x,y)∈Z2
                                                                    K(x,y)=d2

  Now we consider the latter case G(x, y) = 0. Let C ′ = {(x, y) ∈ A2 : G(x, y) = 0}. As above, we
have four different cases to deal with:
     (1) G is irreducible over Q, but reducible over Q.
     (2) G is irreducible over Q and g(C ′ ) > 0.
     (3) G is irreducible over Q and g(C ′ ) = 0.
     (4) G is reducible over Q.
The first three cases can be dealt with in the same way as in Sections 6.1, 6.2 and 6.3. As a result,
we obtain that either
                          (2)         √
                        Zd1 ,d2 (N ) ≪ N log N or       inf F (x, y) = −∞
                                                                  (x,y)∈Z2
                                                                                                                    25

holds. Since the arguments are similar, we omit the details. Finally, if G is reducible over Q, then
there are two linear polynomials (possibly a constant multiple of the other) L1 and L2 such that
G(x, y) = L1 (x, y)L2 (x, y). Therefore, if G(x, y) = 0, then L1 (x, y) = 0 or L2 (x, y) = 0. In either
                                                                                       (2)
case, we may argue as above to conclude that either it does not contribute to Zd1 ,d2 (N ) or (6.4)
holds.                                                                                               

                                                   References
 [1] P. Bernays, Über die Darstellung von positiven, ganzen Zahlen durch die primitiven, binären quadratischen
     Formen einer nicht quadratischen Diskriminante. Ph.D. dissertation, Georg-August-Universität, Göttingen, Ger-
     many, 1912.
 [2] V. Blomer and A. Granville, Estimates for representation numbers of quadratic forms. Duke Math. J. 135 (2006),
     261–302.
 [3] A. Castillo and R. Dietmann, On Hilbert’s irreducibility theorem. Acta Arith. 180 (2017), no. 1, 1–14.
 [4] S.D. Cohen, The distribution of Galois groups and Hilbert’s irreducibility theorem, Proc. London Math. Soc. 43
     (1981), 227–250.
 [5] C. Elsner, On the approximation of irrational numbers with rationals restricted by congruence relations. Fi-
     bonacci Quart. 34 (1996), no. 1, 18–29.
 [6] M. Hindry and J.H. Silverman, Diophantine geometry. An introduction. Graduate Texts in Mathematics, 201.
     Springer-Verlag, New York, 2000. xiv+558 pp.
 [7] E. Landau, Über die Einteilung der positiven ganzen Zahlen in vier Klassen nach der Mindestzahl der zu ihrer
     additiven Zusammensetzung erforderlichen Quadrate. Arch. Math. Phys. 13 (1908), 305–312.
 [8] S. Lang, Fundamentals of Diophantine Geometry, Springer Verlag, 1983.
 [9] J.S. Lew, Polynomials in two variables taking distinct integer values at lattice points. The American Mathematical
     Monthly, Vol. 88, No. 5 (May, 1981), pp. 344–346.
[10] P. Moree and R. Osburn. Two-dimensional lattices with few distances. Enseign. Math. (2) 52 (2006), no. 3-4,
     361–380.
[11] M.B. Nathanson, A short proof of Cauchy’s polygonal number theorem. Proc. Amer. Math. Soc. 99 (1987), no.
     1, 22–24.
[12] M.B. Nathanson, Additive number theory. The classical bases. Graduate Texts in Mathematics, 164. Springer-
     Verlag, New York, 1996. xiv+342 pp.
[13] C.L. Stewart and S.Y. Xiao, On the representation of integers by binary forms, Math. Ann. 375 (2019), 133–163.

  Department of Mathematics and Statistics, University of Northern British Columbia, 3333 Uni-
versity Way, Prince George, British Columbia, Canada, V2N 4Z9
   Email address: StanleyYao.Xiao@unbc.ca

   IST Austria, Am Campus 1, 3400 Klosterneuburg, Austria
   Email address: shuntaro.yamagishi@ist.ac.at
