1 Introduction

The moments of families of L-functions are part of an important area of research in analytic number theory. The moments of the Riemann zeta-function, averaged over the critical line, have applications to areas such as zero density estimates and the proportion of zeros on the critical line [12]. Furthermore, the Lindelöf hypothesis can be expressed in terms of such moments. One can also study moments over families of L-functions that are evaluated at the central point, which has applications to the non-vanishing of L-functions at the central point.

In 1916, Hardy and Littlewood [13] proved that

$$\begin{aligned} \frac{1}{T} \int _{0}^{T} \left|\zeta \left( \frac{1}{2} + it \right) \right|^2 \mathrm {d} t \sim \log T \end{aligned}$$

as \(T \longrightarrow \infty \). In 1926, Ingham [16] expanded on this by proving that

$$\begin{aligned} \frac{1}{T} \int _{0}^{T} \left|\zeta \left( \frac{1}{2} + it \right) \right|^4 \mathrm {d} t \sim \frac{1}{2 \pi } \log ^4 T \end{aligned}$$

as \(T \longrightarrow \infty \). In 1979, Heath-Brown [14] obtained lower order terms for the fourth moment above. Results for moments of powers greater than 4 have resisted the attempts of mathematicians for many years. Indeed, at this time, we can only conjecture such results. In 2000, Keating and Snaith [18] conjectured, using random matrix theory, the asymptotic main term for all even moments:

$$\begin{aligned} \frac{1}{T} \int _{t=0}^{T} \Big |\zeta \left( \frac{1}{2}+it \right) \Big |^{2k} \mathrm {d}t \sim a_k \frac{G^2 (1+k)}{G (1+2k)} (\log T)^{k^2} \end{aligned}$$
(1)

as \({{\,\mathrm{deg}\,}}T \longrightarrow \infty \), where

$$\begin{aligned} a_k := \prod _{p \text { prime}} \left( 1- \frac{1}{p} \right) ^{k^2} \sum _{m=0}^{\infty } \frac{d_k (p^m )^2}{p^m} , \end{aligned}$$
(2)

\(d_k (a)\) is the number of ways of expressing a as a product of k factors, and G is the Barnes G-function. The factor of \(a_k\) above does not occur in a natural way via the method in [18]. Indeed, random matrix theory allows us to conjecture the factor \(\frac{G^2 (1+k)}{G (1+2k)}\), and the fact that we must then include the factor \(a_k\) can be seen from other results. However, this was addressed by Gonek, Hughes, and Keating [11] where they developed a method for conjecturing the main term of the even moments of \(\zeta (s)\) in such a way that all factors appear naturally. They give an Euler–Hadamard hybrid formula for the \(\zeta (s)\). That is, they express \(\zeta (s)\) as, roughly, a partial product over primes multiplied by a partial product over the zeros of \(\zeta (s)\). The former contributes the factor \(a_k\), while random matrix theory is used to conjecture that the latter contributes the factor \(\frac{G^2 (1+k)}{G (1+2k)}\).

With regards to moments over families of L-functions, we briefly consider the family of Dirichlet L-functions, as that is the focus of this paper. Paley [22] is accredited to proving that

as \(q \longrightarrow \infty \). Here, the sum is over all primitive characters of modulus q; \(\phi ^* (q)\) is the number of primitive characters of modulus q; \(\phi \) is the totient function; and \(L (s , \chi )\) is the Dirichlet L-function associated to the character \(\chi \). Extending the work of Heath-Brown [15], Soundararajan [24] proved that

(3)

More recently, Young [26] obtained lower order terms for the fourth moment above. By adapting the method of [11], Bui and Keating [6] conjectured the main term of all even moments of Dirichlet L-functions at \(\frac{1}{2}\):

We note a similarity between the above and (1). The reason for this is that the family of Dirichlet L-functions and the Riemann zeta function share the same symmetry [7, Section 1], which we briefly touch upon later.

We must also remark that derivatives of L-functions are an important area of study. The derivative of \(\zeta (s)\) plays a key role in obtaining positive lower bounds for the proportion of non-trivial zeros of \(\zeta (s)\) on the critical line [4, 9, 20]. Furthermore, discrete moments of \(\zeta ' (s)\), where one averages over the zeros of \(\zeta (s)\), can be used to understand the number of simple zeros of \(\zeta (s)\) on the critical line (see [12] for a brief explanation of this and other related results). The derivatives of Dirichlet L-functions are of interest because this family of L-functions shares the same symmetry as the Riemann zeta function, and so there are analogies between their derivatives as well. Moments of derivatives of Dirichlet L-functions at central point of \(\frac{1}{2}\) have applications to the non-vanishing of these derivatives at that point. More generally, for some results on the moments of derivatives of automorphic L-functions and applications, we refer the reader to [21]. We now reference two results that we require for comparisons that we will make later. Conrey, Rubinstein, and Snaith [10] conjectured, using random matrix theory, that, for positive integers k,

$$\begin{aligned} \frac{1}{T} \int _{t=0}^{T} \Big |\zeta ' \left( \frac{1}{2}+it \right) \Big |^{2k} \mathrm {d}t \sim a_k b_k (\log T)^{k^2 + 2k} \end{aligned}$$
(4)

as \({{\,\mathrm{deg}\,}}T \longrightarrow \infty \), where \(a_k\) is as in (2) and values for \(b_1 , b_2 , \ldots , b_{15}\) are explicitly given. In particular,

$$\begin{aligned} b_1 = \frac{1}{3} , b_2 = \frac{61}{2^5 \cdot 3^2 \cdot 5 \cdot 7} . \end{aligned}$$

This is consistent with a rigorously established result of Conrey [8]:

$$\begin{aligned} \frac{1}{T} \int _{t=0}^{T} \Big |\zeta ' \left( \frac{1}{2}+it \right) \Big |^{4} \mathrm {d}t \sim a_k \frac{61}{2^5 \cdot 3^2 \cdot 5 \cdot 7} (\log T)^{8} . \end{aligned}$$
(5)

Conrey also showed that

$$\begin{aligned} \frac{\pi ^2}{6} C_{2,m} \sim \frac{1}{16 m^4} \end{aligned}$$
(6)

as \(m \longrightarrow \infty \), where

$$\begin{aligned} C_{2,m} = \lim _{T \longrightarrow \infty } T^{-1} \left( \log \left( \frac{T}{2 \pi } \right) \right) ^{-4m -4} \int _{t=1}^{T} \Big |\zeta ^{(m)} \left( \frac{1}{2} +it \right) \Big |^{4} \mathrm {d} t . \end{aligned}$$

There is another setting in which one can study L-functions: The function field setting. Here, our L-functions are defined as sums over monic polynomials from an appropriate polynomial ring. For details and notation, see Sect. 2. There are many analogies between the classical setting and the function field setting, including an analogue of the Riemann hypothesis (one of the conjectures of Weil), which has been proved (first by Deligne). L-functions in function fields also play a crucial role in our understanding of the symmetries of families of L-functions in both the classical and function field settings. Indeed, for families of classical L-functions, one must consider their function field analogue, for which we can obtain indications as to their symmetry because, in this setting, we have a spectral interpretation of the zeros of the L-functions. For details, we refer the reader to the work of Katz and Sarnak [17], as well as Conrey and Farmer [7].

We now give a brief description of some of the results regarding moments of L-functions in the function field setting. Tamam [25] obtained a special case of the function field analogue of (3):

as \({{\,\mathrm{deg}\,}}Q \longrightarrow \infty \) with Q being prime. Andrade and Yiasemides [3] generalised this to the full analogue of Soundararajan’s result, by removing the restriction that Q be prime. As we will soon see, this current paper considers another generalisation of Tamam’s result. Namely, we still impose that Q is prime, but we consider arbitrary derivatives of the L-functions instead of the L-function itself. A function field analogue of [6] can be found in the thesis of Yiasemides (yet to be published), where conjectures of all even moments of Dirichlet L-functions in function fields are given, as well as an extension of this to the first derivatives of the L-functions. With regards to moments of the family of quadratic Dirichlet L-functions in function fields, we refer the reader to the work of Andrade and Keating [1, 2], and to the work of Bui and Florea [5] for an approach to conjecturing higher moments via the method of the Euler–Hadamard hybrid formula.

These are but a few of the many results regarding moments of L-functions in function fields. For an introduction to number theory in function fields, we refer the reader to the book by Rosen [23].

2 Notation and statement of results

Henceforth, q will represent an integer prime power, not equal to 2. For all such q we have a finite field of order q, denoted by \({\mathbb {F}}_q\). The polynomial ring over this finite field is denoted by \({\mathbb {F}}_q [T]\), but, as we are working with a general prime power \(q \ne 2\), we will simply write \({\mathcal {A}}\) for \({\mathbb {F}}_q [T]\). The subset of monic polynomials is denoted by \({\mathcal {M}}\). The degree of a polynomial is the standard definition, although we do not define it for the zero polynomial. Hence, the range \({{\,\mathrm{deg}\,}}A \le n\), for any non-negative integer n, does not include the case \(A=0\). For \(A \in {\mathcal {A}} \backslash \{ 0 \}\) we define the norm of A as \(|A |:= q^{{{\,\mathrm{deg}\,}}A}\), and for \(A = 0\) we define \(|0 |:= 0\).

Generally, we reserve upper-case letters for elements of \({\mathcal {A}}\), and the letters P and Q are reserved for prime polynomials. Note that primality and irreducibility are equivalent as \({\mathcal {A}}\) is a Euclidean domain. In this paper, the term “prime” is taken to mean “monic prime”. We denote the set of monic primes in \({\mathcal {A}}\) by \({\mathcal {P}}\). The expression \({{\,\mathrm{deg}\,}}Q \longrightarrow \infty \) should be taken to mean “\({{\,\mathrm{deg}\,}}Q \longrightarrow \infty \) with Q being prime”. For \(A,B \in {\mathcal {A}}\) we denote the highest common factor and lowest common multiple by (AB) and [AB], respectively.

For a subset \({\mathcal {S}} \subseteq {\mathcal {A}}\) we define, for all non-negative integers n, \({\mathcal {S}}_n := \{ A \in {\mathcal {S}} : {{\,\mathrm{deg}\,}}A = n \}\). We identify \({\mathcal {A}}_0\) with \({\mathbb {F}}_q \backslash \{ 0 \} = {{\mathbb {F}}_q}^*\). For a k-times differentiable function f(x), we defined \(f^{(k)} (x)\) to be its k-th derivative.

We use the “big O” and “little o” notation, and subscripts demonstrate the dependencies of the implied constant. That is, suppose we have functions f(x) and g(x) with the same domain D. Then, we write \(f(x) = O \big ( g(x) \big )\) or \(f(x) \ll g(x)\) if and only if there is exists some positive constant c such that \(|f (x) |\le c |g (x) |\) for all \(x \in D\). If, instead, we have functions \(f_k (x)\) and \(g_k (x)\) that depend on some parameter k, then we write \(f_k (x) = O \big ( g_k (x) \big )\) or \(f_k (x) \ll g_k (x)\) if and only if there exists some positive constant c such that for all k and all \(x \in D\) we have \(|f_k (x) |\le c |g_k (x) |\). Also, if only \(f_k (x)\) is dependent on k, and g(x) is not, then we write \(f_k (x) = O_k \big ( g (x) \big )\) or \(f_k (x) \ll _k g (x)\) if and only if for all k there exists some positive constant \(c_k\) such that for all \(x \in D\) we have \(|f_k (x) |\le c_k |g (x) |\). Usually, the parameter that our functions may depend on will be the prime power q, and our implied constant will in fact be independent of q. The expression “\(f(x) \sim g(x)\) as \(x \longrightarrow \infty \)” is taken to mean \(\lim _{x \longrightarrow \infty } \frac{f(x)}{g(x)} = 1\).

Definition 2.1

(Dirichlet character) Let \(R \in {\mathcal {M}}\). A Dirichlet character on \({\mathcal {A}}\) of 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 (A) = \chi (B)\) if \(A \equiv B ({{\,\mathrm{mod}\,}}R)\);

  2. (2)

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

  3. (3)

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

