# Partition regularity of generalized Pythagorean pairs

Nikos Frantzikinakis  University of Crete, Department of Mathematics and
Applied Mathematics, Heraklion, Greece<EMAIL_ADDRESS>,  Oleksiy
Klurman  University of Bristol, School of Mathematics, Bristol, UK
<EMAIL_ADDRESS>and  Joel Moreira  University of Warwick, Department of
Mathematics, Coventry, UK<EMAIL_ADDRESS>
###### Abstract.

We address partition regularity problems for homogeneous quadratic equations.
A consequence of our main results is that, under natural conditions on the
coefficients $a,b,c$, for any finite coloring of the positive integers, there
exists a solution to $ax^{2}+by^{2}=cz^{2}$ where $x$ and $y$ have the same
color (and similar results for $x,z$ and $y,z$). For certain choices of
$(a,b,c)$, our result is conditional on an Elliott-type conjecture. Our proofs
build on and extend previous arguments of the authors dealing with the
Pythagorean equation. We make use of new uniformity properties of aperiodic
multiplicative functions and concentration estimates for multiplicative
functions along arbitrary binary quadratic forms.

###### Key words and phrases:

Partition regularity, Pythagorean triples, multiplicative functions,
concentration inequalities, Gowers uniformity.

###### 2020 Mathematics Subject Classification:

Primary: 05D10; Secondary:11N37,11B30, 37A44.

The first author was supported by the Research Grant ELIDEK HFRI-
NextGenerationEU-15689 and the second by the EPSRC Frontier Research Guarantee
grant ref. EP/Y014030/1. For the purpose of open access, the authors have
applied a Creative Commons Attribution (CC BY) licence to any Author Accepted
Manuscript version arising from this submission.

###### Contents

  1. 1 Introduction
  2. 2 Roadmap to the proofs
  3. 3 Vanishing of correlations for aperiodic multiplicative functions
  4. 4 Concentration estimates - Statements and preliminary results
  5. 5 Concentration estimates - Proof of main results
  6. 6 Proof of partition regularity results
  7. 7 Necessity in 1

##  1\. Introduction

###  1.1. Partition regularity results

A central problem in arithmetic Ramsey theory is to determine when a
polynomial equation is _partition regular_ – this means that in every
partition of ${\mathbb{N}}$ into finitely many cells there is a solution to
the equation with all variables in the same cell. A still unsolved special
case of this problem is to decide whether the Pythagorean equation
$x^{2}+y^{2}=z^{2}$ is partition regular. In the previous paper [11] we
studied this and more general quadratic equations of the form

(1.1) $ax^{2}+by^{2}=cz^{2},$

where $a,b,c$ are arbitrary integers. Additional results about partition
regularity of quadratic equations can be found in [1, 2, 3, 4, 5, 8, 10, 15,
16, 19, 22], and we refer the reader to the introduction of [11] for a more
comprehensive account of partition regularity problems and results related to
the ones considered in the present article. While our methods, in the current
form, do not allow us to establish full partition regularity for equations of
the form (1.1), we made progress in understanding partition regularity for
pairs.

######  Definition 1.1.

Given nonzero $a,b,c\in{\mathbb{Z}}$, we say that the equation (1.1) is
partition regular with respect to $x,y$ if for every finite coloring of
${\mathbb{N}}$ there exist distinct $x,y\in{\mathbb{N}}$, with the same color,
and $z\in{\mathbb{N}}$ that satisfy (1.1). Similarly, we define the partition
regularity of (1.1) with respect to the variables $x,z$ and $y,z$.

######  Remarks.

$\bullet$ If (1.1) is partition regular with respect to all three variables,
then it is obviously partition regular for any pair of variables. However the
converse does not hold: [11, Theorem 1.1] implies that the equation
$x^{2}+y^{2}=4z^{2}$ is partition regular with respect to any pair of
variables, but this equation is not partition regular with respect to all
three variables. The last fact follows by combining Rado’s theorem [24] with
the fact that partition regularity of the equation $P(x^{2},y^{2},z^{2})=0$
implies partition regularity of the equation $P(x,y,z)=0$.

$\bullet$ It follows from [9, Proposition 2.13] that equation (1.1) (or any
other homogeneous equation) is partition regular with respect to the variables
$(x,y)$ over ${\mathbb{N}}$ if and only if the same holds over
$\mathbb{Q}_{+}$.

In this paper we address the following conjecture explicitly formulated in
[11] (see the remark following [11, Problem 2]).

######  Conjecture 1.

If $a,b,c\in{\mathbb{Z}}$ are nonzero and at least one of the integers
$ac,bc,(a+b)c$ is a square, then (1.1) is partition regular with respect to
$x,y$.

In Section 1.4 we elaborate on why the assumptions in 1 are natural, and
perhaps even necessary.

Equation (1.1) can be written as
$a^{\prime}z^{2}+b^{\prime}y^{2}=c^{\prime}x^{2}$ with
$(a^{\prime},b^{\prime},c^{\prime}):=(-c,b,-a)$; therefore 1 is equivalent to
the statement that (1.1) is partition regular with respect to $y,z$ whenever
at least one of the integers $ac,-ab,(c-b)a$ is a square. Throughout the
present paper, prototypical working examples to keep in mind are the equations
$x^{2}+2y^{2}=z^{2}$ and $x^{2}+y^{2}=2z^{2}$, which are expected to be
partition regular with respect to any two variables. We will see later why
these two equations encapsulate the various difficulties of the more general
problem.

Our first main result verifies part of 1.

######  Theorem 1.2.

If $a,b,c\in{\mathbb{Z}}$ are nonzero and $ac$ or $bc$ is a square, then (1.1)
is partition regular with respect to $x,y$.

It follows that if $a,b,c\in{\mathbb{Z}}$ are nonzero and $ac$ or $-ab$ is a
square, then (1.1) is partition regular with respect to $y,z$. Theorem 1.2
extends [11, Theorem 1.1] that covers the case where both $ac$ and $bc$ are
squares (which in turn extends [10, Theorem 2.7] that covers the case where
all three quantities $ac,bc,(a+b)c$ are squares). Specializing to
$a=1,b=2,c=1$ this solves [11, Problem 2(i)] where it was conjectured that
$x^{2}+2y^{2}=z^{2}$ is partition regular with respect to $x,y$ and $y,z$.

However, Theorem 1.2 does not cover, for example, partition regularity for the
equation $x^{2}+y^{2}=2z^{2}$ (with respect to any two variables) or the
equation $x^{2}+2y^{2}=z^{2}$ with respect to the variables $x,z$. We provide
a conditional result that covers the missing cases, assuming the following
“Elliott-type” conjecture holds.

######  Conjecture 2.

If $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ are irreducible binary quadratic forms
that are not multiples of each other, then they are good for vanishing of
correlations of aperiodic multiplicative functions (see Definition 2.3 below).

The conjecture is open even for the Liouville function, for instance it is not
known whether

$\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}\,\lambda(m^{2}+n^{2})\cdot\lambda(m^{2}+2n^{2})=0,$

even if we replace the Cesàro averages with logarithmic averages (which is
sufficient for the applications we have in mind). In fact, there is no
specific pair of irreducible binary quadratic forms $P_{1},P_{2}$ for which
the identity

$\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}\,\lambda(P_{1}(m,n))\cdot\lambda(P_{2}(m,n))=0$

is known to hold. On the other hand, if one of the two binary quadratic forms
is irreducible and the other one is reducible, then it follows from Theorem
2.5 below and simple manipulations that the vanishing property of 2 holds for
these polynomials.

######  Theorem 1.3.

Suppose that Conjecture 2 holds. If $a,b,c\in{\mathbb{Z}}$ are nonzero and
$(a+b)c$ is a square (perhaps zero), then (1.1) is partition regular with
respect to $x,y$.

As a corollary of Theorems 1.2 and 1.3, we have that 2 implies 1.

The proof method of Theorem 1.3 allows us to establish the following
unconditional result, which gives further credibility to 1 when $(a+b)c$ is a
square.

######  Theorem 1.4.

Suppose that $a,b,c\in{\mathbb{Z}}$ are nonzero and $(a+b)c$ is a square. Let
$f_{1},\ldots,f_{r}\colon{\mathbb{N}}\to\mathbb{S}^{1}$ be pretentious
multiplicative functions (see Definition 2.1), and $I$ be an open arc of
$\mathbb{S}^{1}$ containing $1$. Then there exist distinct
$x,y\in{\mathbb{N}}$ such that $f_{j}(x)\in I$ and $f_{j}(y)\in I$, for
$j=1,\ldots,r$, and $ax^{2}+by^{2}=cz^{2}$ for some $z\in{\mathbb{N}}$.

Finally, we note that a well-known open problem is whether a necessary and
sufficient condition for partition regularity of the equation (1.1) with
respect to all three variables is that the triple $(a,b,c)$ of positive
integers satisfies Rado’s condition for partition regularity of $ax+by=cz$,
namely, $a=c$, or $b=c$, or $a+b=c$. By combining Theorems 1.2 and 1.3, we get
the following result, which adds some credibility to a positive answer.

######  Corollary 1.5.

Let $a,b,c\in{\mathbb{N}}$ be such that either $a=c$, or $b=c$, or $a+b=c$,
and suppose that 2 holds. Then equation (1.1) is partition regular with
respect to all three pairs of variables $(x,y)$, $(x,z)$, $(y,z)$.

######  Remark.

Our methods can also be used to establish partition regularity for pairs of
non-diagonal quadratic equations $ax^{2}+by^{2}+cz^{2}+dxy+exz+fyz=0$. We
don’t pursue this direction here as several cases have to be considered and it
is not clear if there is a natural extension of Corollary 1.5 to this
generality.

###  1.2. Density regularity results

In order to prove the partition regularity results formulated above, we
establish stronger density versions. To this end, we recall some standard
notions. A _multiplicative Følner sequence in ${\mathbb{N}}$_ is a sequence
$\Phi=(\Phi_{K})_{K=1}^{\infty}$ of finite subsets of ${\mathbb{N}}$ that is
asymptotically invariant under dilation, in the sense that

$\forall
x\in{\mathbb{N}},\qquad\lim_{K\to\infty}\frac{\big{|}\Phi_{K}\cap(x\cdot\Phi_{K})\big{|}}{|\Phi_{K}|}=1.$

An example of a multiplicative Følner sequence is given by

$\Phi_{K}:=\Big{\\{}\prod_{p\leq K}p^{a_{p}}\colon 0\leq a_{p}\leq
K\Big{\\}},\quad K\in{\mathbb{N}}.$

The _upper multiplicative density_ of a set $\Lambda\subset{\mathbb{N}}$ with
respect to a multiplicative Følner sequence $\Phi=(\Phi_{K})_{K=1}^{\infty}$
is the quantity

$\bar{d}_{\Phi}(\Lambda):=\limsup_{K\to\infty}\frac{\big{|}\Phi_{K}\cap\Lambda\big{|}}{|\Phi_{K}|}.$

######  Definition 1.6.

Given $a,b,c\in{\mathbb{N}}$, we say that the equation (1.1) is density
regular with respect to $x,y$ if for every multiplicative Følner sequence
$\Phi$ and every set $\Lambda\subset{\mathbb{N}}$ with
$\bar{d}_{\Phi}(\Lambda)>0$, there exist distinct $x,y\in{\mathbb{N}}$, with
the same color, and $z\in{\mathbb{N}}$ that satisfy (1.1). Similarly we define
the density regularity of (1.1) with respect to the variables $x,z$ and $y,z$.

A finite coloring of ${\mathbb{N}}$ always contains a monochromatic cell with
positive multiplicative density, so density regularity implies partition
regularity. Theorem 1.2 thus follows from the following stronger density
statement.

######  Theorem 1.7.

If $a,b,c\in{\mathbb{Z}}$ are nonzero and $ac$ or $bc$ is a square, then (1.1)
is density regular with respect to $x,y$.

Likewise, Theorem 1.3 follows from the following stronger density statement.

######  Theorem 1.8.

Suppose that 2 holds. If $a,b,c\in{\mathbb{Z}}$ are nonzero and $(a+b)c$ is a
square (perhaps zero), then (1.1) is density regular with respect to $x,y$.

###  1.3. Parametric form

It will be convenient to use the parametric form of the solution set of the
given equations and to work with the respective notion of density regularity.
Two cases to keep in mind are our working examples, the equation

$x^{2}+y^{2}=2z^{2},$

which has parametric solutions of the form (below, $k,m,n$ are arbitrary
integers),

$x=k\,(m^{2}-n^{2}+2mn),\quad y=k\,(m^{2}-n^{2}-2mn),\quad
z=k\,(m^{2}+n^{2}),$

and the equation

$x^{2}+2y^{2}=z^{2},$

which has parametric solutions of the form

$x=k\,(m^{2}-2n^{2}),\quad y=k\,(2mn),\quad z=k\,(m^{2}+2n^{2}).$

More generally, if $ac=d^{2}$ for some $d\in{\mathbb{N}}$ (the case $bc=d^{2}$
is similar), then a simple computation shows that the following are solutions
of $ax^{2}+by^{2}=cz^{2}$

$x=k\,c(am^{2}-bn^{2}),\quad y=k\,2acmn,\quad z=k\,d(am^{2}+bn^{2}),$

$k,m,n\in{\mathbb{Z}}$.

######  Definition 1.9.

We say that the pair $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ is good for density
regularity if whenever $\Lambda\subset{\mathbb{N}}$ satisfies
$\bar{d}_{\Phi}(\Lambda)>0$ for some multiplicative Følner sequence $\Phi$,
there exist $m,n\in{\mathbb{N}}$, such that $P_{1}(m,n)$ and $P_{2}(m,n)$ are
distinct positive integers and

$\bar{d}_{\Phi}\big{(}(P_{1}(m,n))^{-1}\Lambda\cap(P_{2}(m,n))^{-1}\Lambda\big{)}>0.$

If the pair $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ is good for density regularity,
then for any $\Lambda\subset{\mathbb{N}}$ that satisfies
$\bar{d}_{\Phi}(\Lambda)>0$ for some multiplicative Følner sequence $\Phi$,
the intersection $(P_{1}(m,n))^{-1}\Lambda\cap(P_{2}(m,n))^{-1}\Lambda$ has
positive multiplicative density, and in particular is non-empty, for some
$m,n\in{\mathbb{N}}$. Taking any
$k\in(P_{1}(m,n))^{-1}\Lambda\cap(P_{2}(m,n))^{-1}\Lambda$ it follows that
$kP_{1}(m,n)$, $kP_{2}(m,n)$ are distinct and they both belong to $\Lambda$.
Therefore, in order to prove Theorem 1.7 (and hence Theorem 1.2) it suffices
to establish the following result.

######  Theorem 1.10.

Suppose that for some $\alpha,\gamma\in{\mathbb{N}}$ and nonzero
$\beta\in{\mathbb{Z}}$ we have

$P_{1}(m,n)=\alpha m^{2}+\beta n^{2},\qquad P_{2}(m,n)=\gamma mn.$

Then the pair of polynomials $P_{1},P_{2}$ is good for density
regularity.111More generally, we can prove a similar result when at least one
of the non-trivial binary quadratic forms $P_{1}(m,n)$ and $P_{2}(m,n)$ is
reducible (and hence factors linearly) and has nonzero discriminant. Indeed,
using linear substitutions we can reduce to the case $P_{2}(m,n)=\gamma mn$
for some $\gamma\in{\mathbb{N}}$. If $P_{1}$ is also reducible, then we have
established the result in [11]. If $P_{1}$ is irreducible, then the result
follows from case (i) of Theorem 2.4.

If the polynomial $P_{1}$ in the statement of Theorem 1.10 factors into linear
terms, then the conclusion follows from our earlier work (this is explained in
[11, Section 1.5.2]). If $P_{1}$ is irreducible, then Theorem 1.10 follows
from combining part (i) of Theorem 2.4 with Theorem 2.5 below.

Our next result concerns the parametric reformulation of Theorem 1.8. If
$(a+b)c=d^{2}$ for some $d\in{\mathbb{Z}}_{+}$, then direct computation shows
that for every $k,m,n\in{\mathbb{Z}}$, the integers

$x:=k\,c(m^{2}-2bmn-abn^{2}),\quad y:=k\,c(m^{2}+2amn-abn^{2}),\quad
z:=k\,d(m^{2}+abn^{2}),$

satisfy the equation $ax^{2}+by^{2}=cz^{2}$. We use these parametric solutions
when $a+b\neq 0$. If $a+b=0$, then we use the following parametric solutions

$x:=k\,(m^{2}+acn^{2}),\quad y:=k\,(m^{2}-acn^{2}),\quad z:=k\,2amn.$

Using the previous parametric solutions, it turns out that to prove Theorem
1.8 it is sufficient to establish the following result:

######  Theorem 1.11.

Suppose that for some
$\alpha,\beta,\alpha^{\prime},\beta^{\prime}\in{\mathbb{Z}}$ the polynomials

$P_{1}(m,n)=m^{2}+\alpha mn+\beta n^{2},\qquad
P_{2}(m,n)=m^{2}+\alpha^{\prime}mn+\beta^{\prime}n^{2}$

are distinct and irreducible, and 2 holds for $P_{1},P_{2}$. Then the pair of
polynomials $P_{1},P_{2}$ is good for density regularity.

It is important that the coefficients of $m^{2}$ (or $n^{2}$) in $P_{1},P_{2}$
are equal, when this is not the case, the pair $P_{1},P_{2}$ is typically not
good for density regularity. To verify that Theorem 1.8 follows from Theorem
1.11 we need to consider a few cases:

  * •

If $a+b=0$, either $\pm ac$ is a square, in which case we can use Theorem 1.7,
or otherwise the polynomials $P_{1}(m,n)=m^{2}+acn^{2}$,
$P_{2}(m,n)=m^{2}-acn^{2}$ are irreducible, and hence we can use Theorem 1.11.

  * •

If $(a+b)c$ is a non-zero square, we can use Theorem 1.11 with the polynomials
$P_{1}(m,n)=m^{2}-2bmn-abn^{2}$ and $P_{2}(m,n)=m^{2}+2amn-abn^{2}$, provided
they are irreducible (they will be distinct in this case).

  * •

If $P_{1}$ in the previous item is not irreducible, then $b(a+b)$ is a square.
Combined with the assumption that $(a+b)c$ is a square, this implies that $bc$
is a square and hence we can invoke Theorem 1.7. The same argument works if
$P_{2}$ is not irreducible.

Similarly, to prove Theorem 1.4, it suffices to establish the following
result.

######  Theorem 1.12.

Let $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ be of the form (ii) from Theorem 2.4,
$f_{1},\ldots,f_{r}\colon{\mathbb{N}}\to\mathbb{S}^{1}$ be pretentious
multiplicative functions (see Definition 2.1), and $I$ be an open arc of
$\mathbb{S}^{1}$ containing $1$. Then there exist $k,m,n\in{\mathbb{N}}$ such
that $P_{1}(m,n),P_{2}(m,n)$ are distinct, positive, and
$f_{j}(kP_{1}(m,n))\in I$ and $f_{j}(kP_{2}(m,n))\in I$ for $j=1,\ldots,r$.

Thus, our goal is to prove Theorems 1.10-1.12, then Theorems 1.2-1.8 will
follow. The proof of Theorems 1.10 and 1.11 follows the general strategy
developed in [11] to handle the partition regularity of Pythagorean pairs.
After some initial maneuvering, inspired by Furstenberg’s ergodic proof of
Sárközy’s theorem, we are led to study an integral of averages of products of
completely multiplicative functions evaluated on binary quadratic forms.
Roughly speaking, we perform analysis resembling “circle method" over the
group $\mathcal{M},$ considering separately the contribution of the “minor
arcs” consisting of aperiodic multiplicative functions, which are treated
using Gowers uniformity results, and the contribution of appropriately
averaged “major arcs” consisting of pretentious multiplicative functions (in a
suitable sense), which are treated using concentration estimates. The more
general setting covered in this article presents several additional
difficulties over the ones considered in [11] in both the “major arcs” and
“minor arcs” parts of the argument. In particular, dealing with binary
quadratic forms of positive discriminant is one of the reasons, since we have
to work with number fields with infinitely many units. Also dealing with two
irreducible quadratic forms in Theorem 1.11 leads to subtleties which are not
present in [11]. The outline of our proofs is explained in much more detail in
Section 2.

###  1.4. Necessity in 1

1 stipulates sufficient conditions on the coefficients $a,b,c$ for the
equation (1.1) to be partition regular with respect to $x,y$, but it is not
completely apparent whether those conditions are necessary. In this direction
we have the following result.

######  Proposition 1.13.

Let $a,b,c\in{\mathbb{Z}}$ and assume that (1.1) is partition regular with
respect to $x,y$. Then at least one of $ac,bc,(a+b)c$, or $ab(a+b)c$ is a
perfect square.

In view of Proposition 1.13, one may wonder whether $ab(a+b)c$ being a perfect
square is a sufficient condition for (1.1) to be partition regular with
respect to $x,y$, but as the next two results show, this is not the case.

######  Proposition 1.14.

If $a\equiv 2\bmod 4$, $b$ is odd and $ab(a+b)c$ is a perfect square, then
(1.1) is not partition regular with respect to $x,y$.

In particular, this implies that the equation $x^{2}+2y^{2}=6z^{2}$ is not
partition regular with respect to $x,y$, despite it satisfying the conclusion
of Proposition 1.13.

######  Proposition 1.15.

Suppose that $a$ and $b$ are odd, $c\equiv 2\bmod 4$ and $ab(a+b)c$ is a non-
zero perfect square. If (1.1) is partition regular with respect to $x,y$, then
$ab\equiv 1\bmod 8$.

For instance, the equation $3x^{2}+5y^{2}=30z^{2}$ is not partition regular
with respect to $x,y$, but satisfies the conclusion of Proposition 1.13.

None of our results suffices to decide whether, say, any of the equations

$x^{2}+17y^{2}=34z^{2},\quad 8x^{2}+3y^{2}=66z^{2},\quad
5x^{2}+7y^{2}=105z^{2}$

are partition regular with respect to $x,y$.

The proofs of Propositions 1.13-1.15 are elementary and are given in Section
7.

###  1.5. Notation

