1 Introduction

The study of moments of families L-functions is a central theme in analytic number theory. These moments are connected to the famous Lindelöf hypothesis for such L-functions and have many applications in analytic number theory. It is a very challenging problem to establish asymptotic formulas for higher moments of families of L-functions and until now we only have asymptotic formulas for the first few moments of any given family of L-functions. However, we do have precise conjectures for higher moments of families of L-functions due to the work of many mathematicians (see for example [2] and [3]). In this paper the focus is on the moments of Dirichlet L-functions associated to primitive Dirichlet characters.

In 1981, Heath-Brown [4] proved that

$$\begin{aligned} \mathop {\mathop {\sum }\nolimits ^{*}}\limits _{\chi {{\,\mathrm{mod}\,}}q} \Big |L \Big ( \frac{1}{2} , \chi \Big ) \Big |^4 = \frac{1}{2 \pi ^2} \phi ^* (q) \prod _{p \mid q} \frac{(1-p^{-1})^3}{(1+p^{-1})} (\log q)^4 + O \big ( 2^{\omega (q)} q (\log q)^3 \big ) , \end{aligned}$$
(1)

where for all positive integers q, \({\sum ^{*}_{\chi {{\,\mathrm{mod}\,}}q}}\) represents a summation over all primitive Dirichlet characters of modulus q, \(\phi ^* (q)\) is the number of primitive characters of modulus q, and \(\omega (q)\) is the number of distinct prime divisors of q and \(L ( s , \chi )\) is the associated Dirichlet L-function.

In the equation above (1), in order to ensure that the error term is of lower order than the main term, we must restrict q to

$$\begin{aligned} \omega (q) \le \frac{\log \log q - 7 \log \log \log q }{\log 2} . \end{aligned}$$

Soundararajan [8] addressed this by proving that

$$\begin{aligned}&\mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}q} \Big |L \Big ( \frac{1}{2} , \chi \Big ) \Big |^4 = \frac{1}{2 \pi ^2} \phi ^* (q) \prod _{p \mid q} \frac{(1-p^{-1})^3}{(1+p^{-1})} (\log q)^4\\&\quad \bigg ( 1 + O \Big ( \frac{\omega (q)}{\log q} \sqrt{\frac{q}{\phi (q)}} \Big ) \bigg ) + O \big ( q (\log q)^{\frac{7}{2}} \big ) . \end{aligned}$$

Here, the error terms are of lower order than the main term without the need to have any restriction on q.

In a breakthrough paper, Young [11] obtained explicit lower order terms for the case where q is an odd prime and was able to establish the full polynomial expansion for the fourth moment of the associated Dirichlet L-functions. In other words, he proved that

$$\begin{aligned} \frac{1}{\phi ^* (q)} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}q} \Big |L \Big ( \frac{1}{2} , \chi \Big ) \Big |^4 = \sum _{i=0}^{4} c_i (\log q)^i + O \big ( q^{-\frac{5}{512} + \epsilon } \big ) , \end{aligned}$$

where the constants \(c_i\) are computable. The error term was subsequently improved by Blomer et al. [1] who proved that

$$\begin{aligned} \frac{1}{\phi ^* (q)} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}q} \Big |L \Big ( \frac{1}{2} , \chi \Big ) \Big |^4 = \sum _{i=0}^{4} c_i (\log q)^i + O_{\epsilon } \big ( q^{-\frac{1}{32} + \epsilon } \big ) . \end{aligned}$$

In the function field setting Tamam [9] established that

$$\begin{aligned} \frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \Big |L \Big ( \frac{1}{2} , \chi \Big ) \Big |^2 = {{\,\mathrm{deg}\,}}Q + \frac{1}{(q^{\frac{1}{2}} -1)^2} \bigg ( 1 - \frac{2}{|Q |^{\frac{1}{2}} +1} \bigg ) \end{aligned}$$

and

$$\begin{aligned} \frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \Big |L \Big ( \frac{1}{2} , \chi \Big ) \Big |^4 = \frac{q-1}{12q} ({{\,\mathrm{deg}\,}}Q)^4 + O\big ( ({{\,\mathrm{deg}\,}}Q)^3 \big ) \end{aligned}$$

as \({{\,\mathrm{deg}\,}}Q \rightarrow \infty \). Here, Q is an irreducible, monic polynomial in \({\mathbb {F}}_{q}[T]\) with \({\mathbb {F}}_{q}\) a finite field with q elements; \(\chi _0\) is the trivial character (in this case, of modulus Q); and, for non-trivial characters of modulus Q,

$$\begin{aligned} L \Big ( \frac{1}{2} , \chi \Big ) = \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A < {{\,\mathrm{deg}\,}}Q \end{array}} \frac{\chi (A)}{|A |^{\frac{1}{2}}} , \end{aligned}$$

where \({\mathcal {M}}\) is the set of monic polynomials \({\mathbb {F}}_{q}[T]\).

In this paper we prove the function field analogue of Soundararajan’s fourth moment result, which is also an extension of Tamam’s fourth moment result. In order to accomplish this we prove, along the way, a function field analogue of a special case of Shiu’s Brun–Titchmarsh theorem for multiplicative functions [7]. We also obtain an asymptotic main term for the second moment. This generalises Tamam’s result in that her result is for all primitive characters of prime modulus, whereas our result is for primitive characters of any modulus. Note, however, that Tamam’s result is exact. By considering only square-full moduli, we also obtain an exact formula.

2 Notation and statement of results

Let \(q \in {\mathbb {N}}\) be a prime-power, not equal to 2. We denote the finite field of order q by \({\mathbb {F}}_q\). We denote the ring of polynomials over the finite field \({\mathbb {F}}_q\) by \({\mathcal {A}} := {\mathbb {F}}_q [T]\). Unless otherwise stated, for a subset \({\mathcal {S}} \subset {\mathcal {A}}\) we define \({\mathcal {S}}_n := \{ A \in {\mathcal {S}} : {{\,\mathrm{deg}\,}}A = n \}\). We identify \({\mathcal {A}}_0\) with \({\mathbb {F}}_q\). Also, if we have some non-negative real number x, then range \({{\,\mathrm{deg}\,}}A \le x\) is not taken to include the polynomial \(A=0\).

The norm of \(A \in {\mathcal {A}} \backslash \{ 0\}\) is defined by \(|A |:= q^{{{\,\mathrm{deg}\,}}A}\), and for the zero polynomial we define \(|0 |:= 0\).

We denote the set of monic polynomials in \({\mathcal {A}}\) by \({\mathcal {M}}\). For \(a \in {\mathbb {F}}_q^*\) we denote the set of polynomials, with leading coefficient equal to a, by \(a {\mathcal {M}}\). Because \({\mathcal {A}}\) is an integral domain, an element is prime if and only if it is irreducible. We denote the set of prime monic polynomials in \({\mathcal {A}}\) by \({\mathcal {P}}\), and all references to primes (or irreducibles) in the function field setting are taken as being monic primes. Also, when indexing, the upper-case letter P always refers to a monic prime. Furthermore, if we range over polynomials E that divide some polynomial F, then these E are taken to be the monic divisors only.

Suppose \(f,g: {\mathfrak {D}} \longrightarrow {\mathbb {C}}\) are functions from the domain \({\mathfrak {D}}\) to the complex numbers, where either \({\mathfrak {D}} \subseteq {\mathcal {A}}\) or \({\mathfrak {D}} \subseteq {\mathbb {C}}\), and f and/or g may be dependent on q. We take \(f(x) = O\big ( g(x) \big )\) to mean: There exists a positive constant c such that for all q and all \(x \in {\mathfrak {D}}\) we have \(|f (x) |\le c |g(x) |\). Now suppose that we have some variable \(\epsilon \) (not equal to the variable q) taking values in a set \({\mathfrak {E}}\), which f and/or g may depend on. Then, we take \(f(x) = O_{\epsilon }\big ( g(x) \big )\) to mean: For each \(\epsilon \in {\mathfrak {E}}\), there exists a positive constant \(c_{\epsilon }\) such that for all q and all \(x \in {\mathfrak {D}}\) we have \(|f (x) |\le c_{\epsilon } |g(x) |\). We take \(f(x) \ll g(x)\) and \(g(x) \gg f(x)\) to mean \(f(x) = O\big ( g(x) \big )\), and we take \(f(x) \asymp g(x)\) to mean that both \(f(x) \ll g(x)\) and \(f(x) \gg g(x)\) hold. Similarly, we take \(f(x) \ll _{\epsilon } g(x)\) and \(g(x) \gg _{\epsilon } f(x)\) to mean \(f(x) = O_{\epsilon } \big ( g(x) \big )\).

Definition 2.1

(Dirichlet Characters) Let \(R \in {\mathcal {M}}\). A Dirichlet character on \({\mathcal {A}}\) with modulus R is a function \(\chi : {\mathcal {A}} \longrightarrow {\mathbb {C}}^*\) satisfying the following properties. For all \(A,B \in {\mathcal {A}}\):

  1. 1.

    \(\chi (AB) = \chi (A) \chi (B)\);

  2. 2.

    If \(A \equiv B ({{\,\mathrm{mod}\,}}R)\), then \(\chi (A) = \chi (B)\);

  3. 3.

    \(\chi (A) = 0\) if and only if \((A,R) \ne 1\).

Due to point 2, we can view a character \(\chi \) of modulus R as a function on \({\mathcal {A}} \backslash R {\mathcal {A}}\). This makes expressions such as \(\chi (A^{-1})\) well-defined for \(A \in \big ( {\mathcal {A}} \backslash R {\mathcal {A}} \big )^*\).

We can deduce that \(\chi (1) =1\) and \(|\chi (A) |=1\) when \((A,R)=1\). We say that \(\chi \) is the trivial character of modulus R if \( \chi (A) =1\) when \((A,R)=1\), and this is denoted by \(\chi _0\). Otherwise, we say that \(\chi \) is non-trivial. Also, there is only one character of modulus 1 and it simply maps all \(A \in {\mathcal {A}}\) to 1.

It can easily be seen that the set of characters of a fixed modulus R forms an abelian group under multiplication. The identity element is \(\chi _0\). The inverse of \(\chi \) is \(\overline{\chi }\), which is defined by \(\overline{\chi }(A) = \overline{\chi (A)}\) for all \(A \in {\mathcal {A}}\). It can be shown that the number of characters of modulus R is \(\phi (R)\).

A character \(\chi \) is said to be even if \(\chi (a) = 1\) for all \(a \in {\mathbb {F}}_q^*\). Otherwise, we say that it is odd. The set of even characters of modulus R is a subgroup of the set of all characters of modulus R. It can be shown that there are \(\frac{1}{q-1} \phi (R)\) elements in this group.

Definition 2.2

(Primitive Character) Let \(R \in {\mathcal {M}}\), \(S \mid R\) and \(\chi \) be a character of modulus R. We say that S is an induced modulus of \(\chi \) if there exists a character \(\chi _1\) of modulus S such that

$$\begin{aligned} \chi (A) ={\left\{ \begin{array}{ll} \chi _1 (A) &{}\text { if }(A,R)=1 \\ 0 &{}\text { otherwise} . \end{array}\right. } \end{aligned}$$

\(\chi \) is said to be primitive if there is no induced modulus of strictly smaller norm than R. Otherwise, \(\chi \) is said to be non-primitive. \(\phi ^* (R)\) denotes the number of primitive characters of modulus R.

We note that all trivial characters of some modulus \(R \ne 1\) are non-primitive as they are induced by the character of modulus 1. We also note that if R is prime, then the only non-primitive character of modulus R is the trivial character of modulus R. We denote a sum over primitive characters of modulus R by the standard notation .

Definition 2.3

(Dirichlet L-functions) Let \(\chi \) be a Dirichlet character. The associated L-function, \(L(s,\chi )\), is defined for \({\text {Re}}(s) > 1\) by

$$\begin{aligned} L(s,\chi ) := \sum _{A \in {\mathcal {M}}} \frac{\chi (A)}{|A |^s} . \end{aligned}$$

This has an analytic continuation to either \({\mathbb {C}}\) or \({\mathbb {C}} \backslash \{ 1 \}\), depending on the character.

In this paper, we will prove the following three main results.

Theorem 2.4

Let \(R \in {\mathcal {M}}\). Then,

$$\begin{aligned} \frac{1}{\phi ^* (R)} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \Big |L \Big ( \frac{1}{2}, \chi \Big ) \Big |^2 = \frac{\phi (R)}{|R |} {{\,\mathrm{deg}\,}}R + O \big ( \log \omega (R) \big ) \end{aligned}$$

Theorem 2.5

Let R be a square-full polynomial. That is, if \(P \mid R\) then \(P^2 \mid R\). Then,

$$\begin{aligned}&\mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \Big |L \Big ( \frac{1}{2}, \chi \Big ) \Big |^2\\&\quad = \frac{\phi (R)^3}{|R |^2} {{\,\mathrm{deg}\,}}R + \frac{1}{\big ( q^{\frac{1}{2}} -1 \big )^2} \bigg ( - \frac{\phi (R)^3}{|R |^2} + 2 \frac{\phi (R)}{|R |^{\frac{1}{2}}} \prod _{P \mid R} \Big (1-\frac{1}{|P |^{\frac{1}{2}}} \Big )^2 \bigg ) . \end{aligned}$$

Theorem 2.6

Let \(R \in {\mathcal {M}}\). Then,

$$\begin{aligned} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \Big |L \Big ( \frac{1}{2} , \chi \Big ) \Big |^4 =&\frac{1-q^{-1}}{12} \phi ^* (R) \prod _{\begin{array}{c} P \text { prime} \\ P \mid R \end{array}} \bigg ( \frac{ \big ( 1 - |P |^{-1} \big )^3}{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^4 \Bigg ( 1 + O \bigg ( \sqrt{\frac{\omega (R)}{{{\,\mathrm{deg}\,}}R}}\bigg ) \Bigg ) . \end{aligned}$$

Furthermore, in order to prove Theorem 2.6 we are required to prove a specific case of the function field analogue of Shiu’s generalised Brun–Titchmarsh theorem. This allows us to estimate sums of the form

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X) < y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \end{array}} d(N) \end{aligned}$$

given certain conditions on \(X,A,G \in {\mathcal {M}}\) and \(y \ge 0\).

3 Function field background

We provide some definitions and results relating to function fields that are needed in this paper. Many of these results are well known and so we do not provide a proof. Some proofs can be found in Rosen’s book [6], particularly chapter 4.

Definition 3.1

(Möbius Function) We define the Möbius function, \(\mu \), multiplicatively by \(\mu (P) =-1\) and \(\mu (P^e) =0\) for all primes \(P \in {\mathcal {A}}\) and all integers \(e \ge 2\).

Definition 3.2

(\(\omega \) Function) For all \(R \in {\mathcal {A}} \backslash \{ 0 \}\) we define \(\omega (R)\) to be the number of distinct prime factors of R.

Definition 3.3

(\(\varOmega \) Function) For all \(R \in {\mathcal {A}} \backslash \{ 0 \}\) we define \(\varOmega (R)\) to be the total number of prime factors of R (i.e. counting multiplicity).

Definition 3.4

(\(\phi \) Function) For \(R \in {\mathcal {A}}\) with \({{\,\mathrm{deg}\,}}R =0\) we define \(\phi (R) := 1\), and for \(R \in {\mathcal {A}}\) with \({{\,\mathrm{deg}\,}}R \ge 1\) we define

$$\begin{aligned} \phi (R) := \# \{ A \in {\mathcal {A}} : {{\,\mathrm{deg}\,}}A < {{\,\mathrm{deg}\,}}R , (A,R)=1 \} . \end{aligned}$$

It is not hard to show that

$$\begin{aligned} \phi (R) = |R |\prod _{P \mid R} (1 - |P |^{-1}) . \end{aligned}$$

Definition 3.5

For all \(R \in {\mathcal {A}}\) with \({{\,\mathrm{deg}\,}}R \ge 1\) we define \(p_{-} (R)\) to be the largest positive integer such that if \(P \mid R\) then \({{\,\mathrm{deg}\,}}P \ge p_{-} (R)\). Similarly, we define \(p_{+} (R)\) to be the smallest positive integer such that if \(P \mid R\) then \({{\,\mathrm{deg}\,}}P \le p_{+} (R)\).

Lemma 3.6

(Orthogonality Relations) Let \(R \in {\mathcal {M}}\). Then,

$$\begin{aligned} \sum _{\chi {{\,\mathrm{mod}\,}}R } \chi (A) \overline{\chi }(B) = {\left\{ \begin{array}{ll} \phi (R) &{}\text { if }(AB,R)=1\text { and }A \equiv B ({{\,\mathrm{mod}\,}}R) \\ 0 &{}\text { otherwise.} \end{array}\right. } \end{aligned}$$

and

$$\begin{aligned} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}R \\ \chi \text { even} \end{array}} \chi (A) \overline{\chi }(B) = {\left\{ \begin{array}{ll} \frac{1}{q-1} \phi (R) &{}\text { if }(AB,R)=1\text { and }A \equiv aB ({{\,\mathrm{mod}\,}}R)\text { for some }a \in {{\mathbb {F}}_q}^* \\ 0 &{}\text { otherwise.} \end{array}\right. } \end{aligned}$$

Lemma 3.7

Let \(R \in {\mathcal {M}}\) and let \(A,B \in {\mathcal {A}}\). Then,

$$\begin{aligned} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \chi (A) {\tilde{\chi }} (B) = {\left\{ \begin{array}{ll} \sum _{\begin{array}{c} EF = R \\ F \mid (A-B) \end{array}} \mu (E) \phi (F) &{}\text { if }(AB,R)=1\\ 0 &{}\text { otherwise} \end{array}\right. } \end{aligned}$$

and

$$\begin{aligned} \mathop {\mathop {\sum }\nolimits ^{*}}_{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}R \\ \chi \text { even} \end{array}} \chi (A) {\tilde{\chi }} (B) = {\left\{ \begin{array}{ll} \frac{1}{q-1} \sum _{\begin{array}{c} EF = R \\ F \mid (A-aB) \\ a \in {\mathbb {F}}_q^* \end{array}} \mu (E) \phi (F) &{}\text { if }(AB,R)=1\\ 0 &{}\text { otherwise} \end{array}\right. } . \end{aligned}$$

Proof

The case where \((AB,R) \ne 1\) is trivial. So, suppose \((AB,R)=1\). We have that

$$\begin{aligned} \sum _{\chi {{\,\mathrm{mod}\,}}R} \chi (A) {\tilde{\chi }} (B) = \sum _{EF=R} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}E} \chi (A) {\tilde{\chi }} (B) . \end{aligned}$$
(2)

Recall the Möbius inversion formula tells us that if gf are functions on \({\mathcal {M}}\) satisfying

$$\begin{aligned} g(R) = \sum _{EF=R} f(E) \end{aligned}$$

for all \(R \in {\mathcal {M}}\), then

$$\begin{aligned} f(R) = \sum _{EF=R} \mu (E) g(F) \end{aligned}$$

for all \(R \in {\mathcal {M}}\). By applying this to (2) and making use of Lemma 3.6 we obtain the first result. The second result follows similarly to the first. \(\square \)

Corollary 3.8

For all \(R \in {\mathcal {M}}\) we have that

$$\begin{aligned} \phi ^* (R) = \sum _{EF=R} \mu (E) \phi (F) . \end{aligned}$$

Proof

This follows easily from Lemma 3.7 when we take \(A,B=1\). \(\square \)

For a character \(\chi \) we will, on occasion, write the associated L-function as

$$\begin{aligned} L(s,\chi ) = \sum _{n=0}^{\infty } L_n (\chi ) q^{-ns} , \end{aligned}$$

where we define

$$\begin{aligned} L_n (\chi ) := \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A = n \end{array}} \chi (A) \end{aligned}$$

for all non-negative integers n and all characters \(\chi \).

Suppose \(\chi \) is the character of modulus 1 and \({\text {Re}}(s) > 1\). Then, \(L(s,\chi )\) is simply the zeta-function for the ring \({\mathcal {A}}\). That is,

$$\begin{aligned} L(s,\chi ) = \sum _{A \in {\mathcal {M}}} \frac{1}{|A |^s} =: \zeta _{{\mathcal {A}}} (s) . \end{aligned}$$

We note further that

$$\begin{aligned} \zeta _{{\mathcal {A}}} (s) = \sum _{A \in {\mathcal {M}}} \frac{1}{|A |^s} = \frac{1}{1-q^{1-s}}. \end{aligned}$$

The far-RHS provides a meromorphic extension for \(\zeta _{{\mathcal {A}}}\) to \({\mathbb {C}}\) with a simple pole at 1. The following Euler product formula will also be useful

$$\begin{aligned} \zeta _{{\mathcal {A}}} (s) = \prod _{P \in {\mathcal {P}}} \big ( 1- |P |^{-s} \big )^{-1}, \end{aligned}$$

for \({\text {Re}}(s) > 1\).

Now suppose that \(\chi _0\) is the trivial character of some modulus R and \({\text {Re}}(s) > 1\). It can be shown that

$$\begin{aligned} L(s,\chi _0 ) = \bigg ( \prod _{\begin{array}{c} P \in {\mathcal {P}} \\ P \mid R \end{array}} 1- |P |^{-s} \bigg ) \zeta _{{\mathcal {A}}} (s) . \end{aligned}$$

So, again, the far-RHS provides a meromorphic extension for \(L(s,\chi _0 )\) to \({\mathbb {C}}\) with a simple pole at 1.

Finally, suppose that \(\chi \) is a non-trivial character of modulus R and \({\text {Re}}(s) > 1\). It can be shown that

$$\begin{aligned} L(s,\chi ) = \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A < {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A)}{|A |^s} . \end{aligned}$$

This is just a finite polynomial in \(q^{-s}\), and so it provides a holomorphic extension for \(L(s,\chi )\) to \({\mathbb {C}}\).

Theorem 3.9

(Functional Equation for L-functions of Primitive Characters) Let \(\chi \) be a primitive character of some modulus \(R \ne 1\). If \(\chi \) is even, then \(L(s , \chi )\) satisfies the function equation

$$\begin{aligned} \big ( q^{1-s} -1 \big ) L(s,\chi ) = W(\chi ) q^{\frac{{{\,\mathrm{deg}\,}}R}{2}} \big (q^{-s} -1 \big ) \big (q^{-s} \big )^{{{\,\mathrm{deg}\,}}R -1} L(1-s, \overline{\chi }) ; \end{aligned}$$

and if \(\chi \) is odd, then \(L(s , \chi )\) satisfies the function equation

$$\begin{aligned} L(s,\chi ) = W(\chi ) q^{\frac{{{\,\mathrm{deg}\,}}R -1}{2}} \big (q^{-s} \big )^{{{\,\mathrm{deg}\,}}R -1} L(1-s, \overline{\chi }) ; \end{aligned}$$

where \(|W(\chi ) |=1\).