We denote a sum over all characters of modulus R by \(\sum _{\chi {{\,\mathrm{mod}\,}}R}\). Also, note that we can view \(\chi \) as a function on \({\mathcal {A}} / R {\mathcal {A}}\), which follows naturally from point (1) above. This will allow us to use expressions such as \(\chi (A^{-1})\) when \(A \in ({\mathcal {A}} / R {\mathcal {A}})^*\).

We say \(\chi \) is the trivial character of modulus R if \(\chi (A) = 1\) for all \(A \in {\mathcal {A}}\) satisfying \((A,R) =1\), and we denote such characters by \(\chi _0\) (the dependence on the modulus R is not shown with this notation, but when used it will be clear what the associated modulus is). We define the even characters to be those characters \(\chi \) satisfying \(\chi (a) = 1\) for all \(a \in {\mathbb {F}}_q^*\). Otherwise, we say that the character is odd. It can be shown that there are \(\phi (R)\) characters of modulus R and \(\frac{\phi (R)}{q-1}\) even characters of modulus R, where \(\phi \) is the totient function. This follows from the fact that a finite abelian group is isomorphic to its dual. Specifically, we refer the reader to Theorem 9.1 and Corollary 9.3 of [19], where one should take the abelian group in the theorem to be \(({\mathcal {A}} / R {\mathcal {A}} )^*\) and the subgroup in the corollary to be \({\mathbb {F}}_q^*\).

Now, suppose \(\chi \) is a character of modulus \(R \in {\mathcal {M}}\) and further suppose that \(S \mid 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) &{}\quad \text { if } {(A,R)=1} \\ 0 &{}\quad \text { otherwise} . \end{array}\right. } \end{aligned}$$

We say that \(\chi \) is primitive if there is no induced modulus of strictly smaller degree than R. Otherwise, \(\chi \) is said to be non-primitive. We denote the number of primitive characters of modulus R by \(\phi ^* (R)\). We note that all trivial characters of modulus \(R \in {\mathcal {M}} \backslash \{ 1 \}\) are non-primitive as they are induced by the character of modulus 1. We also note that if Q is prime, then the only non-primitive character of modulus Q is the trivial character of modulus Q. In particular, if Q is prime then \(\phi ^* (Q) = \phi (Q) - 1 \sim \phi (Q)\) as \({{\,\mathrm{deg}\,}}Q \longrightarrow \infty \). We denote a sum over all primitive characters \(\chi \) of modulus R by , and if Q is prime then it is equivalent to write \(\sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}}\).

Definition 2.2

(Dirichlet L-function) Let \(\chi \) be a Dirichlet character of modulus R. We define the associated Dirichlet L-function as follows: For all \(\ Re (s) > 1\),

$$\begin{aligned} L (s , \chi ) := \sum _{A \in {\mathcal {M}}} \frac{ \chi (A)}{|A |^s} = \sum _{n=0}^{\infty } L_n ( \chi ) (q^{-s} )^n , \end{aligned}$$

where

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

This has an analytic continuation to \({\mathbb {C}}\) for non-trivial characters, and to \({\mathbb {C}} \backslash \{ 1 + \frac{2n \pi i}{\log q} : n \in {\mathbb {Z}} \}\) for trivial characters.

Definition 2.3

(Riemann Zeta-function in \({\mathbb {F}}_q [T ]\)) When \(\chi \) is the Dirichlet character of modulus 1, then the associated Dirichlet L-function is simply the Riemann zeta-function on \({\mathcal {A}}\), namely

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

We now state the main results of this paper.

Theorem 2.4

For all positive integers k, we have that

$$\begin{aligned} \frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} L^{(k)} \left( \frac{1}{2} , \chi \right)&= \frac{-(-\log q)^k}{q^{\frac{1}{2}}-1} \frac{ ({{\,\mathrm{deg}\,}}Q)^k}{|Q |^{\frac{1}{2}}} + O_k \left( (\log q)^k \frac{ ({{\,\mathrm{deg}\,}}Q)^{k-1}}{|Q |^{\frac{1}{2}}} \right) . \end{aligned}$$

Theorem 2.5

For all positive integers k we have that

$$\begin{aligned} \frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \left|L^{(k)} \left( \frac{1}{2} , \chi \right) \right|^2 = \frac{(\log q)^{2k}}{2k+1} ({{\,\mathrm{deg}\,}}Q)^{2k+1} + O \left( ( \log q )^{2k} ({{\,\mathrm{deg}\,}}Q)^{2k}\right) . \end{aligned}$$

Theorem 2.6

For all non-negative integers kl we have that

$$\begin{aligned}&\frac{1}{\phi (Q)} \frac{1}{(\log q)^{2k+2l}} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \Big |L^{(k)} \left( \frac{1}{2} , \chi \right) \Big |^{2} \Big |L^{(l)} \left( \frac{1}{2} , \chi \right) \Big |^{2}\\ =&(1-q^{-1}) ({{\,\mathrm{deg}\,}}Q)^{2k+2l+4}\\&\times \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< 1 \\ 2a_2 + a_3 + a_4 < 1 \end{array}} f_k \big ( a_1 + a_3 , a_1 + a_4 , 1 \big ) f_l \big ( a_2 + a_4 , a_2 + a_3 , 1 \big ) \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 \\&+ O_{k,l} \left( ({{\,\mathrm{deg}\,}}Q)^{2k+2l+\frac{7}{2}} \right) , \end{aligned}$$

where for all non-negative integers i we define

$$\begin{aligned} f_{i} \big ( x, y, z \big ) = x^i y^i + (z - x)^i (z - y)^i . \end{aligned}$$

Notice the similarity between the conjecture (4) for \(k=1,2\) and Conrey’s result (5), and the corresponding special cases of our results:

$$\begin{aligned} \frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \left|L' \left( \frac{1}{2} , \chi \right) \right|^2 \sim (\log q)^{2} \frac{1}{3} ({{\,\mathrm{deg}\,}}Q)^{3} \end{aligned}$$

and

$$\begin{aligned} \frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \left|L' \left( \frac{1}{2} , \chi \right) \right|^4 \sim (\log q)^{4} (1-q^{-1}) \frac{61}{2^5 \cdot 3^2 \cdot 5 \cdot 7} ({{\,\mathrm{deg}\,}}Q)^{8} . \end{aligned}$$

This is not surprising given that the Riemann zeta-function and the family of Dirichlet L-functions share the same symmetry, as mentioned previously.

We also prove the following result:

Theorem 2.7

For all non-negative integers m we define

$$\begin{aligned} \begin{aligned} D_m&:= \lim _{{{\,\mathrm{deg}\,}}Q \longrightarrow \infty } \frac{1}{(1-q^{-1}) (\log q)^{4m}} \frac{1}{\phi (Q)} \frac{1}{({{\,\mathrm{deg}\,}}Q)^{4m + 4}} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \Big |L^{(m)} \left( \frac{1}{2} , \chi \right) \Big |^{4} \\&= \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< 1 \\ 2a_2 + a_3 + a_4 < 1 \end{array}} \left( (a_1 + a_3 )^m (a_1 + a_4 )^m + (1- a_1 - a_3 )^m (1 - a_1 - a_4 )^m \right) \\&\quad \times \left( (a_2 + a_3 )^m (a_2 + a_4 )^m + (1- a_2 - a_3 )^m (1 - a_2 - a_4 )^m \right) \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 . \end{aligned} \end{aligned}$$
(7)

We have that

$$\begin{aligned} D_m \sim \frac{1}{16 m^4} \end{aligned}$$

as \(m \longrightarrow \infty \).

We note the similarity between our result and (6). Note that the factor of \(\zeta (2) = \frac{ \pi ^2 }{6}\) in (6) corresponds to the factor of \(\zeta _{{\mathcal {A}}} (2) = \frac{1}{1 - q^{-1}}\) in our definition of \(D_m\).

3 Preliminary results

The following results are well known and, for many, the proofs can be found in Rosen’s book [23].

Lemma 3.1

Let \(\chi \) be a non-trivial Dirichlet character modulo \(R \in {\mathcal {M}}\). Then,

$$\begin{aligned} \sum _{A \in {\mathcal {A}}/R{\mathcal {A}}} \chi (A) = \sum _{A \in ({\mathcal {A}}/R{\mathcal {A}})^*} \chi (A) = 0 . \end{aligned}$$

Lemma 3.2

Let \(\chi \) be an odd Dirichlet character. Then,

$$\begin{aligned} \sum _{a \in {{\mathbb {F}}_q}} \chi (a) = \sum _{a \in {{\mathbb {F}}_q}^*} \chi (a) = 0 . \end{aligned}$$

Lemma 3.3

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

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

and, if we also have \(R \ne 1\),

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

Corollary 3.4

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

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

and, if we also have \(R \ne 1\),

$$\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{\phi (R)}{q-1} &{}\quad \text { if } (AB,R)=1\,\,\text {and}\,\,A \equiv aB ({{\,\mathrm{mod}\,}}R)\,\,\text {for\,\,some}\,\, a \in ({\mathbb {F}}_q)^* \\ 0 &{}\quad \text { otherwise} . \end{array}\right. } \end{aligned}$$

Lemma 3.5

We have that

$$\begin{aligned} \zeta _{{\mathcal {A}}} (s) = \frac{1}{1-q^{1-s}} , \end{aligned}$$

and this gives an analytic continuation of \(\zeta _{{\mathcal {A}}}\) to \({\mathbb {C}} \backslash \{ 1 + \frac{2n \pi i}{\log q} : n \in {\mathbb {Z}} \}\). We also have the following Euler product for \({\text {Re}}(s) >1\):

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

Lemma 3.5 can be generalised to the following:

Lemma 3.6

Let \(R \in {\mathcal {M}}\) and let \(\chi \) be a Dirichlet character of modulus R. If \(\chi = \chi _0\) then we have

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

If \(\chi \ne \chi _0\) then we have