We let ${\mathbb{N}}:=\\{1,2,\ldots\\}$,
${\mathbb{Z}}_{+}:=\\{0,1,2,\ldots\\}$, $Z_{r}:={\mathbb{Z}}/(r{\mathbb{Z}})$,
${\mathbb{R}}_{+}:=[0,+\infty)$, $\mathbb{S}^{1}\subset{\mathbb{C}}$ be the
unit circle, and ${\mathbb{U}}$ be the closed complex unit disk. With
${\mathbb{P}}$ we denote the set of primes and throughout we use the letter
$p$ to denote primes.

For $t\in{\mathbb{R}}$, we let $e(t):=e^{2\pi it}$. For $z\in{\mathbb{C}}$,
with $\Re(z)$, $\operatorname{Im}(z)$ we denote the real and imaginary parts
of $z$ respectively, and we let $\exp(z):=e^{z}$.

For $N\in{\mathbb{N}}$, we let $[N]:=\\{1,\dots,N\\}$. We often denote
sequences $a\colon{\mathbb{N}}\to{\mathbb{U}}$ by $(a(n))$, instead of
$(a(n))_{n\in{\mathbb{N}}}$.

If $A$ is a finite non-empty subset of the integers and $a\colon
A\to{\mathbb{C}}$, we let

${\mathbb{E}}_{n\in A}\,a(n):=\frac{1}{|A|}\sum_{n\in A}\,a(n).$

We write $a(n)\ll b(n)$ if for some $C>0$ we have $a(n)\leq C\,b(n)$ for every
$n\in{\mathbb{N}}$.

Throughout this article, the letter $f$ is typically used for multiplicative
functions and the letter $\chi$ for Dirichlet characters.

##  2\. Roadmap to the proofs

We shall follow the general strategy developed in our previous work [11]. In
order to explain our argument we introduce a few notions. A function
$f\colon{\mathbb{N}}\to{\mathbb{U}}$, where ${\mathbb{U}}$ is the complex unit
disk, is called multiplicative if

$f(mn)=f(m)\cdot f(n)\quad\text{ whenever }(m,n)=1.$

It is called completely multiplicative if the previous equation holds for all
$m,n\in{\mathbb{N}}$. Let

${\mathcal{M}}:=\\{f\colon{\mathbb{N}}\to\mathbb{S}^{1}\text{ is a completely
multiplicative function}\\}.$

Throughout, we assume that ${\mathcal{M}}$ is equipped with the topology of
pointwise convergence; then ${\mathcal{M}}$ is a metrizable compact space with
this topology.

######  Definition 2.1.

We say that the multiplicative function $f\colon{\mathbb{N}}\to{\mathbb{U}}$
is (see (4.7) for the definition of ${\mathbb{D}}(f,g)$)

  * •

pretentious if ${\mathbb{D}}(f,\chi\cdot n^{it})<+\infty$ for some
$t\in{\mathbb{R}}$ and Dirichlet character $\chi$.

  * •

aperiodic  if it is not pretentious.

######  Remark.

A well-known result of Daboussi-Delange [7, Corollary 1] states that a
multiplicative function is aperiodic if and only if
$\lim_{N\to\infty}\frac{1}{N}\sum_{n=1}^{N}\,f(an+b)=0$ for every
$a,b\in{\mathbb{N}}$. But such a clean characterization is not possible for
the more general notion of $P$-aperiodicity, which we will introduce shortly.

We will also need the following more refined notions of aperiodicity and
pretentiousness (the usual notion given in the previous definition corresponds
to the case $P(m,n)=n$ in the following definition).

######  Definition 2.2.

Let $P\in{\mathbb{Z}}[m,n]$ be a homogeneous polynomial. We say that the
multiplicative function $f\colon{\mathbb{N}}\to{\mathbb{U}}$ is (see (4.6) for
the definition of ${\mathbb{D}}_{P}(f,g)$)

  * •

$P$-pretentious if ${\mathbb{D}}_{P}(f,\chi\cdot n^{it})<\infty$ for some
$t\in{\mathbb{R}}$ and Dirichlet character $\chi$ and write
$f\sim_{P}\chi\cdot n^{it}$.

  * •

$P$-aperiodic  if it is not $P$-pretentious.

######  Remark.

If the multiplicative function $f$ is pretentious, then it is $P$-pretentious
for every $P\in{\mathbb{Z}}[m,n]$, and conversely, if $f$ is $P$-aperiodic for
some $P\in{\mathbb{Z}}[m,n]$, then it is aperiodic. More generally, if
$P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ are homogeneous polynomials such that
$\omega_{P_{1}}(p)\geq\omega_{P_{2}}(p)$ (see Definition 4.2) for all but
finitely many $p\in{\mathbb{P}}$, then a $P_{2}$-aperiodic multiplicative
function is also $P_{1}$-aperiodic and thus aperiodic. Conversely, a
$P_{1}$-pretentious multiplicative function is also $P_{2}$-pretentious.

The utility of aperiodic or $P$-aperiodic multiplicative functions for our
arguments is due to the expectation that they have vanishing correlations
along certain polynomials. The exact property is defined below.

######  Definition 2.3.

We say that the polynomials $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ are good for
vanishing of correlations of aperiodic multiplicative functions whenever the
following property holds: If $f_{1},f_{2}\colon{\mathbb{N}}\to{\mathbb{U}}$
are multiplicative functions such that either $f_{1}$ is $P_{1}$-aperiodic or
$f_{2}$ is $P_{2}$-aperiodic, then for every $Q\in{\mathbb{N}}$ and
$a,b\in{\mathbb{Z}}_{+}$ we have

$\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}\,{\bf 1}_{S}(Qm+a,Qn+b)\cdot
f_{1}(P_{1}(Qm+a,Qn+b))\cdot f_{2}(P_{2}(Qm+a,Qn+b))=0,$

where $S:=\\{m,n\in{\mathbb{N}}\colon P_{1}(m,n)>0,P_{2}(m,n)>0\\}$.

The next result will play a crucial role in establishing Theorem 1.10 and
immediately implies Theorem 1.11.

######  Theorem 2.4.

Suppose that for some
$\alpha,\beta,\alpha^{\prime},\beta^{\prime},\gamma\in{\mathbb{Z}}$ and
$\ell,\ell^{\prime}\in{\mathbb{N}}$, the polynomials
$P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ satisfy one of the following conditions:

  1. (i)

$P_{1}(m,n)=\ell(m^{2}+\alpha mn+\beta
n^{2}),\,P_{2}(m,n)=\ell^{\prime}(m+\gamma n)n$, and $P_{1}$ is irreducible;

  2. (ii)

$P_{1}(m,n)=m^{2}+\alpha mn+\beta
n^{2},\,P_{2}(m,n)=m^{2}+\alpha^{\prime}mn+\beta^{\prime}n^{2},$ and
$P_{1},P_{2}$ are distinct and irreducible.

Suppose also that the pair $(P_{1},P_{2})$ is good for vanishing of
correlations of aperiodic multiplicative functions. Then the pair
$(P_{1},P_{2})$ is good for density regularity.

To see why the polynomials $P_{1},P_{2}$ described in part (i) of Theorem 2.4
contain those in Theorem 1.10, suppose
$\tilde{P}_{1}(m,n)=\tilde{\alpha}m^{2}+\tilde{\beta}n^{2}$ and
$\tilde{P}_{2}(m,n)=\tilde{\gamma}mn$. Then letting $\ell=\tilde{\alpha}$,
$\beta=\tilde{\alpha}\tilde{\beta}$, $\alpha=\gamma=0$, and
$\ell^{\prime}=\tilde{\alpha}\tilde{\gamma}$ it follows that
$P_{j}(m,n)=\tilde{P}_{j}(m,\tilde{\alpha}n)$, for $j=1,2$. If $(P_{1},P_{2})$
is good for density regularity, then so is $(\tilde{P}_{1},\tilde{P}_{2})$.
Therefore, in order to prove Theorem 1.10 it suffices to combine case (i) of
Theorem 2.4 with the next result.

######  Theorem 2.5.

If $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ are as in case (i) of Theorem 2.4, then
they are good for vanishing of correlations of aperiodic multiplicative
functions.

We prove a more general result in Theorem 3.1. The key idea is to use a
variant of an orthogonality criterion of Daboussi-Kátai for quadratic number
fields (see Corollary 3.6, which is easily deduced from a recent result in
[25]) in order to eventually reduce matters to a statement about vanishing of
correlations of products of aperiodic multiplicative functions evaluated on
linear forms (see Lemma 3.2, which is borrowed from [10]).

###  2.1. Proof plan for Theorem 2.4

Following the argument used in [11, Section 2.1], we see that to prove Theorem
2.4, it is sufficient to establish the next result:

######  Theorem 2.6.

Let $\sigma$ be a bounded Borel measure on ${\mathcal{M}}$ such that
$\sigma(\\{1\\})>0$ and

(2.1) $\int_{\mathcal{M}}f(r)\cdot\overline{f(s)}\,d\sigma(f)\geq
0\quad\text{for every }r,s\in{\mathbb{N}}.$

Let also $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ satisfy the assumptions of Theorem
2.4 and $w_{\delta,P_{1},P_{2}}(m,n)$ be the weight defined in (6.1) of Lemma
6.4. Then

(2.2)
$\liminf_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}\,w_{\delta,P_{1},P_{2}}(m,n)\cdot\int_{{\mathcal{M}}}f\big{(}P_{1}(m,n)\big{)}\cdot\overline{f\big{(}P_{2}(m,n)\big{)}}\,d\sigma(f)>0.$

######  Remarks.

$\bullet$ Since a homogeneous polynomial $P\in{\mathbb{Z}}[m,n]$ that vanishes
on a set of positive upper density (with respect to squares $[N]\times[N]$)
vanishes identically, we deduce that if (2.2) holds for distinct polynomials
$P_{1},P_{2}$, then there exist $m,n\in{\mathbb{N}}$ such that $P_{1}(m,n)$
and $P_{2}(m,n)$ are positive, distinct, and
$\int_{{\mathcal{M}}}f(P_{1}(m,n))\cdot\overline{f(P_{2}(m,n))}\,d\sigma(f)>0$.

$\bullet$ We show in Theorem 2.5 that if $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ are
as in case (i) of Theorem 2.4, then they are good for vanishing of
correlations of aperiodic multiplicative functions and so in this case (2.2)
holds unconditionally.

$\bullet$ Our argument shows that, unconditionally, if the polynomials are as
in case (ii) of Theorem 2.4 and the measure $\sigma$ is supported on the set
${\mathcal{M}}_{p}$ of pretentious multiplicative functions, defined in (2.8)
(or the larger set ${\mathcal{M}}_{p,P_{1},P_{1}}$ defined in (2.9)) and
satisfies $\sigma(\\{1\\})>0$, then (2.2) holds. We will show in Section 6.7
how to derive Theorem 1.12 from this fact.

To prove Theorem 2.6 it will be crucial to restrict the values of the
polynomials $P_{1},P_{2}$ to suitable arithmetic progressions in a uniform way
(this is needed to prove Proposition 2.8). To this end, we introduce the
following notation: for $\delta>0$, $Q\in{\mathbb{N}}$,
$a,b\in{\mathbb{Z}}_{+}$, and multiplicative function
$f\colon{\mathbb{N}}\to{\mathbb{U}}$, let222We could instead use the weight
$\tilde{w}_{\delta,P_{1},P_{2}}(Qm+a,Qn+b)$ in the definition of
$L_{\delta,N}$, the reason we use $\tilde{w}_{\delta,P_{1},P_{2}}(m,n)$ is
that later on in our argument we crucially use that the weight does not depend
on $Q$. In any case, in view of Lemma 6.5 given below, it follows that the two
weights can be used interchangeably.

(2.3) $L_{\delta,N}(f,Q;a,b):=\\\
{\mathbb{E}}_{m,n\in[N]}\,\tilde{w}_{\delta,P_{1},P_{2}}(m,n)\cdot
f\big{(}P_{1}(Qm+a,Qn+b)\big{)}\cdot\overline{f\big{(}P_{2}(Qm+a,Qn+b)\big{)}},$

(note that $L_{\delta,N}$ also depends on $P_{1},P_{2}$ but we suppress this
dependence) where the normalized weights $\tilde{w}_{\delta,P_{1},P_{2}}$ are
given by

(2.4) $\tilde{w}_{\delta,P_{1},P_{2}}(m,n):=\mu^{-1}_{\delta,P_{1},P_{2}}\cdot
w_{\delta,P_{1},P_{2}}(m,n),$

where

$\mu_{\delta,P_{1},P_{2}}:=\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}\,w_{\delta,P_{1},P_{2}}(m,n).$

Note that for every $\delta>0$ the last limit exists and is positive by Lemma
6.4 and our assumptions about the polynomials $P_{1},P_{2}$. It follows from
the positivity property (2.1), Lemma 6.5, and Fatou’s lemma, that in order to
establish (2.2) it suffices to show that there exist $\delta>0$,
$Q\in{\mathbb{N}}$, and $a,b\in{\mathbb{Z}}_{+}$, such that

(2.5)
$\int_{{\mathcal{M}}}\liminf_{N\to\infty}\Re\big{(}L_{\delta,N}(f,Q;a,b)\big{)}\,d\sigma(f)>0.$

In fact, to prove case (i) of Theorem 2.4, we will take $a=1$, $b=0$, but for
case (ii) a more complicated choice of $a,b$ is needed that depends on $Q$.

To establish (2.5), we use the theory of completely multiplicative functions.
In the aperiodic case, which roughly speaking corresponds to the “minor arcs"
in $\mathcal{M},$ we use the following result.

######  Proposition 2.7.

Let $P_{1},P_{2}$ be homogeneous polynomials of the same degree such that the
pair $(P_{1},P_{2})$ is good for vanishing of correlations of aperiodic
multiplicative functions. Let $f\colon{\mathbb{N}}\to{\mathbb{U}}$ be an
aperiodic multiplicative function that is either $P_{1}$ or $P_{2}$ aperiodic.
Then for every $\delta>0$ and $Q\in{\mathbb{N}}$, $a,b\in{\mathbb{Z}}_{+}$, we
have

(2.6) $\lim_{N\to\infty}L_{\delta,N}(f,Q;a,b)=0.$

The positivity property for integrals in (2.5) will follow from a pointwise
non-negativity property, combined with the fact that $\sigma(\\{1\\})>0$. To
state the latter, we need to introduce some additional notation. For each
$K\in{\mathbb{N}}$ let

(2.7) $\Phi_{K}:=\Big{\\{}\prod_{p\leq K}p^{a_{p}}\colon K<a_{p}\leq
2K\Big{\\}}.$

The sequence $(\Phi_{K})$ is a multiplicative Følner sequence with the
property that for every $q\in{\mathbb{N}}$, if $K$ is sufficiently large then
for every $Q\in\Phi_{K}$ we have $q|Q$. Let

(2.8) ${\mathcal{M}}_{p}:=\\{f\colon{\mathbb{N}}\to\mathbb{S}^{1}\colon
f\text{ is pretentious}\\}.$

Furthermore, if $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ are homogeneous polynomials
let

(2.9)
${\mathcal{M}}_{p,P_{1},P_{2}}:=\\{f\colon{\mathbb{N}}\to\mathbb{S}^{1}\colon
f\text{ is }P_{1}\text{ and }P_{2}\text{ pretentious}\\}.$

In Lemma 6.3 we show that ${\mathcal{M}}_{p}$ and
${\mathcal{M}}_{p,P_{1},P_{2}}$ are Borel subsets of ${\mathcal{M}}$.

We now give the key non-negativity property, which is proved using known
concentration estimates for linear forms (as in Proposition 4.7) and new
concentration estimates for irreducible binary quadratic forms (as in
Proposition 4.9).

######  Proposition 2.8.

Let $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ be as in Theorem 2.4 and
$L_{\delta,N}(f,Q;a,b)$ be as in (2.3).333In both of the following statements,
our argument does not allow us to exchange $\liminf_{N\to\infty}$ and
${\mathbb{E}}_{Q\in\Phi_{K}}$.

  1. (i)

In case (i) of Theorem 2.4, for every $f\in{\mathcal{M}}_{p}$ we have

$\liminf_{\delta\to
0^{+}}\liminf_{K\to\infty}\liminf_{N\to\infty}{\mathbb{E}}_{Q\in\Phi_{K}}\Re\big{(}L_{\delta,N}(f,Q;1,0)\big{)}\geq
0,$

where $(\Phi_{K})$ is as in (2.7).

  2. (ii)

In case (ii) of Theorem 2.4, for every $f\in{\mathcal{M}}_{p,P_{1},P_{2}}$ we
have

$\liminf_{r\to\infty}\liminf_{\delta\to
0^{+}}\liminf_{K\to\infty}\liminf_{N\to\infty}{\mathbb{E}}_{Q_{1}\in\Phi_{1,K},Q_{2}\in\Phi_{2,K}}\Re\big{(}L_{\delta,N}(f,Q_{K};a_{r,K,Q_{1},Q_{2}},b_{r,K,Q_{1},Q_{2}})\big{)}\geq
0,$

for suitably chosen $Q_{K}\in{\mathbb{N}}$, $K\in{\mathbb{N}}$ (as in (6.12)),
integer subsets $(\Phi_{j,K})_{K\in{\mathbb{N}}}$, $j=1,2$ (as in (6.19)), and
$a_{r,K,Q_{1},Q_{2}},b_{r,K,Q_{1},Q_{2}}\in[Q_{K}]$ (as in Proposition 6.10).

######  Remark.

If we also use Theorem 2.5 and Proposition 2.7 we get that the positivity
property of part (i) holds for every $f\in{\mathcal{M}}$.

To establish part (i) we consider two cases. If $f=n^{it}$ for some
$t\in{\mathbb{R}}$ it is quite easy to show that the limit is non-negative,
and in this case there is no need to take a multiplicative average over $Q$.
The point is that the weight $\tilde{w}_{\delta,P_{1},P_{2}}$, used in the
definition of $L_{\delta,N}(f,Q;1,0)$, restricts the range of averaging to
those values of $m,n\in[N]$ for which
$(P_{1}(m,n))^{it}\cdot(P_{2}(m,n))^{-it}$ is $\delta$-close to $1$. The most
difficult case is the complementary one, where $f\in{\mathcal{M}}_{p}$ but
$f\neq n^{it}$ for each $t\in{\mathbb{R}}$. Using concentration estimates we
manage to show that for $Q\in\Phi_{K}$ the averages $L_{\delta,N}(f,Q;1,0)$
are asymptotically equal to $f(Q)Q^{-it}$ times an expression that depends
only on $K$. Using this, it is easy to show that after taking multiplicative
averages over $Q\in\Phi_{K}$ the resulting expression vanishes. Combining the
above, we get the claimed non-negativity for all $f\in{\mathcal{M}}_{p}$.

In part (ii) it is not immediately clear how to implement the previous
strategy, since the irreducibility of the polynomials makes it difficult to
factor out a term $f(Q)Q^{-it}$. The key observation that lets us get started,
is to restrict the range of $m,n$ to $Q{\mathbb{N}}+a,Q{\mathbb{N}}+b$ for
values of $a,b$ that satisfy suitable congruences (see Lemma 6.9) and apply
concentration estimates along this lattice. Suppose that for $j=1,2$ we have
$f\sim\chi_{j}\cdot n^{it}$ for some $t\in{\mathbb{R}}$ and Dirichlet
characters $\chi_{j}$. We get that if for $j=1,2$ all the prime factors of the
integers $Q_{j}$ belong to certain sets ${\mathcal{P}}_{j}$
(${\mathcal{P}}_{j}$ are the primes $p$ for which the equation
$P_{j}(m,1)\equiv\pmod{p}$ has a solution), then for $Q_{j}\in\Phi_{j,K}$ the
averages $L_{\delta,N}(Q;a,b)$, for suitable $Q=Q_{K}$ and $a,b$, depending on
$Q_{1},Q_{2}$, are asymptotically equal to
$\tilde{f}_{1}(Q_{1})\cdot\overline{\tilde{f}_{2}(Q_{2})}$ times an expression
depending only on $K$, where $\tilde{f}_{j}(n):=f(n)\cdot\chi_{j}(n)\cdot
n^{it}$. We conclude that if for $j=1$ or $2$ we have $\tilde{f}_{j}(p)\neq 1$
for some prime $p\in{\mathcal{P}}_{j}$, then the multiplicative averages over
$Q_{1}\in\Phi_{1,K}$ and $Q_{2}\in\Phi_{2,K}$ ($\Phi_{j,k}$ are as in (6.19))
of $L_{\delta,N}(f,Q_{K};a_{r,Q_{1},Q_{2}},b_{r,Q_{1},Q_{2}})$ vanish. On the
other hand, if for $j=1$ and $2$ we have $\tilde{f}_{j}(p)=1$ for all primes
$p\in{\mathcal{P}}_{j}$, then after using concentration estimates, and taking
advantage of the fact that in this case some unwanted oscillatory terms cancel
out, we get that for $\delta$ small enough the averages
$L_{\delta,N}(f,Q_{K};a_{r,Q_{1},Q_{2}},b_{r,Q_{1},Q_{2}})$ are positive.
Combining the above we get the asserted non-negativity for all
$f\in{\mathcal{M}}_{p,P_{1},P_{2}}$.

We conclude this section by noting how the previous results allow us to reach
our goal, which is to prove Theorem 2.6, thus completing the proof of Theorem
2.4.

###### Proof of Theorem 2.6 assuming Proposition 2.7 and Proposition 2.8.

We assume that the polynomials $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ are as in
case (ii) of Theorem 2.4, the argument is similar and slightly simpler if they
are as in case (i) of Theorem 2.4 (the only difference is that we use part (i)
of Proposition 2.8 instead of part (ii)).

Note that if $f\notin{\mathcal{M}}_{p,P_{1},P_{2}}$, then $f$ is either
$P_{1}$-aperiodic or $P_{2}$-aperiodic, hence Proposition 2.7 gives that for
every $\delta>0$ and $Q\in{\mathbb{N}}$, $a,b\in{\mathbb{Z}}_{+}$, we have

$\lim_{N\to\infty}L_{\delta,N}(f,Q;a,b)=0$