A generalisation of the theorem above appears in Rosen’s book [6, Theorem 9.24 A].

Lemma 3.10

Let \(\chi \) a primitive odd character of modulus R. Then,

$$\begin{aligned} \Big |L \Big ( \frac{1}{2} , \chi \Big ) \Big |^2 = 2 \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB < {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} + c_o (\chi ) , \end{aligned}$$

where we define

$$\begin{aligned} c_o (\chi ) := - \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -1 \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} . \end{aligned}$$

Proof

The functional equation for odd primitive characters gives

$$\begin{aligned} L ( s , \chi ) = \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} L_n (\chi ) q^{-ns}&= W(\chi ) q^{\frac{{{\,\mathrm{deg}\,}}R -1}{2}} \big (q^{-s} \big )^{{{\,\mathrm{deg}\,}}R -1} \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} L_n (\overline{\chi }) q^{-n(1-s)} \\&= W(\chi ) q^{- \frac{{{\,\mathrm{deg}\,}}R -1}{2}} \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} L_n (\overline{\chi }) q^{(1-s) ( {{\,\mathrm{deg}\,}}R -1 -n )} . \end{aligned}$$

That is,

$$\begin{aligned} L ( s , \chi ) = \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} L_n (\chi ) q^{-ns} \end{aligned}$$
(3)

and

$$\begin{aligned} L ( s , \chi ) = W(\chi ) q^{- \frac{{{\,\mathrm{deg}\,}}R -1}{2}} \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} L_n (\overline{\chi }) q^{(1-s) ( {{\,\mathrm{deg}\,}}R -1 -n )} . \end{aligned}$$
(4)

Taking the squared modulus of both sides of (3) and of (4), we see that

$$\begin{aligned} |L ( s , \chi ) |^2 = \sum _{n=0}^{2{{\,\mathrm{deg}\,}}R -2} \bigg (\sum _{\begin{array}{c} 0\le i,j < {{\,\mathrm{deg}\,}}R \\ i+j=n \end{array}} L_i (\chi ) L_j (\overline{\chi }) \bigg ) q^{-ns} \end{aligned}$$
(5)

and

$$\begin{aligned} |L ( s , \chi ) |^2 = q^{-{{\,\mathrm{deg}\,}}R +1} \sum _{n=0}^{2{{\,\mathrm{deg}\,}}R -2} \bigg (\sum _{\begin{array}{c} 0\le i,j < {{\,\mathrm{deg}\,}}R \\ i+j=n \end{array}} L_i (\chi ) L_j (\overline{\chi }) \bigg ) q^{(1-s) ( 2{{\,\mathrm{deg}\,}}R -2 -n )} . \end{aligned}$$
(6)

By the linear independence of powers of \(q^{-s}\) we can see that \(|L ( s , \chi ) |^2\) is equal to the sum of the terms \(n=0, 1, \ldots , {{\,\mathrm{deg}\,}}R -1\) on the RHS of (5) and the terms \(n=0, 1, \ldots , {{\,\mathrm{deg}\,}}R -2\) on the RHS of (6). That is,

$$\begin{aligned} |L ( s , \chi ) |^2 =&\sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} \bigg (\sum _{\begin{array}{c} 0\le i,j< {{\,\mathrm{deg}\,}}R \\ i+j=n \end{array}} L_i (\chi ) L_j (\overline{\chi }) \bigg ) q^{-ns}\\&+ q^{-{{\,\mathrm{deg}\,}}R +1} \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -2} \bigg (\sum _{\begin{array}{c} 0\le i,j < {{\,\mathrm{deg}\,}}R \\ i+j=n \end{array}} L_i (\chi ) L_j (\overline{\chi }) \bigg ) q^{(1-s) ( 2{{\,\mathrm{deg}\,}}R -2 -n )} . \end{aligned}$$

Hence,

$$\begin{aligned}&\Big |L \Big ( \frac{1}{2} , \chi \Big ) \Big |^2\\&\quad = \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} \bigg (\sum _{\begin{array}{c} 0\le i,j< {{\,\mathrm{deg}\,}}R \\ i+j=n \end{array}} L_i (\chi ) L_j (\overline{\chi }) \bigg ) q^{-\frac{n}{2}} + \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -2} \bigg (\sum _{\begin{array}{c} 0\le i,j< {{\,\mathrm{deg}\,}}R \\ i+j=n \end{array}} L_i (\chi ) L_j (\overline{\chi }) \bigg ) q^{-\frac{n}{2}} \\&\quad = 2 \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB < {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} - \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -1 \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} , \end{aligned}$$

as required. \(\square \)

Lemma 3.11

Let \(\chi \) a primitive even character of modulus \(R\ne 1\). Then,

$$\begin{aligned} \Big |L \Big ( \frac{1}{2} , \chi \Big ) \Big |^2 = 2 \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB < {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} + c_e (\chi ) , \end{aligned}$$

where

$$\begin{aligned} c_e (\chi ) :=&-\frac{q}{\big ( q^{\frac{1}{2}}-1 \big )^2} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -2 \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} -\frac{2q^{\frac{1}{2}}}{ q^{\frac{1}{2}}-1} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -1 \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} \\&+ \frac{1}{\big ( q^{\frac{1}{2}}-1 \big )^2} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} . \end{aligned}$$

Proof

The functional equation for even primitive characters gives us that

$$\begin{aligned} \begin{aligned}&\big ( q^{1-s} - 1 \big ) L ( s , \chi ) = \big ( q^{1-s} -1 \big ) \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} L_n (\chi ) q^{-ns} \\&\quad = W(\chi ) q^{\frac{{{\,\mathrm{deg}\,}}R}{2}} \big (q^{-s} -1 \big ) \big (q^{-s} \big )^{{{\,\mathrm{deg}\,}}R -1} \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} L_n (\overline{\chi }) q^{-n(1-s)} \\&\quad = W(\chi ) q^{- \frac{{{\,\mathrm{deg}\,}}R}{2}} \big (q^{1-s} -q \big ) \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} L_n (\overline{\chi }) q^{(1-s) ({{\,\mathrm{deg}\,}}R -1 -n)} \end{aligned} \end{aligned}$$
(7)

For any primitive character \(\chi _1\) of modulus \(R \ne 1\), we define \(L_{-1} (\chi _1 ) :=0\) and recall that \(L_{{{\,\mathrm{deg}\,}}R} (\chi _1 ) =0\). If we define

$$\begin{aligned} M_i (\chi _1 ) := q L_{i-1} (\chi _1 ) - L_i (\chi _1 ) \end{aligned}$$

for \(i=0, 1, \ldots , {{\,\mathrm{deg}\,}}R\), then (7) gives us that

$$\begin{aligned} \big ( q^{1-s} - 1 \big ) L ( s , \chi ) =\sum _{n=0}^{{{\,\mathrm{deg}\,}}R} M_n (\chi ) q^{-ns} \end{aligned}$$
(8)

and

$$\begin{aligned} \big ( q^{1-s} - 1 \big ) L ( s , \chi ) = -W(\chi ) q^{- \frac{{{\,\mathrm{deg}\,}}R}{2}} \sum _{n=0}^{{{\,\mathrm{deg}\,}}R } M_n (\overline{\chi }) q^{(1-s) ({{\,\mathrm{deg}\,}}R -n)} . \end{aligned}$$
(9)

Similarly as in the proof of Lemma 3.10, we take the squared modulus of both sides of (8) and (9), and use the linear independence of powers of \(q^{-s}\), to obtain

$$\begin{aligned} \big ( q^{1-s} - 1 \big )^2 |L ( s , \chi ) |^2 =&\sum _{n=0}^{{{\,\mathrm{deg}\,}}R} \bigg (\sum _{\begin{array}{c} 0\le i,j \le {{\,\mathrm{deg}\,}}R \\ i+j=n \end{array}} M_i (\chi ) M_j (\overline{\chi }) \bigg ) q^{-ns} \\&+ q^{-{{\,\mathrm{deg}\,}}R} \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} \bigg (\sum _{\begin{array}{c} 0\le i,j \le {{\,\mathrm{deg}\,}}R \\ i+j=n \end{array}} M_i (\chi ) M_j (\overline{\chi }) \bigg ) q^{(1-s) ( 2{{\,\mathrm{deg}\,}}R -n )} . \end{aligned}$$

We now take \(s =\frac{1}{2}\) and simplify to obtain

$$\begin{aligned} \big ( q^{\frac{1}{2}} -1 \big )^2 \Big |L \Big ( \frac{1}{2} , \chi \Big ) \Big |^2&= 2 \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} \bigg (\sum _{\begin{array}{c} 0\le i,j \le {{\,\mathrm{deg}\,}}R \\ i+j=n \end{array}} M_i (\chi ) M_j (\overline{\chi }) \bigg ) q^{-\frac{n}{2}}\\&\quad +\, \sum _{\begin{array}{c} 0\le i,j \le {{\,\mathrm{deg}\,}}R \\ i+j= {{\,\mathrm{deg}\,}}R \end{array}} M_i (\chi ) M_j (\overline{\chi }) q^{-\frac{{{\,\mathrm{deg}\,}}R}{2}} . \end{aligned}$$

Now,

$$\begin{aligned}&\sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} \bigg (\sum _{\begin{array}{c} 0\le i,j \le {{\,\mathrm{deg}\,}}R \\ i+j=n \end{array}} M_i (\chi ) M_j (\overline{\chi }) \bigg ) q^{-\frac{n}{2}} \\&\quad = \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} q^2 \bigg ( \sum _{\begin{array}{c} 0 \le i,j \le {{\,\mathrm{deg}\,}}R \\ i+j=n \end{array}} L_{i-1} (\chi ) L_{j-1} (\overline{\chi }) \bigg ) q^{-\frac{n}{2}}\\&\qquad - \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} q \bigg ( \sum _{\begin{array}{c} 0 \le i,j \le {{\,\mathrm{deg}\,}}R \\ i+j=n \end{array}} L_{i-1} (\chi ) L_{j} (\overline{\chi }) \bigg ) q^{-\frac{n}{2}} \\&\qquad -\sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} q \bigg ( \sum _{\begin{array}{c} 0 \le i,j \le {{\,\mathrm{deg}\,}}R \\ i+j=n \end{array}} L_{i} (\chi ) L_{j-1} (\overline{\chi }) \bigg ) q^{-\frac{n}{2}}\\&\qquad +\sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} \bigg ( \sum _{\begin{array}{c} 0 \le i,j \le {{\,\mathrm{deg}\,}}R \\ i+j=n \end{array}} L_{i} (\chi ) L_{j} (\overline{\chi }) \bigg ) q^{-\frac{n}{2}} \\&\quad = \sum _{n=0}^{{{\,\mathrm{deg}\,}}R -3} q \bigg ( \sum _{\begin{array}{c} 0 \le i,j \le {{\,\mathrm{deg}\,}}R -1 \\ i+j=n \end{array}} L_{i} (\chi ) L_{j} (\overline{\chi }) \bigg ) q^{-\frac{n}{2}}\\&\qquad -\sum _{n=0}^{{{\,\mathrm{deg}\,}}R -2} q^{\frac{1}{2}} \bigg ( \sum _{\begin{array}{c} 0 \le i,j \le {{\,\mathrm{deg}\,}}R -1 \\ i+j=n \end{array}} L_{i} (\chi ) L_{j} (\overline{\chi }) \bigg ) q^{-\frac{n}{2}} \\&\qquad -\sum _{n=0}^{{{\,\mathrm{deg}\,}}R -2} q^{\frac{1}{2}} \bigg ( \sum _{\begin{array}{c} 0 \le i,j \le {{\,\mathrm{deg}\,}}R -1 \\ i+j=n \end{array}} L_{i} (\chi ) L_{j} (\overline{\chi }) \bigg ) q^{-\frac{n}{2}}\\&\qquad +\sum _{n=0}^{{{\,\mathrm{deg}\,}}R -1} \bigg ( \sum _{\begin{array}{c} 0 \le i,j \le {{\,\mathrm{deg}\,}}R -1 \\ i+j=n \end{array}} L_{i} (\chi ) L_{j} (\overline{\chi }) \bigg ) q^{-\frac{n}{2}} \\&\quad = \big ( q^{\frac{1}{2}} -1 \big )^2 \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB < {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} - q \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -2 \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} \\&\qquad + \big (2q^{\frac{1}{2}} -q \big )\sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -1 \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} , \end{aligned}$$

and similarly,

$$\begin{aligned}&\sum _{\begin{array}{c} 0\le i,j \le {{\,\mathrm{deg}\,}}R \\ i+j= {{\,\mathrm{deg}\,}}R \end{array}} M_i (\chi ) M_j (\overline{\chi }) q^{-\frac{{{\,\mathrm{deg}\,}}R}{2}} \\&\quad = q \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -2 \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} - 2 q^{\frac{1}{2}} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -1 \end{array}} \frac{\chi (B) \overline{\chi }(A)}{|AB |^{\frac{1}{2}}}+ \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} . \end{aligned}$$

Hence,

$$\begin{aligned}&\Big |L \Big ( \frac{1}{2} , \chi \Big ) \Big |^2\\&= 2 \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB < {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} -\frac{q}{\big ( q^{\frac{1}{2}}-1 \big )^2} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -2 \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} \\&\quad -\,\frac{2q^{\frac{1}{2}}}{ q^{\frac{1}{2}}-1} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -1 \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} +\, \frac{1}{\big ( q^{\frac{1}{2}}-1 \big )^2} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} , \end{aligned}$$

as required. \(\square \)

It is convenient to define

$$\begin{aligned} c(\chi ) := {\left\{ \begin{array}{ll} c_e (\chi ) &{}\text { if }\chi \text { is even} \\ c_o (\chi ) &{}\text { if }\chi \text { is odd} . \end{array}\right. } \end{aligned}$$
(10)

4 Multiplicative functions on \({\mathbb {F}}_q [T]\)

In this section we state and prove some results for the functions \(\mu , \phi \) and \(\omega \) that are required for the proofs of the main theorems. We will need the following well-known theorem.

Theorem 4.1

(Prime Polynomial Theorem) We have that

$$\begin{aligned} \# {\mathcal {P}}_n = \frac{q^n}{n} + O \Big ( \frac{q^\frac{n}{2}}{n} \Big ) , \end{aligned}$$

where the implied constant is independent of q. We reserve the symbol \({\mathfrak {c}}\) for the implied constant.

We will also need the following two definitions.

Definition 4.2

(Radical of a Polynomial, Square-free, and Square-full) For all \(R \in {\mathcal {A}}\) we define the radical of R to be the product of all distinct monic prime factors that divide R. It is denoted by \({{\,\mathrm{rad}\,}}(R)\). If \(R = {{\,\mathrm{rad}\,}}(R)\), then we say that R is square-free. If for all \(P \mid R\) we have that \(P^2 \mid R\), then we say that R is square-full.

Definition 4.3

(Primorial Polynomials) Let \((S_i)_{i \in {\mathbb {Z}}_{> 0}}\) be a fixed ordering of all the monic irreducibles in \({\mathcal {A}}\) such that \({{\,\mathrm{deg}\,}}S_i \le {{\,\mathrm{deg}\,}}S_{i+1}\) for all \(i \ge 1\) (the order of the irreducibles of a given degree is not of importance in this paper). For all positive integers n we define

$$\begin{aligned} R_n := \prod _{i=1}^{n} S_i . \end{aligned}$$

We will refer to \(R_n\) as the n-th primorial. For each positive integer n we have unique non-negative integers \(m_n\) and \(r_n\) such that

$$\begin{aligned} R_n = \bigg ( \prod _{{{\,\mathrm{deg}\,}}P \le m_n } P \bigg ) \bigg ( \prod _{i=1}^{r_n } Q_i \bigg ) , \end{aligned}$$
(11)

where the \(Q_i\) are distinct monic irreducibles of degree \(m_n +1\). This definition of primorial is not standard.

Now, before proceeding to prove results on the growth of the \(\omega \) and \(\phi \) functions, we note that

$$\begin{aligned} \sum _{E \mid R} \frac{\mu (E)}{|E |^s} = \prod _{P \mid R} 1 - \frac{1}{|P |^s} \end{aligned}$$
(12)

and

$$\begin{aligned} \sum _{E \mid R} \frac{\mu (E) {{\,\mathrm{deg}\,}}E}{|E |^s} = - \bigg ( \prod _{P \mid R} 1 - \frac{1}{|P |^s} \bigg ) \bigg ( \sum _{P \mid R} \frac{{{\,\mathrm{deg}\,}}P}{|P |^s -1} \bigg ) \end{aligned}$$
(13)

for all \(R \in {\mathcal {A}} \backslash \{ 0 \}\) . The first equation holds for all \(s \in {\mathbb {C}}\). The second holds for all \(s \in {\mathbb {C}} \backslash \{ 0 \}\) and is obtained by differentiating the first with respect to s.

Also, for all square-full \(R \in {\mathcal {A}} \backslash \{ 0 \}\) we have that

$$\begin{aligned} \begin{aligned} \sum _{EF = R} \frac{\mu (E) \phi (F)}{|F |^s} =&\sum _{EF = R} \mu (E) \frac{\phi (R)}{|E |} \frac{|E |^s}{|R |^s} = \frac{\phi (R)}{|R |^s} \sum _{EF = R} \frac{\mu (E)}{|E |^{1-s}} = \frac{\phi (R)}{|R |^s} \prod _{P \mid R} 1 - \frac{1}{|P |^{1-s}} \end{aligned} \end{aligned}$$
(14)

and

$$\begin{aligned} \sum _{EF = R} \frac{\mu (E) \phi (F) {{\,\mathrm{deg}\,}}F}{|F |^s} =&\frac{\phi (R)}{|R |^s} \bigg ( \prod _{P \mid R} 1 - \frac{1}{|P |^{1-s}} \bigg ) \bigg ( {{\,\mathrm{deg}\,}}R - \sum _{P \mid R} \frac{{{\,\mathrm{deg}\,}}P}{|P |^{1-s} -1} \bigg ) , \end{aligned}$$
(15)

The first equation holds for all \(s \in {\mathbb {C}}\). The second holds for all \(s \in {\mathbb {C}} \backslash \{ 1 \}\) and is obtained by differentiating the first with respect to s.

Lemma 4.4

For all positive integers n we have that

$$\begin{aligned} \log _q \log _q |R_n |= m_n + O(1) . \end{aligned}$$

Proof

By (11) and the prime polynomial theorem, we see that

$$\begin{aligned} \log _q |R_n |= {{\,\mathrm{deg}\,}}R_n \le \bigg ( \sum _{i=1}^{m_n +1} q^i + O \Big ( q^{\frac{i}{2}} \Big ) \bigg ) \ll q^{m_n +1} . \end{aligned}$$

and

$$\begin{aligned} \log _q |R_n |= {{\,\mathrm{deg}\,}}R_n \ge \bigg ( \sum _{i=1}^{m_n} q^i + O \Big ( q^{\frac{i}{2}} \Big ) \bigg ) \gg q^{m_n} . \end{aligned}$$

By taking logarithms of both equations above, we deduce that

$$\begin{aligned} \log _q \log _q |R_n |= m_n + O (1) . \end{aligned}$$

\(\square \)

Lemma 4.5

Let \(R \in {\mathcal {M}}\). We have that

$$\begin{aligned} \sum _{P \mid R} \frac{{{\,\mathrm{deg}\,}}P}{|P |- 1} = O \big ( \log \omega (R) \big ). \end{aligned}$$

Proof

It suffices to prove the claim for the primorials. Indeed, if this is true, then taking \(n:= \omega (R)\) gives

$$\begin{aligned} \sum _{P \mid R} \frac{{{\,\mathrm{deg}\,}}P}{|P |- 1} \le \sum _{P \mid R_n } \frac{{{\,\mathrm{deg}\,}}P}{|P |- 1} \ll \log n = \log \omega (R) . \end{aligned}$$

To prove the middle relation above, we first recall that the prime polynomial theorem gives \(\# {\mathcal {P}}_m = \frac{q^m}{m} + O \big ( \frac{q^{\frac{m}{2}}}{m} \big )\). From this, we can deduce that there is a constant \(c \in (0,1)\), which is independent of q, such that \(\# {\mathcal {P}}_{\le m} \ge c q^{\frac{m}{2}}\) for all positive integers m. In particular, if we take \(m = \lceil \frac{2}{\log q} \log \frac{n}{c} \rceil \), then \(\# {\mathcal {P}}_{\le m} \ge n\) . So,

$$\begin{aligned} \sum _{P \mid R_n} \frac{{{\,\mathrm{deg}\,}}P }{|P |- 1} \le \sum _{i = 1}^{\frac{2}{ \log q} \log \frac{n}{c} + 1} \sum _{\begin{array}{c} P \text { prime} \\ {{\,\mathrm{deg}\,}}P = i \end{array}} \frac{{{\,\mathrm{deg}\,}}P }{|P |- 1} \ll \sum _{i = 1}^{\frac{2}{ \log q} \log \frac{n}{c} + 1} \frac{i}{q^i - 1} \frac{q^i}{i} \ll \log n , \end{aligned}$$

where the second relation follows from the prime polynomial theorem again. \(\square \)

The following four results well-known (at least, their analogues in the number field setting are), and their proofs follow the same method as Lemma 4.5 above: Prove the claim for the primorials by using the prime polynomial theorem and perhaps Lemma 4.4, and then generalise to all \(R \in {\mathcal {M}}\).

Lemma 4.6

We have that

$$\begin{aligned} \limsup _{{{\,\mathrm{deg}\,}}R \rightarrow \infty } \omega (R) \frac{\log _q \log _q |R |}{\log _q |R |} = 1 . \end{aligned}$$

Lemma 4.7

For all \(R \in {\mathcal {A}}\) with \({{\,\mathrm{deg}\,}}R \ge 1\) we have that

$$\begin{aligned} \phi (R) \ge \frac{e^{- \gamma } |R |}{\log _q \log _q |R |+ O(1) } e^{-a q^{-\frac{1}{2}}} , \end{aligned}$$
(16)

and for infinitely many \(R \in {\mathcal {A}}\) we have that

$$\begin{aligned} \phi (R) \le \frac{e^{- \gamma } |R |}{\log _q \log _q |R |+ O(1) } e^{b q^{-\frac{1}{2}}} , \end{aligned}$$
(17)

where a and b are positive constants which are independent of q and R.

Lemma 4.8

For all \(R \in {\mathcal {A}}\) with \({{\,\mathrm{deg}\,}}R \ge 1\) we have that

$$\begin{aligned} \phi ^* (R) \ge \frac{e^{- \gamma } \phi (R) }{\log _q \log _q |R |+ O(1) } e^{-c q^{-\frac{1}{2}}} , \end{aligned}$$

and for infinitely many \(R \in {\mathcal {A}}\) we have that

$$\begin{aligned} \phi ^* (R) \le \frac{e^{- \gamma } \phi (R) }{\log _q \log _q |R |+ O(1) } e^{d q^{-\frac{1}{2}}} , \end{aligned}$$

where c and d are positive constants which are independent of q and R.

Lemma 4.9

Let k be a non-negative integer. For \(R \in {\mathcal {M}}\),

$$\begin{aligned}&\prod _{P \mid R} \frac{1}{1 + 2 |P |^{-1}} \asymp \prod _{P \mid R} \bigg ( \frac{1}{1 + |P |^{-1}} \bigg )^2 ; \\&\prod _{P \mid R} \frac{1}{1 + |P |^{-1}} \asymp \prod _{P \mid R} 1 - |P |^{-1} ; \\&\bigg ( \prod _{P \mid R} 1- |P |^{-1} \bigg )^k \omega (R) \gg _k 1 ; \\&\bigg ( \prod _{P \mid R} 1- |P |^{-1} \bigg ) \omega (R) \gg \sqrt{\omega (R)} \gg \log \omega (R) . \end{aligned}$$

Note, the fourth result follows easily from the third

We end this section with three more lemmas.

Lemma 4.10

We have that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le x \end{array}} \frac{1}{\phi (N)} = \Big ( \sum _{E \in {\mathcal {M}}} \frac{\mu (E)^2 }{\phi (E) |E |} \Big ) x + O(1) . \end{aligned}$$

Proof

For all \(N \in {\mathcal {A}}\) we have that

$$\begin{aligned} \sum _{E \mid N} \frac{\mu (E)^2}{\phi (E)} = \prod _{P \mid N} 1 + \frac{1}{|P |-1} = \prod _{P \mid N} \frac{1}{1-|P |^{-1}} = \frac{|N |}{\phi (N)} . \end{aligned}$$

So,

$$\begin{aligned}&\sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le x \end{array}} \frac{1}{\phi (N)}\\&\quad = \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le x \end{array}} \frac{1}{|N |} \frac{|N |}{\phi (N)} = \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le x \end{array}} \frac{1}{|N |} \sum _{E \mid N} \frac{\mu (E)^2}{\phi (E)} = \sum _{\begin{array}{c} E \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}E \le x \end{array}} \frac{\mu (E)^2}{\phi (E)} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le x \\ E \mid N \end{array}} \frac{1}{|N |} \\&\quad = \sum _{\begin{array}{c} E \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}E \le x \end{array}} \frac{\mu (E)^2 (x- {{\,\mathrm{deg}\,}}E)}{\phi (E) |E |} = \Big ( \sum _{E \in {\mathcal {M}}} \frac{\mu (E)^2 }{\phi (E) |E |} \Big ) x + O(1) . \end{aligned}$$