$$\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}$$

We can now see how the analytic continuations given in the introduction are obtained.

Lemma 3.7

For \({\text {Re}}(r) , {\text {Re}}(s) > 1\), we have that

$$\begin{aligned} \sum _{\begin{array}{c} R,S \in {\mathcal {M}} \\ (R,S)=1 \end{array}} \frac{1}{|R |^r |S |^s } = \left( \sum _{R \in {\mathcal {M}}} \frac{1}{|R |^r } \right) \left( \sum _{S \in {\mathcal {M}}} \frac{1}{|S |^s } \right) \left( 1 - q^{1-r-s} \right) . \end{aligned}$$

Proof

We have that

$$\begin{aligned} \sum _{R,S \in {\mathcal {M}}} \frac{1}{|R |^r |S |^s }&= \sum _{G \in {\mathcal {M}}} \sum _{\begin{array}{c} R,S \in {\mathcal {M}} \\ (R,S) =G \end{array}} \frac{1}{|R |^r |S |^s } = \sum _{G \in {\mathcal {M}}} \frac{1}{|G |^r |G |^s} \sum _{\begin{array}{c} R,S \in {\mathcal {M}} \\ (R,S) =1 \end{array}} \frac{1}{|R |^r |S |^s } \\&= \left( \sum _{G \in {\mathcal {M}}} \frac{1}{|G |^{r+s}} \right) \left( \sum _{\begin{array}{c} R,S \in {\mathcal {M}} \\ (R,S) =1 \end{array}} \frac{1}{|R |^r |S |^s } \right) . \end{aligned}$$

From this we easily deduce that

$$\begin{aligned} \sum _{\begin{array}{c} R,S \in {\mathcal {M}} \\ (R,S) =1 \end{array}} \frac{1}{|R |^r |S |^s }&= \left( \sum _{R,S \in {\mathcal {M}}} \frac{1}{|R |^r |S |^s } \right) \left( \sum _{G \in {\mathcal {M}}} \frac{1}{|G |^{r+s}} \right) ^{-1} \\&= \left( \sum _{R \in {\mathcal {M}}} \frac{1}{|R |^r } \right) \left( \sum _{S \in {\mathcal {M}}} \frac{1}{|S |^s } \right) \left( 1 - q^{1-r-s} \right) . \end{aligned}$$

\(\square \)

4 First moments

To prove Theorem 2.4 we will require the following lemma.

Lemma 4.1

For all positive integers k we have that

$$\begin{aligned} \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} n^k q^{\frac{n}{2}} = \frac{1}{q^{\frac{1}{2}}-1} ({{\,\mathrm{deg}\,}}Q)^k |Q |^{\frac{1}{2}} + O_k \left( ({{\,\mathrm{deg}\,}}Q)^{k-1} |Q |^{\frac{1}{2}} \right) . \end{aligned}$$

Proof

We have that

$$\begin{aligned} \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} n^k q^{\frac{n}{2}}&= \frac{1}{q^{\frac{1}{2}} -1} \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} \left( n^k q^{\frac{n+1}{2}} - n^k q^{\frac{n}{2}} \right) \\&= \frac{1}{q^{\frac{1}{2}} -1} \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} \left( (n+1)^k q^{\frac{n+1}{2}} - n^k q^{\frac{n}{2}} \right) \\&\quad - \frac{1}{q^{\frac{1}{2}} -1} \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} \left( (n+1)^k q^{\frac{n+1}{2}} - n^k q^{\frac{n+1}{2}} \right) \\&= \frac{1}{q^{\frac{1}{2}}-1} ({{\,\mathrm{deg}\,}}Q)^k |Q |^{\frac{1}{2}} +O \left( \sum _{i=0}^{k-1} \left( {\begin{array}{c}k\\ i\end{array}}\right) ({{\,\mathrm{deg}\,}}Q)^i \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} q^{\frac{n+1}{2}} \right) \\&= \frac{1}{q^{\frac{1}{2}}-1} ({{\,\mathrm{deg}\,}}Q)^k |Q |^{\frac{1}{2}} + O_k \left( ({{\,\mathrm{deg}\,}}Q)^{k-1} |Q |^{\frac{1}{2}} \right) . \end{aligned}$$

\(\square \)

Proof of Theorem 2.4

We can easily see that

$$\begin{aligned} L^{(k)} (s,\chi ) = (-\log q)^k \sum _{n=1}^{{{\,\mathrm{deg}\,}}Q -1} n^k q^{-ns} \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A=n \end{array}} \chi (A) , \end{aligned}$$

from which we deduce that

$$\begin{aligned} \frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} L^{(k)} \left( \frac{1}{2} , \chi \right)= & {} \frac{(-\log q)^k}{\phi (Q)} \sum _{n=1}^{{{\,\mathrm{deg}\,}}Q -1} n^k q^{-\frac{n}{2}} \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A=n \end{array}} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \chi (A) \\= & {} - \frac{(-\log q)^k}{\phi (Q)} \sum _{n=1}^{{{\,\mathrm{deg}\,}}Q -1} n^k q^{-\frac{n}{2}} \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A=n \end{array}} 1 \\= & {} -\frac{(-\log q)^k}{q^{\frac{1}{2}}-1} \frac{ ({{\,\mathrm{deg}\,}}Q)^k}{|Q |^{\frac{1}{2}}} + O_k \left( (\log q)^k \frac{ ({{\,\mathrm{deg}\,}}Q)^{k-1}}{|Q |^{\frac{1}{2}}} \right) . \end{aligned}$$

For the second equality we used Lemma 3.3, and for the last equality we used Lemma 4.1 and the fact that \(\phi (Q) = |Q |-1\) (since Q is prime). \(\square \)

5 Second moments

Proof of Theorem 2.5

For positive integers k we have that

$$\begin{aligned} L^{(k)} \left( \frac{1}{2},\chi \right)&= (-\log q)^k \sum _{n=1}^{{{\,\mathrm{deg}\,}}Q -1} n^k q^{-\frac{n}{2}} \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A=n \end{array}} \chi (A) \\&= (-\log q)^k \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A < {{\,\mathrm{deg}\,}}Q \end{array}} \frac{(\log _q |A |)^k \chi (A)}{|A |^{\frac{1}{2}}} , \end{aligned}$$

and so

$$\begin{aligned}&\frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \left|L^{(k)} \left( \frac{1}{2} , \chi \right) \right|^2\\&= \frac{( \log q )^{2k}}{\phi (Q)} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A , {{\,\mathrm{deg}\,}}B < {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ ( \log _q |A |\log _q |B |)^k}{|AB |^{\frac{1}{2}}} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \chi (A) \overline{\chi }(B) . \end{aligned}$$

We now apply Corollary 3.4 to obtain that

$$\begin{aligned}&\frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \left|L^{(k)} \left( \frac{1}{2} , \chi \right) \right|^2 \\&\quad = ( \log q )^{2k} \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ ( \log _q |A |)^{2k}}{|A |}- \frac{( \log q )^{2k}}{\phi (Q)} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A , {{\,\mathrm{deg}\,}}B < {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ ( \log _q |A |\log _q |B |)^k}{|AB |^{\frac{1}{2}}} . \end{aligned}$$

For the first term on the RHS we have that

$$\begin{aligned} \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A < {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ ( \log _q |A |)^{2k}}{|A |} = \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} n^{2k} = \frac{1}{2k+1} ({{\,\mathrm{deg}\,}}Q)^{2k+1} + O \left( ({{\,\mathrm{deg}\,}}Q)^{2k} \right) , \end{aligned}$$

where the final equality uses Faulhaber’s formula. For the second term we have that

$$\begin{aligned}&\frac{1}{\phi (Q)} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A , {{\,\mathrm{deg}\,}}B < {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ ( \log _q |A |\log _q |B |)^k}{|AB |^{\frac{1}{2}}} = \frac{1}{\phi (Q)} \left( \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} n^k q^{\frac{n}{2}} \right) ^2 \\&\quad \le \frac{1}{\phi (Q)} \left( ({{\,\mathrm{deg}\,}}Q)^k \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} q^{\frac{n}{2}} \right) ^2 \ll \frac{1}{\phi (Q)} \big ( ({{\,\mathrm{deg}\,}}Q)^k |Q |^{\frac{1}{2}} \big )^2 \ll ({{\,\mathrm{deg}\,}}Q)^{2k} . \end{aligned}$$

The result now follows. \(\square \)

6 Fourth moments: expressing as manageable summations

Before proceeding to the main part of the proof for the fourth moments, we need to express the fourth moments as more manageable summations.

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

Theorem 6.1

(Functional Equation for \(L (s,\chi ))\) Let \(\chi \) be a non-trivial character with modulus \(Q \in {\mathcal {P}}\). If \(\chi \) is an odd character, then \(L(s,\chi )\) satisfies the functional equation

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

and if \(\chi \) is an even character, then \(L(s,\chi )\) satisfies the functional equation

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

where we always have

$$\begin{aligned} |W(\chi ) |= 1 . \end{aligned}$$

Lemma 6.2

Let \(\chi \) be an odd character of modulus \(Q \in {\mathcal {P}}\), and let k be a non-negative integer. Then,

$$\begin{aligned}&(\log q)^{-2k} \Big |L^{(k)} \left( \frac{1}{2}, \chi \right) \Big |^2 \\&\quad = \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB < {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ \left( f_{k} \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big ) + g_{O,k} \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big ) \right) \chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} \\&\qquad + \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}Q -1 \end{array}} \frac{ h_{O,k} \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big ) \chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} , \end{aligned}$$

where

$$\begin{aligned} f_{k} \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big )&= ({{\,\mathrm{deg}\,}}A )^k ({{\,\mathrm{deg}\,}}B)^k + ({{\,\mathrm{deg}\,}}Q -{{\,\mathrm{deg}\,}}A)^k ({{\,\mathrm{deg}\,}}Q -{{\,\mathrm{deg}\,}}B)^k , \\ g_{O,k} \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big )&= ({{\,\mathrm{deg}\,}}Q -{{\,\mathrm{deg}\,}}A -1)^k ({{\,\mathrm{deg}\,}}Q -{{\,\mathrm{deg}\,}}B -1)^k \\&\quad - ({{\,\mathrm{deg}\,}}Q -{{\,\mathrm{deg}\,}}A)^k ({{\,\mathrm{deg}\,}}Q -{{\,\mathrm{deg}\,}}B)^k , \\ h_{O,k} \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big )&= - ({{\,\mathrm{deg}\,}}Q - {{\,\mathrm{deg}\,}}A -1)^k ({{\,\mathrm{deg}\,}}Q - {{\,\mathrm{deg}\,}}B -1)^k . \end{aligned}$$

Remark 6.3

The “O” in the subscript is to signify that these polynomials apply to the odd character case. It is important to note that \(g_{O,k} \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big )\) has degree \(2k-1\), whereas \(f_{k} \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big )\) has degree 2k (hence, the later ultimately contributes the higher order term); and that all three polynomials are independent of q.