It follows that the non-negativity property in part (ii) of Proposition 2.8
extends to all multiplicative functions $f\in{\mathcal{M}}$. Using this and
Fatou’s lemma we get (we follow the notation of Proposition 2.8)

(2.10) $\liminf_{r\to\infty}\liminf_{\delta\to
0^{+}}\liminf_{K\to\infty}\liminf_{N\to\infty}\\\
{\mathbb{E}}_{Q_{1}\in\Phi_{1,K},Q_{2}\in\Phi_{2,K}}\Re\big{(}\int_{{\mathcal{M}}\setminus\\{1\\}}L_{\delta,N}(f,Q_{K};a_{r,K,Q_{1},Q_{2}},b_{r,K,Q_{1},Q_{2}})\,d\sigma(f)\big{)}\geq
0.$

We deduce from (2.10) that there exist $\delta_{0}>0$ and
$r_{0},K_{0}\in{\mathbb{N}}$, depending only on $\sigma$, $P_{1}$, $P_{2}$,
such that

(2.11)
$\liminf_{N\to\infty}{\mathbb{E}}_{Q_{1}\in\Phi_{1,K_{0}},Q_{2}\in\Phi_{2,K_{0}}}\,\int_{{\mathcal{M}}\setminus\\{1\\}}L_{\delta_{0},N}(f,Q_{K_{0}};a_{r_{0},K_{0},Q_{1},Q_{2}},b_{r_{0},K_{0},Q_{1},Q_{2}})\,d\sigma(f)>-\frac{\rho}{2},$

where

$\rho:=\sigma(\\{1\\})>0.$

Note that for every $\delta>0$, $Q\in{\mathbb{N}}$, $a,b\in{\mathbb{Z}}_{+}$,
we have

$\lim_{N\to\infty}L_{\delta,N}(1,Q;a,b)=\mu^{-1}_{\delta,P_{1},P_{2}}\cdot\lim_{N\to\infty}{\mathbb{E}}_{n\in[N]}\,w_{\delta,P_{1},P_{2}}(m,n)=1>0.$

Using this and the lower bound (2.11), we deduce that

$\liminf_{N\to\infty}{\mathbb{E}}_{Q_{1}\in\Phi_{1,K_{0}},Q_{2}\in\Phi_{2,K_{0}}}\,\int_{{\mathcal{M}}}L_{\delta_{0},N}(f,Q_{K_{0}};a_{r_{0},K_{0},Q_{1},Q_{2}},b_{r_{0},K_{0},Q_{1},Q_{2}})\,d\sigma(f)>\frac{\rho}{2}.$

(The real part is no longer needed since all integrals are known to be real by
(2.1).)

The last estimate implies that there exist $Q_{j,N}\in\Phi_{j,K_{0}}$,
$j=1,2$, and $a_{r_{0},K_{0},Q_{1,N},Q_{2,N}}$,
$b_{r_{0},K_{0},Q_{1,N},Q_{2,N}}\in[Q_{K_{0}}]$, $N\in{\mathbb{N}}$, such that

(2.12)
$\liminf_{N\to\infty}\int_{{\mathcal{M}}}L_{\delta_{0},N}(f,Q_{K_{0}};a_{r_{0},K_{0},Q_{1,N},Q_{2,N}},b_{r_{0},K_{0},Q_{1,N},Q_{2,N}})\,d\sigma(f)\geq\frac{\rho}{2}.$

Using Lemma 6.5 below and since the integers
$a_{r_{0},K_{0},Q_{1,N},Q_{2,N}}$, $b_{r_{0},K_{0},Q_{1,N},Q_{2,N}}$ belong to
a finite set that is independent of $N$, we get that the same estimate holds
if in the definition of
$L_{\delta_{0},N}(f,Q_{K_{0}};a_{r_{0},K_{0},Q_{1,N},Q_{2,N}},b_{r_{0},K_{0},Q_{1,N},Q_{2,N}})$
we replace the weight $\tilde{w}_{\delta_{0},P_{1},P_{2}}(m,n)$ with
$\tilde{w}_{\delta_{0},P_{1},P_{2}}(Q_{K_{0}}m+a_{r_{0},K_{0},Q_{1,N},Q_{2,N}},Q_{K_{0}}n+b_{r_{0},K_{0},Q_{1,N},Q_{2,N}})$.
We use this, the positivity property

$\tilde{w}_{\delta_{0},P_{1},P_{2}}(m,n)\int_{\mathcal{M}}f\big{(}P_{1}(m,n)\big{)}\cdot\overline{f\big{(}P_{2}(m,n)\big{)}}\,d\sigma(f)\geq
0\quad\text{for every }m,n\in{\mathbb{N}},$

which follows from (2.1), and the fact that the integers
$a_{r_{0},K_{0},Q_{1,N},Q_{2,N}}$, $b_{r_{0},K_{0},Q_{1,N},Q_{2,N}}$ belong to
a finite set that is independent of $N$. We deduce from these facts and (2.12)
that

$\liminf_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}\,\tilde{w}_{\delta_{0},P_{1},P_{2}}(m,n)\cdot\int_{{\mathcal{M}}}f\big{(}P_{1}(m,n)\big{)}\cdot\overline{f\big{(}P_{2}(m,n)\big{)}}\,d\sigma(f)\geq\frac{\rho}{2(Q_{K_{0}})^{2}}.$

This establishes (2.2) (with the lower bound
$\frac{\rho\cdot\mu_{\delta_{0},P_{1},P_{2}}}{2(Q_{K_{0}})^{2}}$) and
completes the proof. ∎

To prove Theorem 2.6, it remains to prove Proposition 2.7 and Proposition 2.8.
The proof of Proposition 2.7 is relatively simple and is given in Section 6.4.
The proof of Proposition 2.8 is much harder, and we will complete it in
Section 6, after having established the concentration estimates for binary
quadratic forms, stated in Proposition 4.9, and proved in Sections 4 and 5.
Finally, Theorem 2.5, which is used to complete the proof of Theorem 1.10, is
proved in Section 3.

##  3\. Vanishing of correlations for aperiodic multiplicative functions

###  3.1. Statement of main result

Our goal is to prove Theorem 2.5, which is covered by the following more
general result.

######  Theorem 3.1.

Suppose for $s\in{\mathbb{N}}$ that the multiplicative functions
$f_{1},\ldots,f_{s},g\in{\mathcal{M}}$ are extended to even sequences in
${\mathbb{Z}}$ and that $f_{1}$ is aperiodic. Let $L_{1},\ldots,L_{s}$ be
linear forms in two variables with integer coefficients and suppose that
either $s=1$ and $L_{1}$ is non-trivial, or $s\geq 2$ and the forms
$L_{1},L_{j}$ are linearly independent for $j=2,\ldots,s$. Let also

$P(m,n):=\alpha m^{2}+\beta mn+\gamma n^{2},$

where $\alpha,\beta,\gamma\in{\mathbb{Z}}$, be irreducible, i.e.,
$D:=\beta^{2}-4\alpha\gamma$ is not a square, and $Q\in{\mathbb{N}}$,
$a,b\in{\mathbb{Z}}_{+}$. Finally, let $K$ be a convex subset of
${\mathbb{R}}_{+}^{2}$ that is homogeneous, i.e. $(x,y)\in K$ implies
$(kx,ky)\in K$ for every $k\in{\mathbb{N}}$. Then

$\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}\,{\bf
1}_{K}(Qm+a,Qn+b)\cdot\prod_{j=1}^{s}f_{j}(L_{j}(Qm+a,Qn+b))\cdot
g(P(Qm+a,Qn+b))=0.$

######  Remark.

If $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ are as in case (i) of Theorem 2.4, then
$P_{1}$ is an irreducible binary quadratic form and
$P_{2}(m,n)=L_{1}(m,n)\cdot L_{2}(m,n)$ where $L_{1},L_{2}$ are pairwise
independent linear forms. Applying Theorem 3.1 for $s:=2$, $f_{1}:=f_{2}$,
$P:=P_{1}$, and $K=\\{(x,y)\in{\mathbb{R}}_{+}\colon P_{j}(x,y)>0,j=1,2\\}$,
which is a disjoint union of finitely many homogeneous convex subsets of
${\mathbb{R}}_{+}^{2}$, we get the conclusion of Theorem 2.5.

In the case of completely multiplicative functions, Theorem 3.1 generalizes
[10, Theorem 9.7] that covered the case where $P(m,n)=m^{2}+dn^{2}$ for
$d\equiv 1,2\\!\pmod{4}$ and $P(m,n)=m^{2}+mn+\frac{d+1}{4}n^{2}$ for $d\equiv
3\\!\pmod{4}$ with $d>0;$ see also [21] for a quantitative aspect of this
result for linear forms. The case of binary quadratic forms with negative
discriminant can be reduced to the previous cases by a simple trick explained
in Section 3.5. On the other hand, when the binary quadratic form $P$ has a
positive discriminant, new difficulties arise that were not present in [10].
The problem in this case is to find a suitable variant of the Daboussi-Kátai
orthogonality criterion that takes into account the existence of infinitely
many units of the number field on which $P$ can be realized as a norm form.
This has recently been established in [25]; we describe the construction in
Section 3.4 and adapt it for our purposes.

###  3.2. Known result about aperiodic multiplicative functions

We will use the following result from [10].

######  Lemma 3.2.

Suppose for $s\in{\mathbb{N}}$ that the multiplicative functions
$f_{1},\ldots,f_{s},g\in{\mathcal{M}}$ are extended to even sequences in
${\mathbb{Z}}$ and that $f_{1}$ is aperiodic. Let $L_{1},\ldots,L_{s}$ be
linear forms in two variables with integer coefficients and suppose that
either $s=1$ and $L_{1}$ is non-trivial, or $s\geq 2$ and the forms
$L_{1},L_{j}$ are linearly independent for $j=2,\ldots,s$. Then for every
$r\in{\mathbb{N}}$ we have

$\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[rN]}\,{\bf
1}_{K_{N}}(m,n)\cdot\prod_{j=1}^{s}f_{j}(L_{j}(m,n))=0,$

where for $N\in{\mathbb{N}}$ we have $K_{N}:=K\cap A_{1}([N]\times[N])\cap
A_{2}([N]\times[N])$ for some convex subset $K$ of ${\mathbb{R}}_{+}^{2}$ and
linear transformations $A_{1},A_{2}\colon{\mathbb{Z}}^{2}\to{\mathbb{Z}}^{2}$
with nonzero determinant.

If $K_{N}$ are convex subsets of $[0,rN]\times[0,rN]$ the result follows by
combining [10, Theorem 2.5] and [10, Lemma 9.6]. The argument given in the
proof of [10, Lemma 9.6] can be adapted in a straightforward way to obtain the
advertised statement.

###  3.3. Quadratic number fields - Notation

Let $d\in{\mathbb{Z}}$ be a square-free integer. If $\mathcal{O}_{K}$ is the
ring of integers (i.e. solutions of monic polynomials with coefficients in
$K$) of a quadratic number field $K=\mathbb{Q}(\sqrt{-d})$, then there exists
$\tau_{d}\in\mathcal{O}_{K}$ such that every element $z\in\mathcal{O}_{K}$ can
be uniquely expressed in the form $m+n\tau_{d}$ for some $m,n\in{\mathbb{Z}}$.
In fact, we can take

(3.1) $\tau_{d}:=\begin{cases}\sqrt{-d},\quad&\,\text{ if }d\equiv
1,2\\!\pmod{4}\\\ \frac{1+\sqrt{-d}}{2},&\,\text{ if }d\equiv
3\\!\pmod{4}.\end{cases}$

We let

(3.2) $R_{N}:=\\{z\in\mathcal{O}_{K}\colon z=m+n\tau_{d},m,n\in[N]\\}.$

If $z=m+n\sqrt{-d}$ we let $\overline{z}:=m-n\sqrt{-d}$ and
$\mathcal{N}(z):=z\cdot\overline{z}=m^{2}+dn^{2}$. Note that if
$z=m+n\tau_{d}$, then $\mathcal{N}(z)=P_{d}(m,n)$ where

(3.3) $P_{d}(m,n):=\begin{cases}m^{2}+dn^{2},\quad&\,\text{ if }d\equiv
1,2\\!\pmod{4}\\\ m^{2}+mn+\frac{d+1}{4}n^{2},&\,\text{ if }d\equiv
3\\!\pmod{4}.\end{cases}$

###  3.4. Variant of the Daboussi-Kátai orthogonality criterion

An important fact used in the proof of the Daboussi-Kátai orthogonality
criterion on ${\mathbb{Z}}$ [6, 17] is that for $r\in{\mathbb{N}}$ the
cardinality of the set $r^{-1}[N]:=\\{n\in{\mathbb{N}}\colon rn\in[N]\\}$ is
approximately $N/r$. A similar statement holds for Gaussian integers, namely,
if $R_{N}=\\{m+in\colon m,n\in[N]\\}$ and $z\in{\mathbb{Z}}[i]$ is nonzero,
then

$z^{-1}R_{N}=\\{w\in{\mathbb{Z}}[i]\colon zw\in R_{N}\\}\subset
R_{C\cdot\mathcal{N}(z)^{-\frac{1}{2}}N}$

for some $C>0$. Similar inclusions also hold for all other quadratic fields
with negative discriminant, but this is not the case for quadratic number
fields with positive discriminant, which have infinitely many units (elements
$\epsilon\in\mathcal{O}_{K}$ with $\mathcal{N}(\epsilon)=1$). In this case,
every element $z\in\mathcal{O}_{K}$ has infinitely many associates
$z\epsilon$, all of which have the same norm. While not all of them satisfy
the required property, Sun proved in [25] that at least one of the associates
of any given element does. We state here the result for quadratic number
fields, since that is all we need.

######  Definition 3.3 (Definition 2.12 in [25]).

Let ${\mathbb{Z}}[\tau_{d}]$ be the ring of integers of a quadratic number
field ${\mathbb{Q}}(\sqrt{-d})$ and $C>0$. We say that
$z\in{\mathbb{Z}}[\tau_{d}]$, $z\neq 0$, is $C$-regular if for all
$N\in{\mathbb{N}}$ we have

$z^{-1}R_{N}\subset R_{C|\mathcal{N}(z)|^{-\frac{1}{2}}N},$

where $R_{N}$ is as in (3.2).

We will use the following special case of a result from [25].

######  Lemma 3.4 (Theorem 2.13 in [25]).

Let ${\mathbb{Z}}[\tau_{d}]$ be the ring of integers of a quadratic number
field ${\mathbb{Q}}(\sqrt{-d})$. Then there exists $C>0$, depending on $d$
only, such that for every $z\in{\mathbb{Z}}[\tau_{d}]$ there exists a unit
$\epsilon\in\mathcal{O}_{K}$ such that $\epsilon z$ is $C$-regular.

Using this, the following extension of the Daboussi-Kátai orthogonality
criterion was established in [25] (in the setting of general number fields,
but we only need it for quadratic number fields).

######  Lemma 3.5 (Lemma 2.20 in [25]).

Let $d\in{\mathbb{Z}}$ be square-free, ${\mathbb{Z}}[\tau_{d}]$ be the ring of
integers of the quadratic number field ${\mathbb{Q}}(\sqrt{-d})$, and
$a\colon{\mathbb{Z}}[\tau_{d}]\to{\mathbb{C}}$ be a bounded sequence. Let also
$C>0$ and ${\mathcal{P}}$ be a collection of $C$-regular prime elements of
${\mathbb{Z}}[\tau_{d}]$ such that

$\sum_{p\in{\mathcal{P}}}\frac{1}{|{\mathcal{N}}(p)|}=+\infty.$

Suppose that for all $p,q\in{\mathcal{P}}$ with coprime norms we have

$\lim_{N\to\infty}{\mathbb{E}}_{z\in R_{N}}\,a(pz)\,\overline{a(qz)}=0.$

Then for every completely multiplicative function
$f\in\colon{\mathbb{Z}}[\tau_{d}]\to{\mathbb{U}}$ we have

$\lim_{N\to\infty}{\mathbb{E}}_{z\in R_{N}}\,a(z)\,f(z)=0.$

######  Remark.

The case $d>0$ was previously covered by [10, Proposition 9.5].

We will use this lemma in the form of the following corollary that is better
suited for our purposes.

######  Corollary 3.6 (Daboussi-Kátai orthogonality criterion for quadratic
number fields).

Let $d\in{\mathbb{Z}}$ be square-free, ${\mathbb{Z}}[\tau_{d}]$ be the ring of
integers of the quadratic number field ${\mathbb{Q}}(\sqrt{-d})$,
$a\colon{\mathbb{Z}}[\tau_{d}]\to{\mathbb{C}}$ be a bounded sequence, and
$P_{0}>0$. Suppose that for all $\alpha,\beta$ that are prime elements of
${\mathbb{Z}}[\tau_{d}]$ with norm greater than $P_{0}$ and such that all
elements $\alpha,\overline{\alpha},\beta,\overline{\beta}$ are non-associates,
we have

$\lim_{N\to\infty}{\mathbb{E}}_{z\in R_{N}}\,a(\alpha z)\,\overline{a(\beta
z)}=0.$

Then for every completely multiplicative function
$f\colon{\mathbb{Z}}[\tau_{d}]\to{\mathbb{U}}$ we have

$\lim_{N\to\infty}{\mathbb{E}}_{z\in R_{N}}\,a(z)\,f(z)=0.$

###### Proof.

For each integer prime $p$ let $\tilde{p}\in{\mathbb{Z}}[\tau_{d}]$ be a prime
that divides $p$. Using Lemma 3.4 we can assume that each $\tilde{p}$ is
$C$-regular, for the constant $C$ given in Lemma 3.4. Let ${\mathcal{P}}$
denote the set of all $\tilde{p}$ for $p>P_{0}$ such that $\tilde{p}$ is not
associated to its conjugate or to an integer.

Since ${\mathcal{N}}(\tilde{p})=p$ the primes $\tilde{p}$ and $\tilde{q}$ are
not associate whenever $p\neq q$. If $\tilde{p}$ and its conjugate are
associate, then $p$ is divisible by $\tilde{p}^{2}$, and hence $\tilde{p}$ is
a ramified prime, of which there are only finitely many. If $\tilde{p}$ is
associated to an integer, then $p$ itself is a prime in
${\mathbb{Z}}[\tau_{d}]$ and hence it is an inert prime. By [23, Theorem
7.4.2], $\tilde{p}\in{\mathcal{P}}$ if and only if $p>P_{0}$ and $-d$ is a
quadratic residue modulo $p$. By the quadratic reciprocity and Dirichlet’s
theorem, it follows that
$\sum_{\alpha\in{\mathcal{P}}}\frac{1}{|{\mathcal{N}}(\alpha)|}=\infty$.

We have shown that ${\mathcal{P}}$ satisfies the conditions of Lemma 3.5, and
hence the conclusion follows by applying that lemma. ∎

###  3.5. Proof of Theorem 3.1

For $d\in{\mathbb{Z}}$ square-free let $P_{d}$ be the binary quadratic form
defined in (3.3).444We work with $P_{d}(m,n)$ because it is a norm form on the
ring of integers of a quadratic field, and all such rings are unique
factorization domains (UFD). In contrast, the binary form $m^{2}+3n^{2}$ is a
norm form on the ring ${\mathbb{Z}}[\sqrt{-3}]$, which is not a UFD. We
alleviate this problem by working with the binary form $m^{2}+mn+n^{2}$. This
is a norm form on the ring ${\mathbb{Z}}[(1+\sqrt{-3})/2]$, which is a UFD. We
then use the identity $m^{2}+3n^{2}=(m-n)^{2}+(m-n)(2n)+(2n)^{2}$, to transfer
results from one form to the other.

Case where $P=P_{d}$, $Q=1,a=b=0$. First, suppose that $P=P_{d}$ and
$Q=1,a=b=0$. We will show that under these additional assumptions, for every
$C>0$ we have

(3.4) $\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[CN]}\,{\bf
1}_{K_{N}}(m,n)\cdot\prod_{j=1}^{s}f_{j}(L_{j}(m,n))\cdot g(P_{d}(m,n))=0,$

where for $N\in{\mathbb{N}}$ we have $K_{N}:=K\cap A([N]\times[N])$ for some
convex subset $K$ of ${\mathbb{R}}_{+}^{2}$ and linear transformation
$A\colon{\mathbb{Z}}^{2}\to{\mathbb{Z}}^{2}$ with nonzero determinant. We
remark that the sets $A([N]\times[N])$ do not appear in the statement of
(3.1), but they are needed later on in order to reduce the general case to the
one covered here.

We argue as in the proof of [10, Theorem 9.7], which covered the case where
$d>0$, with minor changes (the important new ingredient is the variant of the
Daboussi-Kátai criterion we use, which was essentially proved in [25]). The
goal is to use Corollary 3.6 in order to eliminate the “quadratic term”
$g(P_{d}(m,n))$ and be left with products of “linear terms.” To this end,
recall that if $\tau_{d}$ is as in (3.1), then $P_{d}(m,n)$ is the norm of the
element $m+n\tau_{d}$. Since $g\in{\mathcal{M}}$, the map
$\tilde{g}\colon{\mathbb{Z}}[\tau_{d}]\to{\mathbb{U}}$ defined by

$\tilde{g}(z):=g(\mathcal{N}(z)).$

is a completely multiplicative function on ${\mathbb{Z}}[\tau_{d}]$. Letting
$\phi_{d}\colon{\mathbb{Z}}[\tau_{d}]\to{\mathbb{Z}}$ be given by

$\phi_{d}(m+n\tau_{d}):=n,$

for $j=1,\ldots,s$ we can find $\zeta_{j}\in{\mathbb{Z}}[\tau_{d}]$ such that

(3.5) $L_{j}(m,n)=\phi_{d}(\zeta_{j}(m+n\tau_{d})).$

Identifying $(m,n)$ with $z:=m+n\tau_{d}$ and recalling that $R_{N}$ is
defined by (3.2), we see that (3.4) is equivalent to

(3.6) $\lim_{N\to\infty}{\mathbb{E}}_{z\in R_{CN}}\,{\bf
1}_{K_{N}}(z)\cdot\prod_{j=1}^{s}f_{j}(\phi_{d}(\zeta_{j}z))\cdot\tilde{g}(z)=0.$