\(\square \)

Lemma 4.11

We have that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le x \end{array}} \frac{\mu ^2 (N)}{\phi (N)} \ge x . \end{aligned}$$

Proof

For square-free N we have that

$$\begin{aligned} \frac{1}{\phi (N)}&= \frac{1}{|N |} \prod _{P \mid N} \Big ( 1 - \vert P |^{-1} \Big )^{-1} = \frac{1}{|N |} \prod _{P \mid N} \bigg ( 1 + \frac{1}{\vert P |} + \frac{1}{\vert P |^2} + \ldots \bigg ) \\&= \sum _{\begin{array}{c} M \in {\mathcal {M}} \\ {{\,\mathrm{rad}\,}}(M) =N \end{array}} \frac{1}{|M |} , \end{aligned}$$

and so

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le x \end{array}} \frac{\mu (N)^2}{\phi (N)} = \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ N \text { is square-free} \\ {{\,\mathrm{deg}\,}}N \le x \end{array}} \; \sum _{\begin{array}{c} M \in {\mathcal {M}} \\ {{\,\mathrm{rad}\,}}(M) =N \end{array}} \frac{1}{|M |} \ge \sum _{\begin{array}{c} M \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}M \le x \end{array}} \frac{1}{|M |} = x. \end{aligned}$$

\(\square \)

While it is not a result on multiplicative functions, the proof of the following lemma uses several results from this section.

Lemma 4.12

Let \(R \in {\mathcal {M}}\) and let x be a positive integer. Then,

$$\begin{aligned} \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A \le x \\ (A , R) = 1 \end{array}} \frac{1}{|A |} = {\left\{ \begin{array}{ll} \frac{\phi (R)}{|R |} x + O \big (\log \omega (R) \big ) &{}\text { if }x \ge {{\,\mathrm{deg}\,}}R \\ \frac{\phi (R)}{|R |} x + O \big (\log \omega (R) \big ) + O \Big ( \frac{2^{\omega (R)} x}{q^x} \Big ) &{}\text { if }x < {{\,\mathrm{deg}\,}}R \end{array}\right. } . \end{aligned}$$

Proof

For all positive integers x we have that

$$\begin{aligned} \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A \le x \\ (A , R) = 1 \end{array}} \frac{1}{|A |}&= \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}F \le x \end{array}} \frac{1}{|A |} \sum _{E \mid (A,R)} \mu (E) = \sum _{E \mid R} \mu (E) \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A \le x \\ E \mid A \end{array}} \frac{1}{|A |}\\&= \sum _{\begin{array}{c} E \mid R \\ {{\,\mathrm{deg}\,}}E \le x \end{array}} \frac{\mu (E)}{|E |} \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A \le x - {{\,\mathrm{deg}\,}}E \end{array}} \frac{1}{|A |} = \sum _{\begin{array}{c} E \mid R \\ {{\,\mathrm{deg}\,}}E \le x \end{array}} \frac{\mu (E)}{|E |} ( x - {{\,\mathrm{deg}\,}}E )\\&= \sum _{E \mid R} \frac{\mu (E)}{|E |} ( x - {{\,\mathrm{deg}\,}}E ) - \sum _{\begin{array}{c} E \mid R \\ {{\,\mathrm{deg}\,}}E > x \end{array}} \frac{\mu (E)}{|E |} ( x - {{\,\mathrm{deg}\,}}E ) . \end{aligned}$$

By (12), (13), and Lemma 4.5, we see that

$$\begin{aligned} \sum _{E \mid R} \frac{\mu (E)}{|E |} ( x - {{\,\mathrm{deg}\,}}E ) = \frac{\phi (R)}{|R |} x + O \bigg ( \frac{\phi (R)}{|R |} \log \omega (R) \bigg ) . \end{aligned}$$

When \(x \ge {{\,\mathrm{deg}\,}}R\), it is clear that

$$\begin{aligned} \sum _{\begin{array}{c} E \mid R \\ {{\,\mathrm{deg}\,}}E > x \end{array}} \frac{\mu (E)}{|E |} ( x - {{\,\mathrm{deg}\,}}E ) = 0 . \end{aligned}$$

Whereas, when \(x < {{\,\mathrm{deg}\,}}R\), we have that

$$\begin{aligned} \sum _{\begin{array}{c} E \mid R \\ {{\,\mathrm{deg}\,}}E> x \end{array}} \frac{\mu (E)}{|E |} ( x - {{\,\mathrm{deg}\,}}E ) \ll \sum _{\begin{array}{c} E \mid R \\ {{\,\mathrm{deg}\,}}E> x \end{array}} \frac{|\mu (E) |{{\,\mathrm{deg}\,}}E}{|E |} \ll \frac{x}{q^x} \sum _{\begin{array}{c} E \mid R \\ {{\,\mathrm{deg}\,}}E > x \end{array}} |\mu (E) |\ll \frac{2^{\omega (R)} x}{q^x} . \end{aligned}$$

The proof follows. \(\square \)

5 The second moment

We now proceed to prove Theorems 2.4 and 2.5.

Proof of Theorem 2.4

By using the functional equation for Dirichlet L-functions, we have that

$$\begin{aligned} \frac{1}{\phi ^* (R)} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \Big |L \Big ( \frac{1}{2}, \chi \Big ) \Big |^2&= \frac{2}{\phi ^* (R)} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB < {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}}\\&\quad + \frac{1}{\phi ^* (R)} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} c (\chi ) . \end{aligned}$$

For the first term on the RHS, by Lemma 3.7 and Corollary 3.8, we have

$$\begin{aligned}&\frac{2}{\phi ^* (R)} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} = \frac{2}{\phi ^* (R)} \sum _{EF=R} \mu (E) \phi (F) \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}R \\ (AB,R)=1 \\ A \equiv B ({{\,\mathrm{mod}\,}}F) \end{array}} \frac{1}{|AB |^{\frac{1}{2}}} \\&\quad = 2 \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A< \frac{1}{2} {{\,\mathrm{deg}\,}}R \\ (A,R)=1 \end{array}} \frac{1}{|A |} + \frac{2}{\phi ^* (R)} \sum _{EF=R} \mu (E) \phi (F) \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB < {{\,\mathrm{deg}\,}}R \\ (AB,R)=1 \\ A \equiv B ({{\,\mathrm{mod}\,}}F) \\ A \ne B \end{array}} \frac{1}{|AB |^{\frac{1}{2}}} . \end{aligned}$$

By Lemma 4.12, we have that

$$\begin{aligned} 2 \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A < \frac{1}{2} {{\,\mathrm{deg}\,}}R \\ (A,R)=1 \end{array}} \frac{1}{|A |} = \frac{\phi (R)}{|R |} {{\,\mathrm{deg}\,}}R + O \big ( \log \omega (R) \big ) . \end{aligned}$$

For the off-diagonal terms, let us consider the case where \({{\,\mathrm{deg}\,}}AB =z\) and \({{\,\mathrm{deg}\,}}A > {{\,\mathrm{deg}\,}}B\). Then, \({{\,\mathrm{deg}\,}}B < \frac{z}{2}\) and we can write \(A =LF+B\) for monic L with \({{\,\mathrm{deg}\,}}L = z-{{\,\mathrm{deg}\,}}B - {{\,\mathrm{deg}\,}}F\). So,

$$\begin{aligned}&\sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB =z \\ {{\,\mathrm{deg}\,}}A > {{\,\mathrm{deg}\,}}B \\ (AB,R)=1 \\ A \equiv B ({{\,\mathrm{mod}\,}}F) \end{array}} \frac{1}{|AB |^{\frac{1}{2}}} \le \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}B< \frac{z}{2} \end{array}} \frac{1}{|B |^{\frac{1}{2}}} \sum _{\begin{array}{c} L \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}L = z-{{\,\mathrm{deg}\,}}B -{{\,\mathrm{deg}\,}}F \end{array}} \frac{1}{|LF |^{\frac{1}{2}}}\\&\quad \le \frac{q^{\frac{z}{2}}}{|F |} \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}B < \frac{z}{2} \end{array}} \frac{1}{|B |} = \frac{z q^{\frac{z}{2}}}{2 |F |} . \end{aligned}$$

The case where \({{\,\mathrm{deg}\,}}A < {{\,\mathrm{deg}\,}}B\) is similar. For the case \({{\,\mathrm{deg}\,}}A = {{\,\mathrm{deg}\,}}B\), we have \({{\,\mathrm{deg}\,}}B = \frac{z}{2}\) and \(A = LF + B\) for \(L \in {\mathcal {A}}\) with \({{\,\mathrm{deg}\,}}L < {{\,\mathrm{deg}\,}}B - {{\,\mathrm{deg}\,}}F\). So,

$$\begin{aligned}&\sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB =z \\ {{\,\mathrm{deg}\,}}A = {{\,\mathrm{deg}\,}}B \\ (AB,R)=1 \\ A \equiv B ({{\,\mathrm{mod}\,}}F) \\ A \ne B \end{array}} \frac{1}{|AB |^{\frac{1}{2}}} \le \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}B = \frac{z}{2} \end{array}} \frac{1}{|B |^{\frac{1}{2}}} \sum _{\begin{array}{c} L \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}L < {{\,\mathrm{deg}\,}}B -{{\,\mathrm{deg}\,}}F \end{array}} \frac{1}{|LF |^{\frac{1}{2}}}\\&\quad \ll \frac{q^{\frac{1}{2}}}{|F |} \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}B = \frac{z}{2} \end{array}} 1 = \frac{q^{\frac{z+1}{2}}}{|F |} . \end{aligned}$$

Hence,

$$\begin{aligned} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB < {{\,\mathrm{deg}\,}}R \\ (AB,R)=1 \\ A \equiv B ({{\,\mathrm{mod}\,}}F) \\ A \ne B \end{array}} \frac{1}{|AB |^{\frac{1}{2}}} \ll \frac{1}{|F |} \sum _{z=0}^{{{\,\mathrm{deg}\,}}R -1} z q^{\frac{z+1}{2}} \ll \frac{|R |^{\frac{1}{2}} {{\,\mathrm{deg}\,}}R}{|F |} , \end{aligned}$$

and so

$$\begin{aligned}&\frac{2}{\phi ^* (R)} \sum _{EF=R} \mu (E) \phi (F) \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB < {{\,\mathrm{deg}\,}}R \\ (AB,R)=1 \\ A \equiv B ({{\,\mathrm{mod}\,}}F) \\ A \ne B \end{array}} \frac{1}{|AB |^{\frac{1}{2}}} \ll \frac{|R |^{\frac{1}{2}} {{\,\mathrm{deg}\,}}R }{\phi ^* (R)} \sum _{EF=R} |\mu (E) |\frac{\phi (F)}{|F |} \\&\quad \le \frac{2^{\omega (R)} |R |^{\frac{1}{2}} {{\,\mathrm{deg}\,}}R }{\phi ^* (R)} \ll |R |^{-\frac{1}{3}} . \end{aligned}$$

Hence, we have that

$$\begin{aligned} \frac{2}{\phi ^* (R)} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB < {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} = \frac{\phi (R)}{|R |} {{\,\mathrm{deg}\,}}R + O \big ( \log \omega (R) \big ) . \end{aligned}$$

Finally,

$$\begin{aligned} \frac{1}{\phi ^* (R)} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} c (\chi )&= \frac{1}{\phi ^* (R)} \bigg ( \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}R \\ \chi \text { odd} \end{array}} c_o (\chi ) + \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}R \\ \chi \text { even} \end{array}} c_e (\chi ) \bigg ) \\&= \frac{1}{\phi ^* (R)} \bigg ( \sum _{\chi {{\,\mathrm{mod}\,}}R } c_o (\chi ) + \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}R \\ \chi \text { even} \end{array}} c_e (\chi ) - c_o (\chi ) \bigg ) . \end{aligned}$$

By similar methods as previously in the proof, we can see that the above is O(1). The result follows. \(\square \)

Proof of Theorem 2.5

We have that

$$\begin{aligned} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \Big |L \Big ( \frac{1}{2}, \chi \Big ) \Big |^2 =&\mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A , {{\,\mathrm{deg}\,}}B< {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} \\ =&\sum _{EF=R} \mu (E) \phi (F) \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A , {{\,\mathrm{deg}\,}}B< {{\,\mathrm{deg}\,}}R \\ (AB,R)=1 \\ A \equiv B ({{\,\mathrm{mod}\,}}F) \end{array}} \frac{1}{|AB |^{\frac{1}{2}}} \\ =&\sum _{EF=R} \mu (E) \phi (F) \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A< {{\,\mathrm{deg}\,}}R \\ (A,R)=1 \end{array}} \frac{1}{|A |^{\frac{1}{2}}} \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}B < {{\,\mathrm{deg}\,}}R \\ B \equiv A ({{\,\mathrm{mod}\,}}F) \end{array}} \frac{1}{|B |^{\frac{1}{2}}} \end{aligned}$$

The second equality follows from Lemma 3.7. For the last equality we note that if R is square-full, \(EF=R\), and \(\mu (E)\ne 0\), then F and R have the same prime factors. Therefore, if we also have that \((A,R)=1\) and \(B \equiv A ({{\,\mathrm{mod}\,}}F)\), then \((B,R)=1\).

Continuing,

$$\begin{aligned} \begin{aligned}&\mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \Big |L \Big ( \frac{1}{2}, \chi \Big ) \Big |^2 \\&\quad =\sum _{EF=R} \mu (E) \phi (F) \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A< {{\,\mathrm{deg}\,}}R \end{array}} \frac{1}{|A |^{\frac{1}{2}}} \sum _{G \mid (A,R)} \mu (G)\sum _{\begin{array}{c} B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}B< {{\,\mathrm{deg}\,}}R \\ B \equiv A ({{\,\mathrm{mod}\,}}F) \end{array}} \frac{1}{|B |^{\frac{1}{2}}} \\&\quad =\sum _{EF=R} \mu (E) \phi (F) \sum _{G \mid R} \mu (G) \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A< {{\,\mathrm{deg}\,}}R \\ G \mid A \end{array}} \frac{1}{|A |^{\frac{1}{2}}}\sum _{\begin{array}{c} B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}B< {{\,\mathrm{deg}\,}}R \\ B \equiv A ({{\,\mathrm{mod}\,}}F) \end{array}} \frac{1}{|B |^{\frac{1}{2}}} \\&\quad =\sum _{EF=R} \mu (E) \phi (F) \sum _{G \mid R} \mu (G) \\&\qquad \sum _{\begin{array}{c} K \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}K< {{\,\mathrm{deg}\,}}F - {{\,\mathrm{deg}\,}}G \\ \text {or} \\ K=0 \end{array}}\bigg ( \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A< {{\,\mathrm{deg}\,}}R \\ A \equiv GK ({{\,\mathrm{mod}\,}}F) \end{array}} \frac{1}{|A |^{\frac{1}{2}}} \bigg ) \bigg ( \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}B < {{\,\mathrm{deg}\,}}R \\ B \equiv GK ({{\,\mathrm{mod}\,}}F) \end{array}} \frac{1}{|B |^{\frac{1}{2}}} \bigg ). \end{aligned} \end{aligned}$$
(18)

The last equality follows from the fact that F and R have the same prime factors, and so, if \(\mu (G) \ne 0\), then \(G \mid F\). Hence, if \(G \mid A\), then \(A \equiv GK ({{\,\mathrm{mod}\,}}F)\) for some \(K \in {\mathcal {A}}\) with \({{\,\mathrm{deg}\,}}K < {{\,\mathrm{deg}\,}}F - {{\,\mathrm{deg}\,}}G\) or \(k=0\).

Now, we note that if \(K \in {\mathcal {A}} \backslash {\mathcal {M}}\), then

$$\begin{aligned}&\sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A< {{\,\mathrm{deg}\,}}R \\ A \equiv GK ({{\,\mathrm{mod}\,}}F) \end{array}} \frac{1}{|A |^{\frac{1}{2}}} = \sum _{\begin{array}{c} L \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}L< {{\,\mathrm{deg}\,}}R -{{\,\mathrm{deg}\,}}F \end{array}} \frac{1}{|LF+GK |^{\frac{1}{2}}} = \sum _{\begin{array}{c} L \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}L < {{\,\mathrm{deg}\,}}R -{{\,\mathrm{deg}\,}}F \end{array}} \frac{1}{|LF |^{\frac{1}{2}}}\\&\quad = \frac{1}{q^{\frac{1}{2}} -1} \bigg ( \frac{|R |^{\frac{1}{2}}}{|F |} - \frac{1}{|F |^{\frac{1}{2}}} \bigg ) . \end{aligned}$$

Whereas, if \(K \in {\mathcal {M}}\), then

$$\begin{aligned}&\sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A< {{\,\mathrm{deg}\,}}R \\ A \equiv GK ({{\,\mathrm{mod}\,}}F) \end{array}} \frac{1}{|A |^{\frac{1}{2}}} = \frac{1}{|G K |^{\frac{1}{2}}} + \sum _{\begin{array}{c} L \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}L < {{\,\mathrm{deg}\,}}R -{{\,\mathrm{deg}\,}}F \end{array}} \frac{1}{|LF+GK |^{\frac{1}{2}}}\\&\quad = \frac{1}{|G K |^{\frac{1}{2}}} + \frac{1}{q^{\frac{1}{2}} -1} \bigg ( \frac{|R |^{\frac{1}{2}}}{|F |} - \frac{1}{|F |^{\frac{1}{2}}} \bigg ) . \end{aligned}$$

Hence,

$$\begin{aligned}&\sum _{\begin{array}{c} K \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}K< {{\,\mathrm{deg}\,}}F - {{\,\mathrm{deg}\,}}G \\ \text {or} \\ K=0 \end{array}} \bigg ( \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A< {{\,\mathrm{deg}\,}}R \\ A \equiv GK ({{\,\mathrm{mod}\,}}F) \end{array}} \frac{1}{|A |^{\frac{1}{2}}} \bigg ) \bigg ( \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}B< {{\,\mathrm{deg}\,}}R \\ B \equiv GK ({{\,\mathrm{mod}\,}}F) \end{array}} \frac{1}{|B |^{\frac{1}{2}}} \bigg ) \\&\quad = \frac{1}{\big ( q^{\frac{1}{2}} -1 \big )^2} \bigg ( \frac{|R |^{\frac{1}{2}}}{|F |} - \frac{1}{|F |^{\frac{1}{2}}} \bigg )^2 \sum _{\begin{array}{c} K \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}K< {{\,\mathrm{deg}\,}}F - {{\,\mathrm{deg}\,}}G \\ \text {or} \\ K=0 \end{array}} 1 \\&\qquad + \frac{2}{q^{\frac{1}{2}} -1} \bigg ( \frac{|R |^{\frac{1}{2}}}{|F |} - \frac{1}{|F |^{\frac{1}{2}}} \bigg ) \frac{1}{|G |^{\frac{1}{2}}} \sum _{\begin{array}{c} K \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}K< {{\,\mathrm{deg}\,}}F - {{\,\mathrm{deg}\,}}G \end{array}} \frac{1}{|K |^{\frac{1}{2}}} \\&\qquad +\frac{1}{|G |} \sum _{\begin{array}{c} K \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}K < {{\,\mathrm{deg}\,}}F - {{\,\mathrm{deg}\,}}G \end{array}} \frac{1}{|K |} \\&\quad = \frac{1}{\big ( q^{\frac{1}{2}} -1 \big )^2} \bigg ( \frac{|R |}{|FG |} - 2 \frac{|R |^{\frac{1}{2}}}{|F ||G |^{\frac{1}{2}}} - \frac{1}{|G |} + \frac{2}{|F |^{\frac{1}{2}} |G |^{\frac{1}{2}}} \bigg ) + \frac{{{\,\mathrm{deg}\,}}F}{|G |} - \frac{{{\,\mathrm{deg}\,}}G}{|G |} . \end{aligned}$$

By applying this to (18), and using (12) to (15), we see that

$$\begin{aligned}&\mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \Big |L \Big ( \frac{1}{2}, \chi \Big ) \Big |^2 \\&\quad = \frac{\phi (R)^3}{|R |^2} {{\,\mathrm{deg}\,}}R + \frac{1}{\big ( q^{\frac{1}{2}} -1 \big )^2} \bigg ( - \frac{\phi (R)^3}{|R |^2} + 2 \frac{\phi (R)}{|R |^{\frac{1}{2}}} \prod _{P \mid R} \Big (1-\frac{1}{|P |^{\frac{1}{2}}} \Big )^2 \bigg ) . \end{aligned}$$