Proof

The functional equation gives us that

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

Taking the \(k^{\text {th}}\) derivative of both sides gives

$$\begin{aligned}&(-\log q)^k \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q-1} n^k L_n (\chi ) (q^{-s})^n \\&\quad = (-\log q)^k W (\chi ) q^{-\frac{{{\,\mathrm{deg}\,}}Q-1}{2}}\sum _{n=0}^{{{\,\mathrm{deg}\,}}Q-1} ({{\,\mathrm{deg}\,}}Q-n-1)^k L_n (\overline{\chi }) (q^{1-s})^{{{\,\mathrm{deg}\,}}Q-n-1} . \end{aligned}$$

Let us now take the squared modulus of both sides. In order to make our calculations slightly easier, we restrict our attention to the case where \(s \in {\mathbb {R}}\). We obtain

$$\begin{aligned}&(\log q)^{2k} \sum _{n=0}^{2 {{\,\mathrm{deg}\,}}Q-2} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j< {{\,\mathrm{deg}\,}}Q \end{array}} i^k j^k L_i (\chi ) L_j (\overline{\chi })\right) (q^{-s})^n\\&= (\log q)^{2k} q^{-{{\,\mathrm{deg}\,}}Q +1}\\&\quad \sum _{n=0}^{2 {{\,\mathrm{deg}\,}}Q-2} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j < {{\,\mathrm{deg}\,}}Q \end{array}} ({{\,\mathrm{deg}\,}}Q -i-1)^k ({{\,\mathrm{deg}\,}}Q \!-\!j-1)^k L_i (\chi ) L_j (\overline{\chi })\!\right) (q^{1-s})^{2{{\,\mathrm{deg}\,}}Q -n-2} . \end{aligned}$$

Both sides of the above are equal to \(\big |L^{(k)} (s, \chi ) \big |^2\). By the linear independence of powers of \(q^{-s}\), we have that \(\big |L^{(k)} (s, \chi ) \big |^2\) is the sum of the terms corresponding to \(n=0, 1, \ldots , {{\,\mathrm{deg}\,}}Q -1\) from the LHS and \(n=0, 1, \ldots , {{\,\mathrm{deg}\,}}Q -2\) from the RHS. This gives

$$\begin{aligned}&(\log q)^{-2k} \big |L^{(k)} (s, \chi ) \big |^2 \\&\quad = \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q-1} \bigg ( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j< {{\,\mathrm{deg}\,}}Q \end{array}} i^k j^k L_i (\chi ) L_j (\overline{\chi })\bigg ) (q^{-s})^n\\&\qquad + q^{-{{\,\mathrm{deg}\,}}Q +1} \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q-2} \Bigg ( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j < {{\,\mathrm{deg}\,}}Q \end{array}} \!\!\!({{\,\mathrm{deg}\,}}Q \!-\!i\!-\!1)^k({{\,\mathrm{deg}\,}}Q \!-\!j\!-\!1)^k L_i (\chi ) L_j (\overline{\chi })\!\Bigg ) (q^{1-s})^{2{{\,\mathrm{deg}\,}}Q -n-2} . \end{aligned}$$

We now substitute \(s=\frac{1}{2}\) and simplify the right-hand-side to obtain

$$\begin{aligned}&(\log q)^{-2k} \Big |L^{(k)} \left( \frac{1}{2}, \chi \right) \Big |^2\\&\quad =\sum _{n=0}^{{{\,\mathrm{deg}\,}}Q-1} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j< {{\,\mathrm{deg}\,}}Q \end{array}} i^k j^k L_i (\chi ) L_j (\overline{\chi })\right) q^{-\frac{n}{2}} \\&\qquad + \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q-2} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j< {{\,\mathrm{deg}\,}}Q \end{array}} ({{\,\mathrm{deg}\,}}Q -i-1)^k ({{\,\mathrm{deg}\,}}Q -j-1)^k L_i (\chi ) L_j (\overline{\chi })\right) q^{-\frac{n}{2}} \\&\quad = \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q-1} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j< {{\,\mathrm{deg}\,}}Q \end{array}} \Big [ i^k j^k + ({{\,\mathrm{deg}\,}}Q -i-1)^k ({{\,\mathrm{deg}\,}}Q -j-1)^k \Big ] L_i (\chi ) L_j (\overline{\chi })\right) q^{-\frac{n}{2}} \\&\qquad - \sum _{\begin{array}{c} i+j={{\,\mathrm{deg}\,}}Q-1 \\ 0 \le i,j < {{\,\mathrm{deg}\,}}Q \end{array}} ({{\,\mathrm{deg}\,}}Q -i-1)^k ({{\,\mathrm{deg}\,}}Q -j-1)^k L_i (\chi ) L_j (\overline{\chi }) q^{-\frac{{{\,\mathrm{deg}\,}}Q-1}{2}} . \end{aligned}$$

Finally, we substitute back \(L_n (\chi ) = \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A = n \end{array}} \chi (A)\) to obtain the required result. \(\square \)

Definition 6.4

For all \(s \in {\mathbb {C}}\) and all non-trivial even characters, \(\chi \), of prime modulus we define

$$\begin{aligned} {\hat{L}} (s, \chi ) := (q^{1-s} -1) L(s, \chi ) . \end{aligned}$$
(8)

Lemma 6.5

For all non-trivial even characters, \(\chi \), of prime modulus and all non-negative integers k we have that

$$\begin{aligned} L^{(k)} \left( \frac{1}{2} , \chi \right)&= \frac{1}{q^{\frac{1}{2}} -1} {\hat{L}}^{(k)} \left( \frac{1}{2} , \chi \right) + \frac{1}{q^{\frac{1}{2}} -1} \sum _{i=0}^{k-1} (-\log q)^{k-i} p_{k,i} \left( \frac{q^{\frac{1}{2}}}{q^{\frac{1}{2}}-1} \right) {\hat{L}}^{(i)} \left( \frac{1}{2} , \chi \right) \\&= \frac{1}{q^{\frac{1}{2}} -1} \sum _{i=0}^{k} (-\log q)^{k-i} p_{k,i} \left( \frac{q^{\frac{1}{2}}}{q^{\frac{1}{2}}-1} \right) {\hat{L}}^{(i)} \left( \frac{1}{2} , \chi \right) , \end{aligned}$$

where, for non-negative integers ki satisfying \(i \le k\), we define the polynomials \(p_{k,i}\) by

$$\begin{aligned} p_{k,k} \left( \frac{q^{\frac{1}{2}}}{q^{\frac{1}{2}}-1} \right)&= 1 , \\ p_{k,i} \left( \frac{q^{\frac{1}{2}}}{q^{\frac{1}{2}}-1} \right)&= - \frac{q^{\frac{1}{2}}}{q^{\frac{1}{2}} -1} \sum _{j=i}^{k-1} \left( {\begin{array}{c}k\\ j\end{array}}\right) p_{j,i} \left( \frac{q^{\frac{1}{2}}}{q^{\frac{1}{2}}-1} \right) \quad \quad \text { for }{ i<k.} \end{aligned}$$

Remark 6.6

Because \(1 \le \frac{q^{\frac{1}{2}}}{q^{\frac{1}{2}}-1} < 4\) for all prime powers q, we can see that the polynomials \(p_{k,i} \left( \frac{q^{\frac{1}{2}}}{q^{\frac{1}{2}}-1} \right) \) can be bounded independently of q (but dependent on k and i of course). The factors \((-\log q)^{k-i}\) are of course still dependent on q, as well as k and i. These two points are important when we later determine how the lower order terms in our main results are dependent on q.

Proof

We prove this by strong induction on k. The base case, \(k=0\), is obvious by Definition 6.4. Now, suppose the claim holds for \(j=0,1,\ldots , k\). Differentiating, \(k+1\) number of times, the Eq. (8) gives

$$\begin{aligned} {\hat{L}}^{(k+1)} (s, \chi ) = (q^{1-s} -1) L^{(k+1)} (s, \chi ) + q^{1-s} \sum _{j=0}^{k} \left( {\begin{array}{c}k+1\\ j\end{array}}\right) (- \log q)^{k+1-j} L^{(j)} (s, \chi ) . \end{aligned}$$

Substituting \(s=\frac{1}{2}\) and rearranging gives

$$\begin{aligned}&L^{(k+1)} \left( \frac{1}{2}, \chi \right) = \frac{1}{q^{\frac{1}{2}} -1} {\hat{L}}^{(k+1)} \left( \frac{1}{2}, \chi \right) - \frac{q^{\frac{1}{2}}}{q^{\frac{1}{2}} -1} \sum _{j=0}^{k} \left( {\begin{array}{c}k+1\\ j\end{array}}\right) (- \log q)^{k+1-j} L^{(j)} \left( \frac{1}{2}, \chi \!\right) \! . \end{aligned}$$

We now apply the inductive hypothesis to obtain

$$\begin{aligned}&L^{(k+1)} \left( \frac{1}{2}, \chi \right) \\&\quad = \frac{1}{q^{\frac{1}{2}} {-}1} {\hat{L}}^{(k+1)} \left( \frac{1}{2}, \chi \right) \\&\qquad - \frac{q^{\frac{1}{2}}}{q^{\frac{1}{2}} {-}1} \sum _{j=0}^{k} \left( {\begin{array}{c}k+1\\ j\end{array}}\right) (- \log q)^{k+1-j} \frac{1}{q^{\frac{1}{2}} -1} \sum _{i=0}^{j} (-\log q)^{j-i} p_{j,i} \left( \frac{q^{\frac{1}{2}}}{q^{\frac{1}{2}}\!-\!1} \right) {\hat{L}}^{(i)} \left( \frac{1}{2} , \chi \!\right) \\&\quad = \frac{1}{q^{\frac{1}{2}} -1} {\hat{L}}^{(k+1)} \left( \frac{1}{2}, \chi \right) \\&\qquad + \frac{1}{q^{\frac{1}{2}} -1} \sum _{i=0}^{k} (- \log q)^{k+1-i} \left( - \frac{q^{\frac{1}{2}}}{q^{\frac{1}{2}} -1} \sum _{j=i}^{k} \left( {\begin{array}{c}k+1\\ j\end{array}}\right) p_{j,i} \left( \frac{q^{\frac{1}{2}}}{q^{\frac{1}{2}}-1} \right) \right) {\hat{L}}^{(i)} \left( \frac{1}{2} , \chi \right) . \end{aligned}$$

The result follows by the definition of the polynomials \(p_{k,i}\) . \(\square \)

Lemma 6.7

For all non-negative integers k, and all non-trivial even characters \(\chi \) of modulus \(Q \in {\mathcal {P}}\), we have that

$$\begin{aligned}&\frac{1}{(\log q)^{2k} (q^{\frac{1}{2}} -1)^2} \Big |{\hat{L}}^{(k)} \left( \frac{1}{2}, \chi \right) \Big |^2 \\&\quad = \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB < {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ \left( f_{k} \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big ) + g_{E , k} \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big ) \right) \chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} \\&\qquad + \sum _{{{\,\mathrm{deg}\,}}Q -2 \le n \le {{\,\mathrm{deg}\,}}Q} \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = n \end{array}} \frac{h_{E , k , n} \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big ) \chi (A) \overline{\chi }(B) }{|AB |^{\frac{1}{2}}} , \end{aligned}$$