Let now $\alpha,\beta$ be prime elements of ${\mathbb{Z}}[\tau_{d}]$ such that

(3.7) $\alpha,\overline{\alpha},\beta,\overline{\beta}\text{ are non-
associates and do not divide }\zeta_{j}\text{ for }j=1,\ldots,s.$

From Corollary 3.6, we get that in order to establish (3.6), it is sufficient
to show that for all distinct $\alpha,\beta$ satisfying (3.7) we have

$\lim_{N\to\infty}{\mathbb{E}}_{z\in R_{CN}}\,{\bf 1}_{K_{N}}(\alpha
z)\cdot{\bf 1}_{K_{N}}(\beta
z)\cdot\prod_{j=1}^{s}f_{j}(\phi_{d}(\zeta_{j}\alpha
z))\cdot\prod_{j=1}^{s}\overline{f}_{j}(\phi_{d}(\zeta_{j}\beta z))=0.$

Since the function $f_{1}$ is aperiodic we have by Lemma 3.2 that the needed
vanishing property holds, provided that we show that the linear form
$\phi_{d}(\zeta_{1}\alpha z)$ is linearly independent of each of the forms
$\phi_{d}(\zeta_{j}\alpha z)$ for $j=2,\ldots,s$ and of each of the forms
$\phi_{d}(\zeta_{j}\beta z)$ for $j=1,\ldots,s$. To see this, arguing by
contradiction, suppose that for some nonzero $k,l\in{\mathbb{Z}}$ and
$j\in\\{1,\ldots,s\\}$ and $\alpha^{\prime}\in\\{\alpha,\beta\\}$ with
$(1,\alpha)\neq(j,\alpha^{\prime})$, we have

$k\phi_{d}(\zeta_{1}\alpha z)=l\phi_{d}(\zeta_{j}\alpha^{\prime}z).$

Using this identity for $z:=1$ and $z:=\tau_{d}$ we immediately deduce that

(3.8) $k\zeta_{1}\alpha=l\zeta_{j}\alpha^{\prime}.$

We argue as in the proof of Claim 5 in [10, Section 9.7.2] to get a
contradiction. We consider three cases:

(i) Suppose that $j=1$ and $\alpha^{\prime}=\beta$. In this case, equation
(3.8) gives that $\alpha/\beta$ is a rational, which is impossible because by
(3.7) the elements $\alpha$ and $\beta$ are non-integer and non-associate
primes in ${\mathbb{Z}}[\tau_{d}]$.

(ii) Suppose that $j>1$ and $\alpha^{\prime}=\alpha$. In this case we have
that $\zeta_{1}/\zeta_{j}\in{\mathbb{Q}}$, and by (3.5) the linear forms
$L_{1}$ and $L_{j}$ are linearly dependent, contradicting our hypothesis.

(iii) It remains to consider the case where $j>1$ and $\alpha^{\prime}=\beta$.
Let $r_{k}$ be the exponent of $(\alpha)$ in the factorization of the ideal
$(k)$ into prime ideals of ${\mathbb{Z}}[\tau_{d}]$. Since by (3.7) the
element $\alpha$ is a non-integer prime of ${\mathbb{Z}}[\tau_{d}]$,
$\overline{\alpha}$ is also a non-integer prime, and since $k$ is real, the
exponent of $(\overline{\alpha})$ in the factorization of $(k)$ is also equal
to $r_{k}$. Since by (3.7) the elements $\alpha$ and $\overline{\alpha}$ are
non-associate primes, it follows that $k$ can be written as
$k=\alpha^{r_{k}}\overline{\alpha}^{r_{k}}b$ for some
$b\in{\mathbb{Z}}[\tau_{d}]$ not divisible by $\alpha$ or $\overline{\alpha}$.
In the same way, $l=\alpha^{r_{l}}\overline{\alpha}^{r_{l}}c$ for some non-
negative integer $r_{l}$ and some $c\in{\mathbb{Z}}[\tau_{d}]$ not divisible
by $\alpha$ or $\overline{\alpha}$. Equation (3.8) gives

$\alpha^{r_{k}+1}\overline{\alpha}^{r_{k}}b\zeta_{1}=\alpha^{r_{l}}\overline{\alpha}^{r_{l}}c\zeta_{j}\beta.$

By (3.7), the elements $\alpha$ and $\overline{\alpha}$ are non-associate
primes, $\beta$ is a prime element non-associate to $\alpha$, and $\zeta_{j}$
are not divisible by $\alpha$. Since $c$ is also not divisible by $\alpha$, it
follows that $r_{l}\geq r_{k}+1$. Similarly, since $b$ and $\zeta_{1}$ are not
divisible by $\overline{\alpha}$, it follows that $r_{k}\geq r_{l}$, a
contradiction. This completes the proof of the claim.

General Case. Suppose now that $P(m,n)=\alpha m^{2}+\beta mn+\gamma n^{2}$ for
some $\alpha,\beta,\gamma\in{\mathbb{Z}}$. We have $\alpha\neq 0$ (since $P$
is irreducible) and we can assume that $\alpha\in{\mathbb{N}}$ (since all
multiplicative functions involved are even). We want to show that for every
$Q\in{\mathbb{N}}$ and $a,b\in{\mathbb{Z}}_{+}$ we have

$\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}\,{\bf
1}_{K}(Qm+a,Qn+b)\cdot\prod_{j=1}^{s}f_{j}(L_{j}(Qm+a,Qn+b))\cdot
g(P(Qm+a,Qn+b))=0.$

We first reduce to the case $Q=1$, $a=b=0$. Note that since the indicator
function of an arithmetic progression is a linear combination of Dirichlet
characters, it suffices to show that for all Dirichlet characters
$\chi,\chi^{\prime}\pmod{Q}$ we have

$\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}\,\chi(m)\cdot\chi^{\prime}(n)\cdot{\bf
1}_{K}(m,n)\cdot\prod_{j=1}^{s}f_{j}(L_{j}(m,n))\cdot g(P(m,n))=0.$

In order to eliminate the Dirichlet character $\chi$, note that if
$L_{j}(m,n)$ is a multiple of $m$ for some $j\in\\{1,\ldots,s\\}$, then
replacing $f_{j}$ with $f_{j}\cdot\chi$ we get that our assumptions are still
satisfied and $\chi$ is absorbed in $f_{j}$. Otherwise, we work with $s+1$
functions, where $f_{s+1}:=\chi$ and $L_{s+1}(m,n):=m;$ then the linear
independence assumption between $L_{1}$ and $L_{2},\ldots L_{s+1}$ is still
satisfied. Similarly, we eliminate the Dirichlet character $\chi^{\prime}$.
Thus, it suffices to show that, under the above assumptions, we have

$\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}\,{\bf
1}_{K}(m,n)\cdot\prod_{j=1}^{s}f_{j}(L_{j}(m,n))\cdot g(P(m,n))=0.$

We next reduce to the case $P=P_{d}$ where $d$ is the unique square-free
integer that satisfies

$4\alpha\gamma-\beta^{2}=r^{2}d$

for some $r\in{\mathbb{N}}$, and $P_{d}$ is as in (3.3). To get started, note
that direct computation gives

$4\alpha\,P(m,n)=P_{d}(A_{d}(m,n)),$

where

(3.9) $A_{d}(m,n):=\begin{cases}(2\alpha m+\beta n,rn),\quad&\ \text{ if
}d\equiv 1,2\\!\pmod{4}\\\ (2\alpha m+(\beta-r)n,2rn),&\ \text{ if }d\equiv
3\\!\pmod{4}.\end{cases}$

Using this, the complete multiplicativity of $f_{j},g$ in the form
$f_{j}(4\alpha r)f_{j}(k)=f_{j}(4\alpha rk)$ and $g(4\alpha)g(k)=g(4\alpha k)$
for every $k\in{\mathbb{N}}$, the linearity of the $L_{j}$, and the
homogeneity of the set $K$, we get that it suffices to verify that

$\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}\,\prod_{j=1}^{s}{\bf 1}_{K}(4\alpha
rm,4\alpha rn)\cdot f_{j}(L_{j}(4\alpha rm,4\alpha rn))\cdot
g(P_{d}(A_{d}(m,n)))=0.$

Equivalently, it suffices to show that

$\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}\,{\bf
1}_{K}(\tilde{L}_{d}(A_{d}(m,n)))\cdot\prod_{j=1}^{s}f_{j}(L_{j,d}^{\prime}(A_{d}(m,n)))\cdot
g(P_{d}(A_{d}(m,n)))=0,$

where

$\tilde{L}_{d}(m,n):=\begin{cases}2\,(rm-\beta n,2\alpha n),\quad&\ \text{ if
}d\equiv 1,2\\!\pmod{4}\\\ (2rm-(\beta-r)n,2\alpha n),&\ \text{ if }d\equiv
3\\!\pmod{4}\end{cases}$

and for $j=1,\ldots,s$, $L^{\prime}_{j,d}=L_{j}\circ\tilde{L}_{d}$. Hence, it
suffices to show that

$\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[CN]}\,{\bf 1}_{A_{d,N}}(m,n)\cdot{\bf
1}_{K}(\tilde{L}_{d}(m,n))\cdot\prod_{j=1}^{s}f_{j}(L_{j,d}^{\prime}(m,n))\cdot
g(P_{d}(m,n))=0,$

where $C:=2|\alpha|+|\beta|+2r$, and $A_{d,N}:=A_{d}([N]\times[N])$, and we
used that $A_{d,N}$ is a subset of $[CN]\times[CN]$ and $A_{d}$ is an
injective map. Note also that ${\bf 1}_{K}(\tilde{L}_{d}(m,n))={\bf
1}_{K_{d}}(m,n)$ where
$K_{d}:=\\{(x,y)\in{\mathbb{R}}^{2}_{+}\colon\tilde{L}_{d}(x,y)\in K\\}$ is a
convex subset of ${\mathbb{R}}_{+}^{2}$. Since our linear independence
assumption for the linear forms $L_{1},\ldots,L_{s}$ passes to the linear
forms $L_{1,d}^{\prime},\ldots,L_{s,d}^{\prime}$, the last vanishing property
follows from (3.4).

##  4\. Concentration estimates - Statements and preliminary results

The main goal of this section and the next one is to prove the concentration
estimates for irreducible binary quadratic forms as stated in Propositions 4.8
and 4.9 below. Some of our intermediate results apply without additional
difficulty to arbitrary homogeneous polynomials, and we present them in this
broader context.

###  4.1. Preliminaries and notation

We will need some notation in order to state the main concentration estimates.

######  Definition 4.1.

If $P\in{\mathbb{Z}}[m,n]$ is a homogeneous polynomial we let

(4.1) ${\mathcal{P}}_{P}:=\\{p\in{\mathbb{P}}\colon P(m,n)\equiv
0\\!\\!\pmod{p}\text{ has a solution with }n\not\equiv 0\\!\\!\pmod{p}\\}$

and note that because the polynomial $P$ is homogeneous we have

${\mathcal{P}}_{P}=\\{p\in{\mathbb{P}}\colon P(m,1)\equiv
0\\!\\!\pmod{p}\text{ has a solution}\\}.$

We remark that if $P$ is an irreducible binary quadratic form with
discriminant $D$, then ${\mathcal{P}}_{P}$ is the set of primes such that $D$
is a quadratic residue $\\!\\!\mod{p}$. Thus, if the square-free parts of the
discriminants of two binary quadratic forms $P,Q$ coincide, then
${\mathcal{P}}_{P}={\mathcal{P}}_{Q}$.

######  Definition 4.2.

If $P\in{\mathbb{Z}}[m,n]$ is a homogeneous polynomial and $r\in{\mathbb{N}}$
we let

(4.2) $\omega_{P}(r):=\big{|}\\{n\in{\mathbb{Z}}_{r}\colon P(n,1)\equiv
0\\!\\!\pmod{r}\\}\big{|}.$

(Note that ${\mathcal{P}}_{P}=\\{p\in{\mathbb{P}}\colon\omega_{P}(p)>0\\}$.)

######  Remarks.

$\bullet$ We trivially have $\omega_{P}(r)\in\\{0,\ldots,r\\}$ for every
$r\in{\mathbb{N}}$ and for all but finitely many $p\in{\mathbb{P}}$ we have
$\omega_{P}(p)\leq\deg(P)$. If we assume that the greatest common divisor of
the coefficient of $P$ is $1$, then $\omega_{P}(p)\leq\deg(P)$ for all
$p\in{\mathbb{P}}$. Note, however, that this is not the case for composite
$r$, for instance, if $P(m,n)=m^{2}$ we have $\omega_{P}(p^{2})=p$ for every
$p\in{\mathbb{P}}$.

$\bullet$ If $P(m,n)=m^{2}+dn^{2}$ and $p\in{\mathbb{P}}$ is odd such that
$p\nmid d$, then $\omega_{P}(p)=2$ if $-d$ is a quadratic residue
$\\!\\!\mod{p}$ and $\omega(p)=0$ if $-d$ is not a quadratic residue
$\\!\\!\mod{p}$.

The following basic property is a consequence of the Chinese remainder theorem

(4.3) $\omega_{P}(rs)=\omega_{P}(r)\,\omega_{P}(s),\quad\text{whenever
}(r,s)=1.$

In other words $\omega_{P}$ is a multiplicative function on ${\mathbb{N}}$.

######  Lemma 4.3.

Let $P$ be an irreducible binary quadratic form with discriminant $D$ and
suppose $d$ is the unique square-free integer satisfying $D=dr^{2}$ for some
$r\in{\mathbb{N}}$. Then for all but finitely many $p\in{\mathbb{P}}$ we have
$\omega_{P}(p)=2$ or $0$ depending on whether $d$ is a quadratic residue
$\\!\\!\mod{p}$ or not.

###### Proof.

Let $P(m,n)=\alpha m^{2}+\beta mn+\gamma n^{2}$ for some
$\alpha,\beta,\gamma\in{\mathbb{Z}}$ not all of them $0$. Since the form is
irreducible we have $\alpha\neq 0$ and $D:=\beta^{2}-4\alpha\gamma$ is not a
square. Note that $4\alpha P(m,1)=(2\alpha m+\beta)^{2}-dr^{2}$. It follows
that if $p\nmid 2\alpha dr$, then the number of solutions $\\!\\!\pmod{p}$ to
the congruence $P(m,1)\equiv 0\\!\\!\pmod{p}$ is equal to the number of
solutions to the congruence $m^{2}\equiv d\\!\\!\pmod{p}$; hence, it is $2$ or
$0$, depending on whether $d$ is a quadratic residue $\\!\\!\mod{p}$ or not. ∎

We also introduce some quantities that will appear in our main concentration
estimates. If $P\in{\mathbb{Z}}[m,n]$ is a homogeneous polynomial,
$t\in{\mathbb{R}}$ and $\chi$ is a Dirichlet character, we let

(4.4) $G_{P,N}(f,K):=\sum_{\begin{subarray}{c}K<p\leq N,\\\
p\in{\mathbb{P}}\end{subarray}}\,\frac{\omega_{P}(p)}{p}\,(f(p)\cdot\overline{\chi(p)}\cdot
n^{-it}-1);$

(we suppress the dependence on $t$ and $\chi$) and

(4.5) ${\mathbb{D}}_{P}(f,g;x,y)^{2}:=\sum_{\begin{subarray}{c}x<p\leq y,\\\
p\in{\mathbb{P}}\end{subarray}}\frac{\omega_{P}(p)}{p}\,(1-\Re(f(p)\cdot\overline{g(p)}));$
(4.6) ${\mathbb{D}}_{P}(f,g):={\mathbb{D}}_{P}(f,g;1,+\infty).$

If $P(m,n)=n$, in which case $\omega_{P}(p)=1$ for every $p\in{\mathbb{P}}$,
we let

(4.7)
${\mathbb{D}}(f,g;x,y):={\mathbb{D}}_{P}(f,g;x,y),\qquad{\mathbb{D}}(f,g):={\mathbb{D}}_{P}(f,g).$

Recall that by Definition 2.2, if $P\in{\mathbb{Z}}[m,n]$ is a homogeneous
polynomial we say that the multiplicative function
$f\colon{\mathbb{N}}\to{\mathbb{U}}$ is $P$-pretentious if
${\mathbb{D}}_{P}(f,\chi\cdot n^{it})<+\infty$ for some $t\in{\mathbb{R}}$ and
Dirichlet character $\chi$. Note that since for all but finitely many
$p\in{\mathbb{P}}$ we have $\omega_{P}(p)\leq\deg(P)$, $f$ is $P$-pretentious
if and only if

$\sum_{p\in{\mathcal{P}}_{P}}\frac{1}{p}\,(1-\Re(f(p)\cdot\overline{\chi(p)}\cdot
p^{-it}))<+\infty,$

where ${\mathcal{P}}_{P}$ is the set defined in (4.1). In this case we write
$f\sim_{P}\chi\cdot n^{it}$. If $P(m,n)=n$, then $\omega_{P}(p)=1$ for all
$p\in{\mathbb{P}}$ and we recover the usual notion of pretentiousness in the
sense of Granville and Soundararajan [14]. More generally we have the
following definition.

######  Definition 4.4.

For every bounded sequence $c\colon{\mathbb{P}}\to{\mathbb{R}}_{+}$ we let

${\mathbb{D}}_{c}(f,g;x,y)^{2}:=\sum_{\begin{subarray}{c}x<p\leq y,\\\
p\in{\mathbb{P}}\end{subarray}}\frac{c(p)}{p}\,(1-\Re(f(p)\cdot\overline{g(p)})).$

If ${\mathbb{D}}_{c}(f,g;1,+\infty)<+\infty$ we write $f\sim_{c}g$. Note that
if $c_{1}(p)\leq c_{2}(p)$ for all but finitely many $p$, then the following
implication holds $f\sim_{c_{2}}g\Rightarrow f\sim_{c_{1}}g$.

It can be shown (as in [13] or [14, Section 2.1.1]) that ${\mathbb{D}}_{P}$
satisfies the triangle inequality

(4.8) ${\mathbb{D}}_{P}(f,g)\leq{\mathbb{D}}_{P}(f,h)+{\mathbb{D}}_{P}(h,g)$

for all $f,g,h\colon{\mathbb{P}}\to{\mathbb{U}}$. Also, for all
$f_{1},f_{2},g_{1},g_{2}\colon{\mathbb{P}}\to{\mathbb{U}}$, we have (proved as
in [12, Lemma 3.1])

(4.9)
${\mathbb{D}}_{P}(f_{1}f_{2},g_{1}g_{2})\leq{\mathbb{D}}_{P}(f_{1},g_{1})+{\mathbb{D}}_{P}(f_{2},g_{2}).$

It follows from (4.9) that if $f_{1}\sim_{P}g_{1}$ and $f_{2}\sim_{P}g_{2}$,
then $f_{1}f_{2}\sim_{P}g_{1}g_{2}$. Similar estimates also hold with
${\mathbb{D}}_{c}$ in place of ${\mathbb{D}}_{P}$ where
$c\colon{\mathbb{P}}\to{\mathbb{R}}_{+}$ is any bounded sequence.

If $f\sim\chi\cdot n^{it}$, it is known that the value of $t$ is unique. A
similar fact holds if $f\sim_{P}\chi\cdot n^{it}$ and $P$ is an irreducible
binary quadratic form. We will prove a more general fact in the next lemma.

######  Lemma 4.5.

Let $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ be two irreducible binary quadratic
forms, let $f\colon{\mathbb{N}}\to{\mathbb{U}}$ be a multiplicative function,
and suppose that for $j=1,2$ we have $f\sim_{P_{j}}\chi_{j}\cdot n^{it_{j}}$
for some $t_{j}\in{\mathbb{R}}$ and Dirichlet characters $\chi_{j}$. Then
$t_{1}=t_{2}$ and $\chi_{1}(p)=\chi_{2}(p)$ for all but finitely many
$p\in{\mathcal{P}}_{P_{1}}\cap{\mathcal{P}}_{P_{2}}$.

###### Proof.

First, we show that $t_{1}=t_{2}$. Using Lemma 4.3 and quadratic reciprocity,
we can find $a\in{\mathbb{N}}$ such that
$\omega_{P_{1}}(p)=\omega_{P_{2}}(p)=2$ for all but finitely many primes
$p\in\mathcal{G}:=1+a{\mathbb{N}}$. Indeed, if $d_{1},d_{2}$ are the square-
free parts of the discriminants of $P_{1},P_{2}$, and $q_{1},\ldots,q_{k}$ are
the prime factors of $d_{1},d_{2}$, for any prime $p$ such that
$q_{1},\ldots,q_{k}$ are all quadratic residues $\pmod{p}$, both $d_{1}$ and
$d_{2}$ are quadratic residues $\pmod{p}$ and hence by Lemma 4.3
$\omega_{P_{1}}(p)=\omega_{P_{2}}(p)=2$. Using quadratic reciprocity we get
that any prime $p$ satisfying $p\equiv 1\pmod{8\,q_{1}\cdots q_{k}}$ works, so
it suffices to take $a:=8\,q_{1}\cdots q_{k}$.

So let $c(p):=2$ if $p\in\mathcal{G}$ and $c(p):=0$ otherwise, so that
$c(p)\leq\omega_{P_{j}}(p)$ for $j=1,2$ and all but finitely many $p$.
Therefore $f\sim_{c}\chi_{1}\cdot n^{it_{1}}$ and $f\sim_{c}\chi_{2}\cdot
n^{it_{2}}$. It follows from (4.9), with ${\mathbb{D}}_{c}$ in place of
${\mathbb{D}}_{P}$, that $\chi_{1}\cdot n^{it_{1}}\sim_{c}\chi_{2}\cdot
n^{it_{2}}$. Note also that there exists $k\in{\mathbb{N}}$ such that
$\chi_{j}^{k}(p)=1$, $j=1,2$, for all but finitely many primes
$p\in{\mathbb{P}}$. Using the previous facts and (4.9) again, we deduce that
$n^{ikt_{1}}\sim_{c}n^{ikt_{2}}$, hence $n^{ik(t_{1}-t_{2})}\sim_{c}1$.
Whenever $\sum_{p\in\mathcal{G}}\frac{1-\Re(p^{it})}{p}<\infty$, the prime
number theorem on arithmetic progressions implies $t=0.$ Consequently, we have
$t_{1}=t_{2}$.