\(\square \)

6 The Brun–Titchmarsh theorem for the divisor function in \({\mathbb {F}}_{q}[T]\)

In this section we prove a specific case of the function field analogue of the generalised Brun–Titchmarsh theorem. The generalised Brun–Titchmarsh theorem in the number field setting was proved by Shiu [7]. It gives upper bounds for sums over short intervals and arithmetic progressions of certain multiplicative functions. We will look at the case where the multiplicative function is the divisor function in the function field setting.

The main results in this section are the following two theorems.

Theorem 6.1

Suppose \(\alpha , \beta \) are fixed and satisfy \(0< \alpha < \frac{1}{2}\) and \(0< \beta < \frac{1}{2}\). Let \(X \in {\mathcal {M}}\) and y be a positive integer satisfying \(\beta {{\,\mathrm{deg}\,}}X < y \le {{\,\mathrm{deg}\,}}X\). Also, let \(A \in {\mathcal {A}}\) and \(G \in {\mathcal {M}}\) satisfy \((A,G)=1\) and \({{\,\mathrm{deg}\,}}G < (1-\alpha ) y\). Then, we have that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X) < y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \end{array}} d(N) \ll _{\alpha , \beta } \frac{q^y {{\,\mathrm{deg}\,}}X}{\phi (G)} . \end{aligned}$$

Intuitively, this seems to be a good upper bound. Indeed, all N in the sum are of degree equal to \({{\,\mathrm{deg}\,}}X\), and so this suggests that the average value that the divisor function will take is \({{\,\mathrm{deg}\,}}X\). Also, there are \(q^y \frac{1}{\vert G |} \approx q^y \frac{1}{\phi (G)}\) possible values for N in the sum.

Theorem 6.2

Suppose \(\alpha , \beta \) are fixed and satisfy \(0< \alpha < \frac{1}{2}\) and \(0< \beta < \frac{1}{2}\). Let \(X \in {\mathcal {M}}\) and y be a positive integer satisfying \(\beta {{\,\mathrm{deg}\,}}X < y \le {{\,\mathrm{deg}\,}}X\). Also, let \(A \in {\mathcal {A}}\) and \(G \in {\mathcal {M}}\) satisfy \((A,G)=1\) and \({{\,\mathrm{deg}\,}}G < (1-\alpha ) y\). Finally, let \(a \in {\mathbb {F}}_q^*\). Then, we have that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}(N-X) = y \\ (N-X) \in \ {\mathcal {M}} \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \end{array}} d(N) \ll _{\alpha , \beta } \frac{q^y {{\,\mathrm{deg}\,}}X}{\phi (G)} . \end{aligned}$$

Our proofs of these two theorems are based on Shiu’s proof of the more general theorem in the number field setting [7]. We begin by proving preliminary results that are needed for the main part of the proofs.

The Selberg sieve gives us the following result. A proof is given in [10].

Theorem 6.3

Let \({\mathcal {S}} \subseteq {\mathcal {A}}\) be a finite subset. For a prime \(P \in {\mathcal {A}}\) we define \({\mathcal {S}}_P = {\mathcal {S}} \cap P {\mathcal {A}} = \{ A \in {\mathcal {S}} : P \mid A \}\). We extend this to all square-free \(D \in {\mathcal {A}}\): \({\mathcal {S}}_D = {\mathcal {S}} \cap D {\mathcal {A}}\).

Furthermore, let \({\mathcal {Q}} \subseteq {\mathcal {A}}\) be a subset of prime elements. For positive integers z we define \({\mathcal {Q}}_z = \prod _{\begin{array}{c} P \in {\mathcal {Q}} \\ {{\,\mathrm{deg}\,}}P \le z \end{array}} P\). We also define \({\mathcal {S}}_{{\mathcal {Q}},z} := {\mathcal {S}} \backslash \cup _{P \mid {\mathcal {Q}}_z} {\mathcal {S}}_P\).

Suppose there exists a completely multiplicative function \(\omega \) and a function r such that for each \(D \mid {\mathcal {Q}}_z\) we have \(\# {\mathcal {S}}_D = \frac{\omega (D)}{|D |} \# {\mathcal {S}}_D + r(D)\) and \(0< \omega (D) < |D |\). Also, define \(\psi \) multiplicatively by \(\psi (P) = \frac{|P |}{\omega (P)} - 1\) and \(\psi (P^e ) = 0\) for \(e \ge 2\).

We then have that

$$\begin{aligned} \# {\mathcal {S}}_{{\mathcal {Q}},z}&:= \# \Big ( {\mathcal {S}} \backslash \cup _{P \mid {\mathcal {Q}}_z} {\mathcal {S}}_P \Big ) = \# \{ A \in {\mathcal {S}} : (P \mid A \text { and } P \in {\mathcal {Q}}) \Rightarrow {{\,\mathrm{deg}\,}}P > z \} \\&\le \frac{\# {\mathcal {S}}}{\sum _{\begin{array}{c} F \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}F \le z \\ F \mid {\mathcal {Q}}_z \end{array}} \frac{\mu ^2 (F)}{\psi (F)}} + \sum _{\begin{array}{c} D,E \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}E \le z \\ D,E \mid {\mathcal {Q}}_z \end{array}} |r([D,E]) |\end{aligned}$$

Corollary 6.4

Let \(X \in {\mathcal {M}}\) and y be a positive integer satisfying \(y \le {{\,\mathrm{deg}\,}}X\). Also, let \(K \in {\mathcal {M}}\) and \(A \in {\mathcal {A}}\) satisfy \((A,K)=1\). Finally, let z be a positive integer such that \({{\,\mathrm{deg}\,}}K + z \le y\). Then,

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X) < y \\ N \equiv A ({{\,\mathrm{mod}\,}}K) \\ p_{-} (N) > z \end{array}} 1 \le \frac{q^y}{\phi (K) z} + O \Big ( q^{2z} \Big ) . \end{aligned}$$

Proof

Let us define

$$\begin{aligned} {\mathcal {S}} = \{ N \in {\mathcal {M}} : {{\,\mathrm{deg}\,}}(N-X) < y , N \equiv A ({{\,\mathrm{mod}\,}}K) \} \end{aligned}$$

and

$$\begin{aligned} {\mathcal {Q}} = \{ P \text { prime} : {{\,\mathrm{deg}\,}}P \le z , P \not \mid K \} . \end{aligned}$$

Then, we have that

$$\begin{aligned} \# {\mathcal {S}}_{{\mathcal {Q}} , z} = \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X) < y \\ N \equiv A ({{\,\mathrm{mod}\,}}K) \\ p_{-} (N) > z \end{array}} 1 , \end{aligned}$$

which is what we want to bound.

For \(D \mid {\mathcal {Q}}_z\) with \({{\,\mathrm{deg}\,}}D \le z\) we have that

$$\begin{aligned} \# {\mathcal {S}}_D = \# \{ N \in {\mathcal {M}} : {{\,\mathrm{deg}\,}}(N-X) < y , N \equiv A ({{\,\mathrm{mod}\,}}K) , N \equiv 0 ({{\,\mathrm{mod}\,}}D) \} = \frac{q^y}{|KD |} . \end{aligned}$$

This follows from the fact that K and D are coprime and that \({{\,\mathrm{deg}\,}}K + {{\,\mathrm{deg}\,}}D \le {{\,\mathrm{deg}\,}}K + z \le y\). For \(D \mid {\mathcal {Q}}_z\) with \({{\,\mathrm{deg}\,}}D > z\) we have that

$$\begin{aligned} \# {\mathcal {S}}_D = \frac{q^y}{|KD |} + c_D \end{aligned}$$

where \(|c_D |\le 1\). Therefore, we have \(\omega (D) =1\) and \( |r(D) |\le 1\) for all \(D \mid {\mathcal {Q}}_z\). We also have that \(\psi (D) = \phi (D)\) for square-free D.

We can now see that

$$\begin{aligned} \sum _{\begin{array}{c} F \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}F \le z \\ F \mid {\mathcal {Q}}_z \end{array}} \frac{\mu ^2 (F)}{\psi (F)} = \sum _{\begin{array}{c} F \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}F \le z \\ (F,K)=1 \end{array}} \frac{\mu (F)^2}{\phi (F)} , \end{aligned}$$

and we have that

$$\begin{aligned} \sum _{\begin{array}{c} F \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}F \le z \\ (F,K)=1 \end{array}} \frac{\mu (F)^2}{\phi (F)} \sum _{E \mid K} \frac{\mu (E)^2}{\phi (E)} \ge \sum _{\begin{array}{c} F \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}F \le z \end{array}} \frac{\mu (F)^2}{\phi (F)} . \end{aligned}$$

To this we apply Lemma 4.11 and the fact that

$$\begin{aligned} \sum _{E \mid K} \frac{\mu (E)^2}{\phi (E)} = \prod _{P \mid K} 1 + \frac{1}{|P |-1} = \prod _{P \mid K} \Big ( 1 - \vert P |^{-1} \Big )^{-1} = \frac{|K |}{\phi (K)} , \end{aligned}$$

to obtain

$$\begin{aligned} \sum _{\begin{array}{c} F \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}F \le z \\ (F,K)=1 \end{array}} \frac{\mu (F)^2}{\phi (F)} \ge \frac{\phi (K)}{|K |} z. \end{aligned}$$

Also, we have that

$$\begin{aligned} \sum _{\begin{array}{c} D,E \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}E \le z \\ D,E \mid {\mathcal {P}}_z \end{array}} |r([D,E]) |\le \bigg ( \sum _{\begin{array}{c} D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}D \le z \end{array}} 1 \bigg )^2 \ll q^{2z} . \end{aligned}$$

The result now follows by applying Theorem 6.3. \(\square \)

The proof of the following corollary is almost identical to the proof above.

Corollary 6.5

Let \(X \in {\mathcal {M}}\) and y be a positive integer satisfying \(y \le {{\,\mathrm{deg}\,}}X\). Also, let \(K \in {\mathcal {M}}\) and \(A \in {\mathcal {A}}\) satisfy \((A,K)=1\). Finally, let z be a positive integer such that \({{\,\mathrm{deg}\,}}K + z \le y\), and let \(a \in {\mathbb {F}}_q ^*\). Then,

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}(N-X) = y \\ (N-X) \in a {\mathcal {M}} \\ N \equiv A ({{\,\mathrm{mod}\,}}K) \\ p_{-} (N) > z \end{array}} 1 \le \frac{q^y}{\phi (K) z} + O \Big ( q^{2z} \Big ) . \end{aligned}$$

Lemma 6.6

We have that

$$\begin{aligned} \sum _{{{\,\mathrm{deg}\,}}P \le w} \frac{1}{{{\,\mathrm{deg}\,}}P} = \frac{q}{q-1} \frac{q^{w}}{(w+1)^2} + O \Big ( \frac{q^{\frac{w}{2}}}{w^2} \Big ) . \end{aligned}$$

In particular, we can find an absolute constant \({\mathfrak {d}}\) such that

$$\begin{aligned} \sum _{{{\,\mathrm{deg}\,}}P \le w} \frac{1}{{{\,\mathrm{deg}\,}}P} \le {\mathfrak {d}} \frac{q^w}{w^2} . \end{aligned}$$

Proof

By using the prime polynomial theorem, we have that

$$\begin{aligned} \sum _{{{\,\mathrm{deg}\,}}P \le w} \frac{1}{{{\,\mathrm{deg}\,}}P} = \sum _{n=1}^{w} \frac{1}{n} \bigg ( \frac{q^n}{n} + O \Big ( \frac{q^{\frac{n}{2}}}{n} \Big ) \bigg ) = \sum _{n=1}^{w} \frac{q^n}{n^2} + O \Big ( \frac{q^{\frac{w}{2}}}{w^2} \Big ) . \end{aligned}$$

The proof follows by noting that

$$\begin{aligned} \sum _{n=1}^{w} \frac{q^n}{n^2}&= \frac{1}{q-1} \bigg ( \sum _{n=1}^{w} \frac{q^{n+1}}{n^2} - \frac{q^n}{n^2} \bigg ) = \frac{1}{q-1} \bigg ( \sum _{n=1}^{w} \frac{q^{n+1}}{(n+1)^2} - \frac{q^n}{n^2} \bigg ) + O \Big ( \frac{q^w}{w^3} \Big ) \\&= \frac{q}{q-1} \frac{q^{w}}{(w+1)^2} + O \Big ( \frac{q^w}{w^3} \Big ) . \end{aligned}$$

\(\square \)

Lemma 6.7

Let \(0< \alpha , \beta < \frac{1}{2}\), let \(z > q\) be an integer, and let

$$\begin{aligned} w(z) := \log _q z . \end{aligned}$$

Then,

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le z \\ p_{+} (N) \le w(z) \end{array}} 1 \le q^{\sqrt{{\mathfrak {d}}} \frac{z}{(\log z)}} \end{aligned}$$

as \(z \rightarrow \infty \), where \({\mathfrak {d}}\) is as in Lemma 6.6. In particular, this implies that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le z \\ p_{+} (N) \le w(z) \end{array}} 1 \ll q^{\frac{z}{4}} \end{aligned}$$

(under the condition that \(z >q\)).

Proof

Let \(\delta > 0\). We will optimise on the value of \(\delta \) later. We have that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le z \\ p_{+} (N) \le w(z) \end{array}} 1&\le \, q^{\delta z} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le z \\ p_{+} (N) \le w(z) \end{array}} |N |^{-\delta } \le q^{\delta z} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ p_{+} (N) \le w(z) \end{array}} |N |^{-\delta }\\&=\, q^{\delta z} \prod _{{{\,\mathrm{deg}\,}}P \le w(z)} \bigg ( 1 + \vert P |^{-\delta } + \vert P |^{-2 \delta } + \ldots \bigg ) \\&=\, q^{\delta z} \prod _{{{\,\mathrm{deg}\,}}P \le w(z)} \bigg ( 1 + \frac{1}{|P |^{\delta } -1} \bigg ) \le q^{\delta z} \prod _{{{\,\mathrm{deg}\,}}P \le w(z)} \bigg ( \exp \Big ( \frac{1}{|P |^{\delta } -1}\Big ) \bigg )\\&\quad \le \, q^{\delta z} \prod _{{{\,\mathrm{deg}\,}}P \le w(z)} \bigg ( \exp \Big ( \frac{1}{\delta \log |P |}\Big ) \bigg ) , \end{aligned}$$

where the last two relations follow from the Taylor series for the exponential function.

Continuing,

$$\begin{aligned}&\sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le z \\ p_{+} (N) \le w(z) \end{array}} 1 \le \exp \bigg ( (\delta \log q) z + \frac{1}{\delta \log q} \sum _{{{\,\mathrm{deg}\,}}P \le w(z)} \frac{1}{{{\,\mathrm{deg}\,}}P} \bigg ) \\&\quad \le \exp \bigg ( (\delta \log q) z + \frac{1}{\delta \log q} \frac{{\mathfrak {d}} q^{w(z)}}{w(z)^2} \bigg ) , \end{aligned}$$

where the last inequality follows from Lemma 6.6. By using the definition of w(z), we have that

$$\begin{aligned} \frac{{\mathfrak {d}} q^{w(z)}}{w(z)^2} = \frac{{\mathfrak {d}} z}{(\log _q z)^2} ; \end{aligned}$$

and if we take

$$\begin{aligned} \delta = \frac{\sqrt{{\mathfrak {d}}}}{\log z} , \end{aligned}$$

then

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le z \\ p_{+} (N) \le w(z) \end{array}} 1 \le \exp \bigg ( \frac{\sqrt{{\mathfrak {d}}} (\log q) z}{\log z} + \frac{\sqrt{{\mathfrak {d}}} (\log z) z}{(\log q) (\log _q z)^2} \bigg ) \le q^{\sqrt{{\mathfrak {d}}} \frac{z}{(\log z)}} . \end{aligned}$$

\(\square \)

Lemma 6.8

Let z and r be a positive integers satisfying \(r \log _q r \le z\). Then,

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \ge \frac{z}{2} \\ p_{+} (N) \le \frac{z}{r} \end{array}} \frac{d(N)}{\vert N |} \ll z^2 \exp \bigg ( -\frac{r \log r}{9} \bigg ) . \end{aligned}$$

Proof

Let \(\frac{3}{4} \le \delta <1\). We will optimise on the value of \(\delta \) later. We have that

$$\begin{aligned} \begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \ge \frac{z}{2} \\ p_{+} (N) \le \frac{z}{r} \end{array}} \frac{d(N)}{\vert N |} \le&q^{(\delta -1) \frac{z}{2}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \ge \frac{z}{2} \\ p_{+} (N) \le \frac{z}{r} \end{array}} \frac{d(N)}{\vert N |^{\delta } } \le q^{(\delta -1) \frac{z}{2}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ p_{+} (N) \le \frac{z}{r} \end{array}} \frac{d(N)}{\vert N |^{\delta } } \\ \le&q^{(\delta -1) \frac{z}{2}} \prod _{{{\,\mathrm{deg}\,}}P \le \frac{z}{r}} \bigg ( 1 + \frac{2}{\vert P |^{\delta }} + \sum _{l=2}^{\infty } \frac{l+1}{|P |^{l \delta }} \bigg ) \\ \le&\exp \bigg ( (\log q) (\delta -1) \frac{z}{2} + 2 \sum _{{{\,\mathrm{deg}\,}}P \le \frac{z}{r}} \frac{1}{|P |^{\delta }} + \sum _{{{\,\mathrm{deg}\,}}P \le \frac{z}{r}} \sum _{l=2}^{\infty } \frac{l+1}{|P |^{l \delta }} \bigg ) \end{aligned} \end{aligned}$$
(19)

where the last relation uses the Taylor series for the exponential function.

Note that

$$\begin{aligned} \begin{aligned} \sum _{{{\,\mathrm{deg}\,}}P \le \frac{z}{r}} \sum _{l=2}^{\infty } \frac{l+1}{|P |^{l \delta }}&\le \sum _{P \text { prime}} \frac{3}{\vert P |^{2 \delta }} \sum _{l=0}^{\infty } \frac{l+1}{|P |^{l \delta }} = \sum _{P \text { prime}} \frac{3}{\vert P |^{2 \delta }} \bigg ( \frac{1}{1 - \frac{1}{\vert P |^{\delta }}} \bigg )^2\\&= 3 \sum _{P \text { prime}} \bigg ( \frac{1}{ \vert P |^{\delta } -1} \bigg )^2 = O(1) , \end{aligned} \end{aligned}$$
(20)

where the last relation uses the fact that \(\delta \ge \frac{3}{4}\). Also, we can write \(\frac{1}{\vert P |^{\delta }} = \frac{1}{\vert P |} + \frac{1}{\vert P |} \Big ( |P |^{1 -\delta } -1 \Big )\).

We have that

$$\begin{aligned} \begin{aligned} \sum _{{{\,\mathrm{deg}\,}}P \le \frac{z}{r}} \frac{1}{|P |} = \sum _{n=1}^{\frac{z}{r}} \frac{1}{q^n} \bigg ( \frac{q^n}{n} + O \Big ( \frac{q^{\frac{n}{2}}}{n} \Big ) \bigg ) \le \log z - \log r + O(1) \le \log (z) + O(1), \end{aligned} \end{aligned}$$
(21)

and that

$$\begin{aligned} \begin{aligned} \sum _{{{\,\mathrm{deg}\,}}P \le \frac{z}{r}} \frac{1}{|P |} \Big ( |P |^{1 -\delta } -1 \Big )&= \sum _{{{\,\mathrm{deg}\,}}P \le \frac{z}{r}} \frac{1}{|P |} \sum _{n=1}^{\infty } \frac{\big ( (1-\delta ) \log \vert P |\big )^n}{n!} \\&\le \sum _{n=1}^{\infty } \frac{(1-\delta )^n \big ( (\log q) \frac{z}{r} \big )^{n-1}}{n!} \sum _{ {{\,\mathrm{deg}\,}}P \le \frac{z}{r}} \frac{(\log q) {{\,\mathrm{deg}\,}}P}{|P |} \\&\le (1 + {\mathfrak {c}}) \sum _{n=1}^{\infty } \frac{(1-\delta )^n \big ( (\log q) \frac{z}{r} \big )^{n}}{n!} = (1 + {\mathfrak {c}}) q^{(1-\delta ) \frac{z}{r}} , \end{aligned} \end{aligned}$$
(22)

where the second-to-last relation follows from a similar calculation as (21).

We substitute (20), (21), and (22) into (19) to obtain

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \ge \frac{z}{2} \\ p_{+} (N) \le \frac{z}{r} \end{array}} \frac{d(N)}{\vert N |} \ll z^2 \exp \bigg ( \log q (\delta -1) \frac{z}{2} + 2 (1 + {\mathfrak {c}}) q^{(1-\delta ) \frac{z}{r}} \bigg ) . \end{aligned}$$

We can now take \(\delta = 1 - \frac{r \log _q r}{4z}\) (by the conditions on r given in theorem, we have that \(\frac{3}{4} \le \delta < 1\), as required). Then,

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \ge \frac{z}{2} \\ p_{+} (N) \le \frac{z}{r} \end{array}} \frac{d(N)}{\vert N |} \ll z^2 \exp \bigg ( -\frac{r \log r}{8} + 2 (1 + {\mathfrak {c}}) r^{\frac{1}{4}} \bigg ) \ll z^2 \exp \bigg ( -\frac{r \log r}{9} \bigg ) . \end{aligned}$$

\(\square \)

Proof of Theorem 6.1

We will need to break the sum into four parts. First, we define \(z := \frac{\alpha }{10} y\). Now, for any N in the summation range, we can write

$$\begin{aligned} N = {P_1}^{e_1} \ldots {P_j}^{e_j} {P_{j+1}}^{e_{j+1}} \ldots {P_n}^{e_n} \end{aligned}$$
(23)

where \({{\,\mathrm{deg}\,}}P_1 \le {{\,\mathrm{deg}\,}}P_2 \le \cdots \le {{\,\mathrm{deg}\,}}P_n\) and \(j \ge 0\) is chosen such that

$$\begin{aligned} {{\,\mathrm{deg}\,}}\Big ( {P_1}^{e_1} \ldots {P_j}^{e_j} \Big ) \le z < {{\,\mathrm{deg}\,}}\Big ( {P_1}^{e_1} \ldots {P_j}^{e_j} {P_{j+1}}^{e_{j+1}} \Big ) . \end{aligned}$$

For convenience, we write

$$\begin{aligned} B_N&:= {P_1}^{e_1} \ldots {P_j}^{e_j} , \\ D_N&:= {P_{j+1}}^{e_{j+1}} \ldots {P_n}^{e_n} . \end{aligned}$$