where

$$\begin{aligned} f_{k} \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big ) = ({{\,\mathrm{deg}\,}}A)^{k} ({{\,\mathrm{deg}\,}}B)^{k} + ({{\,\mathrm{deg}\,}}Q - {{\,\mathrm{deg}\,}}A)^{k} ({{\,\mathrm{deg}\,}}Q - {{\,\mathrm{deg}\,}}B)^{k} , \end{aligned}$$

and \(g_{E , k} \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big ) \; , \; h_{E , k, n} \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big )\) are polynomials of degrees \(2k -1\) and 2k, respectively, whose coefficients can be bounded independently of q.

Proof

Let us define \(L_{-1} (\chi ) := 0\), and recall from Lemma 3.6 that \(L_{{{\,\mathrm{deg}\,}}Q} (\chi ) = 0\). We can now define, for \(n=0,1,\ldots , {{\,\mathrm{deg}\,}}Q\),

$$\begin{aligned} M_n (\chi ) := L_n (\chi ) - q L_{n-1} (\chi ) . \end{aligned}$$

Then, the functional equation for even characters can be written as

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

Note that both sides of (9) are equal to \({\hat{L}} (s, \chi )\). We proceed similarly to the odd character case. First we differentiate, k number of times, the Eq. (9); and then we take the modulus squared of both sides. Again, in order to make our calculations slightly easier, we restrict our attention to the case where \(s \in {\mathbb {R}}\). We obtain

$$\begin{aligned}&(\log q)^{2k} \sum _{n=0}^{2 {{\,\mathrm{deg}\,}}Q} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} i^k j^k M_i (\chi ) M_j (\overline{\chi }) \right) (q^{-s})^n \\&= (\log q)^{2k} q^{- {{\,\mathrm{deg}\,}}Q} \sum _{n=0}^{2 {{\,\mathrm{deg}\,}}Q}\left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} ({{\,\mathrm{deg}\,}}Q -i)^k ({{\,\mathrm{deg}\,}}Q -j)^k M_i (\chi ) M_j (\overline{\chi }) \right) (q^{1-s})^{2{{\,\mathrm{deg}\,}}Q -n} . \end{aligned}$$

Now we take the terms corresponding to \(n=0,1, \ldots , {{\,\mathrm{deg}\,}}Q\) from the LHS and \(n=0,1,\ldots ,{{\,\mathrm{deg}\,}}Q -1\) from the RHS to obtain

$$\begin{aligned} {\hat{L}}^{(k)} (s, \chi )&= (\log q)^{2k} \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} i^k j^k M_i (\chi ) M_j (\overline{\chi }) \right) (q^{-s})^n \\&\quad + (\log q)^{2k} q^{- {{\,\mathrm{deg}\,}}Q} \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} ({{\,\mathrm{deg}\,}}Q -i)^k ({{\,\mathrm{deg}\,}}Q -j)^k M_i (\chi ) M_j (\overline{\chi }) \right) (q^{1-s})^{2{{\,\mathrm{deg}\,}}Q -n} . \end{aligned}$$

Substituting \(s=\frac{1}{2}\) and simplifying the RHS gives

$$\begin{aligned} \begin{aligned} {\hat{L}}^{(k)} \left( \frac{1}{2}, \chi \right)&= (\log q)^{2k} \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} \left( i^k j^k + ({{\,\mathrm{deg}\,}}Q -i)^k ({{\,\mathrm{deg}\,}}Q -j)^k \right) M_i (\chi ) M_j (\overline{\chi }) \right) q^{-\frac{n}{2}} \\&\quad + (\log q)^{2k} \sum _{\begin{array}{c} i+j= {{\,\mathrm{deg}\,}}Q \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} i^k j^k M_i (\chi ) M_j (\overline{\chi }) q^{-\frac{{{\,\mathrm{deg}\,}}Q}{2}} . \end{aligned} \end{aligned}$$
(10)

Now, we want factors such as \(L_n (\chi )\) in our expression, as opposed to factors like \(M_n (\chi )\). To this end, suppose p(ij) is a finite polynomial. Then,

$$\begin{aligned}&\sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} p (i,j) M_i (\chi ) M_j (\overline{\chi }) \right) q^{-\frac{n}{2}} \\&\quad = \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} p (i,j) \left( L_i (\chi ) - q L_{i-1} (\chi ) \right) \left( L_j (\overline{\chi }) - q L_{j-1} (\overline{\chi }) \right) \right) q^{-\frac{n}{2}} \\&\quad = \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} p (i,j) L_i (\chi ) L_j (\overline{\chi }) \right) q^{-\frac{n}{2}}\\&\qquad + \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -3} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} p (i+1,j+1) L_i (\chi ) L_j (\overline{\chi }) \right) q^{-\frac{n-2}{2}} \\&\qquad - \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -2} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} p (i,j+1) L_i (\chi ) L_j (\overline{\chi }) \right) q^{-\frac{n-1}{2}} \\&\qquad - \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -2} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} p (i+1,j) L_i (\chi ) L_j (\overline{\chi }) \right) q^{-\frac{n-1}{2}} . \end{aligned}$$

Grouping the terms together gives

$$\begin{aligned}&\sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} \Bigg ( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} p (i,j) M_i (\chi ) M_j (\overline{\chi }) \Bigg ) q^{-\frac{n}{2}} \\&\quad = \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} \Bigg ( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} \Big [ q p(i+1,j+1) - q^{\frac{1}{2}} p (i,j+1)\\&- q^{\frac{1}{2}} p (i+1,j) + p (i,j) \Big ] L_i (\chi ) L_j (\overline{\chi }) \Bigg ) q^{-\frac{n}{2}} \\&\qquad - \sum _{\begin{array}{c} i+j={{\,\mathrm{deg}\,}}Q -2 \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} q p(i+1,j+1) L_i (\chi ) L_j (\overline{\chi }) q^{-\frac{{{\,\mathrm{deg}\,}}Q -2 }{2}} \\&\qquad + \sum _{\begin{array}{c} i+j={{\,\mathrm{deg}\,}}Q -1 \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} \Big ( q^{\frac{1}{2}} p (i,j+1) + q^{\frac{1}{2}} p (i+1,j) - q p(i+1,j+1) \Big ) L_i (\chi ) L_j (\overline{\chi }) q^{\frac{{{\,\mathrm{deg}\,}}Q -1 }{2}} . \end{aligned}$$

In the case where

$$\begin{aligned} p(i,j) = i^k j^k + ({{\,\mathrm{deg}\,}}Q -i)^k ({{\,\mathrm{deg}\,}}Q -j)^k \end{aligned}$$

we have that

$$\begin{aligned}&q p(i+1,j+1) - q^{\frac{1}{2}} p (i,j+1) - q^{\frac{1}{2}} p (i+1,j) + p (i,j) \\&\quad = (q^{\frac{1}{2}} -1)^2 \left( f_k (i,j, {{\,\mathrm{deg}\,}}Q) + g_{E,k} (i,j, {{\,\mathrm{deg}\,}}Q) \right) , \end{aligned}$$

where \(g_{E,k} (i,j, {{\,\mathrm{deg}\,}}Q)\) is a polynomial of degree \(2k-1\) whose coefficients can be bounded independently of q.

We can now see that (10) becomes

$$\begin{aligned}&\frac{1}{(\log q)^{2k} (q^{\frac{1}{2}} -1)^2} {\hat{L}}^{(k)} \left( \frac{1}{2}, \chi \right) \\&\quad = \sum _{n=0}^{{{\,\mathrm{deg}\,}}Q -1} \left( \sum _{\begin{array}{c} i+j=n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} \left( f_k (i,j, {{\,\mathrm{deg}\,}}Q) + g_{E,k} (i,j, {{\,\mathrm{deg}\,}}Q) \right) L_i (\chi ) L_j (\overline{\chi }) \right) q^{-\frac{n}{2}} \\&\qquad + \sum _{n= {{\,\mathrm{deg}\,}}Q -2}^{{{\,\mathrm{deg}\,}}Q} \left( \sum _{\begin{array}{c} i+j= n \\ 0 \le i,j \le {{\,\mathrm{deg}\,}}Q \end{array}} h_{E,k,n} (i,j, {{\,\mathrm{deg}\,}}Q) L_i (\chi ) L_j (\overline{\chi }) \right) q^{-\frac{n}{2}} , \end{aligned}$$

where \(h_{E,k,n} (i,j, {{\,\mathrm{deg}\,}}Q)\) is a polynomial of degree k whose coefficients can be bounded independently of q. Finally, we substitute back \(L_n (\chi ) = \sum _{\begin{array}{c} A \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}A = n \end{array}} \chi (A)\) to obtain the required result. \(\square \)

7 Fourth moments: handling the summations

We now demonstrate some techniques for handling the summations that we obtained in Sect. 6.

Lemma 7.1

Let \(Q \in {\mathcal {P}}\), and let \(p_1 \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big )\) and \(p_2 \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big )\) be finite polynomials (which, for presentational purposes, we will write as \(p_1\) and \(p_2\), except when we need to use variables other than \({{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q\)). Then,

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

Proof

This follows by expanding the brackets and applying Corollary 3.4 . \(\square \)

Lemma 7.2

Let \(p \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}C , {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big )\) be a finite homogeneous polynomial of degree d. Then,

$$\begin{aligned}&\sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}Q \\ {{\,\mathrm{deg}\,}}CD< {{\,\mathrm{deg}\,}}Q \\ AC = BD \end{array}} \frac{p \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}C , {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big )}{|ABCD |^{\frac{1}{2}}}\\ =&(1- q^{-1}) ({{\,\mathrm{deg}\,}}Q)^{d+4}\\&\quad \times \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< 1 \\ 2a_2 + a_3 + a_4 < 1 \end{array}} p \big ( a_1 + a_3 , a_1 + a_4 , a_2 + a_4 , a_2 + a_3 , 1 \big ) \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 + O_p \big ( ({{\,\mathrm{deg}\,}}Q)^{d+3} \big ) . \end{aligned}$$

Remark 7.3

The subscript p in \(O_p\) should be interpreted as saying that the implied constant is dependent on the coefficients of p.

Proof

Consider the function f defined by

$$\begin{aligned} f(t_1 , t_2 , t_3 , t_4 ) = \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ AC=BD \end{array}} \frac{{t_1}^{{{\,\mathrm{deg}\,}}A} {t_2}^{{{\,\mathrm{deg}\,}}B} {t_3}^{{{\,\mathrm{deg}\,}}C} {t_4}^{{{\,\mathrm{deg}\,}}D}}{|ABCD |^{\frac{1}{2}}} \end{aligned}$$
(11)