Next note that if $P$ is an irreducible quadratic form with discriminant $D$,
then ${\mathcal{P}}_{P}$ consists of those primes $p$ that satisfy
$\left(\frac{D}{p}\right)=1$. Using quadratic reciprocity we deduce that there
exists $Q\in{\mathbb{N}}$ and a non-empty finite set $Q_{0}$, consisting of
positive integers relatively prime to $Q$, such that

(4.10) ${\mathcal{P}}_{P_{1}}\cap{\mathcal{P}}_{P_{2}}=\\{p\equiv
j\\!\\!\pmod{Q}\colon j\in Q_{0}\\}.$

By enlarging $Q$ if necessary, we can assume that $\chi_{1},\chi_{2}$ have
period $Q$. Let $\omega(p)=2$ for
$p\in{\mathcal{P}}_{P_{1}}\cap{\mathcal{P}}_{P_{2}}$ and $0$ otherwise. Since
$\omega_{P_{1}}(p)=\omega_{P_{2}}(p)=2$ for all but finitely many
$p\in{\mathcal{P}}_{P_{1}}\cap{\mathcal{P}}_{P_{2}}$, we have
$f\sim_{\omega}\chi_{j}\cdot n^{it}$, for $j=1,2$, and we deduce using (4.8),
with ${\mathbb{D}}_{c}$ in place of ${\mathbb{D}}_{P}$, that

(4.11)
$\sum_{p\in{\mathcal{P}}_{P_{1}}\cap{\mathcal{P}}_{P_{2}}}\,\frac{1}{p}\,(1-\Re(\chi_{1}(p)\cdot\overline{\chi_{2}(p)}))<\infty.$

Since $\chi_{1},\chi_{2}$ have period $Q$ and take finitely many values on
primes, if $\chi_{1}(p_{0})\neq\chi_{2}(p_{0})$ for some
$p_{0}\in{\mathcal{P}}_{P_{1}}\cap{\mathcal{P}}_{P_{2}}$ which does not divide
$Q$, we deduce from (4.10) and (4.11) that

$\sum_{p\equiv p_{0}\\!\\!\\!\pmod{Q}}\,\frac{1}{p}<\infty.$

This contradicts Dirichlet’s theorem on arithmetic progressions and completes
the proof. ∎

###  4.2. The case $P(m,n)=m^{2}+dn^{2}$

For $d\in{\mathbb{Z}}$ square-free we let

$P_{d}(m,n)=m^{2}+dn^{2}\quad\text{ and
}\quad{\mathcal{P}}_{d}:={\mathcal{P}}_{P_{d}},$

where ${\mathcal{P}}_{P_{d}}$ is given by (4.1). Then

(4.12)
${\mathcal{P}}_{d}=\Big{\\{}p\in{\mathbb{P}}\colon\left(\frac{-d}{p}\right)=1\Big{\\}}.$

For example, ${\mathcal{P}}_{1}:=\\{p\equiv 1\\!\pmod{4}\\}$,
${\mathcal{P}}_{2}:=\\{p\equiv 1,3\\!\pmod{8}\\}$,
${\mathcal{P}}_{-2}:=\\{p\equiv 1,7\\!\\!\pmod{8}\\}$. It can be shown that
for square-free $d$ the set ${\mathcal{P}}_{d}$ has relative density $1/2$ on
the primes and it always consists of the set of primes that belong to finitely
many congruence classes. For example, using quadratic reciprocity, we get that
if $q$ is an odd prime, then

${\mathcal{P}}_{q}=\\{p\equiv\pm k^{2}\\!\\!\pmod{4q}\colon k\in[4q]\text{ is
odd}\\}.$

In the case where $P=P_{d}$ the expressions (4.4) and (4.5) used in the
statements of Proposition 4.8 and Proposition 4.9 take the form

(4.13) $G_{d,N}(f,K):=2\,\sum_{\begin{subarray}{c}K<p\leq N,\\\
p\in{\mathcal{P}}_{d}\end{subarray}}\,\frac{1}{p}\,(f(p)\cdot\overline{\chi(p)}\cdot
n^{-it}-1)$

and

(4.14) ${\mathbb{D}}_{d}(f,g;x,y)^{2}:=2\,\sum_{\begin{subarray}{c}x<p\leq
y,\\\
p\in{\mathcal{P}}_{d}\end{subarray}}\frac{1}{p}\,(1-\Re(f(p)\cdot\overline{g(p)})).$

###  4.3. Statements of linear and quadratic concentration estimates

We will make use of the following “linear” concentration estimate, which is an
immediate consequence of [20, Lemma 2.5].

######  Definition 4.6.

Throughout, if $f\colon{\mathbb{N}}\to{\mathbb{U}}$ is a multiplicative
function we extend it to ${\mathbb{Z}}$ by letting $f(-n)=f(n)$ for
$n\in{\mathbb{N}}$. We do a similar thing for additive functions
$h\colon{\mathbb{N}}\to{\mathbb{R}}$.

For each $K\in{\mathbb{N}}$ let

(4.15) $\Phi_{K}:=\Big{\\{}\prod_{p\leq K}p^{a_{p}}\colon K<a_{p}\leq
2K\Big{\\}}.$

######  Proposition 4.7.

Let $f\colon\mathbb{N}\to\mathbb{U}$ be a multiplicative function such that
$f\sim\chi\cdot n^{it}$ for some $t\in{\mathbb{R}}$ and Dirichlet character
$\chi$ with period $q$. Let $K\in{\mathbb{N}}$ and $\Phi_{K}$ be the set
described in (4.15). Suppose that $K$ is sufficiently large so that $q$
divides all elements of $\Phi_{K}$. Then

$\limsup_{N\to\infty}\max_{Q\in\Phi_{K},a\in
A_{Q}}{\mathbb{E}}_{n\in[N]}|f(Qn+a)-\chi(a)\cdot(Qn)^{it}\cdot\exp\big{(}F_{N}(f,K)\big{)}|\\\
\ll{\mathbb{D}}(f,\chi\cdot n^{it};K,\infty)+K^{-1/2},$

where for given $Q\in{\mathbb{N}}$ the set $A_{Q}$ consists of all
$a\in{\mathbb{Z}}$ with $|a|\leq Q$ and $(a,Q)=1$, the implicit constant is
absolute, ${\mathbb{D}}$ is as in (4.7), and

(4.16) $F_{N}(f,K):=\sum_{K<p\leq
N}\frac{1}{p}\,\big{(}f(p)\cdot\overline{\chi(p)}\cdot p^{-it}-1\big{)}.$

(We suppress the dependence on $t$ and $\chi$).

Our main goal in this section is to prove an analog of this result for
irreducible binary quadratic forms. The case where $Q(m,n)=m^{2}+n^{2}$ was
essentially covered in [11]. We follow a similar general strategy, but the
more general setting we want to cover presents some additional challenges that
we need to address. In particular, unlike in [11], we need to invoke several
results from algebraic number theory and also work over real quadratic
extensions.

######  Proposition 4.8.

Let $P\in{\mathbb{Z}}[m,n]$ be an irreducible binary quadratic form,
$A,K,N\in{\mathbb{N}}$, and $f\colon{\mathbb{Z}}\to{\mathbb{U}}$ be an even
multiplicative function, $t\in{\mathbb{R}}$, $\chi$ be a Dirichlet character
with period $q,$ $Q=\prod_{p\leq K}p^{a_{p}}$ for some $a_{p}\in{\mathbb{N}}$.
Let also $a,b\in{\mathbb{Z}}$ be such that $-A\leq a,b\leq A$,
$c:=(P(a,b),Q)$, and suppose that $q$ and $\prod_{p\leq K}p$ divide $Q/c$.
Then there exist constants $C_{A,P,Q}>0$ such that if $K$ is sufficiently
large, depending only on $P$, and $N$ is sufficiently large, depending only on
$A$, $P$, $Q$, we have

(4.17)
${\mathbb{E}}_{m,n\in[N]}\,\big{|}f\big{(}P_{c}(Qm+a,Qn+b)\big{)}-\chi(P_{c}(a,b))\cdot(P_{c}(Qm,Qn))^{it}\cdot\exp\big{(}G_{P,N}(f,K)\big{)}\big{|}\\\
\ll_{P}({\mathbb{D}}_{P}+{\mathbb{D}}_{P}^{2})(f,\chi\cdot
n^{it};K,\sqrt{N})+C_{A,P,Q}\cdot\mathbb{D}_{P}(f,\chi\cdot
n^{it};\sqrt{N},C_{A,P,Q}N^{2})+K^{-1/2},$

where $P_{c}:=P/c$ and $G_{P,N},{\mathbb{D}}_{P}$ are as in (4.4), (4.5).

######  Remarks.

$\bullet$ The uniformity in the parameters is important for our applications.
In particular, it is crucial that the implicit constant depends only on $P$
and not on $A,K$, and that $\exp\big{(}G_{P,N}(f,K)\big{)}$ is the same for
all $Q$ that are divisible by $\prod_{p\leq K}p$.

$\bullet$ In the proof of part (i) of Theorem 2.4 we apply this result and the
next one for $a=1,b=0$ in which case some of our assumptions hold trivially.
The full strength of Proposition 4.8, for varying $a,b$ that depend on $Q$, is
needed in the proof of part (ii) of Theorem 2.4 to cover the case where the
irreducible polynomials $P_{1},P_{2}$ have different discriminants.

$\bullet$ If $P$ is reducible, then $P=L_{1}\cdot L_{2}$, where $L_{1},L_{2}$
are linear forms, and we get concentration estimates using Proposition 4.7.

For $P$-pretentious multiplicative functions we deduce the following result.

######  Proposition 4.9.

Let $P\in{\mathbb{Z}}[m,n]$ be an irreducible binary quadratic form and
$f\colon{\mathbb{Z}}\to{\mathbb{U}}$ be an even multiplicative function such
that $f\sim_{P}\chi\cdot n^{it}$ for some $t\in{\mathbb{R}}$ and Dirichlet
character $\chi$ with period $q$. Let also $A_{K}\in{\mathbb{N}}$ and
$\Phi_{K}$ be as in (4.15) and suppose that $K$ is sufficiently large,
depending only on $P$, and so that ${\mathbb{D}}_{P}(f,\chi\cdot
n^{it};K,\infty)\leq 1$ and $q$ divides all elements of $\Phi_{K}$. Then

$\limsup_{N\to\infty}\max_{Q\in\Phi_{K},a,b\in
S_{K}}{\mathbb{E}}_{m,n\in[N]}\,\big{|}f\big{(}P_{c}(Qm+a,Qn+b)\big{)}-\\\
\chi(P_{c}(a,b))\cdot(P_{c}(Qm,Qn))^{it}\cdot\exp\big{(}G_{P,N}(f,K)\big{)}\big{|}\ll_{P}{\mathbb{D}}_{P}(f,\chi\cdot
n^{it};K,\infty)+K^{-1/2},$

where $c:=(P(a,b),Q)$, $P_{c}:=P/c$, $S_{K}$ consists of all
$a,b\in[-A_{K},A_{K}]$ such that $q$ and $\prod_{p\leq K}p$ divide $Q/c$, and
$G_{P,N},{\mathbb{D}}_{P}$ are as in (4.4), (4.5).

######  Remark.

It is important for our argument that $\exp\big{(}G_{P,N}(f,K)\big{)}$ is the
same for all $Q\in\Phi_{K}$ that are divisible by $q$. It is also important
for our applications that we get some uniformity over the $Q\in\Phi_{K}$. Also
note that if $(P(a,b),Q)=1$, then $P_{c}=P$ and $S_{K}=[-A_{K},A_{K}]$.

In the remaining part of this section we give some preliminary results needed
to prove Proposition 4.8 and then complete its proof in Section 5.

###  4.4. Preliminary results I

We will need the following elementary result.

######  Lemma 4.10.

Let $P\in{\mathbb{Z}}[m,n]$ be an irreducible homogeneous polynomial and
$\omega_{P}$ be as in Definition 4.2. Then $\omega_{P}(p^{2})\leq\deg(P)$ for
all but finitely many $p\in{\mathbb{P}}$.

###### Proof.

Let $\tilde{P}(n):=P(n,1)$. By Hensel’s lemma, if $\tilde{P}(n)\equiv
0\\!\pmod{p^{2}}$ has more than $\deg(\tilde{P})$ solutions, then either
$\tilde{P}(n)\equiv 0\\!\pmod{p}$ has more than $\deg(\tilde{P})$ solutions
(which can only happen for finitely many $p$), or the polynomials $\tilde{P}$
and $\tilde{P}^{\prime}$ have a common root $\\!\\!\\!\pmod{p}$. Since
$\tilde{P}$ is irreducible in ${\mathbb{Z}}[n]$, it shares no common factors
with $\tilde{P}^{\prime}$ and hence there are polynomials
$P_{1},P_{2}\in{\mathbb{Z}}[n]$ such that
$P_{1}\tilde{P}+P_{2}\tilde{P}^{\prime}=k$ for some non-zero
$k\in{\mathbb{Z}}$. Therefore, if $\tilde{P}$ and $\tilde{P}^{\prime}$ share a
root $\\!\\!\\!\pmod{p}$, $k$ must be a multiple of $p$, which can also only
happen for finitely many primes $p$.∎

######  Lemma 4.11.

Let $P\in{\mathbb{Z}}[m,n]$ be a homogeneous polynomial that is nonlinear and
irreducible, and let $\omega_{P}$ be as in Definition 4.2. For
$Q,N\in{\mathbb{N}}$, $a,b\in{\mathbb{Z}}$, and $p,q\in{\mathbb{P}}$, let

(4.18)
$w_{P,Q,N}(p,q):=\frac{1}{N^{2}}\,\sum_{\begin{subarray}{c}m,n\in[N],\\\
p,q\,\mid\mid\,P(Qm+a,Qn+b)\end{subarray}}1.$

(Note that $w$ also depends on $a$ and $b$. To ease the notation, we suppress
the dependence.) Then there exists a finite subset $F$ of the primes,
consisting of the prime divisors of $Q$ together with a finite set
$F^{\prime}$ depending only on $P$, such that for $p\notin F$ we have

(4.19)
$w_{P,Q,N}(p,p)=\Big{(}\frac{\omega_{P}(p)}{p}-\frac{\omega_{P}(p^{2})}{p^{2}}\Big{)}\,\Big{(}1-\frac{1}{p}\Big{)}+O_{P}\Big{(}\frac{1}{N}\Big{)},$

and if $p,q\not\in F$ and $p\neq q$ we have

(4.20)
$w_{P,Q,N}(p,q)=\Big{(}\frac{\omega_{P}(p)}{p}-\frac{\omega_{P}(p^{2})}{p^{2}}\Big{)}\,\Big{(}\frac{\omega_{P}(q)}{q}-\frac{\omega_{P}(q^{2})}{q^{2}}\Big{)}\,\Big{(}1-\frac{1}{p}\Big{)}\,\Big{(}1-\frac{1}{q}\Big{)}+O_{P}\Big{(}\frac{1}{N}\Big{)}.$

Furthermore, if $p,q\not\in F$, then for every $c\in{\mathbb{N}}$ such that
$c\mid(Q,P(a,b))$, we have 666Note that if $c\in{\mathbb{N}}$ is such that
$c\mid(Q,P(a,b))$, then $c\mid P(Qm+a,Qn+b)$ for every $m,n\in{\mathbb{N}}$.

(4.21) $w_{P,Q,N}(p,q)=\frac{1}{N^{2}}\,\sum_{\begin{subarray}{c}m,n\in[N],\\\
p,q\,\mid\mid\,P_{c}(Qm+a,Qn+b)\end{subarray}}1$

where $P_{c}:=P/c$.

######  Remark.

Note that $w_{P,Q,N}(p,q)=0$ unless $p,q\in{\mathcal{P}}_{P}$.

###### Proof.

Throughout the proof, we will use $\epsilon$ to denote a number in
$\\{0,1,\ldots,2\deg(P)\\}$. Let $F^{\prime}$ be the set that consists of the
finite set of primes given by Lemma 4.10 and the prime divisors of $P(1,0)$
(which is nonzero since $P$ is irreducible), and let $F$ be the finite set
that consists of $F^{\prime}$ and the prime divisors of $Q$. Henceforth, we
assume that $p\not\in F$ is a prime.

We first establish (4.21). Since $p\notin F$ we have $p\nmid Q$, hence $p\nmid
c$. This implies that $p\mid\mid P_{c}(Qm+a,Qn+b)$ if and only if $p\mid\mid
P(Qm+a,Qn+b)$, and as a consequence for $p,q\notin F$, on the right side of
(4.21) we can replace $P_{c}$ by $P$, proving (4.21).

Next we establish (4.19). We will use that $\omega_{P}(p)\leq\deg(P)$ and
$\omega(p^{2})\leq\deg(P)$ throughout. First, note that if $p\mid Qn+b$ and
$p\mid P(Qm+a,Qn+b)$, then also $p\mid Qm+a$ (we used that $P$ is homogeneous
and $p\nmid P(1,0)$ since $p\not\in F$) and consequently $p^{2}\mid
P(Qm+a,Qm+b)$ (we used that $P$ is homogeneous and non-linear), hence we get
no contribution to the sum (4.18) in this case. So we can assume that $p,n$
are such that $p\nmid Qn+b$. Since $(p,Q)=1$, and $n$ is such that $p\nmid
Qn+b$, and $P$ is homogeneous (hence, $P(m,n)=0\pmod{p}$ if and only if
$P(mn^{*},1)=0\pmod{p}$ where $nn^{*}\equiv 1\pmod{p}$), we get by (4.2) that
for this fixed value of $n\in[N]$ we have exactly $\omega_{P}(p)$ solutions
$m\pmod{p}$ of the congruence

(4.22) $P(Qm+a,Qn+b)\equiv 0\pmod{p}.$

Hence, for those $n\in[N]$ we have $\omega_{P}(p)[N/p]+\epsilon$ solutions in
the variable $m\in[N]$ to (4.22). Since there are $N-[N/p]+\epsilon$ integers
$n\in[N]$ with $p\nmid Qn+b$ (we used that $(p,Q)=1$ here), we get a total of

$\omega_{P}(p)[N/p]\,(N-[N/p])+O(N)=\omega_{P}(p)(N^{2}/p-N^{2}/p^{2})+O_{P}(N)$

solutions of $m,n\in[N]$ to the congruence (4.22). Similarly, we get that if
$p\nmid Qn+b$, then the number of solutions $m,n\in[N]$ to the congruence

$P(Qm+a,Qn+b)\equiv 0\pmod{p^{2}}$

is

$\omega_{P}(p^{2})[N/p^{2}]\,(N-[N/p])+O(N)=\omega_{P}(p^{2})(N^{2}/p^{2}-N^{2}/p^{3})+O_{P}(N).$

These solutions should be subtracted from the previous solutions of (4.22) in
order to count the number of solutions of $m,n\in[N]$ for which
$p\,\mid\mid\,P(Qm+a,Qn+b)$ holds. We deduce that

(4.23) $\frac{1}{N^{2}}\,\sum_{\begin{subarray}{c}m,n\in[N],\\\
p\,\mid\mid\,P(Qm+a,Qn+b)\end{subarray}}1=\Big{(}\frac{\omega_{P}(p)}{p}-\frac{\omega_{P}(p^{2})}{p^{2}}\Big{)}\Big{(}1-\frac{1}{p}\Big{)}+O_{P}\Big{(}\frac{1}{N}\Big{)},$

which proves (4.19).

Next, we establish (4.20). Let $p,q$ satisfy the assumptions. As explained in
the previous case, those $n\in[N]$ for which $p\mid Qn+b$ or $q\mid Qn+b$ do
not contribute to the sum (4.18) defining $w_{Q,N}(p,q)$, so we can assume
that $(pq,Qn+b)=1$. Let

$A_{r,s}:=\frac{1}{N^{2}}\,\sum_{\begin{subarray}{c}m,n\in[N],\\\ r,s\mid
P(Qm+a,Qn+b),\,(rs,Qn+b)=1\end{subarray}}1$

and note that

(4.24) $w_{P,Q,N}(p,q)=A_{p,q}-A_{p^{2},q}-A_{p,q^{2}}+A_{p^{2},q^{2}}.$

First we compute $A_{p,q}$. Since $p,q\in{\mathcal{P}}_{P}$ we get using (4.3)
that for each $n\in[N]$ with $p,q\nmid Qn+b$ and $(pq,Q)=1$ we have
$\omega_{P}(p)\,\omega_{P}(q)$ solutions $m\pmod{pq}$ to the congruence

(4.25) $P(Qm+a,Qn+b)\equiv 0\pmod{pq}.$

We deduce that for every $n\in[N]$ with $(pq,Qn+b)=1$ we have
$\omega_{P}(p)\,\omega_{P}(q)\,[N/(pq)]+\epsilon$ solutions in the variable
$m\in[N]$ to the congruence (4.25). Since the number of $n\in[N]$ for which
$(pq,Qn+b)=1$ is $N-[N/p]-[N/q]+[N/pq]$, we get that the total number of
solutions of the congruence (4.25) with $m,n\in[N]$ and $(pq,n)=1$ is

(4.26)
$\omega_{P}(p)\,\omega_{P}(q)[N/(pq)]\,(N-[N/p]-[N/q]+[N/(pq)])+O_{P}(N)=\\\
N^{2}\cdot(\omega_{P}(p)\,\omega_{P}(q)/(pq))\cdot(1-1/p-1/q+1/(pq))+O_{P}(N).$

Hence,

$A_{p,q}:=\frac{\omega_{P}(p)\,\omega_{P}(q)}{pq}\Big{(}1-\frac{1}{p}\Big{)}\Big{(}1-\frac{1}{q}\Big{)}+O_{P}\Big{(}\frac{1}{N}\Big{)}.$

Similarly, using again (4.3), we find that

$A_{p^{2},q}=\frac{\omega_{P}(p^{2})\,\omega_{P}(q)}{p^{2}q}\Big{(}1-\frac{1}{p}\Big{)}\Big{(}1-\frac{1}{q}\Big{)}+O_{P}\Big{(}\frac{1}{N}\Big{)},$