We will consider the following cases:

  1. 1.

    \( p_{-} (D_N) > \frac{1}{2} z\) ;

  2. 2.

    \( p_{-} (D_N) \le \frac{1}{2} z\) and \({{\,\mathrm{deg}\,}}B_N \le \frac{1}{2} z\) ;

  3. 3.

    \( p_{-} (D_N) < w(z)\) and \({{\,\mathrm{deg}\,}}B_N > \frac{1}{2} z\) ;

  4. 4.

    \(w(z) \le p_{-} (D_N) \le \frac{1}{2} z\) and \({{\,\mathrm{deg}\,}}B_N > \frac{1}{2} z\) ;

where

$$\begin{aligned} w(z) := {\left\{ \begin{array}{ll} 1 &{}\text { if }z \le q \\ \log _q (z) &{}\text { if }z > q . \end{array}\right. } \end{aligned}$$

Case 1: We have that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X)< y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ p_{-} (D_N)> \frac{1}{2} z \end{array}} d(N)&= \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X)< y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ p_{-} (D_N)> \frac{1}{2} z \end{array}} d(B_N ) d(D_N )\\&\le \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}B \le z \\ (B,G)=1 \end{array}} d(B) \sum _{\begin{array}{c} D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(D-X_B ) < y - {{\,\mathrm{deg}\,}}B \\ D \equiv A_B ({{\,\mathrm{mod}\,}}G) \\ p_{-} (D) > \frac{1}{2} z \end{array}} d(D) , \end{aligned}$$

where \(X_B\) is a monic polynomial of degree \({{\,\mathrm{deg}\,}}X - {{\,\mathrm{deg}\,}}B\) such that \({{\,\mathrm{deg}\,}}\big ( X - B X_B \big ) < y\), and \(A_B\) is a polynomial satisfying \(A_B B \equiv A ({{\,\mathrm{mod}\,}}G)\).

We note that

$$\begin{aligned} \varOmega (D) \le \frac{{{\,\mathrm{deg}\,}}D}{p_{-} (D)} \le \frac{y}{\frac{1}{2} z} = \frac{20}{\alpha } , \end{aligned}$$

and so \(d(D) \le 2^{\frac{20}{\alpha }}\) . Hence,

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X)< y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ p_{-} (D_N)> \frac{1}{2} z \end{array}} d(N) \ll _{\alpha } \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}B \le z \\ (B,G)=1 \end{array}} d(B) \sum _{\begin{array}{c} D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(D-X_B ) < y - {{\,\mathrm{deg}\,}}B \\ D \equiv A_B ({{\,\mathrm{mod}\,}}G) \\ p_{-} (D) > \frac{1}{2} z \end{array}} 1 . \end{aligned}$$

We can now apply Corollary 6.4 to obtain

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X) < y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ p_{-} (D_N) > \frac{1}{2} z \end{array}} d(N)&\ll _{\alpha } x \frac{ q^y }{\phi (G) z} \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}B \le z \\ (B,G)=1 \end{array}} \frac{d(B)}{|B |} + q^{z} \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}B \le z \\ (B,G)=1 \end{array}} d(B)\nonumber \\&\le \bigg ( \frac{ 2 q^y }{\phi (G) z} +q^{2z} \bigg ) \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}B \le z \\ (B,G)=1 \end{array}} \frac{d(B)}{|B |} \nonumber \\&\le \bigg ( \frac{ 2 q^y }{\phi (G) z} +q^{2z} \bigg ) z^2 \ll \frac{ q^y z }{\phi (G)} \le \frac{ q^y {{\,\mathrm{deg}\,}}X }{\phi (G)}, \end{aligned}$$
(24)

where the second-to-last relation uses the fact that \({{\,\mathrm{deg}\,}}G \le (1-\alpha ) y\) and \(z= \frac{\alpha }{10}y\).

Case 2: Suppose N satisfies case 2. Then, the associated \(P_{j+1}\) (from (23)) satisfies \({P_{j+1}}^{e_{j+1}} \mid N\), \({{\,\mathrm{deg}\,}}P_{j+1} \le \frac{1}{2} z\), and \({{\,\mathrm{deg}\,}}{P_{j+1}}^{e_{j+1}} > \frac{1}{2} z\). For a general prime P with \({{\,\mathrm{deg}\,}}P \le \frac{1}{2} z\) we denote \(e_P \ge 2\) to be the smallest integer such that \({{\,\mathrm{deg}\,}}P^{e_P} > \frac{1}{2} z\). We will need to note for later that

$$\begin{aligned} \sum _{{{\,\mathrm{deg}\,}}P \le \frac{1}{2} z} \frac{1}{|P |^{e_P}} \le \sum _{{{\,\mathrm{deg}\,}}P \le \frac{1}{4} z} q^{-\frac{1}{2} z}+ \sum _{\frac{1}{4} z < {{\,\mathrm{deg}\,}}P \le \frac{1}{2} z} \frac{1}{|P |^{2}} \ll q^{-\frac{1}{4} z} . \end{aligned}$$

Let us also note that for N with \({{\,\mathrm{deg}\,}}N \le {{\,\mathrm{deg}\,}}X\) we have that

$$\begin{aligned} d(N) \ll _{\alpha , \beta } |N |^{\frac{\alpha \beta }{80}} \le |X |^{\frac{\alpha \beta }{80}} \le q^{\frac{\alpha }{80}y} = q^{\frac{1}{8} z} . \end{aligned}$$

So,

$$\begin{aligned} \begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X)< y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ p_{-} (D_N) \le \frac{1}{2} z \\ {{\,\mathrm{deg}\,}}B_N \le \frac{1}{2} z \end{array}} d(N)&\le \sum _{\begin{array}{c} {{\,\mathrm{deg}\,}}P \le \frac{1}{2} z \\ (P,G)=1 \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X)< y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ N \equiv 0 ({{\,\mathrm{mod}\,}}P^{e_P}) \end{array}} d(N) \ll _{\alpha , \beta } q^{\frac{1}{8}z} \sum _{\begin{array}{c} {{\,\mathrm{deg}\,}}P \le \frac{1}{2} z \\ (P,G)=1 \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X) < y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ N \equiv 0 ({{\,\mathrm{mod}\,}}P^{e_P}) \end{array}} 1 \\&\quad \le q^{\frac{1}{8}z} \sum _{\begin{array}{c} {{\,\mathrm{deg}\,}}P \le \frac{1}{2} z \\ (P,G)=1 \end{array}} \bigg ( q^{y} \frac{1}{|G P^{e_P} |} + O(1) \bigg ) \\&\quad \le q^{y} \frac{1}{|G |} q^{\frac{1}{8}z}\sum _{{{\,\mathrm{deg}\,}}P \le \frac{1}{2} z} \frac{1}{|P^{e_P} |} \; + O \big ( q^{\frac{5}{8} z} \big ) \\&\quad \ll q^{y} \frac{1}{|G |} q^{-\frac{1}{8}z} + O \big ( q^{\frac{5}{8} z} \big ) \ll q^{y} \frac{1}{|G |} q^{-\frac{1}{8}z} , \end{aligned} \end{aligned}$$
(25)

where the last relation follows from the fact that \(z=\frac{\alpha }{10} y\) and \({{\,\mathrm{deg}\,}}G \le (1- \alpha ) y\).

Case 3: Suppose N satisfies case 3. For the case where \(z \le q\) we have that \(w(z) =1\), meaning that the only possible value N could take is 1. At most this contributes O(1).

So, suppose that \(z > q\), and so \(w(z) = \log _q z\). Case 3 tells us that \(\frac{1}{2} z < {{\,\mathrm{deg}\,}}B_N \le z\) and

$$\begin{aligned} p_{+} (B_N ) \le p_{-} (D_N ) < w(z) . \end{aligned}$$

Hence,

$$\begin{aligned}&\sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X)< y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ p_{-} (D_N)< w(z) \\ \frac{1}{2} z<{{\,\mathrm{deg}\,}}B_N \le z \end{array}} d(N) \ll _{\alpha , \beta } \; q^{\frac{1}{8} z} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X)< y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ p_{-} (D_N)< w(z) \\ \frac{1}{2} z<{{\,\mathrm{deg}\,}}B_N \le z \end{array}} 1 \le q^{\frac{1}{8} z} \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ \frac{1}{2} z< {{\,\mathrm{deg}\,}}B \le z \\ (B,G)=1 \\ p_{+} (B )< w(z) \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X)< y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ N \equiv 0 ({{\,\mathrm{mod}\,}}B) \end{array}} 1 \nonumber \\&\quad \le q^{\frac{1}{8} z} \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ \frac{1}{2} z< {{\,\mathrm{deg}\,}}B \le z \\ p_{+} (B )< w(z) \end{array}} \bigg ( \frac{q^y}{|G B |} + O(1) \bigg ) \le \bigg ( \frac{q^y}{|G |} q^{-\frac{3}{8} z} \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ \frac{1}{2} z< {{\,\mathrm{deg}\,}}B \le z \\ p_{+} (B ) < w(z) \end{array}} 1 \bigg ) + O \big ( q^{\frac{9}{8} z} \big ) \nonumber \\&\quad \ll \bigg ( \frac{q^y}{|G |} q^{-\frac{3}{8} z} q^{\frac{1}{4} z} \bigg ) + O \big ( q^{\frac{9}{8} z} \big ) \ll \frac{q^y}{|G |} q^{-\frac{1}{8} z} \end{aligned}$$
(26)

as \(z \longrightarrow \infty \), where the second-to-last relation follows from Lemma 6.7, and the last relation uses the fact that \({{\,\mathrm{deg}\,}}G \le (1-\alpha ) y\) and \(z=\frac{\alpha }{10} y\).

Case 4: The case \(z<1\) is trivial, and so we proceed under the assumption that \(z \ge 1\). We have that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X)< y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ w(z) \le p_{-} (D_N ) \le \frac{1}{2} z \\ \frac{1}{2} z< {{\,\mathrm{deg}\,}}B_N \le z \end{array}} d(N) = \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ \frac{1}{2} z< {{\,\mathrm{deg}\,}}B \le z \\ (B,G)=1 \end{array}} d(B) \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X) < y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ w(z) \le p_{-} (D_N ) \le \frac{1}{2} z \\ B_N = B \\ p_{-} (D_N ) \ge p_{+} (B_N ) \end{array}} d( D_N ) . \end{aligned}$$
(27)

We now divide \(p_{-} (D_N)\) into the blocks \( \frac{1}{r+1} z < p_{-} (D_N ) \le \frac{1}{r} z\) for \(r = 2, 3, \ldots , r_1\) where

$$\begin{aligned} r_1 = \Big \lfloor \frac{z}{w(z)} \Big \rfloor . \end{aligned}$$

For \(D_N\) satisfying \( \frac{1}{r+1} z < p_{-} (D_N ) \le \frac{1}{r} z\) we have that

$$\begin{aligned} \varOmega (D_N ) \le \frac{{{\,\mathrm{deg}\,}}X}{ p_{-} (D_N )} \le \frac{{{\,\mathrm{deg}\,}}X}{\frac{1}{r+1} z} \le \frac{10 (r+1)}{\alpha \beta } \le \frac{20 r}{\alpha \beta } , \end{aligned}$$

and so

$$\begin{aligned} d (D_N ) \le 2^{\frac{20 r}{\alpha \beta }} = a^r , \end{aligned}$$

where \(a = 2^{\frac{20 }{\alpha \beta }}\).

So, continuing from (27),

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X)< y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ w(z) \le p_{-} (D_N ) \le \frac{1}{2} z \\ {{\,\mathrm{deg}\,}}B_N> \frac{1}{2} z \end{array}} d(N)\le & {} \sum _{r=2}^{r_1} a^r \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ \frac{1}{2} z< {{\,\mathrm{deg}\,}}B \le z \\ (B,G)=1 \\ p_{+} (B) \le \frac{1}{r} z \end{array}} d(B) \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X)< y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ N \equiv 0 ({{\,\mathrm{mod}\,}}B) \\ \frac{1}{r+1} z< p_{-} (D_N ) \le \frac{1}{r} z \end{array}} 1 \nonumber \\\le & {} \sum _{r=2}^{r_1} a^r \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ \frac{1}{2} z< {{\,\mathrm{deg}\,}}B \le z \\ (B,G)=1 \\ p_{+} (B) \le \frac{1}{r} z \end{array}} d(B) \sum _{\begin{array}{c} D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X_B ) < y - {{\,\mathrm{deg}\,}}B \\ N \equiv A_B ({{\,\mathrm{mod}\,}}G) \\ p_{-} (D ) > \frac{1}{r+1} z \end{array}} 1 , \end{aligned}$$
(28)

where \(X_B\) is a monic polynomial of degree \({{\,\mathrm{deg}\,}}X - {{\,\mathrm{deg}\,}}B\) such that \({{\,\mathrm{deg}\,}}X - B X_B < y\), and \(A_B\) is a polynomial satisfying \(A_B B \equiv A ({{\,\mathrm{mod}\,}}G)\).

Corollary 6.4 tells us that

$$\begin{aligned} \sum _{\begin{array}{c} D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X_B ) < y - {{\,\mathrm{deg}\,}}B \\ N \equiv A_B ({{\,\mathrm{mod}\,}}G) \\ p_{-} (D ) \ge \frac{1}{r+1} z \end{array}} 1 \le \frac{q^y}{\phi (G) \vert B |} \frac{r+1}{z} + q^{\frac{2z}{r+1}} \ll \frac{q^y}{\phi (G) \vert B |} \frac{r+1}{z} , \end{aligned}$$

where the last relation follows from the fact that \({{\,\mathrm{deg}\,}}B \le z\), \(z = \frac{\alpha }{10} y\), and \({{\,\mathrm{deg}\,}}G \le (1-\alpha ) y\). Hence, continuing from (28):

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X)< y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ v< p_{-} (D_N ) \le \frac{1}{2} z \\ {{\,\mathrm{deg}\,}}B_N > \frac{1}{2} z \end{array}} d(N) \ll \frac{q^y}{\phi (G)} \frac{1}{z} \sum _{r=2}^{r_1} (r+1) a^r \sum _{\begin{array}{c} B \in {\mathcal {M}} \\ \frac{1}{2} z < {{\,\mathrm{deg}\,}}B \le z \\ (B,G)=1 \\ p_{+} (B) \le \frac{1}{r} z \end{array}} \frac{d(B)}{|B |} . \end{aligned}$$

Finally, we wish to apply Lemma 6.8. This requires that \(r \log _q r \le z\). Now, when \(1 \le z \le q\) we have that \(w(z) =1\) and \(r_1 =z\). Hence, \(r \log _q r \le z \log _q q = z\). When \(z > q\) we have that \(w(z) = \log _q z\) and \(r_1 = \Big \lfloor \frac{z}{w(z)} \Big \rfloor \). Hence, \(r \log _q r \le \frac{z}{\log _q z} (\log _q z - \log _q \log _q z) \le z\), since \(z>q\). Hence,

$$\begin{aligned}&\sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X)< y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ v < p_{-} (D_N ) \le \frac{1}{2} z \\ {{\,\mathrm{deg}\,}}B_N > \frac{1}{2} z \end{array}} d(N) \ll \frac{q^y}{\phi (G)} z \sum _{r=2}^{r_1} (r+1) a^r \exp \bigg ( -\frac{r \log r}{9} \bigg )\nonumber \\&\quad \ll \frac{q^y}{\phi (G)} z \ll \frac{q^y}{\phi (G)} {{\,\mathrm{deg}\,}}X . \end{aligned}$$
(29)

The proof now follows from (24), (25), (26), and (29). \(\square \)

Proof of Theorem 6.2

The proof of this theorem is almost identical to the proof of Theorem 6.1. Where we applied Corollary 6.4, we should instead apply Corollary 6.5. Also, the calculations

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X)<y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ N \equiv 0 ({{\,\mathrm{mod}\,}}P^{e_P}) \end{array}} 1 = \frac{q^y}{|G P^{e_P} |} + O(1) \quad \quad \quad \text { and } \quad \quad \quad \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(N-X) <y \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ N \equiv 0 ({{\,\mathrm{mod}\,}}B) \end{array}} 1 = \frac{q^y}{|G B |} + O(1) \end{aligned}$$

should be replaced by

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}(N-X) =y \\ (N-X) \in a{\mathcal {M}} \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ N \equiv 0 ({{\,\mathrm{mod}\,}}P^{e_P}) \end{array}} 1 = \frac{q^y}{|G P^{e_P} |} + O(1) \quad \quad \quad \text { and } \quad \quad \quad \sum _{\begin{array}{c} N \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}(N-X) =y \\ (N-X) \in a{\mathcal {M}} \\ N \equiv A ({{\,\mathrm{mod}\,}}G) \\ N \equiv 0 ({{\,\mathrm{mod}\,}}B) \end{array}} 1 = \frac{q^y}{|G B |} + O(1) , \end{aligned}$$

respectively. \(\square \)

7 Further preliminary results

Lemma 7.1

Let c be a positive real number, and let \(k \ge 2\) be an integer. Then,

$$\begin{aligned} \int _{c- i \infty }^{c+ i \infty } \frac{y^s}{s^k} \mathrm {d} s = {\left\{ \begin{array}{ll} 0 &{}\text { if }0 \le y < 1 \\ \frac{2\pi i}{(k-1)!} (\log y)^{k-1} &{}\text { if }y \ge 1 \end{array}\right. } . \end{aligned}$$

Proof

See [5, 4.1.6, p. 282] \(\square \)

Lemma 7.2

For all \(R \in {\mathcal {A}}\) and all \(s \in {\mathbb {C}}\) with \({\text {Re}}(s) > -1\) we define

$$\begin{aligned} f_R (s) := \prod _{P \mid R} \frac{1 - |P |^{-s-1}}{1 + |P |^{-s-1}} . \end{aligned}$$

Then, for all \(R \in {\mathcal {A}}\) and \(j=1,2,3,4\) we have that

$$\begin{aligned} f_R^{(j)} (0) \ll \big ( \log _q \log _q |R |\big )^{j} \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} . \end{aligned}$$

Remark 7.3

We must mention that, in the lemma and the proof, the implied constants may depend on j, for example; but because there are only finitely many cases of j that we are interested in, we can take the implied constants to be independent.

Proof

First, we note that

$$\begin{aligned} f_R '(s) = g_R (s) f_R (s) , \end{aligned}$$
(30)

where

$$\begin{aligned} g_R (s) := \sum _{P \mid R} 2 \log |P |\bigg ( \frac{1}{|P |^{s+1} + 1} + \frac{1}{|P |^{2s+2} - 1} \bigg ) . \end{aligned}$$

We note further that

$$\begin{aligned} \begin{aligned} f_R ''(s)&= \Big ( g_R (s)^2 + g_R ' (s) \Big ) f_R (s) , \\ f_R '''(s)&= \Big ( g_R (s)^3 + 3 g_R (s) g_R ' (s) + g_R '' (s) \Big ) f_R (s) , \\ f_R '''' (s)&= \Big ( g_R (s)^4 + 6 g_R (s)^2 g_R ' (s) + 4 g_R (s) g_R '' (s) + 3 g_R ' (s)^2 + g_R ''' (s) \Big ) f_R (s) . \end{aligned} \end{aligned}$$
(31)

For all \(R \in {\mathcal {A}}\) and \(k=0,1,2,3\) it is not difficult to deduce that

$$\begin{aligned} g_R^{(k)} (0) \ll \sum _{P \mid R} \frac{ \big ( \log |P |\big )^{k+1} }{|P |- 1} . \end{aligned}$$
(32)

The function \(\frac{(\log x)^{k+1}}{x-1}\) is decreasing at large enough x, and the limit as \(x \longrightarrow \infty \) is 0. Therefore, there exist an independent constant \(c \ge 1\) such that for \(k=0,1,2,3\) and all \(A,B \in {\mathcal {A}}\) with \({{\,\mathrm{deg}\,}}A \le {{\,\mathrm{deg}\,}}B\) we have that

$$\begin{aligned} c \frac{\big ( \log |A |\big )^{k+1}}{|A |-1} \ge \frac{\big ( \log |B |\big )^{k+1}}{|B |-1} . \end{aligned}$$

Hence, taking \(n=\omega (R)\), we see that

$$\begin{aligned} \begin{aligned} \sum _{P \mid R} \frac{ \big ( \log |P |\big )^{k+1} }{|P |- 1} \ll&\sum _{P \mid R_n } \frac{ \big ( \log |P |\big )^{k+1} }{|P |- 1} \ll \sum _{r=1}^{m_n +1 } \frac{q^r}{r} \frac{r^{k+1}}{q^r - 1} \ll \sum _{n=1}^{m_n +1 } r^k \\ \ll&(m_n + 1 )^{k+1} \ll \big ( \log _q \log _q |R_n |\big )^{k+1} \ll \big ( \log _q \log _q |R |\big )^{k+1} , \end{aligned} \end{aligned}$$
(33)

where we have used the prime polynomial theorem and Lemma 4.4.

So, by (30)–(33) and the fact that

$$\begin{aligned} f_R (0) = \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} , \end{aligned}$$

we deduce that

$$\begin{aligned} f_R^{(j)} (0) \ll \big ( \log _q \log _q |R |\big )^{j} \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} . \end{aligned}$$

\(\square \)

Lemma 7.4

Let \(R \in {\mathcal {A}}\), and define \({z_R}' := {{\,\mathrm{deg}\,}}R - \log _q 9^{\omega (R)}\). We have that

$$\begin{aligned}&\sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {z_R}' \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} ( {z_R}' - {{\,\mathrm{deg}\,}}N )^2 = \frac{(1-q^{-1})}{12} \bigg ( \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^4 \\&\quad + O \Bigg ( \bigg ( \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) \Big ( ({{\,\mathrm{deg}\,}}R)^3 \omega (R) + ({{\,\mathrm{deg}\,}}R)^3 \log {{\,\mathrm{deg}\,}}R \Big ) \Bigg ) . \end{aligned}$$

Proof

Step 1: Let us define the function F for \({\text {Re}}s > 1\) by

$$\begin{aligned} F(s) = \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |^s} . \end{aligned}$$

We can see that

$$\begin{aligned} F(s)&= \prod _{\begin{array}{c} P \text { prime} \\ P \not \mid R \end{array}} \bigg ( 1 + \frac{2}{|P |^s} + \frac{2}{|P |^{2s}} + \frac{2}{|P |^{3s}} \ldots \bigg ) = \prod _{\begin{array}{c} P \text { prime} \\ P \not \mid R \end{array}} \bigg ( \frac{2}{1 - |P |^{-s}} - 1 \bigg )\\&= \prod _{P \text { prime}} \bigg ( \frac{1 + |P |^{-s}}{1 - |P |^{-s}} \bigg ) \prod _{P \mid R} \bigg ( \frac{1 - |P |^{-s}}{1 + |P |^{-s}} \bigg ) = \frac{\zeta _{{\mathcal {A}}} (s)^2}{\zeta _{{\mathcal {A}}} (2s)} \prod _{P \mid R} \bigg ( \frac{1 - |P |^{-s}}{1 + |P |^{-s}} \bigg ) . \end{aligned}$$