with domain \(|t_i |< \frac{1}{2} q^{-\frac{1}{2}}\). Note that \(AC=BD\) if and only if there exist \(G,H,R,S \in {\mathcal {M}}\) satisfying \((R,S)=1\) and \(A=GR\), \(B=GS\), \(C=HS\), \(D=HR\). Hence,

$$\begin{aligned} \begin{aligned}&f(t_1 , t_2 , t_3 , t_4 ) \\&\quad = \sum _{\begin{array}{c} G,H,R,S \in {\mathcal {M}} \\ (R,S)=1 \end{array}} \frac{{t_1}^{{{\,\mathrm{deg}\,}}GR} {t_2}^{{{\,\mathrm{deg}\,}}GS} {t_3}^{{{\,\mathrm{deg}\,}}HS} {t_4}^{{{\,\mathrm{deg}\,}}HR}}{|GHRS |} \\&\quad = \sum _{G,H,R,S \in {\mathcal {M}}} \frac{{t_1}^{{{\,\mathrm{deg}\,}}GR} {t_2}^{{{\,\mathrm{deg}\,}}GS} {t_3}^{{{\,\mathrm{deg}\,}}HS} {t_4}^{{{\,\mathrm{deg}\,}}HR}}{|GHRS |}\\&\qquad - q^{-1} \sum _{G,H,R,S \in {\mathcal {M}}} \frac{{t_1}^{{{\,\mathrm{deg}\,}}GR +1} {t_2}^{{{\,\mathrm{deg}\,}}GS +1} {t_3}^{{{\,\mathrm{deg}\,}}HS +1} {t_4}^{{{\,\mathrm{deg}\,}}HR +1}}{|GHRS |} \\&\quad = \sum _{ a_1 , a_2 , a_3 , a_4 \ge 0} {t_1}^{a_1 + a_3} {t_2}^{a_1 + a_4} {t_3}^{a_2 + a_4} {t_4}^{a_2 + a_3} \\&\qquad - q^{-1} \sum _{ a_1 , a_2 , a_3 , a_4 \ge 0} {t_1}^{a_1 + a_3 +1} {t_2}^{a_1 + a_4 +1} {t_3}^{a_2 + a_4 +1} {t_4}^{a_2 + a_3 +1} , \end{aligned} \end{aligned}$$
(12)

where the second equality follows by similar means as in the proof of Lemma 3.7.

Now, for \(i=1,2,3,4\) we define the operator \(\Omega _i := t_i \frac{\mathrm {d}}{\mathrm {d} t_i}\). For non-negative integers \(k_1 , k_2 , k_3 , k_4\) we can apply the operator \({\Omega _1 }^{k_1} {\Omega _2 }^{k_2} {\Omega _3 }^{k_3} {\Omega _4 }^{k_4}\) to (11) and (12) to obtain

$$\begin{aligned}&\sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ AC=BD \end{array}} \frac{({{\,\mathrm{deg}\,}}A)^{k_1} ({{\,\mathrm{deg}\,}}B)^{k_2} ({{\,\mathrm{deg}\,}}C)^{k_3} ({{\,\mathrm{deg}\,}}D)^{k_4}}{|ABCD |^{\frac{1}{2}}} {t_1}^{{{\,\mathrm{deg}\,}}A} {t_2}^{{{\,\mathrm{deg}\,}}B} {t_3}^{{{\,\mathrm{deg}\,}}C} {t_4}^{{{\,\mathrm{deg}\,}}D} \\&\quad = \sum _{ a_1 , a_2 , a_3 , a_4 \ge 0} (a_1 + a_3 )^{k_1} (a_1 + a_4 )^{k_2} (a_2 + a_4 )^{k_3} (a_2 + a_3 )^{k_4} {t_1}^{a_1 + a_3} {t_2}^{a_1 + a_4} {t_3}^{a_2 + a_4} {t_4}^{a_2 + a_3} \\&\qquad - q^{-1} \sum _{ a_1 , a_2 , a_3 , a_4 \ge 0} (a_1 + a_3 +1)^{k_1} (a_1 + a_4 +1)^{k_2} (a_2 + a_4 +1)^{k_3} (a_2 + a_3 +1)^{k_4} \\&\qquad \qquad \qquad \qquad \qquad \qquad \times {t_1}^{a_1 + a_3 +1} {t_2}^{a_1 + a_4 +1} {t_3}^{a_2 + a_4 +1} {t_4}^{a_2 + a_3 +1} \\&\quad = (1 - q^{-1} ) \sum _{ a_1 , a_2 , a_3 , a_4 \ge 0} (a_1 + a_3 )^{k_1} (a_1 + a_4 )^{k_2} (a_2 + a_4 )^{k_3} (a_2 + a_3 )^{k_4}\\&\qquad \times {t_1}^{a_1 + a_3} {t_2}^{a_1 + a_4} {t_3}^{a_2 + a_4} {t_4}^{a_2 + a_3} \\&\qquad + q^{-1} \sum _{\begin{array}{c} (a_1 , a_2 ) = (0,0) , (0,1) , (1,0) \\ a_3 , a_4 \ge 0 \end{array}} (a_1 + a_3 )^{k_1} (a_1 + a_4 )^{k_2} (a_2 + a_4 )^{k_3} (a_2 + a_3 )^{k_4}\\&\qquad \times {t_1}^{a_1 + a_3 } {t_2}^{a_1 + a_4 } {t_3}^{a_2 + a_4 } {t_4}^{a_2 + a_3 } . \end{aligned}$$

From this we can deduce that if \(p \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}C , {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big )\) is a finite homogeneous polynomial of degree d, then

$$\begin{aligned}&\sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ AC=BD \end{array}} \frac{p \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}C , {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big )}{|ABCD |^{\frac{1}{2}}} {t_1}^{{{\,\mathrm{deg}\,}}A} {t_2}^{{{\,\mathrm{deg}\,}}B} {t_3}^{{{\,\mathrm{deg}\,}}C} {t_4}^{{{\,\mathrm{deg}\,}}D} \\&\quad = (1- q^{-1}) \sum _{ a_1 , a_2 , a_3 , a_4 \ge 0} p \big ( a_1 + a_3 , a_1 + a_4 , a_2 + a_4 , a_2 + a_3 , {{\,\mathrm{deg}\,}}Q \big ) {t_1}^{a_1 + a_3} {t_2}^{a_1 + a_4} {t_3}^{a_2 + a_4} {t_4}^{a_2 + a_3} \\&\qquad + q^{-1} \sum _{\begin{array}{c} (a_1 , a_2 ) = (0,0) , (0,1) , (1,0) \\ a_3 , a_4 \ge 0 \end{array}} p \big ( a_1 + a_3 , a_1 + a_4 , a_2 + a_4 , a_2 + a_3 , {{\,\mathrm{deg}\,}}Q \big ) {t_1}^{a_1 + a_3 } {t_2}^{a_1 + a_4 } {t_3}^{a_2 + a_4 } {t_4}^{a_2 + a_3 } . \end{aligned}$$

Now, we can extract and sum the coefficients of \({t_1}^{i_1} {t_2}^{i_2} {t_3}^{i_3} {t_4}^{i_4}\) for which \(i_1 + i_2 < {{\,\mathrm{deg}\,}}Q\) and \(i_3 + i_4 < {{\,\mathrm{deg}\,}}Q\) to obtain

$$\begin{aligned}&\sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}Q \\ {{\,\mathrm{deg}\,}}CD< {{\,\mathrm{deg}\,}}Q \\ AC=BD \end{array}} \frac{p \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}C , {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big )}{|ABCD |^{\frac{1}{2}}} \\&\quad = (1- q^{-1}) \sum _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< {{\,\mathrm{deg}\,}}Q \\ 2a_2 + a_3 + a_4< {{\,\mathrm{deg}\,}}Q \end{array}} p \big ( a_1 + a_3 , a_1 + a_4 , a_2 + a_4 , a_2 + a_3 , {{\,\mathrm{deg}\,}}Q \big ) \\&\qquad + q^{-1} \sum _{\begin{array}{c} (a_1 , a_2 ) = (0,0) , (0,1) , (1,0) \\ a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< {{\,\mathrm{deg}\,}}Q \\ 2a_2 + a_3 + a_4< {{\,\mathrm{deg}\,}}Q \end{array}} p \big ( a_1 + a_3 , a_1 + a_4 , a_2 + a_4 , a_2 + a_3 , {{\,\mathrm{deg}\,}}Q \big ) \\&\quad = (1- q^{-1}) \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< {{\,\mathrm{deg}\,}}Q \\ 2a_2 + a_3 + a_4< {{\,\mathrm{deg}\,}}Q \end{array}} p \big ( a_1 + a_3 , a_1 + a_4 , a_2 + a_4 , a_2 + a_3 , {{\,\mathrm{deg}\,}}Q \big ) \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 \\&\qquad + O_p \big ( ({{\,\mathrm{deg}\,}}Q)^{d+3} \big ) + O_p \big ( ({{\,\mathrm{deg}\,}}Q)^{d+2} \big ) \\&\quad = (1- q^{-1}) ({{\,\mathrm{deg}\,}}Q)^{d+4} \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< 1 \\ 2a_2 + a_3 + a_4 < 1 \end{array}} p \big ( a_1 + a_3 , a_1 + a_4 , a_2 + a_4 , a_2 + a_3 , 1 \big ) \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 \\&\qquad + O_p \big ( ({{\,\mathrm{deg}\,}}Q)^{d+3} \big ) . \end{aligned}$$

\(\square \)

Lemma 7.4

Let \(p \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}C , {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big )\) be a finite polynomial of degree d. Then,

$$\begin{aligned} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}Q \\ {{\,\mathrm{deg}\,}}CD < {{\,\mathrm{deg}\,}}Q \\ AC \equiv BD ({{\,\mathrm{mod}\,}}Q) \\ AC \ne BD \end{array}} \frac{p \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}C , {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big )}{|ABCD |^{\frac{1}{2}}} \ll _p ({{\,\mathrm{deg}\,}}Q)^{d+3} . \end{aligned}$$

Proof

Because \({{\,\mathrm{deg}\,}}AB , {{\,\mathrm{deg}\,}}CD < {{\,\mathrm{deg}\,}}Q\), we have that

$$\begin{aligned} p \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}C , {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big ) \ll _p ({{\,\mathrm{deg}\,}}Q)^{d} . \end{aligned}$$

Hence,

$$\begin{aligned} \begin{aligned}&\sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}Q \\ {{\,\mathrm{deg}\,}}CD< {{\,\mathrm{deg}\,}}Q \\ AC \equiv BD ({{\,\mathrm{mod}\,}}Q) \\ AC \ne BD \end{array}} \frac{p \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}C , {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big )}{|ABCD |^{\frac{1}{2}}} \\&\quad \ll _p ({{\,\mathrm{deg}\,}}Q)^{d} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}Q \\ {{\,\mathrm{deg}\,}}CD< {{\,\mathrm{deg}\,}}Q \\ AC \equiv BD ({{\,\mathrm{mod}\,}}Q) \\ AC \ne BD \end{array}} \frac{1}{|ABCD |^{\frac{1}{2}}} = ({{\,\mathrm{deg}\,}}Q)^{d} \sum _{0 \le z_1 , z_2 < {{\,\mathrm{deg}\,}}Q} q^{-\frac{z_1 + z_2}{2}} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = z_1 \\ {{\,\mathrm{deg}\,}}CD = z_2 \\ AC \equiv BD ({{\,\mathrm{mod}\,}}Q) \\ AC \ne BD \end{array}} 1 . \end{aligned} \end{aligned}$$
(13)