and

$A_{p,q^{2}}=\frac{\omega_{P}(p)\,\omega_{P}(q^{2})}{pq^{2}}\Big{(}1-\frac{1}{p}\Big{)}\Big{(}1-\frac{1}{q}\Big{)}+O_{P}\Big{(}\frac{1}{N}\Big{)}.$

Also,

$A_{p^{2},q^{2}}=\frac{\omega_{P}(p^{2})\,\omega_{P}(q^{2})}{p^{2}q^{2}}\Big{(}1-\frac{1}{p}\Big{)}\Big{(}1-\frac{1}{q}\Big{)}+O_{P}\Big{(}\frac{1}{N}\Big{)}.$

Using the last four identities and (4.24), we deduce that (4.20) holds. This
completes the proof. ∎

If we combine Lemma 4.11 with the estimate of Lemma 4.10 we immediately deduce
the following result.

######  Corollary 4.12.

Let $P\in{\mathbb{Z}}[m,n]$ be a homogeneous polynomial that is nonlinear and
irreducible and let $\omega_{P}$, $w_{P,Q,N}$ be as in Definition 4.2 and
(4.18) respectively. Then there exists a finite subset $F$ of the primes,
consisting of the prime divisors of $Q$ together with a finite set
$F^{\prime}$ depending only on $P$, such that for $p\notin F$ we have

(4.27)
$\Big{|}w_{P,Q,N}(p,p)-\frac{\omega_{P}(p)}{p}\Big{|}\ll_{P}\frac{1}{p^{2}}+\frac{1}{N},\quad
w_{P,Q,N}(p,p)\leq\frac{\omega_{P}(p)}{p}+O_{P}\Big{(}\frac{1}{N}\Big{)},$

and if $p,q\not\in F$ and $p\neq q$ we have

(4.28) $|w_{P,Q,N}(p,q)-w_{P,Q,N}(p,p)\cdot
w_{P,Q,N}(q,q)|\ll_{P}\frac{1}{N}.$

###  4.5. Preliminary results II

Let $P\in{\mathbb{Z}}[m,n]$ be homogeneous. For $l,Q,N\in{\mathbb{N}}$ and
$a,b\in{\mathbb{Z}}$ with $-Q\leq a,b\leq Q$, let

(4.29)
$w^{*}_{P,Q,N}(l):=\frac{1}{N^{2}}\,\sum_{\begin{subarray}{c}m,n\in[N],\\\
l\mid P(Qm+a,Qn+b)\end{subarray}}1.$

We use $w^{*}$ instead of $w$ because $w_{P,Q,N}(p)$ was used in (4.18) to
denote a similar expression with $\mid\mid$ instead of $\mid$. Note that
$w^{*}$ also depends on $a,b$, but to ease the notation a bit we will suppress
this dependence. In this subsection we restrict ourselves to the case where
$P$ is an irreducible binary quadratic form, and our goal is to get in Lemma
4.15 useful bounds for $w^{*}_{P,Q,N}(l)$ when $l$ is composite. We note that
these bounds are better than those in (4.27) and (4.28) when $l=p>N$ and
$l=pq>N$ respectively, which will be used in the sequel.

####  4.5.1. Algebraic number theory preliminaries

Let $P=P_{d}$ be as in (3.3) for some square-free $d\in{\mathbb{N}}$, namely,

(4.30) $P_{d}(m,n):=\begin{cases}m^{2}+dn^{2},\quad&\,\text{ if }d\equiv
1,2\\!\pmod{4}\\\ m^{2}+mn+\frac{d+1}{4}n^{2},&\,\text{ if }d\equiv
3\\!\pmod{4}.\end{cases}$

For square-free $d\in{\mathbb{Z}}$, let ${\mathbb{Z}}[\tau_{d}]$ be the ring
of integers of the number field ${\mathbb{Q}}(\sqrt{-d})$ where $\tau_{d}$ is
as in (3.1), namely,

(4.31) $\tau_{d}:=\begin{cases}\sqrt{-d},\quad&\,\text{ if }d\equiv
1,2\\!\pmod{4}\\\ \frac{1+\sqrt{-d}}{2},&\,\text{ if }d\equiv
3\\!\pmod{4},\end{cases}$

and recall that for $m,n\in{\mathbb{Z}}$ the norm of the element $m+n\tau_{d}$
is ${\mathcal{N}}(m+n\tau_{d})=P_{d}(m,n)$. We want to estimate

(4.32) $C_{d,N}(k):=|\\{m,n\in[-N,N]\colon{\mathcal{N}}(m+n\tau_{d})=k\\}|,$

and it turns out to be more convenient to work with ideals in
${\mathbb{Z}}[\tau_{d}]$ and estimate the corresponding quantities. Recall
that the norm of an ideal is a nonnegative number, and if the ideal is
principal and generated by $a\in{\mathbb{Z}}[\tau_{d}]$, then its norm is
equal to $|{\mathcal{N}}(a)|$. For $k\in{\mathbb{N}}$ we let

(4.33) ${\mathcal{C}}_{d}(k):=|\\{\text{ideals of
}{\mathbb{Z}}[\tau_{d}]\text{ with norm }k\\}|.$

######  Lemma 4.13.

Let $d\in{\mathbb{Z}}$ be a square free integer and ${\mathcal{C}}_{d}(k)$ be
as in (4.33). Then

(4.34) $\sum_{n\in[N]}{\mathcal{C}}_{d}(n)\ll_{d}N,$

and if $l\in{\mathbb{N}}$ is a product of at most $s$ not necessarily distinct
primes we have

(4.35) ${\mathcal{C}}_{d}(ln)\leq 2^{s}\,{\mathcal{C}}_{d}(n)\quad\text{ for
every }n\in{\mathbb{N}}.$

###### Proof.

The first estimate follows from the ideal counting theorem (see e.g. [23,
Example 10.2.9]).

We prove (4.35). It is known that ${\mathcal{C}}_{d}(k)$ is multiplicative and
that ${\mathcal{C}}_{d}(p^{a+1})\leq{\mathcal{C}}_{d}(p^{a})+1$ for every
$a\in{\mathbb{Z}}_{+}$ (see for example Exercises 10.2.1 and 10.2.4 in [23]).
It follows easily from these two properties that for any prime $p$ and
$n\in{\mathbb{N}}$ (not necessarily relatively prime to $p$) we have

${\mathcal{C}}_{d}(pn)\leq 2\,{\mathcal{C}}_{d}(n).$

So if $l$ is a product of at most $s$ not necessarily distinct primes, we get
that (4.35) holds. ∎

The next lemma allows us to pass estimates from ${\mathcal{C}}_{d}(k)$ to
$C_{d,N}(k)$.

######  Lemma 4.14.

Let $d$ be a square-free integer, $N\in{\mathbb{N}}$, and $C_{d,N}$ and
${\mathcal{C}}_{d}$ as in (4.32) and (4.33) respectively.

  1. (i)

If $d>0$, then $C_{d,N}(k)\leq 4\cdot{\mathcal{C}}_{d}(|k|)$, for every
$k\in{\mathbb{Z}}$, $N\in{\mathbb{N}}$.

  2. (ii)

If $d<0$, then there exists $c_{d}>0$ such that
$C_{d,N}(k)\leq\log_{+}(c_{d}\,N/\sqrt{|k|})\cdot{\mathcal{C}}_{d}(|k|)$, for
every nonzero $k\in{\mathbb{Z}}$, and $N\in{\mathbb{N}}$, where
$\log_{+}(x)={\bf 1}_{[1,+\infty)}(x)\cdot\log x$.888We remark that the weaker
estimate $C_{d,N}(k)\leq\log_{+}(c_{d}\,N)\cdot{\mathcal{C}}_{d}(|k|)$ is not
sufficient for our purposes.

###### Proof.

We establish (i). Since $d>0$, it is well known that ${\mathbb{Z}}[\tau_{d}]$
has at most $4$ units, and since two elements belong to the same principal
ideal if and only if their quotient is a unit, we get the asserted bound. (We
overcount the non-principal ideals with norm $|k|$.)

We establish (ii). Let $k\in{\mathbb{Z}}$ be nonzero. Dirichlet’s unit theorem
implies that in the case $d<0$ the group of units has rank $1$ and hence there
exists a unit $u\in{\mathbb{Z}}[\tau_{d}]\subset{\mathbb{R}}$ such that $u>1$
and every other unit has the form $\pm u^{t}$ for some $t\in{\mathbb{Z}}$.
Thus, if $m+n\tau_{d}$ and $m^{\prime}+n^{\prime}\tau_{d}$ with
$m,n,m^{\prime},n^{\prime}\in[N]$ both have norm $k$ and generate the same
ideal, then $m+n\tau_{d}=(m^{\prime}+n^{\prime}\tau_{d})u^{t}$ for some
$t\in{\mathbb{Z}}$.

We claim that there exists $c_{d}>0$ such that

(4.36) $|t|\ll_{d}\log_{+}(c_{d}\,N/\sqrt{|k|}).$

Using the symmetries of the polynomials $P_{d}$ in (4.30), which define the
norm ${\mathcal{N}}(m+n\tau_{d})$, we can assume that $m,n\in[N]$ as long as
we allow $P_{d}(m,n)$ to be either $m^{2}+dn^{2}$ or $m^{2}\pm
mn+\frac{d+1}{4}n^{2}$. Since $P_{d}(m,n)=P_{d}(m^{\prime},n^{\prime})=k$, we
get by (4.30) that if $k>0$, then $m,m^{\prime}\geq\sqrt{k}/2$ (since
$P_{d}(m,n)\leq 2m^{2}$), while if $k<0$, then
$n,n^{\prime}\geq\sqrt{|k|}/\sqrt{|d|}$ (since $P_{d}(m,n)\geq dn^{2}$). Also,
$(m^{\prime}+n^{\prime}\tau_{d})u^{t}=m+n\tau_{d}\ll_{d}N$ if $t$ is positive
and $(m+n\tau_{d})u^{-t}=m^{\prime}+n^{\prime}\tau_{d}\ll_{d}N$ if $t$ is
negative. We deduce that $\sqrt{|k|}u^{|t|}\ll_{d}N$ (we used here that
$m,n,m^{\prime},n^{\prime},\tau_{d}$ are all non-negative). Since $u>1$, this
establishes (4.36) and proves the claim.

It follows from the above that $C_{d,N}(k)$ is bounded by
$\log_{+}(c_{d}\,N/\sqrt{|k|})$ times the number of principal ideals with norm
$k$, which gives the asserted bound. ∎

####  4.5.2. Main estimate

The next estimate will be crucial for us and will be used to estimate the
contribution of “large” prime divisors in subsequent arguments.

######  Lemma 4.15.

Let $P\in{\mathbb{Z}}[m,n]$ be an irreducible binary quadratic form. For
$l,A,Q,N\in{\mathbb{N}}$ and $a,b\in{\mathbb{Z}}$ with $-A\leq a,b\leq A$, let
$w^{*}_{P,Q,N}(l)$ be as in (4.29). If $l$ is a product of $s$, not
necessarily distinct primes, then

(4.37) $w^{*}_{P,Q,N}(l)\ll_{A,P,s}\frac{Q^{2}}{l}.$

###### Proof.

Case where $P=P_{d}$, $Q=1,a=b=0$. We first consider the case where $Q=1$,
$a=b=0$, and $P=P_{d}$ is as in (4.30) for some square-free
$d\in{\mathbb{N}}$. In this case, we will show that if $l$ is a product of $s$
not necessarily distinct primes, then

(4.38) $|\\{m,n\in[-N,N]\colon
l\mid{\mathcal{N}}(m+n\tau_{d})\\}|\ll_{d,s}\frac{N^{2}}{l}.$

Since $P_{d}(m,n)={\mathcal{N}}(m+n\tau_{d})$, this clearly implies that
(4.37) holds when $P=P_{d}$ and $Q=1$, $a=b=0$. (The estimate (4.37) only
requires to consider positive $m,n$, but the extended range will be needed in
order to reduce the general polynomial $P$ to $P=P_{d}$.)

For $k\in{\mathbb{Z}}$ let $C_{d,N}(k)$ be as in (4.32). Since
$|{\mathcal{N}}(m+n\tau_{d})|\ll_{d}N^{2}$ if $m,n\in[-N,N]$, the left side in
(4.38) is bounded by

$\displaystyle\sum_{|r|\ll_{d}\frac{N^{2}}{l}}|\\{m,n\in[-N,N]\colon{\mathcal{N}}(m+n\tau_{d})=lr\\}|=\sum_{|r|\ll_{d}\frac{N^{2}}{l}}C_{d,N}(lr).$

Therefore, we will be done if we show that

(4.39) $\sum_{|r|\ll_{d}\frac{N^{2}}{l}}C_{d,N}(lr)\ll_{d,s}\frac{N^{2}}{l}.$

We will prove this by considering the two cases $d>0$ and $d<0$ separately.

Suppose first that $d>0$. Using part (i) of Lemma 4.14 and then (4.35) and
(4.34), we deduce that

$\sum_{|r|\ll_{d}\frac{N^{2}}{l}}C_{d,N}(lr)\ll\sum_{|r|\ll_{d}\frac{N^{2}}{l}}{\mathcal{C}}_{d}(lr)\ll_{s}\sum_{r\ll_{d}\frac{N^{2}}{l}}{\mathcal{C}}_{d}(r)\ll_{d}\frac{N^{2}}{l},$

establishing (4.39) when $d>0$.

Suppose now that $d<0$. Using part (ii) of Lemma 4.14 and then (4.35), we
deduce that

$\sum_{1\leq|r|\ll_{d}\frac{N^{2}}{l}}C_{d,N}(lr)\ll_{d}\sum_{1\leq
r\ll_{d}\frac{N^{2}}{l}}\log_{+}(c_{d}\,N/\sqrt{lr})\cdot{\mathcal{C}}_{d}(lr)\ll_{s}\sum_{1\leq
r\leq
c_{d}^{2}\,\frac{N^{2}}{l}}\log(c_{d}\,N/\sqrt{lr})\cdot{\mathcal{C}}_{d}(r).$

Let

$S(r):=\sum_{1\leq n\leq r}{\mathcal{C}}_{d}(n).$

Using partial summation, the estimate $\log(1+x)\leq x$ for $x\geq 0$, and
(4.34), we get that the right side is bounded by

(4.40) $\ll_{d}S\big{(}[c_{d}^{2}\,N^{2}/l]\big{)}+\sum_{1\leq
r\leq\frac{N^{2}}{l}}\frac{S(r)}{r}\ll_{d}\frac{N^{2}}{l}.$

Combining the above, we get that (4.39) holds when $d<0$.

(General case). Let $P(m,n)=\alpha m^{2}+\beta mn+\gamma n^{2}$, where
$\alpha,\beta,\gamma\in{\mathbb{Z}}$, be an irreducible binary quadratic form
and $a,b\in{\mathbb{Z}}$ with $-A\leq a,b\leq A$. We will reduce to the case
covered in the previous discussion by following an argument similar to the one
used at the end of Section 3.5. Since $P$ is irreducible, its discriminant is
not a square. Let $d$ be the unique square-free integer that satisfies

$4\alpha\gamma-\beta^{2}=r^{2}d$

for some $r\in{\mathbb{N}}$, and note that

$4\alpha\,P(m,n)=P_{d}(A_{d}(m,n)),$

where $A_{d}\colon{\mathbb{Z}}^{2}\mapsto{\mathbb{Z}}^{2}$ is the injective
map given in (3.9) and $P_{d}$ is as in (4.30). It follows that if $l\mid
P(Qm+a,Qn+b)$ for some $m,n\in[N]$, then $l\mid P_{d}(m^{\prime},n^{\prime})$
where $(m^{\prime},n^{\prime})=A_{d}(m,n)\in[-CQ,CQ]$ for some
$C:=C(A,\alpha,\beta,r)$ (we used that $|a|,|b|\leq A$). Note also that the
map $(m,n)\mapsto(m^{\prime},n^{\prime})$ is injective (since $A_{d}$ is
injective). We deduce that

$\big{|}(m,n)\in[N]\times[N]\colon l\mid P(Qm+a,Qn+b)\big{|}\leq\\\
\big{|}(m^{\prime},n^{\prime})\in CQ\cdot([-N,N]\times[-N,N])\colon l\mid
P_{d}(m^{\prime},n^{\prime})\big{|}\ll_{d,s}(CQN)^{2}/l,$

where the last estimate follows because we have already covered the case
$P=P_{d}$, $Q=1$, $a=b=0$. This completes the proof. ∎

##  5\. Concentration estimates - Proof of main results

In this section we complete the proof of Proposition 4.8 and thus of
Proposition 4.9. Although the results and proofs presented are similar to
those in [5], which cover the case where $P(m,n)=m^{2}+n^{2}$ and $c=1$, there
are also a number of technical differences in the argument that necessitate
giving it in full detail in order to facilitate proper understanding.

###  5.1. Concentration estimates for additive functions

We start with a concentration estimate for additive functions, which will
eventually get lifted to a concentration estimate for multiplicative
functions.

######  Definition 5.1.

We say that $h\colon\mathbb{N}\to\mathbb{C}$ is additive, if it satisfies
$h(mn)=h(m)+h(n)$ whenever $(m,n)=1$. We extend additive functions to the
integers by $h(-n):=h(n)$ for $n\in{\mathbb{N}}$.

######  Lemma 5.2 (Turán-Kubilius inequality for quadratic forms).

Let $P\in{\mathbb{Z}}[m,n]$ be an irreducible binary quadratic form and
${\mathcal{P}}_{P}$ be as in (4.1). Let $K\in{\mathbb{N}}$ be sufficiently
large (depending only on $P$) and let $N$ be sufficiently large (depending
only on $K$). For any $A\in{\mathbb{N}}$, $a,b\in{\mathbb{Z}}$ with $-A\leq
a,b\leq A$, $Q=\prod_{p\leq K}p^{a_{p}}$ for some $a_{p}\in{\mathbb{N}}$, and
$c\in{\mathbb{N}}$ with $c\mid(Q,P(a,b))$, there exists $C_{A,P,Q}>0$ such
that for any additive even function $h\colon\mathbb{Z}\to{\mathbb{C}}$
satisfying

  1. (i)

$h(p)=0$ for all primes $p\leq K$ and $p>N$;

  2. (ii)

$h(p)=0$ for all primes $p\notin{\mathcal{P}}_{P}$;

  3. (iii)

$h(p^{k})=0$ for all primes $p$ and $k\geq 2$,

we have

(5.1)
${\mathbb{E}}_{m,n\in[N]}\,\big{|}h\big{(}P_{c}(Qm+a,Qn+b)\big{)}-H_{N}(h,K)\big{|}^{2}\ll_{P}\\\
{\mathbb{D}}^{2}(h;K,\sqrt{N})+C_{A,P,Q}\cdot{\mathbb{D}}^{2}(h;\sqrt{N},N)+K^{-1},$

where $P_{c}:=P/c$,

(5.2) $H_{N}(h,K):=2\,\sum_{K<p\leq N}\,\frac{h(p)}{p}$

and

(5.3) ${\mathbb{D}}^{2}(h;K,N):=\sum_{K<p\leq N}\frac{|h(p)|^{2}}{p}.$

###### Proof.

Henceforth, we take $K$ sufficiently large, depending only on $P$, so that it
exceeds all elements of the finite set $F^{\prime}$ considered in Corollary
4.12 and such that $\omega_{P}(p)=2$ for every $p\in{\mathcal{P}}_{P}$ with
$p>K$ (for this it suffices to ensure that $p$ does not divide the
discriminant of $P$, which is nonzero since the $P$ is irreducible). Note also
that since $p\mid Q$ implies $p\leq K$, for $p>K$ we have $p\notin F$ where
$F$ is the finite set considered in Corollary 4.12.

We consider the additive functions $h_{1},h_{2}$, which are the restrictions
of $h$ on the primes $K<p\leq\sqrt{N}$ and $\sqrt{N}<p\leq N$. More precisely,

$h_{1}(p^{k}):=\begin{cases}h(p),\quad&\text{if }\ k=1\text{ and
}K<p\leq\sqrt{N}\\\ 0,\quad&\text{otherwise,}\end{cases}$

and

$h_{2}(p^{k}):=\begin{cases}h(p),\quad&\text{if }\ k=1\text{ and
}\sqrt{N}<p\leq N\\\ 0,\quad&\text{otherwise,}\end{cases},$

and we extend $h_{1},h_{2}$ to even functions in ${\mathbb{Z}}$. Then
$h=h_{1}+h_{2}$. We also define

(5.4) $H_{N}(h_{i},K):=2\,\sum_{K<p\leq N}\,\frac{h_{i}(p)}{p},\quad i=1,2,$

and the technical variant

(5.5) $H^{\prime}_{N}(h_{1},Q,K):=\sum_{K<p\leq N}\,w_{P,Q,N}(p)\cdot
h_{1}(p),$

where

(5.6) $w_{P,Q,N}(p):=\frac{1}{N^{2}}\,\sum_{\begin{subarray}{c}m,n\in[N],\\\
p\,\mid\mid\,P(Qm+a,Qn+b)\end{subarray}}1.$

(Note that $w_{P,Q,N}(p)=w_{P,Q,N}(p,p)$ where $w_{P,Q,N}(p,q)$ is as in
(4.18).) Note that as shown in (4.21) of Lemma 4.11 for $p\nmid Q$, which
holds for $p>K$, we have

$w_{P,Q,N}(p):=\frac{1}{N^{2}}\,\sum_{\begin{subarray}{c}m,n\in[N],\\\
p\,\mid\mid\,P_{c}(Qm+a,Qn+b)\end{subarray}}1.$

The reason for introducing $H^{\prime}_{N}(h_{1},Q,K)$ is that it gives the
mean value of $h_{1}$ along integers of the form $P_{c}(Qm+a,Qn+b)$. Indeed,
using the properties (i)-(iii), and since $h_{1}$ is additive and even, we
have