Now, let c be a positive real number, and define \(y_R := q^{{z_R}' }\). On the one hand, we have that

$$\begin{aligned}&\frac{1}{\pi i} \int _{c - i \infty }^{c+ i \infty } F(1+s) \frac{{y_R}^s}{s^3} \mathrm {d} s = \frac{1}{\pi i} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \int _{c - i \infty }^{c+ i \infty } \frac{{y_R}^s}{|N |^s s^3} \mathrm {d} s\nonumber \\&\quad = \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {z_R}' \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \log \Big ( \frac{y_R }{|N |} \Big )^2 = ( \log q )^2 \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {z_R}' \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} ( {z_R}' - {{\,\mathrm{deg}\,}}N )^2 ,\nonumber \\ \end{aligned}$$
(34)

where the second equality follows from Lemma 7.1.

On the other hand, for all positive integers n define the following curves:

$$\begin{aligned} l_1 (n)&:= \Big [ c - \frac{(2n+1) \pi i}{\log q} , c + \frac{(2n+1) \pi i}{\log q} \Big ] \\ l_2 (n)&:= \Big [ c + \frac{(2n+1) \pi i}{\log q} , -\frac{1}{4} + \frac{(2n+1) \pi i}{\log q} \Big ] \\ l_3 (n)&:= \Big [ -\frac{1}{4} + \frac{(2n+1) \pi i}{\log q} , -\frac{1}{4} - \frac{(2n+1) \pi i}{\log q} \Big ] \\ l_4 (n)&:= \Big [ -\frac{1}{4} - \frac{(2n+1) \pi i}{\log q} , c - \frac{(2n+1) \pi i}{\log q} \Big ] \\ L (n)&:= l_1 (n) \cup l_2 (n) \cup l_3 (n) \cup l_4 (n) . \end{aligned}$$

Then, we have that

$$\begin{aligned}&\frac{1}{\pi i} \int _{c - i \infty }^{c+ i \infty } F(1+s) \frac{{y_R}^s}{s^3} \mathrm {d} s\nonumber \\&\quad = \frac{1}{\pi i} \lim _{n \rightarrow \infty } \Bigg ( \int _{L (n)} F(1+s) \frac{{y_R}^s}{s^3} \mathrm {d} s - \int _{l_2 (n)} F(1+s) \frac{{y_R}^s}{s^3} \mathrm {d} s\nonumber \\&\qquad - \int _{l_3 (n)} F(1+s) \frac{{y_R}^s}{s^3} \mathrm {d} s - \int _{l_4 (n)} F(1+s) \frac{{y_R}^s}{s^3} \mathrm {d} s \bigg ) . \end{aligned}$$
(35)

Step 2: For the first integral in (35) we note that \(F(1+s) \frac{{y_R}^s}{s^3}\) has a fifth-order pole at \(s=0\) and double poles at \(s = \frac{2m \pi i}{\log q}\) for \(m = \pm 1 , \pm 2 , \ldots , \pm n\). By applying Cauchy’s residue theorem we see that

$$\begin{aligned}&\lim _{n \rightarrow \infty } \frac{1}{\pi i} \int _{L(n)} F(1+s) \frac{{y_R}^s}{s^3} \mathrm {d} s \nonumber \\&\quad = 2 {{\,\mathrm{Res}\,}}_{s=0} F(s+1)\frac{{y_R}^s}{s^3} + 2\sum _{\begin{array}{c} m \in {\mathbb {Z}} \\ m \ne 0 \end{array}} {{\,\mathrm{Res}\,}}_{s=\frac{2m \pi i}{\log q}} F(1+s)\frac{{y_R}^s}{s^3} . \end{aligned}$$
(36)

Step 2.1: For the first residue term we have that

$$\begin{aligned}&{{\,\mathrm{Res}\,}}_{s=0} F(s+1)\frac{{y_R}^s}{s^3}\nonumber \\&\quad = \frac{1}{4!} \lim _{s \longrightarrow 0} \frac{\mathrm {d}^4}{\mathrm {d}s^4} \Bigg ( \zeta _{{\mathcal {A}}} (s +1)^2 s^2 \frac{1}{\zeta _{{\mathcal {A}}} (2s+2)} \prod _{P \mid R} \bigg ( \frac{1 - |P |^{-s-1}}{1 + |P |^{-s-1}} \bigg ) {y_R}^s \Bigg ) . \end{aligned}$$
(37)

If we apply the product rule for differentiation, then one of the terms will be

$$\begin{aligned}&\frac{1}{4!} \lim _{s \longrightarrow 0} \Bigg ( \zeta _{{\mathcal {A}}} (s +1)^2 s^2 \frac{1}{\zeta _{{\mathcal {A}}} (2s+2)} \prod _{P \mid R} \bigg ( \frac{1 - |P |^{-s-1}}{1 + |P |^{-s-1}} \bigg ) \frac{\mathrm {d}^4}{\mathrm {d}s^4} {y_R}^s \Bigg ) \\&\quad = \frac{(1-q^{-1}) (\log q )^2}{24} \prod _{P \mid R} \bigg ( \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) ({z_R}')^4 \\&\quad = \frac{(1-q^{-1}) (\log q )^2}{24} \prod _{P \mid R} \bigg ( \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^4 \\&\qquad + O \Bigg ( \log q \prod _{P \mid R} \bigg ( \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^3 \omega (R) \Bigg ) . \end{aligned}$$

Now we look at the remaining terms that arise from the product rule. By using the fact that \(\zeta _{{\mathcal {A}}} (1+s) = \frac{1}{1-q^{-s}}\) and the Taylor series for \(q^{-s}\), we have for \(k=0,1,2,3,4\) that

$$\begin{aligned} \lim _{s \rightarrow 0} \frac{1}{( \log q)^{k-1}}\frac{\mathrm {d}^k}{\mathrm {d} s^k} \zeta (s+1) s = O (1) , \end{aligned}$$
(38)

Similarly,

$$\begin{aligned} \lim _{s \rightarrow 0} \frac{\mathrm {d}^k}{\mathrm {d} s^k}\zeta (2s+2)^{-1} = \lim _{s \rightarrow 0} \frac{\mathrm {d}^k}{\mathrm {d} s^k} \Big ( 1 - q^{-1-2s} \Big ) = O(1) , \end{aligned}$$
(39)

By (38), (39), and Lemma 7.2, we see that the remaining terms are of order

$$\begin{aligned} ( \log q )^2 \prod _{P \mid R} \bigg ( \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^3 \log {{\,\mathrm{deg}\,}}R . \end{aligned}$$

Hence,

$$\begin{aligned}&2 {{\,\mathrm{Res}\,}}_{s=0} F(s+1)\frac{{y_R}^s}{s^3} = \frac{(1-q^{-1}) (\log q )^2}{12} \bigg ( \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^4 \nonumber \\&\quad + O \Bigg ( ( \log q )^2 \bigg ( \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) \Big ( ({{\,\mathrm{deg}\,}}R)^3 \omega (R) + ({{\,\mathrm{deg}\,}}R)^3 \log {{\,\mathrm{deg}\,}}R \Big )\Bigg ).\qquad \end{aligned}$$
(40)

Step 2.2: Now we look at the remaining residue terms in (36). By similar (but simpler) means as above we can show that

$$\begin{aligned} {{\,\mathrm{Res}\,}}_{s=\frac{2m \pi i}{\log q}} F(1+s)\frac{{y_R}^s}{s^3} = O \Bigg ( \frac{1}{m^3} (\log q )^2 \bigg ( \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) {{\,\mathrm{deg}\,}}R \Bigg ) , \end{aligned}$$

and so

$$\begin{aligned} \sum _{\begin{array}{c} m \in {\mathbb {Z}} \\ m \ne 0 \end{array}} {{\,\mathrm{Res}\,}}_{s=\frac{2m \pi i}{\log q}} F(1+s)\frac{{y_R}^s}{s^3} = O \Bigg ( (\log q )^2 \bigg ( \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) {{\,\mathrm{deg}\,}}R \Bigg ) . \end{aligned}$$
(41)

Step 2.3: By (36), (40) and (41), we see that

$$\begin{aligned} \begin{aligned}&\lim _{n \rightarrow \infty } \frac{1}{\pi i} \int _{L(n)} F(1+s) \frac{{y_R}^s}{s^3} \mathrm {d} s = \frac{(1-q^{-1}) (\log q )^2}{12} \bigg ( \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^4 \\&\quad + O \Bigg ( ( \log q )^2 \bigg ( \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) \Big ( ({{\,\mathrm{deg}\,}}R)^3 \omega (R) + ({{\,\mathrm{deg}\,}}R)^3 \log {{\,\mathrm{deg}\,}}R \Big ) \Bigg ) . \end{aligned} \end{aligned}$$
(42)

Step 3: We now look at the integrals over \(l_2 (n)\) and \(l_4 (n)\). There exists an absolute constant \(\kappa \) such that for all positive integers n and all \(s \in l_2 (n) , l_4 (n)\) we have that \(F(s+1) {y_R}^s \le \kappa |R |^{c+1}\). One can now easily deduce for \(i = 2,4\) that

$$\begin{aligned} \lim _{n \rightarrow \infty } \Big |\frac{1}{\pi i} \int _{l_i (n)} F(1+s) \frac{{y_R}^s}{s^3} \mathrm {d} s \Big |= 0 . \end{aligned}$$
(43)

Step 4: We now look at the integral over \(l_3 (n)\). For all positive integers n and all \(s \in l_3 (n)\) we have that

$$\begin{aligned} \frac{\zeta _{{\mathcal {A}}} (s+1)^2}{\zeta _{{\mathcal {A}}} (2s+2)} = O(1) \end{aligned}$$

and

$$\begin{aligned} \bigg |\bigg ( \prod _{P \mid R} \frac{1 - |P |^{-s-1}}{1 + |P |^{-s-1}} \bigg ) {y_R}^{s} \bigg |\ll&\bigg ( \prod _{P \mid R} \frac{1 + |P |^{-\frac{3}{4}}}{1 - |P |^{-\frac{3}{4}}} \bigg ) \bigg ( \prod _{P \mid R} 9^{\frac{1}{4}} \bigg ) |R |^{-\frac{1}{4}} \\ \ll&\bigg ( \prod _{P \mid R} 1 + \frac{2}{2^{\frac{3}{4}} -1} \bigg ) \bigg ( \prod _{P \mid R} 2 \bigg ) |R |^{-\frac{1}{4}} \\ \ll&\bigg ( \prod _{P \mid R} 8 \bigg ) |R |^{-\frac{1}{4}} \ll \bigg ( \prod _{P \mid R} \frac{8}{|P |^{\frac{1}{4}}} \bigg ) \ll 1 . \end{aligned}$$

We can now easily deduce that

$$\begin{aligned} \lim _{n \rightarrow \infty } \Big |\frac{1}{\pi i} \int _{l_3 (n)} F(1+s) \frac{{y_R}^s}{s^3} \mathrm {d} s \Big |= O(1) . \end{aligned}$$
(44)

Step 5: By (34), (35), (42), (43) and (44), we deduce that

$$\begin{aligned}&\sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {z_R}' \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} ( {z_R}' - {{\,\mathrm{deg}\,}}N )^2 = \frac{(1-q^{-1})}{12} \bigg ( \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^4 \\&\quad + O \Bigg ( \bigg ( \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) \Big ( ({{\,\mathrm{deg}\,}}R)^3 \omega (R) + ({{\,\mathrm{deg}\,}}R)^3 \log {{\,\mathrm{deg}\,}}R \Big ) \Bigg ) . \end{aligned}$$

\(\square \)

Lemma 7.5

We have that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le x \end{array}} \frac{2^{\omega (N)}}{|N |} = \frac{q-1}{2q} x^2 + \frac{3q+1}{2q} x + 1 = O (x^2 ) . \end{aligned}$$

Proof

For \(s>1\) we define

$$\begin{aligned} F(s) := \sum _{N \in {\mathcal {M}}} \frac{2^{\omega (N)}}{|N |^{s+1}}. \end{aligned}$$

We can see that

$$\begin{aligned} F(s) =&\prod _{P \text { prime}} \bigg ( 1 + \frac{2}{|P |^{s+1}} + \frac{2}{|P |^{2(s+1)}} + \frac{2}{|P |^{3(s+1)}} + \cdots \bigg )\\ =&\prod _{P \text { prime}} \bigg ( \frac{2}{1 - \frac{1}{|P |^{s+1}}} - 1 \bigg ) \\ =&\prod _{P \text { prime}} \frac{1 - \frac{1}{|P |^{2(s+1)}}}{\Big ( 1 - \frac{1}{|P |^{s+1}} \Big )^2} = \frac{\zeta (s+1)^2}{\zeta (2s+2)} = \bigg ( \sum _{n=0}^{\infty } q^{-ns} \bigg )^2 \Big ( 1 - q^{-1-2s} \Big ) . \end{aligned}$$

By comparing the coefficients of powers of \(q^{-s}\), we see that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le x \end{array}} \frac{2^{\omega (N)}}{|N |} = \bigg ( \sum _{n=0}^{x} n+1 \bigg ) - \frac{1}{q} \bigg ( \sum _{n=2}^{x} n-1 \bigg ) = \frac{q-1}{2q} x^2 + \frac{3q+1}{2q} x + 1 . \end{aligned}$$

\(\square \)

Lemma 7.6

Let \(R \in {\mathcal {M}}\). We have that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {{\,\mathrm{deg}\,}}R \\ (N,R)=1 \end{array}} \frac{2^{\omega (N)}}{|N |} \ll \bigg ( \prod _{P \mid R} \frac{1}{1 + 2 |P |^{-1}} \bigg ) \big ( {{\,\mathrm{deg}\,}}R \big )^2 \asymp \bigg ( \prod _{P \mid R} \frac{1- |P |^{-1}}{1 + |P |^{-1}} \bigg ) \big ( {{\,\mathrm{deg}\,}}R \big )^2 . \end{aligned}$$

Proof

We have that

$$\begin{aligned} \bigg ( \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {{\,\mathrm{deg}\,}}R \\ (N,R)=1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ) \bigg ( \sum _{E \mid R} \frac{2^{\omega (E)}}{|E |} \bigg ) \le \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le 2 {{\,\mathrm{deg}\,}}R \end{array}} \frac{2^{\omega (N)}}{|N |} \ll \big ( {{\,\mathrm{deg}\,}}R \big )^2 . \end{aligned}$$

where the last relations follows from Lemma 7.5. We also note that

$$\begin{aligned} \sum _{E \mid R} \frac{2^{\omega (E)}}{|E |} \ge \sum _{E \mid R} \frac{\mu (E)^2 2^{\omega (E)}}{|E |} = \prod _{P \mid R} 1 +\frac{2}{|P |}. \end{aligned}$$

This proves the first relation in the lemma. The second relation follows from Lemma 4.9. \(\square \)

Lemma 7.7

Let \(F,K \in {\mathcal {M}}\), \(x \ge 0\), and \(a \in {\mathbb {F}}_q^*\). Suppose also that \(\frac{1}{2} x < {{\,\mathrm{deg}\,}}KF \le \frac{3}{4} x\). Then,

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = x - {{\,\mathrm{deg}\,}}KF \\ (N,F) = 1 \end{array}} d(N) d(KF+ aN) \ll q^x x^2 \frac{1}{|KF |} \sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{x-{{\,\mathrm{deg}\,}}KF}{2} \end{array}} \frac{d(H)}{|H |} . \end{aligned}$$

Proof

We have that,

$$\begin{aligned}&\sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = x - {{\,\mathrm{deg}\,}}KF \\ (N,F) = 1 \end{array}} d(N) d(KF+ aN) \\&\quad \le 2 \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = x - {{\,\mathrm{deg}\,}}KF \\ (N,F) = 1 \end{array}} \sum _{\begin{array}{c} G \mid N \\ {{\,\mathrm{deg}\,}}G \le \frac{x-{{\,\mathrm{deg}\,}}KF}{2} \end{array}} d(KF+ aN)\\&\quad \ll \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{x-{{\,\mathrm{deg}\,}}KF}{2} \\ (G,F) = 1 \end{array}} \; \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = x - {{\,\mathrm{deg}\,}}KF \\ G \mid N \end{array}} d(KF+ aN)\\&\quad = \sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{x-{{\,\mathrm{deg}\,}}KF}{2} \end{array}} \; \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{x-{{\,\mathrm{deg}\,}}KF}{2} \\ (G,F) = 1 \\ (G,K)=H \end{array}} \; \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = x - {{\,\mathrm{deg}\,}}KF \\ G \mid N \end{array}} d(KF+ aN) \\&\quad = \sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{x-{{\,\mathrm{deg}\,}}KF}{2} \end{array}} \; \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{x-{{\,\mathrm{deg}\,}}KF}{2} \\ (G,F) = 1 \\ (G,K)=H \end{array}} \; \sum _{\begin{array}{c} N' \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N' = x - {{\,\mathrm{deg}\,}}KF - {{\,\mathrm{deg}\,}}H \\ G' \mid N' \end{array}} d(HK'F+ aHN') \end{aligned}$$

where \(N' , G', K'\) are defined by \(HN'=N , HG'=G, HK'=K\). Continuing, we have that

$$\begin{aligned}&\sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le x - {{\,\mathrm{deg}\,}}KF \\ (N,F) = 1 \end{array}} d(N) d(KF+ aN) \\&\quad \ll \sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{x-{{\,\mathrm{deg}\,}}KF}{2} \end{array}} d(H) \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{x-{{\,\mathrm{deg}\,}}KF}{2} \\ (G,F) = 1 \\ (G,K)=H \end{array}} \; \sum _{\begin{array}{c} N' \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N' = x - {{\,\mathrm{deg}\,}}KF - {{\,\mathrm{deg}\,}}H \\ G' \mid N' \end{array}} d(K'F+ aN') \\&\quad \le \sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{x-{{\,\mathrm{deg}\,}}KF}{2} \end{array}} d(H) \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{x-{{\,\mathrm{deg}\,}}KF}{2} \\ (G,F) = 1 \\ (G,K)=H \end{array}} \; \sum _{\begin{array}{c} M \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(M-K'F) = x - {{\,\mathrm{deg}\,}}KF - {{\,\mathrm{deg}\,}}H \\ (M-K'F) \in a {\mathcal {M}} \\ M \equiv K' F ({{\,\mathrm{mod}\,}}G') \end{array}} d(M) \\&\quad \ll q^x x \frac{1}{|K F |} \sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{x-{{\,\mathrm{deg}\,}}KF}{2} \end{array}} \frac{d(H)}{|H |} \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{x-{{\,\mathrm{deg}\,}}KF}{2} \\ (G,F) = 1 \\ (G,K)=H \end{array}} \frac{1}{\phi (G')}\\&\ll q^x x^2 \frac{1}{|K F |} \sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{x-{{\,\mathrm{deg}\,}}KF}{2} \end{array}} \frac{d(H)}{|H |} . \end{aligned}$$

The third relation holds by Theorem 6.2 with \(\beta = \frac{1}{6}\) and \(\alpha = \frac{1}{4}\) (one may wish to note that \((K'F,G')=1\) and that the other conditions of the theorem are satisfied because \(\frac{1}{2} x < {{\,\mathrm{deg}\,}}KF \le \frac{3}{4} x\)). The last relation follows from Lemma 4.10. \(\square \)

Lemma 7.8

Let \(F,K \in {\mathcal {M}}\) and \(x \ge 0\) satisfy \({{\,\mathrm{deg}\,}}KF < x\). Then,

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = x \\ (N,F) = 1 \end{array}} d(N) d(KF+N) \ll q^x x^2 \sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{x}{2} \end{array}} \frac{d(H)}{|H |} . \end{aligned}$$

Proof

The proof is similar to the proof of Lemma 7.7. We have that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = x \\ (N,F) = 1 \end{array}} d(N) d(KF+N) \le&2 \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = x \\ (N,F) = 1 \end{array}} \sum _{\begin{array}{c} G \mid N \\ {{\,\mathrm{deg}\,}}G \le \frac{x}{2} \end{array}} d(KF+N)\\ \ll&\sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{x}{2} \\ (G,F) =1 \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = x \\ G \mid N \end{array}} d(KF+N) \\ =&\sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{x}{2} \end{array}} \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{x}{2} \\ (G,F) =1 \\ (G,K) = H \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = x \\ G \mid N \end{array}} d(KF+N) \\ =&\sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{x}{2} \end{array}} \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{x}{2} \\ (G,F) =1 \\ (G,K) = H \end{array}} \sum _{\begin{array}{c} N' \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N' = x-{{\,\mathrm{deg}\,}}H \\ G' \mid N' \end{array}} d(HK'F+HN') , \end{aligned}$$

where \(N' , G', K'\) are defined by \(HN'=N , HG'=G, HK'=K\). Continuing, we have that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = x \\ (N,F) = 1 \end{array}} d(N) d(KF+N) \ll&\sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{x}{2} \end{array}} d(H) \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{x}{2} \\ (G,F) =1 \\ (G,K) = H \end{array}} \sum _{\begin{array}{c} N' \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N' = x-{{\,\mathrm{deg}\,}}H \\ G' \mid N' \end{array}} d(K'F+N') \\ \le&\sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{x}{2} \end{array}} d(H) \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{x}{2} \\ (G,F) =1 \\ (G,K) = H \end{array}} \sum _{\begin{array}{c} M \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(M-X) < x - {{\,\mathrm{deg}\,}}H \\ M \equiv K'F ({{\,\mathrm{mod}\,}}G') \end{array}} d(M) , \end{aligned}$$