Now, Lemma 7.9 from [3] tells us that for non-negative integers \(z_1 , z_2\) we have

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

Hence, for \(\epsilon < \frac{1}{38}\) we have

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

The result follows by applying this to (13). \(\square \)

Remark 7.5

In her paper, Tamam [25, Lemma 8.5] states a similar result as (14) above. However, in her proof she claims that \(d(N) \ll \deg N\), which is not the case. Addressing this is non-trivial and was done in [3], as stated above.

Lemma 7.6

Let \(p \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}C , {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big )\) be a finite polynomial of degree d. Then,

$$\begin{aligned} \frac{1}{\phi (Q)} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}Q \\ {{\,\mathrm{deg}\,}}CD < {{\,\mathrm{deg}\,}}Q \end{array}} \frac{p \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}C , {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big )}{|ABCD |^{\frac{1}{2}}} \ll _p ({{\,\mathrm{deg}\,}}Q)^{d+2} . \end{aligned}$$

Proof

Because \({{\,\mathrm{deg}\,}}AB , {{\,\mathrm{deg}\,}}CD < {{\,\mathrm{deg}\,}}Q\), we have that

$$\begin{aligned} p \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}C , {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big ) \ll _p ({{\,\mathrm{deg}\,}}Q)^{d} . \end{aligned}$$

Hence,

$$\begin{aligned}&\frac{1}{\phi (Q)} \sum _{\begin{array}{c} A,B,C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}Q \\ {{\,\mathrm{deg}\,}}CD< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{p \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}C , {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big )}{|ABCD |^{\frac{1}{2}}} \\&\quad \ll _p \frac{({{\,\mathrm{deg}\,}}Q)^{d}}{\phi (Q)} \left( \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{1}{|AB |^{\frac{1}{2}}} \right) \left( \sum _{\begin{array}{c} C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}CD< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{1}{|CD |^{\frac{1}{2}}} \right) \\&\quad = \frac{({{\,\mathrm{deg}\,}}Q)^{d}}{\phi (Q)} \left( \sum _{\begin{array}{c} n,m \ge 0 \\ n+m < {{\,\mathrm{deg}\,}}Q \end{array}} q^{\frac{m+n}{2}} \right) ^2 \ll ({{\,\mathrm{deg}\,}}Q)^{d+2} . \end{aligned}$$

\(\square \)

From Lemmas 7.1 to  7.6 we can deduce the following:

Lemma 7.7

Let \(Q \in {\mathcal {P}}\), and let \(p_1 \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big )\) and \(p_2 \big ( {{\,\mathrm{deg}\,}}C, {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big )\) be finite homogeneous polynomials of degree \(d_1\) and \(d_2\), respectively. Then,

$$\begin{aligned}&\frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \left( \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{p_1 \; \chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} \right) \left( \sum _{\begin{array}{c} C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}CD< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{p_2 \; \chi (C) \overline{\chi }(D)}{|CD |^{\frac{1}{2}}} \right) \\&\quad = (1- q^{-1}) ({{\,\mathrm{deg}\,}}Q)^{d_1 + d_2 +4}\\&\qquad \times \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< 1 \\ 2a_2 + a_3 + a_4 < 1 \end{array}} p_1 \big ( a_1 + a_3 , a_1 + a_4 , 1 \big ) p_2 \big ( a_2 + a_4 , a_2 + a_3 , 1 \big ) \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4\\&\qquad + O_{p_1 , p_2 } \big ( ({{\,\mathrm{deg}\,}}Q)^{d_1 + d_2 +3} \big ) . \end{aligned}$$

Similarly, the following can be proved:

Lemma 7.8

Let \(Q \in {\mathcal {P}}\), and let \(p_1 \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big )\) and \(p_2 \big ( {{\,\mathrm{deg}\,}}C, {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big )\) be finite homogeneous polynomials of degree \(d_1\) and \(d_2\), respectively. Then,

$$\begin{aligned}&\frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \text { even} \\ \chi \ne \chi _0 \end{array}} \left( \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{p_1 \; \chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} \right) \left( \sum _{\begin{array}{c} C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}CD< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{p_2 \; \chi (C) \overline{\chi }(D)}{|CD |^{\frac{1}{2}}} \right) \\&\quad = q^{-1} ({{\,\mathrm{deg}\,}}Q)^{d_1 + d_2 +4} \\&\qquad \times \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< 1 \\ 2a_2 + a_3 + a_4 < 1 \end{array}} p_1 \big ( a_1 + a_3 , a_1 + a_4 , 1 \big )p_2 \big ( a_2 + a_4 , a_2 + a_3 , 1 \big ) \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 \\&\qquad + O_{p_1 , p_2 } \big ( ({{\,\mathrm{deg}\,}}Q)^{d_1 + d_2+3} \big ) . \end{aligned}$$

The proof of Lemma 7.8 is similar to the proof of Lemma 7.7. From [3], we use Lemma 7.10 instead of Lemma 7.9.

We can similarly prove the following:

Lemma 7.9

Let \(Q \in {\mathcal {P}}\), let \(p_1 \big ( {{\,\mathrm{deg}\,}}A, {{\,\mathrm{deg}\,}}B, {{\,\mathrm{deg}\,}}Q \big )\) and \(p_2 \big ( {{\,\mathrm{deg}\,}}C, {{\,\mathrm{deg}\,}}D, {{\,\mathrm{deg}\,}}Q \big )\) be finite homogeneous polynomials of degree \(d_1\) and \(d_2\), respectively, and let \(a \in \{ 0,1,2 \}\). Then,

$$\begin{aligned}&\frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \left( \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}Q -a \end{array}} \frac{p_1 \; \chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} \right) \left( \sum _{\begin{array}{c} C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}CD = {{\,\mathrm{deg}\,}}Q -a \end{array}} \frac{p_2 \; \chi (C) \overline{\chi }(D)}{|CD |^{\frac{1}{2}}} \right) \\&\quad = O_{p_1 , p_2 } \big ( ({{\,\mathrm{deg}\,}}Q)^{d_1 + d_2 +3} \big ) , \end{aligned}$$

and

$$\begin{aligned}&\frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \text { even} \\ \chi \ne \chi _0 \end{array}} \left( \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}Q -a \end{array}} \frac{p_1 \; \chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} \right) \left( \sum _{\begin{array}{c} C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}CD = {{\,\mathrm{deg}\,}}Q -a \end{array}} \frac{p_2 \; \chi (C) \overline{\chi }(D)}{|CD |^{\frac{1}{2}}} \right) \\&= O_{p_1 , p_2 } \big ( ({{\,\mathrm{deg}\,}}Q)^{d_1 + d_2+3} \big ) . \end{aligned}$$

8 Fourth moments of derivatives

We are now equipped to prove the fourth moment result.

Proof of Theorem 2.6

We have that

$$\begin{aligned} \begin{aligned}&\frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \Big |L^{(k)} \left( \frac{1}{2} , \chi \right) \Big |^{2} \Big |L^{(l)} \left( \frac{1}{2} , \chi \right) \Big |^{2}\\ {}&= \frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \text { odd} \end{array}} \Big |L^{(k)} \left( \frac{1}{2} , \chi \right) \Big |^{2} \Big |L^{(l)} \left( \frac{1}{2} , \chi \right) \Big |^{2} + \frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \text { even} \\ \chi \ne \chi _0 \end{array}} \Big |L^{(k)} \left( \frac{1}{2} , \chi \right) \Big |^{2} \Big |L^{(l)} \left( \frac{1}{2} , \chi \right) \Big |^{2} . \end{aligned} \end{aligned}$$
(15)

Using Lemma 6.2, we have, for the first term on the RHS, that

$$\begin{aligned} \begin{aligned}&\frac{1}{\phi (Q)} \frac{1}{(\log q)^{2k+2l}} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \text { odd} \end{array}} \Big |L^{(k)} \left( \frac{1}{2} , \chi \right) \Big |^{2} \Big |L^{(l)} \left( \frac{1}{2} , \chi \right) \Big |^{2}\\&\quad = \frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \text { odd} \end{array}}\left( \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ \left( f_{k} + g_{O,k} \right) \chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} + \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB = {{\,\mathrm{deg}\,}}Q -1 \end{array}} \frac{ h_{O,k} \chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} \right) \\&\qquad \times \left( \sum _{\begin{array}{c} C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}CD < {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ \left( f_{l} + g_{O,l} \right) \chi (C) \overline{\chi }(D)}{|CD |^{\frac{1}{2}}} + \sum _{\begin{array}{c} C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}CD = {{\,\mathrm{deg}\,}}Q -1 \end{array}} \frac{ h_{O,l} \chi (C) \overline{\chi }(D)}{|CD |^{\frac{1}{2}}} \right) . \end{aligned} \end{aligned}$$
(16)

By using Lemmas 7.7 and 7.8, we have that

$$\begin{aligned}&\frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \text { odd} \end{array}} \left( \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ \left( f_{k} + g_{O,k} \right) \chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} \right) \left( \sum _{\begin{array}{c} C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}CD< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ \left( f_{l} + g_{O,l} \right) \chi (C) \overline{\chi }(D)}{|CD |^{\frac{1}{2}}} \right) \\&= \frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \ne \chi _0 \end{array}} \left( \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ \left( f_{k} + g_{O,k} \right) \chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} \right) \left( \sum _{\begin{array}{c} C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}CD< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ \left( f_{l} + g_{O,l} \right) \chi (C) \overline{\chi }(D)}{|CD |^{\frac{1}{2}}} \right) \\&\quad - \frac{1}{\phi (Q)} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \text { even} \\ \chi \ne \chi _0 \end{array}} \left( \sum _{\begin{array}{c} A,B \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}AB< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ \left( f_{k} + g_{O,k} \right) \chi (A) \overline{\chi }(B)}{|AB |^{\frac{1}{2}}} \right) \left( \sum _{\begin{array}{c} C,D \in {\mathcal {M}} \\ {{\,\mathrm{deg}\,}}CD< {{\,\mathrm{deg}\,}}Q \end{array}} \frac{ \left( f_{l} + g_{O,l} \right) \chi (C) \overline{\chi }(D)}{|CD |^{\frac{1}{2}}} \right) \\&= (1- 2q^{-1}) ({{\,\mathrm{deg}\,}}Q)^{2k+2l+4}\\&\qquad \times \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< 1 \\ 2a_2 + a_3 + a_4 < 1 \end{array}} f_k \big ( a_1 + a_3 , a_1 + a_4 , 1 \big ) f_l \big ( a_2 + a_4 , a_2 + a_3 , 1 \big ) \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4\\&\qquad + O_{k,l} \left( ({{\,\mathrm{deg}\,}}Q)^{2k+2l+3} \right) . \end{aligned}$$