(5.7)
${\mathbb{E}}_{m,n\in[N]}\,h_{1}(P_{c}(Qm+a,Qn+b))={\mathbb{E}}_{m,n\in[N]}\,\sum_{p\,\mid\mid\,P(Qm+a,Qn+b)}h_{1}(p)\\\
=\frac{1}{N^{2}}\sum_{K<p\leq
N}h_{1}(p)\,\sum_{\begin{subarray}{c}m,n\in[N],\\\
p\,\mid\mid\,P_{c}(Qm+a,Qn+b)\end{subarray}}1=H^{\prime}_{N}(h_{1},Q,K).$

Using the estimate (4.27) of Corollary 4.12 (which holds since $p\notin F$ for
$p>K$), and the fact that $\omega_{P}(p)=2$ for every $p\in{\mathcal{P}}_{P}$
with $p>K$ and $h_{1}(p)=0$ if $p\notin{\mathcal{P}}_{P}$ or $p>\sqrt{N}$, we
get

(5.8)
$|H_{N}(h_{1},K)-H^{\prime}_{N}(h_{1},Q,K)|\ll\sum_{K<p\leq\sqrt{N}}\frac{1}{p^{2}}+\frac{1}{\sqrt{N}}\leq\frac{1}{K}+\frac{1}{\sqrt{N}}.$

Hence, in order to prove (5.1), it suffices to estimate

(5.9)
${\mathbb{E}}_{m,n\in[N]}\big{|}h_{1}(P_{c}(Qm+a,Qn+b))-H^{\prime}_{N}(h_{1},Q,K)\big{|}^{2}$

and