where we define \(X := T^{x - {{\,\mathrm{deg}\,}}H}\). We can now apply Theorem 6.1 to obtain that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = x \\ (N,F) = 1 \end{array}} d(N) d(KF+N) \ll&q^x x \sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{x}{2} \end{array}} \frac{d(H)}{|H |} \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{x}{2} \\ (G,F) =1 \\ (G,K) = H \end{array}} \frac{1}{\phi (G')} \\ \ll&q^x x^2 \sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{x}{2} \end{array}} \frac{d(H)}{|H |} . \end{aligned}$$

\(\square \)

Lemma 7.9

Let \(F \in {\mathcal {M}}\) and \(z_1 , z_2\) be non-negative integers. Then, for all \(\epsilon > 0\) we have that

$$\begin{aligned} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = z_1 \\ {{\,\mathrm{deg}\,}}CD = z_2 \\ (ABCD,F)=1 \\ AC \equiv BD ({{\,\mathrm{mod}\,}}F) \\ AC \ne BD \end{array}} 1 {\left\{ \begin{array}{ll} \ll _{\epsilon } \frac{1}{|F |} \Big ( q^{z_1} q^{z_2} \Big )^{1+\epsilon } &{}\text { if }z_1 + z_2 \le \frac{19}{10} {{\,\mathrm{deg}\,}}F \\ \ll \frac{1}{\phi (F)} q^{z_1} q^{z_2} (z_1 + z_2)^3 &{}\text { if }z_1 + z_2 > \frac{19}{10} {{\,\mathrm{deg}\,}}F . \end{array}\right. } \end{aligned}$$

Proof

We can split the sum into the cases \({{\,\mathrm{deg}\,}}AC > {{\,\mathrm{deg}\,}}BD\), \({{\,\mathrm{deg}\,}}AC < {{\,\mathrm{deg}\,}}BD\), and \({{\,\mathrm{deg}\,}}AC = {{\,\mathrm{deg}\,}}BD\) with \(AC \ne BD\). The first two cases are identical by symmetry.

When \({{\,\mathrm{deg}\,}}AC > {{\,\mathrm{deg}\,}}BD\), we have that \(AC = KF + BD\) where \(K \in {\mathcal {M}}\) and \({{\,\mathrm{deg}\,}}KF > {{\,\mathrm{deg}\,}}BD\). Furthermore,

$$\begin{aligned} 2 {{\,\mathrm{deg}\,}}KF = 2 {{\,\mathrm{deg}\,}}AC > {{\,\mathrm{deg}\,}}AC + {{\,\mathrm{deg}\,}}BD = {{\,\mathrm{deg}\,}}AB + {{\,\mathrm{deg}\,}}CD = z_1 + z_2, \end{aligned}$$

from which we deduce that \(\frac{z_1 + z_2}{2} < {{\,\mathrm{deg}\,}}KF \le z_1 + z_2\); and

$$\begin{aligned} {{\,\mathrm{deg}\,}}KF + {{\,\mathrm{deg}\,}}BD = {{\,\mathrm{deg}\,}}AC + {{\,\mathrm{deg}\,}}BD = z_1 + z_2, \end{aligned}$$

from which we deduce that \({{\,\mathrm{deg}\,}}BD = z_1 + z_2 - {{\,\mathrm{deg}\,}}KF\).

When \({{\,\mathrm{deg}\,}}AC = {{\,\mathrm{deg}\,}}BD\), we must have that \({{\,\mathrm{deg}\,}}AC = {{\,\mathrm{deg}\,}}BD = \frac{z_1 + z_2}{2}\) (in particular, this case applies only when \(z_1 + z_2 \) is even). Also, we can write \(AC = KF +BD\), where \({{\,\mathrm{deg}\,}}KF < {{\,\mathrm{deg}\,}}BD = \frac{z_1 + z_2}{2}\) and K need not be monic.

So, writing \(N = BD\), we have that

$$\begin{aligned} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = z_1 \\ {{\,\mathrm{deg}\,}}CD = z_2 \\ (ABCD,F)=1 \\ AC \equiv BD ({{\,\mathrm{mod}\,}}F) \\ AC \ne BD \end{array}} 1&\le 2 \sum _{\begin{array}{c} K \in {\mathcal {M}} \\ \frac{z_1 + z_2}{2}< {{\,\mathrm{deg}\,}}KF \le z_1 + z_2 \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = z_1 + z_2 - {{\,\mathrm{deg}\,}}KF \\ (N,F)=1 \end{array}} d(N) d(KF+N) \nonumber \\&\quad +\, \sum _{\begin{array}{c} K \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}KF < \frac{z_1 + z_2}{2} \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = \frac{z_1 + z_2}{2} \\ (N,F)=1 \end{array}} d(N) d(KF+N) \end{aligned}$$
(45)

Step 1: Let us consider the case when \(z_1 + z_2 \le \frac{19}{10} {{\,\mathrm{deg}\,}}F\). By using well known bounds on the divisor function, we have that

$$\begin{aligned}&\sum _{\begin{array}{c} K \in {\mathcal {M}} \\ \frac{z_1 + z_2}{2}< {{\,\mathrm{deg}\,}}KF \le z_1 + z_2 \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = z_1 + z_2 - {{\,\mathrm{deg}\,}}KF \\ (N,F)=1 \end{array}} d(N) d(KF+N) \\&\quad \ll _{\epsilon } \Big ( q^{z_1} q^{z_2} \Big )^{\frac{\epsilon }{2}} \sum _{\begin{array}{c} K \in {\mathcal {M}} \\ \frac{z_1 + z_2}{2}< {{\,\mathrm{deg}\,}}KF \le z_1 + z_2 \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = z_1 + z_2 - {{\,\mathrm{deg}\,}}KF \\ (N,F)=1 \end{array}} 1 \\&\quad \le \Big ( q^{z_1} q^{z_2} \Big )^{1 + \frac{\epsilon }{2}} \sum _{\begin{array}{c} K \in {\mathcal {M}} \\ \frac{z_1 + z_2}{2} < {{\,\mathrm{deg}\,}}KF \le z_1 + z_2 \end{array}} \frac{1}{|KF |} \\&\quad \le \Big ( q^{z_1} q^{z_2} \Big )^{1 + \frac{\epsilon }{2}} \frac{z_1 + z_2}{|F |} \ll _{\epsilon } \Big ( q^{z_1} q^{z_2} \Big )^{1 + \epsilon } \frac{1}{|F |} . \end{aligned}$$

As for the sum

$$\begin{aligned} \sum _{\begin{array}{c} K \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}KF < \frac{z_1 + z_2}{2} \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = \frac{z_1 + z_2}{2} \\ (N,F)=1 \end{array}} d(N) d(KF+N) , \end{aligned}$$

we note that it does not apply to this case where \(z_1 + z_2 \le \frac{19}{10} {{\,\mathrm{deg}\,}}F\) because \({{\,\mathrm{deg}\,}}KF \ge {{\,\mathrm{deg}\,}}F \ge \frac{20}{19} \frac{z_1 + z_2}{2}\), which does not overlap with range \({{\,\mathrm{deg}\,}}KF < \frac{z_1 + z_2}{2}\) in the sum.

Hence,

$$\begin{aligned} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = z_1 \\ {{\,\mathrm{deg}\,}}CD = z_2 \\ (ABCD,F)=1 \\ AC \equiv BD ({{\,\mathrm{mod}\,}}F) \\ AC \ne BD \end{array}} 1 \ll _{\epsilon } \Big ( q^{z_1} q^{z_2} \Big )^{1 + \epsilon } \frac{1}{|F |} . \end{aligned}$$

Step 2: We now consider the case when \(z_1 + z_2 > \frac{19}{10} {{\,\mathrm{deg}\,}}F\).

Step 2.1: We consider the subcase where \(\frac{z_1 + z_2}{2} < {{\,\mathrm{deg}\,}}KF \le \frac{3(z_1 + z_2)}{4}\). This allows us to apply Lemma 7.7 for the first relation below.

$$\begin{aligned}&\sum _{\begin{array}{c} K \in {\mathcal {M}} \\ \frac{z_1 + z_2}{2}< {{\,\mathrm{deg}\,}}KF \le \frac{3(z_1 + z_2)}{4} \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = z_1 + z_2 - {{\,\mathrm{deg}\,}}KF \\ (N,F)=1 \end{array}} d(N) d(KF+N) \\&\quad \ll q^{z_1} q^{z_2} (z_1 + z_2)^2 \frac{1}{|F |} \sum _{\begin{array}{c} K \in {\mathcal {M}} \\ \frac{z_1 + z_2}{2} < {{\,\mathrm{deg}\,}}KF \le \frac{3(z_1 + z_2)}{4} \end{array}} \frac{1}{|K |} \sum _{\begin{array}{c} H \mid K \\ {{\,\mathrm{deg}\,}}H \le \frac{z_1 + z_2 - {{\,\mathrm{deg}\,}}KF}{2} \end{array}} \frac{d(H)}{|H |} \\&\quad \le q^{z_1} q^{z_2} (z_1 + z_2)^2 \frac{1}{|F |} \sum _{\begin{array}{c} K \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}K \le z_1 + z_2 \end{array}} \frac{1}{|K |} \sum _{H \mid K} \frac{d(H)}{|H |} \\&\quad = q^{z_1} q^{z_2} (z_1 + z_2)^2 \frac{1}{|F |} \sum _{\begin{array}{c} H \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}H \le z_1 + z_2 \end{array}} \frac{d(H)}{|H |} \sum _{\begin{array}{c} K \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}K \le z_1 + z_2 \\ H \mid K \end{array}} \frac{1}{|K |} \\&\quad \le q^{z_1} q^{z_2} (z_1 + z_2)^3 \frac{1}{|F |} \sum _{\begin{array}{c} H \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}H \le z_1 + z_2 \end{array}} \frac{d(H)}{|H |^2} \\&\quad \ll q^{z_1} q^{z_2} (z_1 + z_2)^3 \frac{1}{|F |} . \end{aligned}$$

Step 2.2: Now we consider the subcase where \(\frac{3(z_1 + z_2)}{4} < {{\,\mathrm{deg}\,}}KF \le z_1 + z_2\). We have that

$$\begin{aligned}&\sum _{\begin{array}{c} K \in {\mathcal {M}} \\ \frac{3(z_1 + z_2)}{4}< {{\,\mathrm{deg}\,}}KF \le z_1 + z_2 \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = z_1 + z_2 - {{\,\mathrm{deg}\,}}KF \\ (N,F)=1 \end{array}} d(N) d(KF+N) \\&\quad = \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N< \frac{z_1 + z_2}{4} \\ (N,F)=1 \end{array}} \sum _{\begin{array}{c} K \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}KF = z_1 + z_2 - {{\,\mathrm{deg}\,}}N \end{array}} d(N) d(KF+N) \\&\quad \le \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N< \frac{z_1 + z_2}{4} \\ (N,F)=1 \end{array}} d(N) \sum _{\begin{array}{c} M \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}(M - X_{(N)} ) < z_1 + z_2 - {{\,\mathrm{deg}\,}}N \\ M \equiv N ({{\,\mathrm{mod}\,}}F) \end{array}} d(M) \end{aligned}$$

where we define \(X_{(N)} = T^{z_1 + z_2 - {{\,\mathrm{deg}\,}}N}\).

We can now apply Theorem 6.1. One may wish to note that

$$\begin{aligned} y = z_1 + z_2 - {{\,\mathrm{deg}\,}}N \ge \frac{3}{4}(z_1 +z_2) \ge \frac{3}{4} \frac{19}{10} {{\,\mathrm{deg}\,}}F \end{aligned}$$

and so

$$\begin{aligned} {{\,\mathrm{deg}\,}}F \le \frac{40}{57} y = (1- \alpha ) y \end{aligned}$$

where \(0< \alpha < \frac{1}{2}\), as required. Hence, we have that

$$\begin{aligned}&\sum _{\begin{array}{c} K \in {\mathcal {M}} \\ \frac{3(z_1 + z_2)}{4} < {{\,\mathrm{deg}\,}}KF \le z_1 + z_2 \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = z_1 + z_2 - {{\,\mathrm{deg}\,}}KF \\ (N,F)=1 \end{array}} d(N) d(KF+N) \\&\quad \ll q^{z_1} q^{z_2} (z_1 + z_2) \frac{1}{\phi (F)} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le \frac{z_1 + z_2}{4} \\ (N,F)=1 \end{array}} \frac{d(N)}{|N |} \\&\quad \le q^{z_1} q^{z_2} (z_1 + z_2) \frac{1}{\phi (F)} \bigg ( \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le z_1 + z_2 \end{array}} \frac{1}{|N |} \bigg )^2 \\&\quad \ll q^{z_1} q^{z_2} (z_1 + z_2)^3 \frac{1}{\phi (F)} . \end{aligned}$$

Step 2.3: We now look at the sum

$$\begin{aligned} \sum _{\begin{array}{c} K \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}KF < \frac{z_1 + z_2}{2} \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = \frac{z_1 + z_2}{2} \\ (N,F)=1 \end{array}} d(N) d(KF+N) . \end{aligned}$$

By Lemma 7.8 we have that

$$\begin{aligned}&\sum _{\begin{array}{c} K \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}KF< \frac{z_1 + z_2}{2} \end{array}} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N = \frac{z_1 + z_2}{2} \\ (N,F)=1 \end{array}} d(N) d(KF+N)\\&\quad \ll q^{\frac{z_1 + z_2 }{2}} (z_1 + z_2 )^2 \sum _{\begin{array}{c} K \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}KF< \frac{z_1 + z_2}{2} \end{array}} \sum _{H \mid K} \frac{d(H)}{|H |} \\&\quad \le q^{z_1 + z_2 -1} (z_1 + z_2 )^2 \frac{1}{|F |} \sum _{\begin{array}{c} K \in {\mathcal {A}} \\ {{\,\mathrm{deg}\,}}KF < \frac{z_1 + z_2}{2} \end{array}} \frac{1}{|K |} \sum _{H \mid K} \frac{d(H)}{|H |} \\&\quad \le q^{z_1 + z_2 } (z_1 + z_2 )^3 \frac{1}{|F |} , \end{aligned}$$

where the last relation uses a similar calculation as that in Step 2.1.

Step 2.4: We apply steps 2.1, 2.2, and 2.3 to (45) and we see that

$$\begin{aligned} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = z_1 \\ {{\,\mathrm{deg}\,}}CD = z_2 \\ (ABCD,F)=1 \\ AC \equiv BD ({{\,\mathrm{mod}\,}}F) \\ AC \ne BD \end{array}} 1 \ll q^{z_1} q^{z_2} (z_1 + z_2)^3 \frac{1}{\phi (F)} \end{aligned}$$

for \(z_1 + z_2 \ge \frac{19}{10} {{\,\mathrm{deg}\,}}F\). \(\square \)

In fact, we can prove the following, more general Lemma.

Lemma 7.10

Let \(F \in {\mathcal {M}}\), \(z_1 , z_2\) be non-negative integers, and let \(a \in {\mathbb {F}}_q^*\). Then, for all \(\epsilon > 0\) we have that

$$\begin{aligned} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = z_1 \\ {{\,\mathrm{deg}\,}}CD = z_2 \\ (ABCD,F)=1 \\ AC \equiv a BD ({{\,\mathrm{mod}\,}}F) \\ AC \ne BD \end{array}} 1 {\left\{ \begin{array}{ll} \ll _{\epsilon } \frac{1}{|F |} \Big ( q^{z_1} q^{z_2} \Big )^{1+\epsilon } &{}\text { if }z_1 + z_2 \le \frac{19}{10} {{\,\mathrm{deg}\,}}F \\ \ll \frac{1}{\phi (F)} q^{z_1} q^{z_2} (z_1 + z_2)^3 &{}\text { if }z_1 + z_2 > \frac{19}{10} {{\,\mathrm{deg}\,}}F , \end{array}\right. } \end{aligned}$$

Proof

The case where \(a=1\) is just Lemma 7.9. The proof of the case where \(a \ne 1\) is very similar to the proof of Lemma 7.9. In fact it is easier, because the the case where \({{\,\mathrm{deg}\,}}AC = {{\,\mathrm{deg}\,}}BD\) cannot exist: We would require that AC and BD are both monic, but also require that at least one of AC and BD have leading coefficient equal to \(a \ne 1\). \(\square \)

Proposition 7.11

Let \(R \in {\mathcal {M}}\) and define \(z_R := {{\,\mathrm{deg}\,}}R - \log _q 2^{\omega (R)}\). Also, let \(a \in {\mathbb {F}}_q^*\). Then,

$$\begin{aligned} \sum _{EF=R} \mu (E) \phi (F) \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB \le z_R \\ {{\,\mathrm{deg}\,}}CD \le z_R \\ (ABCD,R)=1 \\ AC \equiv aBD ({{\,\mathrm{mod}\,}}F) \\ AC \ne BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} \ll |R |\big ( {{\,\mathrm{deg}\,}}R \big )^3 . \end{aligned}$$

Proof

We apply Lemma 7.10 with \(\epsilon = \frac{1}{50}\) to deduce that

$$\begin{aligned}&\sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB \le z_R \\ {{\,\mathrm{deg}\,}}CD \le z_R \\ (ABCD,R)=1 \\ AC \equiv aBD ({{\,\mathrm{mod}\,}}F) \\ AC \ne BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}}\\&\quad \ll \frac{1}{|F |} \sum _{\begin{array}{c} z_1 , z_2 \le z_R \\ z_1 + z_2 \le \frac{19}{10} {{\,\mathrm{deg}\,}}F \end{array}} \Big ( q^{z_1} q^{z_2} \Big )^{\frac{1}{2} + \epsilon } + \frac{1}{\phi (F)} \sum _{\begin{array}{c} z_1 , z_2 \le z_R \\ \frac{19}{10} {{\,\mathrm{deg}\,}}F< z_1 + z_2 \le 2 {{\,\mathrm{deg}\,}}R \end{array}} q^{\frac{z_1}{2}} q^{\frac{z_2}{2}} (z_1 + z_2)^3 \\&\quad \ll \frac{1}{|F |^{\frac{1}{20} - 2 \epsilon }} + \frac{1}{\phi (F)} \big ( {{\,\mathrm{deg}\,}}R \big )^3 \sum _{z_1< z_R} \sum _{z_2 < z_R} q^{\frac{z_1}{2}} q^{\frac{z_2}{2}} \ll \frac{1}{|F |^{\frac{1}{20} - 2 \epsilon }} + \frac{1}{|F |} q^{z_R} \big ( {{\,\mathrm{deg}\,}}R \big )^3 . \end{aligned}$$

So,

$$\begin{aligned}&\sum _{EF=R} \mu (E) \phi (F) \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB \le z_R \\ {{\,\mathrm{deg}\,}}CD \le z_R \\ (ABCD,R)=1 \\ AC \equiv BD ({{\,\mathrm{mod}\,}}F) \\ AC \ne BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}}\\&\quad \ll q^{z_R} \big ( {{\,\mathrm{deg}\,}}R \big )^3 \sum _{EF=R} |\mu (E) |+ \sum _{EF=R} |\mu (E) |\frac{\phi (F)}{|F |^{\frac{1}{20} - 2 \epsilon }} \\&\quad \ll q^{z_R} \big ( {{\,\mathrm{deg}\,}}R \big )^3 2^{\omega (R)} + |R |\ll |R |\big ( {{\,\mathrm{deg}\,}}R \big )^3 , \end{aligned}$$

where the second-to-last relation uses the following.

$$\begin{aligned}&\sum _{EF=R} |\mu (E) |\frac{\phi (F)}{|F |^{\frac{1}{20} - 2 \epsilon }} \le \sum _{EF=R} |\mu (E) |\phi (F)\\&\quad = \phi (R) \sum _{EF=R} |\mu (E) |\bigg ( \prod _{\begin{array}{c} P \mid E \\ P^2 \mid R \end{array}} \frac{1}{|P |} \bigg ) \bigg ( \prod _{\begin{array}{c} P \mid E \\ P^2 \not \mid R \end{array}} \frac{1}{|P |-1} \bigg ) \\&\quad \le \phi (R) \sum _{EF=R} |\mu (E) |\prod _{P \mid E} \frac{1}{|P |-1} = \phi (R) \prod _{P \mid R} 1 + \frac{1}{|P |-1} = \phi (R) \frac{|R |}{\phi (R)} = |R |. \end{aligned}$$

\(\square \)

8 The fourth moment

We now proceed to prove Theorem 2.6. In the proof we implicitly state that some terms are of lower order than the main term and that is easy to check. We do not give the justification explicitly, although all the results one needs for a rigorous justification are given in Sect. 4.

Proof of Theorem 2.6

Let \(\chi \) be a Dirichlet character of modulus R. By Lemmas 3.10 and 3.11, we have that

$$\begin{aligned} \Big |L \Big ( \frac{1}{2} , \chi \Big ) \Big |^2 = 2 \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB < {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} + c (\chi ) = 2 a(\chi ) + 2 b(\chi ) + c (\chi ) , \end{aligned}$$

where

$$\begin{aligned} z_R :=&{{\,\mathrm{deg}\,}}R - \log _q (2^{\omega (Q)}) , \\ a (\chi ) :=&\sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB \le z_R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} , \\ b (\chi ) :=&\sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ z_R< {{\,\mathrm{deg}\,}}AB < {{\,\mathrm{deg}\,}}R \end{array}} \frac{\chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} , \end{aligned}$$

and \(c(\chi )\) is defined as in (10). Then,

$$\begin{aligned} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \Big |L \Big ( \frac{1}{2} , \chi \Big ) \Big |^4 = \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \Big ( 2 a(\chi ) + 2 b(\chi ) + c (\chi ) \Big )^2 . \end{aligned}$$

We will show that has an asymptotic main term of higher order than and . From this and the Cauchy–Schwarz inequality, we deduce that gives the leading term in the asymptotic formula.

Step 1: We have that

$$\begin{aligned} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} |a (\chi ) |^2 =&\mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB \le z_R \\ {{\,\mathrm{deg}\,}}CD \le z_R \end{array}} \frac{\chi (AC) \overline{\chi }(BD)}{|ABCD |^{\frac{1}{2}}}\\ =&\sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB \le z_R \\ {{\,\mathrm{deg}\,}}CD \le z_R \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} \chi (AC) \overline{\chi }(BD)\\ =&\sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB \le z_R \\ {{\,\mathrm{deg}\,}}CD \le z_R \\ (ABCD,R) = 1 \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} \sum _{\begin{array}{c} EF = R \\ F \mid (AC - BD) \end{array}} \mu (E) \phi (F) , \end{aligned}$$

where the last equality follows from Lemma 3.7. Continuing,

$$\begin{aligned}&\mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} |a (\chi ) |^2 = \sum _{EF = R} \mu (E) \phi (F) \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB \le z_R \\ {{\,\mathrm{deg}\,}}CD \le z_R \\ (ABCD,R) = 1 \\ F \mid (AC - BD) \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} \nonumber \\&\quad = \sum _{EF = R} \mu (E) \phi (F) \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB \le z_R \\ {{\,\mathrm{deg}\,}}CD \le z_R \\ (ABCD,R) = 1 \\ F \mid (AC - BD) \\ AC = BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}}\nonumber \\&\qquad + \sum _{EF = R} \mu (E) \phi (F) \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB \le z_R \\ {{\,\mathrm{deg}\,}}CD \le z_R \\ (ABCD,R) = 1 \\ F \mid (AC - BD) \\ AC \ne BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} \nonumber \\&\quad = \bigg ( \sum _{EF = R} \mu (E) \phi (F) \bigg ) \bigg ( \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB \le z_R \\ {{\,\mathrm{deg}\,}}CD \le z_R \\ (ABCD,R) = 1 \\ AC = BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} \bigg )\nonumber \\&\qquad + \sum _{EF = R} \mu (E) \phi (F) \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB \le z_R \\ {{\,\mathrm{deg}\,}}CD \le z_R \\ (ABCD,R) = 1 \\ F \mid (AC - BD) \\ AC \ne BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}}. \end{aligned}$$
(46)