Strictly speaking, Lemmas 7.7 and  7.8 require that the polynomials \(f_{k} + g_{O,k}\) and \(f_{l} + g_{O,l}\) are homogeneous, which is not the case. However, these polynomials can be written as sums of homogeneous polynomials, with the terms of highest degree being \(f_{k}\) and \(f_{l}\), respectively. We can then apply the lemmas term-by-term to obtain the result above.

We now have the main term of (16). Indeed, for the remaining terms we can apply the Cauchy–Schwarz inequality and Lemmas 7.7, 7.8, and 7.9 to see that they are equal to \(O_{k,l} \left( ({{\,\mathrm{deg}\,}}Q)^{2k+2l+\frac{7}{2}} \right) \). Hence,

$$\begin{aligned} \begin{aligned}&\frac{1}{\phi (Q)} \frac{1}{(\log q)^{2k+2l}} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \text { odd} \end{array}} \Big |L^{(k)} \left( \frac{1}{2} , \chi \right) \Big |^{2} \Big |L^{(l)} \left( \frac{1}{2} , \chi \right) \Big |^{2} \\&\quad = (1- 2q^{-1}) ({{\,\mathrm{deg}\,}}Q)^{2k+2l+4} \\&\qquad \times \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< 1 \\ 2a_2 + a_3 + a_4 < 1 \end{array}} f_k \big ( a_1 + a_3 , a_1 + a_4 , 1 \big )f_l \big ( a_2 + a_4 , a_2 + a_3 , 1 \big ) \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4\\ {}&\qquad + O_{k,l} \left( ({{\,\mathrm{deg}\,}}Q)^{2k+2l+\frac{7}{2}} \right) . \end{aligned} \end{aligned}$$
(17)

We now look at the second term on the RHS of (15). By using Lemma  6.7 and similar means as those used to deduce (17), we can show for all non-negative integers ij that

$$\begin{aligned}&\frac{1}{\phi (Q)} \frac{1}{(\log q)^{2i+2j}} \frac{1}{(q^{\frac{1}{2}} -1)^4} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \text { even} \\ \chi \ne \chi _0 \end{array}} \Big |{\hat{L}}^{(i)} \left( \frac{1}{2} , \chi \right) \Big |^{2} \Big |{\hat{L}}^{(j)} \left( \frac{1}{2} , \chi \right) \Big |^{2}\\&\quad = q^{-1} ({{\,\mathrm{deg}\,}}Q)^{2i+2j+4}\\&\qquad \times \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< 1 \\ 2a_2 + a_3 + a_4 < 1 \end{array}} f_i \big ( a_1 + a_3 , a_1 + a_4 , 1 \big ) f_j \big ( a_2 + a_4 , a_2 + a_3 , 1 \big ) \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 \\ {}&\qquad + O_{i,j} \left( ({{\,\mathrm{deg}\,}}Q)^{2i+2j+\frac{7}{2}} \right) . \end{aligned}$$

Using Lemma 6.5 and the Cauchy–Schwarz inequality, we obtain that

$$\begin{aligned}&\frac{1}{\phi (Q)} \frac{1}{(\log q)^{2k+2l}} \sum _{\begin{array}{c} \chi {{\,\mathrm{mod}\,}}Q \\ \chi \text { even} \\ \chi \ne \chi _0 \end{array}} \Big |L^{(k)} \left( \frac{1}{2} , \chi \right) \Big |^{2} \Big |L^{(l)} \left( \frac{1}{2} , \chi \right) \Big |^{2}\nonumber \\&\quad = q^{-1} ({{\,\mathrm{deg}\,}}Q)^{2k+2l+4}\times \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< 1 \\ 2a_2 + a_3 + a_4 < 1 \end{array}} f_k \big ( a_1 + a_3 , a_1 + a_4 , 1 \big ) f_l \big ( a_2 + a_4 , a_2 + a_3 , 1 \big ) \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 \nonumber \\&\qquad + O_{k,l} \left( ({{\,\mathrm{deg}\,}}Q)^{2k+2l+\frac{7}{2}} \right) . \end{aligned}$$
(18)

The proof follows from (15), (17), (18). \(\square \)

We now proceed to prove Theorem 2.7.

Lemma 8.1

Let m be a positive integer. For all non-negative x we have that

$$\begin{aligned} \left( 1- \frac{x}{m} \right) ^m \le e^{-x} , \end{aligned}$$

and for all \(x \in [0, 2 m^{\frac{1}{3}}]\) we have that

$$\begin{aligned} \left( 1- \frac{x}{m} \right) ^m \ge e^{-x} e^{\frac{-4}{m^{\frac{1}{3}} - 2 m^{-\frac{1}{3}}}} . \end{aligned}$$

Proof

By using the Taylor series for \(\log \) we have that

$$\begin{aligned} \log \left( \big (1- \frac{x}{m} \big )^m \right) = -x - \frac{x^2}{2m} - \frac{x^3}{3m^2} - \frac{x^4}{4m^3} - \ldots . \end{aligned}$$

Clearly, the RHS is \(\le - x\), which proves the first inequality. For the second inequality we use the bounds on x to obtain that

$$\begin{aligned} \frac{x^2}{2m} + \frac{x^3}{3m^2} + \frac{x^4}{4m^3} + \ldots \le \frac{x^2}{m} \sum _{i=0}^{\infty } \left( \frac{x}{m} \right) ^i = \frac{x^2}{m} \left( \frac{1}{1-\frac{x}{m}} \right) \le \left( \frac{4}{m^{\frac{1}{3}} -2m^{-\frac{1}{3}}} \right) , \end{aligned}$$

from which the result follows. \(\square \)

Proof of Theorem 2.7

Let us expand the brackets in (7) and multiply by \(m^4\). One of the terms is the following:

$$\begin{aligned}&m^4 \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< 1 \\ 2a_2 + a_3 + a_4< 1 \end{array}} (1\!-\! a_1 \!-\! a_3 )^m (1\! -\! a_1 \!-\! a_4 )^m (1- a_2 - a_3 )^m (1 - a_2 - a_4 )^m \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 \\&\quad = \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< m \\ 2a_2 + a_3 + a_4 < m \end{array}} \left( 1 - \frac{a_1 + a_3}{m} \right) ^m \left( 1 - \frac{a_1 + a_4}{m} \right) ^m \\&\times \left( 1 - \frac{a_2 + a_3}{m} \right) ^m \left( 1 - \frac{a_2 + a_4}{m} \right) ^m \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 , \end{aligned}$$

where we have used the substitutions \(a_i \rightarrow \frac{a_i}{m}\). On one hand, by using Lemma 8.1, we have that

$$\begin{aligned}&\int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< m \\ 2a_2 + a_3 + a_4< m \end{array}} \left( 1 - \frac{a_1 + a_3}{m} \right) ^m \left( 1 - \frac{a_1 + a_4}{m} \right) ^m \left( 1 - \frac{a_2 + a_3}{m} \right) ^m\\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \times \left( 1 - \frac{a_2 + a_4}{m} \right) ^m \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 \\&\quad \ge \int _{\begin{array}{c} 0 \le a_1 , a_2 , a_3 , a_4 \le m^{\frac{1}{3}} \\ 2a_1 + a_3 + a_4< m \\ 2a_2 + a_3 + a_4 < m \end{array}} \left( 1 - \frac{a_1 + a_3}{m} \right) ^m \left( 1 - \frac{a_1 + a_4}{m} \right) ^m\\&\qquad \qquad \qquad \qquad \qquad \qquad \times \left( 1 - \frac{a_2 + a_3}{m} \right) ^m \left( 1 - \frac{a_2 + a_4}{m} \right) ^m \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 \\&\quad \ge e^{\frac{-16}{m^{\frac{1}{3}} - 2 m^{-\frac{1}{3}}}} \int _{0 \le a_1 , a_2 , a_3 , a_4 \le m^{\frac{1}{3}}} e^{-2(a_1 + a_2 + a_3 + a_4)} \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 \longrightarrow \frac{1}{16} \end{aligned}$$

as \(m \longrightarrow \infty \). On the other hand, by the same lemma, we have that

$$\begin{aligned}&\int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< m \\ 2a_2 + a_3 + a_4 < m \end{array}} \left( 1 - \frac{a_1 + a_3}{m} \right) ^m \left( 1 - \frac{a_1 + a_4}{m} \right) ^m \left( 1 - \frac{a_2 + a_3}{m} \right) ^m\\&\qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \qquad \times \left( 1 - \frac{a_2 + a_4}{m} \right) ^m \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 \\&\quad \le \int _{\begin{array}{c} 0 \le a_1 , a_2 , a_3 , a_4 \le m \end{array}} e^{-2(a_1 + a_2 + a_3 + a_4)} \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 \longrightarrow \frac{1}{16} \end{aligned}$$

as \(m \longrightarrow \infty \). So, we see that

$$\begin{aligned}&m^4 \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< 1 \\ 2a_2 + a_3 + a_4 < 1 \end{array}} (1\!-\! a_1 \!-\! a_3 )^m (1 \!-\! a_1 \!-\! a_4 )^m(1\!-\! a_2\! -\! a_3 )^m (1 \!-\! a_2 \!-\! a_4 )^m \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4\nonumber \\&\quad \longrightarrow \frac{1}{16} \end{aligned}$$
(19)

as \(m \longrightarrow \infty \).

Now, after we expanded the brackets in (7) and multiplied by \(m^4\), there were other terms. These can be seen to tend to 0 as \(m \longrightarrow \infty \). We prove one case below; the rest are similar.

$$\begin{aligned}&m^4 \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< 1 \\ 2a_2 + a_3 + a_4< 1 \end{array}} (1- a_1 - a_3 )^m (1 - a_1 - a_4 )^m (a_2 + a_3 )^m (a_2 + a_4 )^m \mathrm {d} a_1 \mathrm {d} a_2 \mathrm {d} a_3 \mathrm {d} a_4 \\&\quad \le m^4 \int _{\begin{array}{c} a_1 , a_2 , a_3 , a_4 \ge 0 \\ 2a_1 + a_3 + a_4< 1 \\ 2a_2 + a_3 + a_4 < 1 \end{array}} (a_2 + a_3 )^m (a_2 + a_4 )^m \ll \frac{m^4}{4^m} , \end{aligned}$$

where we have used the following: The maximum value that \((a_2 + a_3 )(a_2 + a_4 )\) can take subject to the conditions in the integral is at most equal to the maximum value that \(f(x,y) := xy\) can take subject to the conditions \(x,y \ge 0\) and \(x+y < 1\). By plotting this range and looking at contours of f(xy) we can see that the maximum value is \(\frac{1}{4}\). The result follows. \(\square \)