(5.10)
${\mathbb{E}}_{m,n\in[N]}\big{|}h_{2}(P_{c}(Qm+a,Qn+b)\big{|}^{2}+|H_{N}(h_{2},K)|^{2}.$

First, we deal with the expression (5.9). Using (5.7) and expanding the square
below we get

(5.11)
${\mathbb{E}}_{m,n\in[N]}\,\big{|}h_{1}(P_{c}(Qm+a,Qn+b)-H^{\prime}_{N}(h_{1},Q,K)\big{|}^{2}=\\\
{\mathbb{E}}_{m,n\in[N]}\,\big{|}h_{1}(P_{c}(Qm+a,Qn+b)\big{|}^{2}-|H^{\prime}_{N}(h_{1},Q,K)|^{2}.$

To estimate this expression, first note that since $h_{1}$ is additive, even,
and $h_{1}(p^{k})=0$ for $k\geq 2$, we have

(5.12)
${\mathbb{E}}_{m,n\in[N]}\,\big{|}h_{1}(P_{c}(Qm+a,Qn+b))\big{|}^{2}={\mathbb{E}}_{m,n\in[N]}\,\Big{|}\sum_{p\,\mid\mid\,P_{c}(Qm+a,Qn+b)}h_{1}(p)\Big{|}^{2}.$

Expanding the square, using the fact that $h_{1}(p)=0$ unless
$K<p\leq\sqrt{N}$, and the definition of $w_{Q,N}(p,q)$ given in (4.18), we
get that the right side is equal to

$\sum_{K<p\leq\sqrt{N}}|h_{1}(p)|^{2}\cdot
w_{P,Q,N}(p,p)+\sum_{K<p,q\leq\sqrt{N},\,p\neq
q}h_{1}(p)\cdot\overline{h_{1}(q)}\cdot w_{P,Q,N}(p,q).$

Using the estimate (4.27) of Corollary 4.12, we get that the first term is at
most

$\sum_{K<p\leq\sqrt{N}}\frac{|h_{1}(p)|^{2}}{p}+O_{P}(N^{-1/2}).$

Using (4.28) of Corollary 4.12 we get that the second term is equal to
(crucially we use the bound $p,q\leq\sqrt{N}$ here and the prime number
theorem)

$\sum_{K<p,q\leq\sqrt{N},\,p\neq q}h_{1}(p)\cdot\overline{h_{1}(q)}\cdot
w_{P,Q,N}(p,p)\cdot w_{P,Q,N}(q,q)+O((\log{N})^{-2})\leq\\\
(H^{\prime}_{N}(h_{1},Q,K))^{2}+O((\log{N})^{-2}),$

where to get the last estimate we added to the sum the contribution of the
diagonal terms $p=q$ (which is non-negative), used (5.5), and the fact that
$h_{1}(p)=0$ for $p>\sqrt{N}$. Combining (5.11) with the previous estimates,
we are led to the bound

(5.13)
${\mathbb{E}}_{m,n\in[N]}\,\big{|}h_{1}(P_{c}(Qm+a,Qn+b)-H^{\prime}_{N}(h_{1},Q,K)\big{|}^{2}\ll_{P}\\\
{\mathbb{D}}^{2}(h_{1};K,\sqrt{N})+O((\log{N})^{-2}).$

Next we estimate the expression (5.10). Since $h_{2}$ is additive, even, and
satisfies the properties (i)-(iii), we get by using (5.12) (with $h_{2}$
instead of $h_{1}$) and expanding the square

${\mathbb{E}}_{m,n\in[N]}\,\big{|}h_{2}(P_{c}(Qm+a,Qn+b))\big{|}^{2}=\sum_{\sqrt{N}<p,q\leq
N}h_{2}(p)\,\overline{h_{2}(q)}\,w_{P,Q,N}(p,q).$

Since $h_{2}(p)\neq 0$ only when $p\in{\mathcal{P}}_{P}$ (by property (ii)),
using Lemma 4.15 for $k=1,2$, we get that the right side is bounded by

$\ll_{A,P,Q}\sum_{\sqrt{N}<p,q\leq
N}\frac{|h_{2}(p)|\,|h_{2}(q)|}{pq}+\sum_{\sqrt{N}<p\leq
N}\frac{|h_{2}(p)|^{2}}{p}=\\\ \Big{(}\sum_{\sqrt{N}<p\leq
N}\frac{|h_{2}(p)|}{p}\Big{)}^{2}+{\mathbb{D}}^{2}(h_{2};\sqrt{N},N)\ll\\\
\sum_{\sqrt{N}<p\leq N}\frac{|h_{2}(p)|^{2}}{p}\cdot\sum_{\sqrt{N}<p\leq
N}\frac{1}{p}+{\mathbb{D}}^{2}(h_{2};\sqrt{N},N)\ll{\mathbb{D}}^{2}(h_{2};\sqrt{N},N),$

where we used crucially the estimate

$\sum_{\sqrt{N}<p\leq N}\frac{1}{p}\ll 1.$

Similarly we find

$(H_{N}(h_{2},K))^{2}=4\,\Big{(}\sum_{\sqrt{N}<p\leq
N}\frac{|h_{2}(p)|}{p}\Big{)}^{2}\ll{\mathbb{D}}^{2}(h_{2};\sqrt{N},N).$

Combining the previous estimates, we get the following bound for the
expression in (5.10)

(5.14)
${\mathbb{E}}_{m,n\in[N]}\big{(}h_{2}(P_{c}(Qm+a,Qn+b)\big{)}^{2}+(H_{N}(h_{2},K))^{2}\ll_{A,P,Q}{\mathbb{D}}^{2}(h_{2};\sqrt{N},N).$

Combining the bounds (5.8), (5.13), (5.14), we get the asserted bound (5.1),
which completes the proof. ∎

###  5.2. Concentration estimates for multiplicative functions

Next we use Lemma 5.2 to get a variant that deals with multiplicative
functions.

######  Lemma 5.3.

Let $P\in{\mathbb{Z}}[m,n]$ be an irreducible binary quadratic form and
${\mathcal{P}}_{P}$ be as in (4.12), $A,K,N\in{\mathbb{N}}$,
$a,b\in{\mathbb{Z}}$ with $-A\leq a,b\leq A$, $c\in{\mathbb{N}}$ with
$c\mid(Q,P(a,b))$, and $f\colon\mathbb{Z}\to\mathbb{U}$ be an even
multiplicative function such that

  1. (i)

$f(p)=1$ for all primes $p\leq K$ and $p>N$;

  2. (ii)

$f(p)=1$ for all primes $p\notin{\mathcal{P}}_{P}$;

  3. (iii)

$f(p^{k})=1$ for all primes $p$ and $k\geq 2$.

Let also $Q=\prod_{p\leq K}p^{a_{p}}$ with $a_{p}\in{\mathbb{N}}$. Then there
exists $C_{A,P,Q}>0$ such that if $K$ is sufficiently large, depending only on
$P$, and $N$ is sufficiently large, depending only on $K$, we have

(5.15)
${\mathbb{E}}_{m,n\in[N]}\,\big{|}f\big{(}P_{c}(Qm+a,Qn+b)\big{)}-\exp\big{(}G_{N}(f,K)\big{)}\big{|}\ll_{P}\\\
({\mathbb{D}}+{\mathbb{D}}^{2})(f,1;K,\sqrt{N})+C_{A,P,Q}\cdot{\mathbb{D}}(f,1;\sqrt{N},N)+K^{-\frac{1}{2}},$

where $P_{c}:=P/c$, ${\mathbb{D}}$ is as in (5.3), and

(5.16) $G_{N}(f,K):=2\,\sum_{K<p\leq N}\,\frac{1}{p}\,(f(p)-1).$

###### Proof.

Henceforth, we take $K$ sufficiently large, depending only on $P$, so that it
exceeds all elements of the finite set $F^{\prime}$ considered in Corollary
4.12, and also so that Lemma 5.2 holds and $\omega_{P}(p)\leq 2$ for $p>K$.

Let $h:\mathbb{N}\to\mathbb{C}$ be the additive function given on prime powers
by

$h(p^{k}):=f(p^{k})-1,\quad k\in{\mathbb{N}}.$

Note that due to our assumptions on $f,$ the properties (i)-(iii) of Lemma 5.2
are satisfied.

Using that $z=e^{z-1}+O(|z-1|^{2})$ for $|z|\leq 1$ and property (iii), we
have

$\displaystyle
f(P_{c}(m,n))=\prod_{p^{k}\,\mid\mid\,P_{c}(m,n)}f(p^{k})=\prod_{p\,\mid\mid\,P_{c}(m,n)}\exp\big{(}h(p)+O(|h(p)|^{2})\big{)}.$

Applying the estimate $|\prod_{i\leq k}z_{i}-\prod_{i\leq
k}w_{i}|\leq\sum_{i\leq k}|z_{i}-w_{i}|$, we deduce that for all
$m,n\in{\mathbb{N}}$ we have

$\displaystyle
f(P_{c}(m,n))=\exp(h(P_{c}(m,n)))+O\Big{(}\sum_{p\,\mid\mid\,P_{c}(m,n)}|h(p)|^{2}\Big{)}.$

Using this and since $G_{N}(f,K)=H_{N}(h,K)$, where $H_{N}(h,K)$ is given by
(5.2), we get

(5.17)
${\mathbb{E}}_{m,n\in[N]}\,\big{|}f\big{(}P_{c}(Qm+a,Qn+b)\big{)}-\exp\big{(}G_{N}(f,K)\big{)}\big{|}\ll\\\
{\mathbb{E}}_{m,n\in[N]}|\exp\big{(}h(P_{c}(m,n))\big{)}-\exp(H_{N}(h,K))|+\\\
{\mathbb{E}}_{m,n\in[N]}\sum_{p\,\mid\mid\,P_{c}(m,n)}|h(p)|^{2},$

where the implicit constant is absolute. Next, we use the inequality
$|e^{z_{1}}-e^{z_{2}}|\leq|z_{1}-z_{2}|$, which holds for $\Re z_{1},\Re
z_{2}\leq 0$, to bound the last expression by

(5.18)
$\displaystyle{\mathbb{E}}_{m,n\in[N]}|h((P_{c}(Qm+a,Qn+b))-H_{N}(h,K)|+{\mathbb{E}}_{m,n\in[N]}\sum_{p\,\mid\mid\,P_{c}(Qm+a,Qn+b)}|h(p)|^{2}.$

To bound the first term in (5.18) we use Lemma 5.2. It gives that there exist
$C_{A,P,Q}>0$ such that for all sufficiently large $N$, depending only on $K$,
we have

(5.19)
${\mathbb{E}}_{m,n\in[N]}\,\big{|}h\big{(}P_{c}(Qm+a,Qn+b)\big{)}-H_{N}(h,K)\big{|}\ll_{P}\\\
{\mathbb{D}}(h;K,\sqrt{N})+C_{A,P,Q}\cdot{\mathbb{D}}(h;\sqrt{N},N)+K^{-\frac{1}{2}}\ll\\\
{\mathbb{D}}(f,1;K,\sqrt{N})+C_{A,P,Q}\cdot{\mathbb{D}}(f,1;\sqrt{N},N)+K^{-\frac{1}{2}},$

where for the last bound we used that $|h(p)|^{2}\leq 2-2\,\Re(f(p))$, which
holds since $|f(p)|\leq 1$. To bound the second term in (5.18), we note that
using the properties (i)-(iii) of Lemma 5.2, we have

(5.20)
${\mathbb{E}}_{m,n\in[N]}\sum_{p\,\mid\mid\,P_{c}(Qm+a,Qn+b)}|h(p)|^{2}=\sum_{K<p\leq
N}\ |h(p)|^{2}\,w_{P,Q,N}(p)\ll_{P}\\\ \\\ \sum_{K<p\leq
N}\frac{|h(p)|^{2}}{p}+O((\log{N})^{-1})\ll_{P}\mathbb{D}^{2}(f,1;K,N)+O((\log{N})^{-1}),$

where $w_{P,Q,N}(p)$ is as in (5.6) and we used equation (4.27) of Corollary
4.12 (which holds since $p>K$ implies $p\nmid Q$ and $p\notin F^{\prime}$),
the bound $\omega_{P}(p)\leq 2$ (which holds for $p>K$), and the prime number
theorem to get the first bound. Combining (5.17)-(5.20) we get the asserted
bound. ∎

We use the previous result to derive the following improved version.

######  Lemma 5.4.

Let $P\in{\mathbb{Z}}[m,n]$ be an irreducible binary quadratic form,
${\mathcal{P}}_{P}$ be as in (4.1), $A,K,N\in{\mathbb{N}}$, and
$f\colon\mathbb{N}\to\mathbb{U}$ be an even multiplicative function such that
$f(p)=1$ for all primes $p>N$ with $p\in{\mathcal{P}}_{P}$. Let also
$Q=\prod_{p\leq K}p^{a_{p}}$ with $a_{p}\in{\mathbb{N}}$. There exists
$C_{A,P,Q}>0$ such that if $K$ is sufficiently large, depending only on $P$,
and $N$ is sufficiently large, depending only on $K$, then for all
$a,b\in{\mathbb{Z}}$ with $-A\leq a,b\leq A$ and such that $\prod_{p\leq K}p$
divides $Q/c$ where $c:=(P(a,b),Q)$, we have

(5.21)
${\mathbb{E}}_{m,n\in[N]}\,\big{|}f\big{(}P_{c}(Qm+a,Qn+b)\big{)}-\exp\big{(}G_{P,N}(f,K)\big{)}\big{|}\ll_{P}\\\
({\mathbb{D}}_{P}+{\mathbb{D}}_{P}^{2})(f,1;K,\sqrt{N})+C_{A,P,Q}\cdot{\mathbb{D}}_{P}(f,1;\sqrt{N},N)+K^{-\frac{1}{2}},$

where

(5.22) $G_{P,N}(f,K):=\sum_{\begin{subarray}{c}K<p\leq
N\end{subarray}}\,\frac{\omega_{P}(p)}{p}\,(f(p)-1),$
${\mathbb{D}}_{P}(f,1;x,y)^{2}:=\sum_{\begin{subarray}{c}x<p\leq
y\end{subarray}}\frac{\omega_{P}(p)}{p}\,(1-\Re(f(p))).$

(Note that both sums are supported on the primes in ${\mathcal{P}}_{P}$ and
$\omega_{P}(p)=2$ for $p\in{\mathcal{P}}_{P}$ with $p>K$ as long as $K$ is
sufficiently large.)

###### Proof.

Let $P(m,n)=\alpha m^{2}+\beta mn+\gamma n^{2}$. Note that since $P$ is
irreducible we have $\alpha\neq 0$. We can assume that $K$ is greater than
$|\alpha|$ and that $\omega_{P}(p)\leq 2$ for all $p>K$; this holds as long as
$p$ does not divide the discriminant of $P$, which is nonzero since $P$ is
irreducible. We also assume that $K$ is sufficiently large for Lemma 5.3 to
hold.

First, we define the multiplicative function
$\tilde{f}\colon{\mathbb{N}}\to{\mathbb{U}}$ on prime powers as follows

$\tilde{f}(p^{k}):=\begin{cases}f(p^{k}),\quad&\text{if }\
p>K,\,k\in{\mathbb{N}}\\\ 1,\quad&\text{otherwise}\end{cases}.$

Since by assumption every prime $p\leq K$ divides $Q/c$ and since
$(P(a,b),Q)=c$, we have

(5.23) $p\nmid P_{c}(Qm+a,Qn+b)\text{ for every }p\leq K\text{ and
}m,n\in{\mathbb{N}}.$

Since $f$ is multiplicative we deduce that

$f(P_{c}(Qm+a,Qn+b))=\tilde{f}(P_{c}(Qm+a,Qn+b))\quad\text{for every
}m,n\in{\mathbb{N}}.$

Note also that $G_{P,N}(\tilde{f},Q)=G_{P,N}(f,Q)$ and
${\mathbb{D}}_{P}(\tilde{f},1;K,N)={\mathbb{D}}_{P}(f,1;K,N)$. It follows that
in order to establish (5.21), it is enough to show that there exist
$C_{A,P,Q}>0$ such that for all sufficiently large $N$, depending only on $A$
and $K$, we have

(5.24)
${\mathbb{E}}_{m,n\in[N]}|\tilde{f}(P_{c}(Qm+a,Qn+b))-\exp(G_{P,N}(\tilde{f},Q))|\ll_{P}\\\
({\mathbb{D}}_{P}+{\mathbb{D}}_{P}^{2})(\tilde{f},1;K,\sqrt{N})+C_{A,P,Q}\cdot{\mathbb{D}}_{P}(\tilde{f},1;\sqrt{N},N)+K^{-\frac{1}{2}}.$

In order to establish (5.24) we make a series of further reductions that will
eventually allow us to apply Lemma 5.3. By the definition of
${\mathcal{P}}_{P}$ (see (4.1)), for each $p\not\in{\mathcal{P}}_{P}$ that
does not divide $\alpha$ (recall that $K>|\alpha|$ so $p>K$ implies that
$p\nmid\alpha$), we have that $p\mid P(m,n)$ implies that $p\mid m$ and $p\mid
n$. Using this and (5.23), we get that the contribution to the average in
(5.24) of those $m,n\in[N]$ for which $P_{c}(Qm+a,Qn+b)$ is divisible by some
prime $p\not\in{\mathcal{P}}_{P}$ is

$\ll\frac{1}{N^{2}}\sum_{K<p\leq
N}\left[\frac{N}{p}\right]^{2}\ll\frac{1}{K},$

which is acceptable.

Next we show that the contribution to the average in (5.24) of those
$m,n\in[N]$ for which $P_{c}(Qm+a,Qn+b)$ is divisible by $p^{2}$ for some
prime $p\in{\mathcal{P}}_{P}$ with $p>K$ (hence $p\nmid Q$) is also
acceptable. Note that this contribution is maximized for $c=1$, hence it is
sufficient to check this for $c=1$, that is, for the polynomial $P$ instead of
$P_{c}$, assuming that $(P(a,b),Q)=1$. For fixed $n\in[N]$ such that $p\nmid
Qn+b$ there are at most $\omega_{P}(p^{2})\cdot([N/p^{2}]+1)$ values of
$m\in[N]$ such that $p^{2}\mid P(Qm+a,Qn+b).$ On the other hand, if $p>K$
satisfies $p\mid Qn+b$ and $p\mid P(Qm+a,Qn+b)$, then also $p\mid Qm+a$
(recall that $p>K$ implies that $p\nmid\alpha$). Since $P(n,1)$ is an
irreducible quadratic polynomial we have $\omega_{P}(p^{2})\leq 2$ for all but
finitely many $p\in{\mathbb{P}}$. So the contribution to the average in (5.24)
of those $m,n\in[N]$ for which $P(Qm+a,Qn+b)$ is divisible by $p^{2}$ for some
prime $p\in{\mathcal{P}}_{P}$ is bounded by (note again that our assumptions
imply that $P(Qm+a,Qn+b)$ is only divisible by primes $p>K$)

$\ll_{P}\frac{1}{N^{2}}\Big{(}\sum_{K<p\leq
N}\Big{(}\left[\frac{N}{p^{2}}\right]+1\Big{)}N+\sum_{K<p\leq
N}\left[\frac{N}{p}\right]^{2}\Big{)}\ll_{P}\frac{1}{K}+\frac{1}{\log{N}},$

where we used the prime number theorem to bound $\frac{1}{N}\sum_{K<p\leq
N}1$.

Combining the above reductions, we deduce that in order to establish the
estimate (5.24), we can further assume that

(5.25) $\tilde{f}(p^{k})=1\ \text{ for all }\ p\in{\mathbb{P}},\,k\geq 2,\
\text{ and }\ \tilde{f}(p^{k})=1\ \text{ for all }\
p\not\in{\mathcal{P}}_{P},\,k\in{\mathbb{N}}.$

We are now in a situation where Lemma 5.3 applies, giving that there exist
$C_{A,P,Q}>0$ such that for all sufficiently large $K$, depending only on $P$,
and all sufficiently large $N$, depending only on $K$, if
${\mathbb{D}}_{P}(f,1;K,N)\leq 1$, we have (note that (5.25) implies that
$\mathbb{D}_{P}(\tilde{f},1;K,N)=\mathbb{D}(\tilde{f},1;K,N)$ where
${\mathbb{D}}$ is as in (5.3))

${\mathbb{E}}_{m,n\in[N]}|\tilde{f}(P_{c}(Qm+a,Qn+b))-\exp(G_{P,N}(\tilde{f},K))|\ll_{P}\\\
({\mathbb{D}}_{P}+{\mathbb{D}}_{P}^{2})(\tilde{f},1;K,\sqrt{N})+C_{A,P,Q}\cdot{\mathbb{D}}_{P}(\tilde{f},1;\sqrt{N},N)+K^{-\frac{1}{2}}.$

Combining this bound with the bounds we got in order to arrive at this
reduction, we get that (5.24) is satisfied. This completes the proof. ∎

###  5.3. Proof of Proposition 4.8

We begin with some reductions. Assuming that the statement holds when $\chi=1$
and $t=0$, we will show that it holds for arbitrary $q$-periodic Dirichlet
character $\chi$ and $t\in\mathbb{R}$. Recall that $P_{c}=P/c$ where
$c=(P(a,b),Q)$ and by assumption $q\mid Q/c$. Let
$\tilde{f}:=f\cdot\overline{\chi}\cdot n^{-it}$, and apply the conclusion for
$\chi=1,t=0$. We get the following bound for $\tilde{f}$

(5.26)
${\mathbb{E}}_{m,n\in[N]}\,\big{|}\tilde{f}\big{(}P_{c}(Qm+a,Qn+b)\big{)}-\exp\big{(}G_{P,N}(\tilde{f},K)\big{)}\big{|}\ll_{P}\\\
({\mathbb{D}}_{P}+{\mathbb{D}}_{P}^{2})(f,1;K,\sqrt{N})+C_{P,Q}\cdot{\mathbb{D}}_{P}(f,1;N,C_{P,Q}N^{2})+C_{P,Q}\cdot{\mathbb{D}}_{P}(f,1;\sqrt{N},N)+K^{-1/2}.$

Note that since $\chi$ is $q$-periodic and $q$ divides $Q/c$, we have
$\chi(P_{c}(Qm+a,Qn+b))=\chi(P_{c}(a,b))$ for every $m,n\in{\mathbb{N}}$.
Furthermore, since $(P_{c}(a,b),Q)=1$ and $q\mid Q$, we have
$(P_{c}(a,b),q)=1$, so $|\chi(P_{c}(a,b))|=1$. Also,
$\lim_{m,n\to\infty}(P_{c}(Qm+a,Qn+b))^{it}-(P_{c}(Qm,Qn))^{it}=0$ and
${\mathbb{D}}_{P}(\tilde{f},1;x,y)={\mathbb{D}}_{P}(f,\chi\cdot n^{it};x,y)$.
Finally, note that

$G_{P,N}(\tilde{f},K)=\sum_{K<p\leq
N}\,\frac{\omega_{P}(p)}{p}\,(\tilde{f}(p)-1)=\sum_{K<p\leq
N}\,\frac{\omega_{P}(p)}{p}\,(f(p)\cdot\overline{\chi(p)}\cdot
n^{-it}-1)=G_{P,N}(f,K).$

After inserting this information into (5.26), we get that (4.17) is satisfied.

So it suffices to show that if $Q=\prod_{p\leq K}p^{a_{p}}$ for some
$a_{p}\in{\mathbb{N}}$, then there exists $C_{A,P,Q}>0$ such that if $N$ is
sufficiently large, depending only on $A,P,Q$, and
$\mathbb{D}_{P}(f,1;K,N)\leq 1$, we have

(5.27)
${\mathbb{E}}_{m,n\in[N]}\,\big{|}f\big{(}P_{c}(m,n)\big{)}-\exp\big{(}G_{P,N}(f,K)\big{)}\big{|}\ll_{P}\\\
({\mathbb{D}}_{P}+{\mathbb{D}}_{P}^{2})(f,1;K,\sqrt{N})+C_{A,P,Q}\cdot
D_{P}(f,1;N,C_{A,P,Q}N^{2})+C_{A,P,Q}\cdot{\mathbb{D}}_{P}(f,1;\sqrt{N},N)+K^{-1/2}.$

For every $N\in{\mathbb{N}}$ we decompose $f$ as $f=f_{N,1}\cdot f_{N,2}$,
where the multiplicative functions
$f_{N,1},f_{N,2}\colon{\mathbb{N}}\to{\mathbb{U}}$ are defined on prime powers
as follows

$\displaystyle f_{N,1}(p^{k}):=$
$\displaystyle\begin{cases}f(p),\quad&\text{if }\ k=1\text{ and
}p>N,\,p\in{\mathcal{P}}_{P}\\\ 1,\quad&\text{otherwise}\end{cases},$
$\displaystyle f_{N,2}(p^{k}):=$ $\displaystyle\begin{cases}1,\quad&\text{if
}\ k=1\text{ and }p>N,\,p\in{\mathcal{P}}_{P}\\\
f(p^{k}),\quad&\text{otherwise}\end{cases}.$

We first study the function $f_{N,1}$. Following the notation of Lemma 4.15
for $l,Q,N\in{\mathbb{N}}$ we let

$w^{*}_{P,Q,N}(l)=\frac{1}{N^{2}}\,\sum_{\begin{subarray}{c}m,n\in[N],\\\
l\mid P(Qm+a,Qn+b)\end{subarray}}1.$

We apply Lemma 4.15 for $k=1,2$. We get that if $l$ is a product of at most
two primes, then

(5.28) $w^{*}_{P,Q,N}(l)\ll_{A,P,Q}\frac{1}{l}.$

Since for $N$ sufficiently large, depending only on $A,P,Q$, we have
$f_{N,1}(P_{c}(Qm+a,Qn+b))-1\neq 0$ only if $P_{c}(Qm+a,Qn+b)$ is divisible by
one or two prime numbers $p>N$,999For $m,n\in[N]$ and $-A\leq a,b\leq A$ we
have $P(Qm+a,Qn+b)\ll_{A,P,Q}N^{2}$, so if $P(Qm+a,Qn+b)$ was divisible by
three or more primes greater than $N$, we would have $N^{3}\ll_{A,P,Q}N^{2}$,
which fails if $N$ is sufficiently large, depending only on $A$, $P$, $Q$.1
we get101010Note that for $N>c$ we have $f_{N,1}(c)=1$ so
$f_{N,1}\big{(}P_{c}(Qm+a,Qn+b)\big{)}=f_{N,1}\big{(}P(Qm+a,Qn+b)\big{)}$ for
those values of $N$.

(5.29)
${\mathbb{E}}_{m,n\in[N]}|f_{N,1}\big{(}P_{c}(Qm+a,Qn+b)\big{)}-1|\leq\\\
\sum_{\begin{subarray}{c}N<p\ll_{A,P,Q}N^{2},\\\
p\in{\mathcal{P}}_{P}\end{subarray}}|f(p)-1|\,w^{*}_{P,Q,N}(p)+\sum_{\begin{subarray}{c}N<p,q\ll_{A,P,Q}N^{2},\,p\neq
q\\\ p,q\in{\mathcal{P}}_{P}\end{subarray}}|f(pq)-1|\,w^{*}_{P,Q,N}(pq),$

where we have used that $f_{N,1}(p)=f(p)$ for all $p>N$ and in the second sum
we have ignored the contribution of the diagonal terms $p=q$ since, by
construction, $f_{N,1}(p^{2})=1$ for all primes $p$. Using (5.28) for
$l:=p\in{\mathcal{P}}_{P}$, we estimate the first term as
follows111111Bounding $w_{P,Q,N}(p)$ using (4.19) would lead to unacceptable
errors here, because the summation range is much larger than $N$.

$\sum_{\begin{subarray}{c}N<p\ll_{P}N^{2},\\\
p\in{\mathcal{P}}_{P}\end{subarray}}|f(p)-1|\,w^{*}_{P,Q,N}(p)\ll_{A,P,Q}\sum_{\begin{subarray}{c}N<p\ll_{A,P,Q}N^{2},\\\
p\in{\mathcal{P}}_{P}\end{subarray}}\frac{|f(p)-1|}{p}\ll\\\
\Big{(}\sum_{\begin{subarray}{c}N<p\ll_{A,P,Q}N^{2},\\\
p\in{\mathcal{P}}_{P}\end{subarray}}\frac{|f(p)-1|^{2}}{p}\Big{)}^{\frac{1}{2}}\cdot\Big{(}\sum_{\begin{subarray}{c}N<p\ll_{A,P,Q}N^{2},\\\
p\in{\mathcal{P}}_{P}\end{subarray}}\frac{1}{p}\Big{)}^{\frac{1}{2}}\ll_{A,P,Q}{\mathbb{D}}_{1}(f,1;N,O_{A,P,Q}(N^{2})),$

where we used that $\sum_{N\leq p\ll_{A,P,Q}N^{2}}\frac{1}{p}\ll_{A,P,Q}1$.
Similarly, using (5.28) for $l:=pq$ with $p,q\in{\mathcal{P}}_{P}$, we
estimate the second term in (5.29) as follows (note that since $p\neq q$, we
have $f(pq)=f(p)f(q)$)

$\sum_{\begin{subarray}{c}N<p,q\ll_{A,P,Q}N^{2},\,p\neq q,\\\
p,q\in{\mathcal{P}}_{P}\end{subarray}}|f(pq)-1|\,w_{N,Q}(pq)\ll_{A,P,Q}\sum_{\begin{subarray}{c}N<p,q\ll_{A,P,Q}N^{2},\\\
p,q\in{\mathcal{P}}_{P}\end{subarray}}\frac{|f(p)-1|+|f(q)-1|}{pq}\ll\\\
\Big{(}\sum_{\begin{subarray}{c}N<p,q\ll_{A,P,Q}N^{2},\\\
p,q\in{\mathcal{P}}_{P}\end{subarray}}\frac{|f(p)-1|^{2}}{pq}\Big{)}^{\frac{1}{2}}\cdot\Big{(}\sum_{\begin{subarray}{c}N<p,q\ll_{A,P,Q}N^{2},\\\
p,q\in{\mathcal{P}}_{P}\end{subarray}}\frac{1}{pq}\Big{)}^{\frac{1}{2}}\ll_{A,P,Q}\mathbb{D}_{1}(f,1;N,O_{A,P,Q}(N^{2})),$

where we used that $\sum_{N\leq p\ll_{A,P,Q}N^{2}}\frac{1}{p}\ll_{A,P,Q}1$.
Combining the above estimates and (5.29), we deduce that for $N\gg_{P,Q}1$ we
have

(5.30)
$\mathbb{E}_{m,n\in[N]}\big{|}f_{N,1}\big{(}P_{c}(Qm+a,Qn+b)\big{)}-1|\ll_{A,P,Q}\mathbb{D}_{P}(f,1;N,O_{A,P,Q}(N^{2})).$

Next, we move to the function $f_{2}$. Since $f_{2}(p)=1$ for all primes
$p\geq N$, Lemma 5.4 applies. We get that if $N$ is sufficiently large,
depending only on $A$ and $K$, we have

(5.31)
$\mathbb{E}_{m,n\in[N]}|f_{N,2}\big{(}P_{c}(Qm+a,Qn+b)\big{)}-\exp(G_{P,N}(f,K))|\ll_{P}\\\
({\mathbb{D}}_{P}+{\mathbb{D}}_{P}^{2})(f,1;K,\sqrt{N})+O_{A,P,Q}({\mathbb{D}}_{P}(f,1;\sqrt{N},N))+K^{-\frac{1}{2}},$

where we used that $f_{N,2}(p)=f(p)$ for all primes $p\in{\mathcal{P}}_{P}$
with $p\leq N$, hence we have $G_{P,N}(f_{N,2},K)=G_{P,N}(f,K)$ and
$\mathbb{D}_{P}(f_{N,2},1;K,N)=\mathbb{D}_{P}(f,1;K,N)$.

Finally, since $f=f_{N,1}\cdot f_{N,2}$, using the triangle inequality and
combining (5.30) and (5.31), we get that the left side in (5.27) is bounded by

$\mathbb{E}_{m,n\in[N]}\big{(}|f_{N,1}\big{(}P_{c}(Qm+a,Qn+b)\big{)}-1|+|f_{N,2}\big{(}P_{c}(Qm+a,Qn+b)\big{)}-\exp(G_{P,N}(f,K))|\big{)}\\\
\ll_{P}({\mathbb{D}}_{P}+{\mathbb{D}}_{P}^{2})(f,1;K,\sqrt{N})+C_{A,P,Q}\cdot\mathbb{D}_{P}(f,1;N,C_{A,P,Q}N^{2})+\\\
C_{A,P,Q}\cdot{\mathbb{D}}_{P}(f,1;\sqrt{N},N)+K^{-1/2}$

for some $C_{A,P,Q}>0$. Thus (5.27) holds, completing the proof.

##  6\. Proof of partition regularity results

Our main goal in this section is to complete the proof Theorem 2.6. As
explained in Section 2.1, it remains to prove Propositions 2.7 and 2.8. We
devote the rest of this section to this task.

###  6.1. Some elementary facts

We will use the following fact from [11, Lemma 3.1].

######  Lemma 6.1.

Let $a\colon{\mathbb{Z}}\to{\mathbb{U}}$ be an even sequence and
$l_{1},l_{2}\in{\mathbb{Z}}$, not both of them $0$. Suppose that for some
$\varepsilon>0$ and for some sequence $L_{N}\colon{\mathbb{N}}\to{\mathbb{U}}$
we have

$\limsup_{N\to\infty}{\mathbb{E}}_{n\in[N]}|a(n)-L_{N}|\leq\varepsilon.$

Then

$\limsup_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}|a(l_{1}m+l_{2}n)-L_{lN}|\leq
2l\cdot\varepsilon,$

where $l:=|l_{1}|+|l_{2}|$.

We will also use the following simple result from [11, Lemma 3.2].

######  Lemma 6.2.

Let $(\Phi_{K})$ be a multiplicative Følner sequence. If
$f\colon{\mathbb{N}}\to{\mathbb{U}}$ is a completely multiplicative function
and $f\neq 1$, then

$\lim_{K\to\infty}{\mathbb{E}}_{n\in\Phi_{K}}\,f(n)=0.$

###  6.2. A Borel measurability result

Recall that if $f$ is pretentious, then there exist a unique
$t=t_{f}\in{\mathbb{R}}$ and a Dirichlet character $\chi$ such that
$f\sim\chi\cdot n^{it}$. Similarly, if $P$ is an irreducible binary quadratic
form and $f$ is $P$-pretentious, then it follows from Lemma 4.5 that there
exist a unique $t=t_{f}\in{\mathbb{R}}$ and a Dirichlet character $\chi$ such
that $f\sim_{P}\chi\cdot n^{it}$ and also $t_{f}$ does not depend on the
irreducible binary quadratic form $P$, as long as $f$ is $P$-pretentious.

######  Lemma 6.3.

Let $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ be irreducible binary quadratic forms.
Then

  1. (i)

The sets ${\mathcal{M}}_{p}$ and ${\mathcal{M}}_{p,P_{1},P_{2}}$, defined in
(2.8) and (2.9), respectively, are Borel subsets of ${\mathcal{M}}$.

  2. (ii)

The maps $f\mapsto t_{f}$ from ${\mathcal{M}}_{p}$ to ${\mathbb{R}}$ and from
${\mathcal{M}}_{p,P_{1},P_{2}}$ to ${\mathbb{R}}$ are Borel measurable.

###### Proof.

Both parts were proved for the set ${\mathcal{M}}_{p}$ in [11, Lemma 3.6].
Thus, we deal only with the results related to
${\mathcal{M}}_{p,P_{1},P_{2}}$.

Note, that we are not able to show directly that
${\mathcal{M}}_{p,P_{1},P_{2}}$ is Borel (as we did for ${\mathcal{M}}_{p}$ in
[11, Lemma 3.6]), because we do not have a convenient characterization for
this set that depends on countably many conditions. So we take a different
approach and first establish a variant of property (ii).

We show that the following map is Borel: $f\mapsto t_{f}$ from ${\mathcal{M}}$
to ${\mathbb{R}}\cup\\{\infty\\}$ ($\infty$ is just an isolated point added to
${\mathbb{R}}$), which maps $f$ to $\infty$ if $f$ is not $P_{1}$-pretentious
or $f$ is not $P_{2}$-pretentious, and otherwise maps $f$ to the unique
$t_{f}\in{\mathbb{R}}$ for which $f\sim_{P_{j}}\chi_{j}\cdot n^{it_{f}}$,
$j=1,2$, for some Dirichlet character $\chi_{j}$. By [18, Theorem 14.12], it
suffices to show that the graph

$\Gamma:=\\{(f,t_{f})\in{\mathcal{M}}\times({\mathbb{R}}\cup\\{\infty\\})\\}$

is a Borel subset of ${\mathcal{M}}\times({\mathbb{R}}\cup\\{\infty\\})$. If
$\chi_{k}$, $k\in{\mathbb{N}}$, is an enumeration of all Dirichlet characters,
and for $k_{1},k_{2}\in{\mathbb{N}}$ we let

$\Gamma_{k_{1},k_{2}}:=\\{(f,t_{f})\in{\mathcal{M}}\times({\mathbb{R}}\cup\\{\infty\\})\colon
f\sim_{P_{j}}\chi_{k_{j}}\cdot n^{it_{f}}\text{ for }j=1,2\\},$

and

$\Gamma_{\infty}=\\{(f,\infty)\colon f\text{ is not }P_{j}\text{-pretentious
for }j=1\text{ or }2\\},$

then

$\Gamma=\cup_{k_{1},k_{2}\in{\mathbb{N}}}\Gamma_{k_{1},k_{2}}\cup\Gamma_{\infty}.$

Therefore, it suffices to show that for the sets $\Gamma_{\infty}$ and
$\Gamma_{k_{1},k_{2}}$, $k_{1},k_{2}\in{\mathbb{N}},$ are Borel. Note that for
$k_{1},k_{2}\in{\mathbb{N}}$ we have

$\Gamma_{k_{1},k_{2}}:=\\{(f,t)\in{\mathcal{M}}\times{\mathbb{R}}\colon{\mathbb{D}}_{P_{j}}(f,\chi_{k_{j}}\cdot
n^{it})<\infty\text{ for }j=1,2\\}$

and

$\Gamma_{\infty}:=\\{(f,t)\in{\mathcal{M}}\times\\{+\infty\\}\colon\text{for
}j=1\text{ or }2\text{ we have }\\\ {\mathbb{D}}_{P_{j}}(f,\chi_{k}\cdot
n^{it})=\infty\text{ for every }t\in{\mathbb{R}},k\in{\mathbb{N}}\\}.$

It easily follows from the definition of the distance ${\mathbb{D}}_{P}$ that
for $k\in{\mathbb{N}}$ and $j=1,2$ the map
$(f,t)\mapsto{\mathbb{D}}_{P_{j}}(f,\chi_{k}\cdot n^{it})$ is Borel. Hence,
the sets $\Gamma_{\infty}$ and $\Gamma_{k_{1},k_{2}}$,
$k_{1},k_{2}\in{\mathbb{N}},$ are Borel.

Now it follows that ${\mathcal{M}}_{p,P_{1},P_{2}}=\\{f\in{\mathcal{M}}\colon
t_{f}\neq\infty\\}$ is Borel and the map $t\mapsto t_{f}$ from
${\mathcal{M}}_{p,P_{1},P_{2}}$ to ${\mathbb{R}}$ is Borel. This completes the
proof. ∎

###  6.3. Some useful weights

In the proof of Theorems 1.2 and 1.7 we utilize weighted averages. The weights
are used to ensure that the averages $L_{\delta,N}(f,Q;a,b)$, as in (2.3),
have a positive real part if $f$ is an Archimedean character and $\delta$ is
sufficiently small.

We now introduce these weights. If $\delta\in(0,1/2)$, we consider the
circular arc with center $1$ given by

$I_{\delta}:=\\{e(\phi)\colon\phi\in(-\delta,\delta)\\}.$

######  Lemma 6.4.

Let $P_{1},P_{2}\in{\mathbb{Z}}[m,n]$ be homogeneous polynomials of the same
degree without common linear factors such that the leading coefficients of the
polynomials $P_{1}(m,1)$, $P_{2}(m,1)$ are positive. Suppose that at least one
of the following two conditions holds

  1. (a)

$P_{1}$ or $P_{2}$ is reducible;

  2. (b)

the leading coefficients of the polynomials $P_{1}(m,1)$, $P_{2}(m,1)$
coincide.

Furthermore, for every $\delta\in(0,1/2)$ let
$F_{\delta}\colon\mathbb{S}^{1}\to[0,1]$ be the trapezoidal function that is
equal to $1$ on the arc $I_{\delta/2}$ and $0$ outside the arc $I_{\delta},$
and

(6.1)
$w_{\delta,P_{1},P_{2}}(m,n):=F_{\delta}\big{(}(P_{1}(m,n))^{i}\cdot(P_{2}(m,n))^{-i}\big{)}\cdot{\bf
1}_{P_{j}(m,n)>0,j=1,2},\quad m,n\in{\mathbb{N}}.$

Then for every $\delta>0$ and $a,b\in{\mathbb{Z}}_{+}$ we have

$\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}\,w_{\delta,P_{1},P_{2}}(m,n)>0.$

###### Proof.

Using the fact that the polynomials $P_{1},P_{2}$ are homogeneous and have the
same degree, we get that the limit we want to evaluate is equal to

$\lim_{N\to\infty}{\mathbb{E}}_{m,n\in[N]}\,F_{\delta}\big{(}(P_{1}(m/N_{N},n/N))^{i}\cdot(P_{2}(m/N,n/N))^{-i}\big{)}\cdot{\bf
1}_{P_{j}(m/N,n/N)>0,j=1,2}.$

Let $\tilde{F}_{\delta}\colon[0,1]\times[0,1]\to[0,1]$ be given by

$\tilde{F}_{\delta}(x,y):=F_{\delta}\big{(}(P_{1}(x,y))^{i}\cdot(P_{2}(x,y))^{-i}\big{)}\cdot{\bf
1}_{P_{j}(x,y)>0,j=1,2},\quad x,y\in[0,1].$

Then $\tilde{F}_{\delta}$ is Riemann integrable on $[0,1]\times[0,1]$ since it
is bounded and continuous except for a set of Lebesgue measure $0$. Therefore,
the limit we want to compute exists and is equal to the Riemann integral

$\int_{0}^{1}\int_{0}^{1}\tilde{F}_{\delta}(x,y)\,dx\,dy.$

Since $\tilde{F}_{\delta}$ is non-negative, in order to show that the integral
is positive, it suffices to show that $\tilde{F}_{\delta}$ is non-negative and
does not vanish almost everywhere.

Suppose that we are in case $(a)$. For $j=1,2$ let