Step 1.1: We will look at the first term on the far-RHS. Since \(AC = BD\), we can write \(A = GU , B = GV , C = HV , D = HU\), where GHUV are monic and UV are coprime. Let us write \(N = UV\), and note that there are \(2^{\omega (N)}\) ways of writing \(N = UV\) with UV being coprime. Then,

$$\begin{aligned}&\sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB \le z_R \\ {{\,\mathrm{deg}\,}}CD \le z_R \\ (ABCD,R) = 1 \\ AC = BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} = \sum _{\begin{array}{c} G,H,U,V \in {\mathcal {M}} \\ (U,V)=1 \\ {{\,\mathrm{deg}\,}}G^2 UV \le z_R \\ {{\,\mathrm{deg}\,}}H^2 UV \le z_R \\ (GHUV,R) = 1 \end{array}} \frac{1}{|GHUV |} = \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le z_R \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ( \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{z_R -{{\,\mathrm{deg}\,}}N}{2} \\ (G , R) = 1 \end{array}} \frac{1}{|G |} \bigg )^2 \nonumber \\&= \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {z_R}' \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ( \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{z_R -{{\,\mathrm{deg}\,}}N}{2} \\ (G , R) = 1 \end{array}} \frac{1}{|G |} \bigg )^2 + \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {z_R}' < {{\,\mathrm{deg}\,}}N \le z_R \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ( \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{z_R -{{\,\mathrm{deg}\,}}N}{2} \\ (G , R) = 1 \end{array}} \frac{1}{|G |} \bigg )^2 ,\nonumber \\ \end{aligned}$$
(47)

where \({z_R}' := {{\,\mathrm{deg}\,}}R - \log _q 9^{\omega (R)}\).

Let us look at the first term on the far-RHS of (47). We apply Lemma 4.12. When \(x = \frac{z_R - {{\,\mathrm{deg}\,}}N}{2}\) and \({{\,\mathrm{deg}\,}}N \le {z_R}'\), we have that \(\frac{2^{\omega (R)} x}{q^x} = O(1)\). Hence

$$\begin{aligned}&\sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {z_R}' \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ( \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{z_R -{{\,\mathrm{deg}\,}}N}{2} \\ (G , R) = 1 \end{array}} \frac{1}{|G |} \bigg )^2\nonumber \\&\quad = \bigg ( \frac{\varPhi (R)}{2 |R |} \bigg )^2 \sum _{\begin{array}{c} N \in {\mathcal {M}}\\ {{\,\mathrm{deg}\,}}N \le {z_R}' \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \Bigg ( {z_R}' - {{\,\mathrm{deg}\,}}N + O \big ( \log \omega (R) \big ) \Bigg )^2 \nonumber \\&\quad = \bigg ( \frac{\varPhi (R)}{2 |R |} \bigg )^2 \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {z_R}' \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \Bigg ( \big ( {z_R}' - {{\,\mathrm{deg}\,}}N \big )^2 + O \big ( {{\,\mathrm{deg}\,}}R \log \omega (R) \big ) \Bigg ) \nonumber \\&\quad = \frac{1-q^{-1}}{48} \prod _{\begin{array}{c} P \text { prime} \\ P \mid R \end{array}} \bigg ( \frac{ \big ( 1 - |P |^{-1} \big )^3}{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^4 \nonumber \\&\qquad + O \Bigg ( \bigg ( \prod _{\begin{array}{c} P \text { prime} \\ P \mid R \end{array}} \frac{\big ( 1 - |P |^{-1} \big )^3 }{1 + |P |^{-1}} \bigg ) \Big ( ({{\,\mathrm{deg}\,}}R)^3 \omega (R)+ ({{\,\mathrm{deg}\,}}R)^3 \log {{\,\mathrm{deg}\,}}R \Big ) \Bigg ),\qquad \end{aligned}$$
(48)

where the last equality follows from Lemmas 7.4 and 7.6.

Now we look at the second term on the far-RHS of (47). Because \({z_R}' < {{\,\mathrm{deg}\,}}N \le z_R\), we have that \({{\,\mathrm{deg}\,}}G \le \log _q \big ( \frac{3}{\sqrt{2}} \big )^{\omega (R)} \). Using this and Lemma 4.12, we have that

$$\begin{aligned} \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{z_R -{{\,\mathrm{deg}\,}}N}{2} \\ (G , R) = 1 \end{array}} \frac{1}{|G |} \le \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \log _q \big ( \frac{3}{\sqrt{2}}^{\omega (R)} \big ) \\ (G , R) = 1 \end{array}} \frac{1}{|G |} \ll \frac{\phi (R)}{|R |} \omega (R) . \end{aligned}$$

Also, by similar means as in Lemma 7.5, we can see that

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {z_R}' \le {{\,\mathrm{deg}\,}}N \le z_R \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \le \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {z_R}' \le {{\,\mathrm{deg}\,}}N \le z_R \end{array}} \frac{2^{\omega (N)}}{|N |} \ll \omega (R) {{\,\mathrm{deg}\,}}R . \end{aligned}$$

Hence,

$$\begin{aligned} \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {z_R}' \le {{\,\mathrm{deg}\,}}N \le z_R \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ( \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{z_R -{{\,\mathrm{deg}\,}}N}{2} \\ (G , R) = 1 \end{array}} \frac{1}{|G |} \bigg )^2 \ll \bigg ( \frac{\phi (R)}{|R |} \bigg )^2 \big ( \omega (R) \big )^3 {{\,\mathrm{deg}\,}}R . \end{aligned}$$
(49)

By (47), (48) and (49), we have that

$$\begin{aligned}&\bigg ( \sum _{EF = R} \mu (E) \phi (F) \bigg ) \bigg ( \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB \le z_R \\ {{\,\mathrm{deg}\,}}CD \le z_R \\ (ABCD,R) = 1 \\ AC = BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} \bigg )\\&\quad = \frac{1-q^{-1}}{48} \phi ^* (R) \prod _{\begin{array}{c} P \text { prime} \\ P \mid R \end{array}} \bigg ( \frac{ \big ( 1 - |P |^{-1} \big )^3}{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^4 \\&\qquad + O \Bigg ( \phi ^* (R) \bigg ( \prod _{\begin{array}{c} P \text { prime} \\ P \mid R \end{array}} \frac{\big ( 1 - |P |^{-1} \big )^3 }{1 + |P |^{-1}} \bigg ) \Big ( ({{\,\mathrm{deg}\,}}R)^3 \omega (R)+ ({{\,\mathrm{deg}\,}}R)^3 \log {{\,\mathrm{deg}\,}}R \Big ) \Bigg ) . \end{aligned}$$

Step 1.2: For the second term on the far-RHS of (46) we simply apply Proposition 7.11. From this, Step 1.1, and (46), we deduce that

$$\begin{aligned}&\mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} |a (\chi ) |^2 \\&\quad = \frac{1-q^{-1}}{48} \phi ^* (R) \prod _{\begin{array}{c} P \text { prime} \\ P \mid R \end{array}} \bigg ( \frac{ \big ( 1 - |P |^{-1} \big )^3}{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^4 \\&\qquad + O \Bigg ( \phi ^* (R) \bigg ( \prod _{\begin{array}{c} P \text { prime} \\ P \mid R \end{array}} \frac{\big ( 1 - |P |^{-1} \big )^3 }{1 + |P |^{-1}} \bigg ) \Big ( ({{\,\mathrm{deg}\,}}R)^3 \omega (R)+ ({{\,\mathrm{deg}\,}}R)^3 \log {{\,\mathrm{deg}\,}}R \Big ) \Bigg ) . \end{aligned}$$

Step 2: We will now look at \(\mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} |b (\chi ) |^2\). We have that

$$\begin{aligned} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} |b (\chi ) |^2\le & {} \sum _{\chi {{\,\mathrm{mod}\,}}R} |b (\chi ) |^2 = \phi (R) \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ z_R< {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}R \\ z_R< {{\,\mathrm{deg}\,}}CD<{{\,\mathrm{deg}\,}}R \\ (ABCD,R) = 1 \\ AC \equiv BD ({{\,\mathrm{mod}\,}}R) \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}}\nonumber \\= & {} \phi (R) \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ z_R< {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}R \\ z_R< {{\,\mathrm{deg}\,}}CD<{{\,\mathrm{deg}\,}}R \\ (ABCD,R) = 1 \\ AC = BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} + \phi (R) \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ z_R< {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}R \\ z_R< {{\,\mathrm{deg}\,}}CD <{{\,\mathrm{deg}\,}}R \\ (ABCD,R) = 1 \\ AC \equiv BD ({{\,\mathrm{mod}\,}}R) \\ AC \ne BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}}\nonumber \\ \end{aligned}$$
(50)

Step 2.1: Looking at the first term on the far-RHS, we apply the same technique as in (47) to obtain

$$\begin{aligned}&\phi (R) \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ z_R< {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}R \\ z_R< {{\,\mathrm{deg}\,}}CD<{{\,\mathrm{deg}\,}}R \\ (ABCD,R) = 1 \\ AC = BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} \nonumber \\&\quad = \phi (R) \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N< {{\,\mathrm{deg}\,}}R \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ( \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ \frac{z_R -{{\,\mathrm{deg}\,}}N}{2}< {{\,\mathrm{deg}\,}}G< \frac{{{\,\mathrm{deg}\,}}R -{{\,\mathrm{deg}\,}}N}{2} \\ (G , R) = 1 \end{array}} \frac{1}{|G |} \bigg )^2 \nonumber \\&\quad \le \phi (R) \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {z_R}' \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ( \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ \frac{z_R -{{\,\mathrm{deg}\,}}N}{2}< {{\,\mathrm{deg}\,}}G< \frac{{{\,\mathrm{deg}\,}}R -{{\,\mathrm{deg}\,}}N}{2} \\ (G , R) = 1 \end{array}} \frac{1}{|G |} \bigg )^2 \nonumber \\&\qquad + \phi (R) \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {z_R}'<{{\,\mathrm{deg}\,}}N< {{\,\mathrm{deg}\,}}R \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ( \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G < \frac{{{\,\mathrm{deg}\,}}R -{{\,\mathrm{deg}\,}}N}{2} \\ (G , R) = 1 \end{array}} \frac{1}{|G |} \bigg )^2 , \end{aligned}$$
(51)

where \({z_R}' := {{\,\mathrm{deg}\,}}R - \log _q 9^{\omega (R)}\).

We look at the first term on the far-RHS:

$$\begin{aligned}&\phi (R) \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {z_R}' \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ( \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ \frac{z_R -{{\,\mathrm{deg}\,}}N}{2}< {{\,\mathrm{deg}\,}}G< \frac{{{\,\mathrm{deg}\,}}R -{{\,\mathrm{deg}\,}}N}{2} \\ (G , R) = 1 \end{array}} \frac{1}{|G |} \bigg )^2 \\&\quad = \phi (R) \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {z_R}' \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ( \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G < \frac{{{\,\mathrm{deg}\,}}R -{{\,\mathrm{deg}\,}}N}{2} \\ (G , R) = 1 \end{array}} \frac{1}{|G |} - \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G \le \frac{z_R -{{\,\mathrm{deg}\,}}N}{2} \\ (G , R) = 1 \end{array}} \frac{1}{|G |} \bigg )^2 \\&\quad \ll \phi (R) \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {z_R}' \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ( \frac{\phi (R)}{|R |} \omega (R) + \log \omega (R) \bigg )^2 \\&\quad \ll |R |\bigg ( \frac{\phi (R)}{|R |} \bigg )^3 \big ( \omega (R) \big )^2 \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {z_R}'' \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \\&\quad \ll |R |\bigg ( \frac{\phi (R)}{|R |} \bigg )^3 \big ( \omega (R) \big )^2 \bigg ( \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) \big ( {{\,\mathrm{deg}\,}}R \big )^2 , \end{aligned}$$

where for the second relation we applied Lemma 4.12 twice. For the use of this lemma one may wish to note that, because \({{\,\mathrm{deg}\,}}N \le {z_R}'\), we have that \(\frac{{{\,\mathrm{deg}\,}}R -{{\,\mathrm{deg}\,}}N}{2} \ge \frac{z_R -{{\,\mathrm{deg}\,}}N}{2} \ge \log _q \big ( \frac{3}{\sqrt{2}}\big )^{\omega (R)}\), and so when \(x = \frac{{{\,\mathrm{deg}\,}}R -{{\,\mathrm{deg}\,}}N}{2}\) or \(x = \frac{z_R -{{\,\mathrm{deg}\,}}N}{2}\) we have that \(\frac{2^{\omega (R)} x}{q^x} = O (1)\). For the last relation we applied Lemma 7.6.

Now we look at the second term on the far-RHS of (51). Because \({z_R}'<{{\,\mathrm{deg}\,}}N < {{\,\mathrm{deg}\,}}R\), we have that \(\frac{{{\,\mathrm{deg}\,}}R - {{\,\mathrm{deg}\,}}N}{2} < \log _q 9^{\frac{\omega (R)}{2}}\). Hence,

$$\begin{aligned}&\phi (R) \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {z_R}'<{{\,\mathrm{deg}\,}}N< {{\,\mathrm{deg}\,}}R \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ( \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G< \frac{{{\,\mathrm{deg}\,}}R -{{\,\mathrm{deg}\,}}N}{2} \\ (G , R) = 1 \end{array}} \frac{1}{|G |} \bigg )^2\\&\quad \le \phi (R) \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N< {{\,\mathrm{deg}\,}}R \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ( \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G < \log _q 9^{\frac{\omega (R)}{2}} \\ (G , R) = 1 \end{array}} \frac{1}{|G |} \bigg )^2 \\&\quad \ll |R |\bigg ( \frac{\phi (R)}{|R |} \bigg )^3 \big ( \omega (R) \big )^2 \sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {z_R}' \\ (N,R) = 1 \end{array}} \frac{2^{\omega (N)}}{|N |} \\&\quad \ll |R |\bigg ( \frac{\phi (R)}{|R |} \bigg )^3 \big ( \omega (R) \big )^2 \bigg ( \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) \big ( {{\,\mathrm{deg}\,}}R \big )^2 , \end{aligned}$$

where, again, we have used Lemmas 4.12 and 7.6.

Hence,

$$\begin{aligned} \phi (R) \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ z_R< {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}R \\ z_R< {{\,\mathrm{deg}\,}}CD <{{\,\mathrm{deg}\,}}R \\ (ABCD,R) = 1 \\ AC = BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} \ll&|R |\bigg ( \frac{\phi (R)}{|R |} \bigg )^3 \big ( \omega (R) \big )^2 \bigg ( \prod _{P \mid R} \frac{1 - |P |^{-1}}{1 + |P |^{-1}} \bigg ) \big ( {{\,\mathrm{deg}\,}}R \big )^2 \\ \ll&\phi ^* (R) \bigg ( \prod _{\begin{array}{c} P \text { prime} \\ P \mid R \end{array}} \frac{\big ( 1 - |P |^{-1} \big )^3 }{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^3 \omega (R) . \end{aligned}$$

Step 2.2: We now look at the second term on the far right-hand-side of (50):

$$\begin{aligned}&\phi (R) \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ z_R< {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}R \\ z_R< {{\,\mathrm{deg}\,}}CD< {{\,\mathrm{deg}\,}}R \\ (ABCD,R) = 1 \\ AC \equiv BD ({{\,\mathrm{mod}\,}}R) \\ AC \ne BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} = \phi (R) \sum _{z_R< z_1 , z_2< {{\,\mathrm{deg}\,}}R} \frac{1}{(q^{z_1 + z_2})^{\frac{1}{2}}} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = z_1 \\ {{\,\mathrm{deg}\,}}CD = z_2 \\ (ABCD,R) = 1 \\ AC \equiv BD ({{\,\mathrm{mod}\,}}R) \\ AC \ne BD \end{array}} 1\\&\quad = \phi (R) \frac{1}{\phi (R)} \sum _{z_R< z_1 , z_2 < {{\,\mathrm{deg}\,}}R} q^{\frac{z_1 + z_2}{2}} (z_1 + z_2)^3. \\&\quad \ll |R |\big ( {{\,\mathrm{deg}\,}}R \big )^3 \ll \phi ^* (R) \bigg ( \prod _{\begin{array}{c} P \text { prime} \\ P \mid R \end{array}} \frac{\big ( 1 - |P |^{-1} \big )^3 }{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^3 \omega (R) . \end{aligned}$$

The second relation follows from Lemma 7.9 with \(F := R\). This can be applied because

$$\begin{aligned} z_1 + z_2 \ge 2z_R = 2 {{\,\mathrm{deg}\,}}R - 2\log _q 2^{\omega (R)} > \frac{19}{10} {{\,\mathrm{deg}\,}}R \end{aligned}$$

for large enough \({{\,\mathrm{deg}\,}}R\).

Step 2.3: Hence, we see that

$$\begin{aligned} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} |b (\chi ) |^2 \ll&\phi ^* (R) \bigg ( \prod _{\begin{array}{c} P \text { prime} \\ P \mid R \end{array}} \frac{\big ( 1 - |P |^{-1} \big )^3 }{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^3 \omega (R) . \end{aligned}$$

Step 3: We will now look at \(\sum _{\chi {{\,\mathrm{mod}\,}}R}^* |c (\chi ) |^2\). We have that

$$\begin{aligned} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} |c (\chi ) |^2 \le \sum _{\chi {{\,\mathrm{mod}\,}}R} |c (\chi ) |^2 = \sum _{\chi {{\,\mathrm{mod}\,}}R} |c_o (\chi ) |^2 -\sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}R \\ \chi \text { even} \end{array}} |c_o (\chi ) |^2 +\sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}R \\ \chi \text { even} \end{array}} |c_e (\chi ) |^2 . \end{aligned}$$

Now,

$$\begin{aligned} \sum _{\chi {{\,\mathrm{mod}\,}}R} |c_o (\chi ) |^2 =&\sum _{\chi {{\,\mathrm{mod}\,}}R} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -1 \\ {{\,\mathrm{deg}\,}}CD = {{\,\mathrm{deg}\,}}R -1 \end{array}} \frac{\chi (AC) \overline{\chi }(BD)}{|ABCD |^{\frac{1}{2}}} \\ =&\phi (R) \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -1 \\ {{\,\mathrm{deg}\,}}CD = {{\,\mathrm{deg}\,}}R -1 \\ (ABCD,R) = 1 \\ AC = BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} + \phi (R) \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -1 \\ {{\,\mathrm{deg}\,}}CD = {{\,\mathrm{deg}\,}}R -1 \\ (ABCD,R) = 1 \\ AC \equiv BD \\ AC \ne BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}}. \end{aligned}$$

For the first term on the far-RHS we have that

$$\begin{aligned} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -1 \\ {{\,\mathrm{deg}\,}}CD = {{\,\mathrm{deg}\,}}R -1 \\ (ABCD,R) = 1 \\ AC = BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} \le&\sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {{\,\mathrm{deg}\,}}R -1 \end{array}} \frac{2^{\omega (N)}}{|N |} \bigg ( \sum _{\begin{array}{c} G \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}G = \frac{{{\,\mathrm{deg}\,}}R - {{\,\mathrm{deg}\,}}N -1}{2} \end{array}} \frac{1}{|G |} \bigg )^2 \\ =&\sum _{\begin{array}{c} N \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}N \le {{\,\mathrm{deg}\,}}R -1 \end{array}} \frac{2^{\omega (N)}}{|N |} \ll \big ( {{\,\mathrm{deg}\,}}R \big )^2 . \end{aligned}$$

For the second term we have that

$$\begin{aligned} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -1 \\ {{\,\mathrm{deg}\,}}CD = {{\,\mathrm{deg}\,}}R -1 \\ (ABCD,R) = 1 \\ AC \equiv BD \\ AC \ne BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} = \frac{q}{|R |} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R -1 \\ {{\,\mathrm{deg}\,}}CD = {{\,\mathrm{deg}\,}}R -1 \\ (ABCD,R) = 1 \\ AC \equiv BD \\ AC \ne BD \end{array}} 1 \ll \frac{|R |}{\varPhi (R)} \big ( {{\,\mathrm{deg}\,}}R \big )^3 , \end{aligned}$$

where we have used Lemma 7.9.Hence,

$$\begin{aligned} \sum _{\chi {{\,\mathrm{mod}\,}}R} |c_o (\chi ) |^2 \ll |R |\big ( {{\,\mathrm{deg}\,}}R \big )^3 \ll \phi ^* (R) \bigg ( \prod _{\begin{array}{c} P \text { prime} \\ P \mid R \end{array}} \frac{\big ( 1 - |P |^{-1} \big )^3 }{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^3 \omega (R) . \end{aligned}$$

Similarly, by using Lemma 7.10 for the even case, we can show, for \(a=0,1,2,3\), that

$$\begin{aligned}&\sum _{\chi {{\,\mathrm{mod}\,}}R} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R - a \\ {{\,\mathrm{deg}\,}}CD = {{\,\mathrm{deg}\,}}R - a \end{array}} \frac{\chi (AC) \overline{\chi }(BD)}{|ABCD |^{\frac{1}{2}}}\\&\quad \ll |R |\big ( {{\,\mathrm{deg}\,}}R \big )^3 \ll \phi ^* (R) \bigg ( \prod _{\begin{array}{c} P \text { prime} \\ P \mid R \end{array}} \frac{\big ( 1 - |P |^{-1} \big )^3 }{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^3 \omega (R), \\&\sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}R \\ \chi \text { even} \end{array}} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}R - a \\ {{\,\mathrm{deg}\,}}CD = {{\,\mathrm{deg}\,}}R - a \end{array}} \frac{\chi (AC) \overline{\chi }(BD)}{|ABCD |^{\frac{1}{2}}}\\&\quad \ll |R |\big ( {{\,\mathrm{deg}\,}}R \big )^3 \ll \phi ^* (R) \bigg ( \prod _{\begin{array}{c} P \text { prime} \\ P \mid R \end{array}} \frac{\big ( 1 - |P |^{-1} \big )^3 }{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^3 \omega (R) . \end{aligned}$$

Hence, by using the Cauchy–Schwarz inequality, we can deduce that

$$\begin{aligned} \mathop {\mathop {\sum }\nolimits ^{*}}_{\chi {{\,\mathrm{mod}\,}}R} |c (\chi ) |^2 \ll \phi ^* (R) \bigg ( \prod _{\begin{array}{c} P \text { prime} \\ P \mid R \end{array}} \frac{\big ( 1 - |P |^{-1} \big )^3 }{1 + |P |^{-1}} \bigg ) ({{\,\mathrm{deg}\,}}R)^3 \omega (R) . \end{aligned}$$

Step 4: From steps 1 to 3, and the use of the Cauchy–Schwarz inequality (as described at the start of the proof), the result follows. \(\square \)