# Odd moments in the distribution of primes

Vivian Kuperberg  Department of Mathematics, Stanford University, Stanford,
CA, USA<EMAIL_ADDRESS>
###### Abstract.

Montgomery and Soundararajan showed that the distribution of
$\psi(x+H)-\psi(x)$, for $0\leq x\leq N$, is approximately normal with mean
$\sim H$ and variance $\sim H\log(N/H)$, when $N^{\delta}\leq H\leq
N^{1-\delta}$. Their work depends on showing that sums $R_{k}(h)$ of $k$-term
singular series are $\mu_{k}(-h\log
h+Ah)^{k/2}+O_{k}(h^{k/2-1/(7k)+\varepsilon})$, where $A$ is a constant and
$\mu_{k}$ are the Gaussian moment constants. We study lower-order terms in the
size of these moments. We conjecture that when $k$ is odd, $R_{k}(h)\asymp
h^{(k-1)/2}(\log h)^{(k+1)/2}$. We prove an upper bound with the correct power
of $h$ when $k=3$, and prove analogous upper bounds in the function field
setting when $k=3$ and $k=5$. We provide further evidence for this conjecture
in the form of numerical computations.

The author is supported by NSF GRFP grant DGE-1656518, and would like to thank
Kannan Soundararajan for many helpful comments and discussions, as well as
Régis de la Bretèche, Alexandra Florea, Zeev Rudnick, and Yuval Wigderson for
helpful feedback.

##  1\. Introduction

What is the distribution of primes in short intervals? Cramér [2] modeled the
indicator function of the sequence of primes by independent random variables
$X_{n}$, for $n\geq 3$, which are $1$ (“$n$ is prime”) with probability
$\frac{1}{\log n}$, and $0$ (“$n$ is composite”) with probability
$1-\frac{1}{\log n}$. Cramér’s model predicts that the distribution of
$\psi(n+h)-\psi(n)$, a weighted count of the number of primes in an interval
of size $h$ starting at $n$, follows a Poisson distribution when $n$ varies in
$[1,N]$ and when $h\asymp\log N$. Gallagher [5] proved that this follows from
a quantitative version of the Hardy-Littlewood prime $k$-tuple conjecture:
namely, that if $\mathcal{D}=\\{d_{1},d_{2},\dots,d_{k}\\}$ is a set of $k$
distinct integers, then

$\sum_{n\leq
N}\prod_{i=1}^{k}\Lambda(n+d_{i})=(\mathfrak{S}(\mathcal{D})+o(1))N,$

where $\mathfrak{S}(\mathcal{D})$ is the singular series, a constant dependent
on $\mathcal{D}$ given by

$\mathfrak{S}(\mathcal{D})=\prod_{p}\left(1-\frac{1}{p}\right)^{-k}\left(1-\frac{\nu_{p}(\mathcal{D})}{p}\right),$

where $\nu_{p}(\mathcal{D})$ denotes the number of distinct residue classes
modulo $p$ among the elements of $\mathcal{D}$. The singular series is also
given by the formula

(1) $\mathfrak{S}(\mathcal{D})=\sum_{\begin{subarray}{c}q_{1},\dots,q_{k}\\\
1\leq
q_{i}<\infty\end{subarray}}\left(\prod_{i=1}^{k}\frac{\mu(q_{i})}{\phi(q_{i})}\right)\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}e\left(\sum_{i=1}^{k}\frac{a_{i}d_{i}}{q_{i}}\right).$

The Hardy-Littlewood prime $k$-tuple conjectures give us a better lens through
which to understand the distribution of primes: by understanding sums of
singular series. For example, Gallagher used the estimate that

$\sum_{\mathcal{D}\subset[1,h]}\mathfrak{S}(\mathcal{D})\sim\sum_{\mathcal{D}\subset[1,h]}1$

to prove that the Hardy-Littlewood conjectures imply Poisson behavior in
intervals of logarithmic length. Our concern is the distribution of primes in
somewhat longer intervals; namely, those of size $H$ where $H=o(N)$ and
$H/\log N\to\infty$ as $N\to\infty$. In this setting, the Cramér model would
predict that the distribution of $\psi(n+H)-\psi(n)$ for $n\leq N$ is
approximately normal, with mean $\sim H$ and variance $\sim H\log N$. However,
the Hardy-Littlewood prime $k$-tuple conjecture gives a different answer in
this case. In [12], Montgomery and Soundararajan provide evidence based on the
Hardy-Littlewood prime $k$-tuple conjectures that the distribution ought to be
approximately normal with variance $\sim H\log\frac{N}{H}$. They consider the
$K$th moment $M_{K}(N;H)$ of the distribution of primes in an interval of size
$H$, given by

$M_{K}(N;H)=\sum_{n=1}^{N}(\psi(n+H)-\psi(n)-H)^{K}.$

They conjecture that these moments should be given by the Gaussian moments

$M_{K}(N;H)=(\mu_{K}+o(1))N\left(H\log\frac{N}{H}\right)^{K/2},$

where $\mu_{K}=1\cdot 3\cdots(K-1)$ if $K$ is even and $0$ if $K$ is odd,
uniformly for $(\log N)^{1+\delta}\leq H\leq N^{1-\delta}$. Their technique
relies on more refined estimates of sums of the singular series constants
$\mathfrak{S}(\mathcal{D})$. Instead of the von Mangoldt function
$\Lambda(n)$, they consider sums of $\Lambda_{0}(n)=\Lambda(n)-1$, where the
main term has been subtracted from the beginning. The corresponding form of
the Hardy-Littlewood conjecture states that

$\sum_{n\leq
N}\prod_{i=1}^{k}\Lambda_{0}(n+d_{i})=(\mathfrak{S}_{0}(\mathcal{D})+o(1))N$

as $N\to\infty$, where $\mathfrak{S}_{0}(\mathcal{D})$ is given by

$\mathfrak{S}_{0}(\mathcal{D})=\sum_{\mathcal{J}\subseteq\mathcal{D}}(-1)^{|\mathcal{D}\setminus\mathcal{J}|}\mathfrak{S}(\mathcal{J}),$

and in turn

$\mathfrak{S}(\mathcal{D})=\sum_{\mathcal{J}\subseteq\mathcal{D}}\mathfrak{S}_{0}(\mathcal{J}).$

We can combine this with Equation 1 to see that

(2)
$\mathfrak{S}_{0}(\mathcal{D})=\sum_{\begin{subarray}{c}q_{1},\dots,q_{k}\\\
1<q_{i}<\infty\end{subarray}}\left(\prod_{i=1}^{k}\frac{\mu(q_{i})}{\phi(q_{i})}\right)\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}e\left(\sum_{i=1}^{k}\frac{a_{i}d_{i}}{q_{i}}\right).$

Montgomery and Soundararajan considered the sum

(3) $R_{k}(h):=\sum_{\begin{subarray}{c}d_{1},\dots,d_{k}\\\ 1\leq d_{i}\leq
h\\\ d_{i}\text{ distinct}\end{subarray}}\mathfrak{S}_{0}(\mathcal{D}),$

showing that for any nonnegative integer $k$, for any $h>1$, and for any
$\varepsilon>0$,

(4) $R_{k}(h)=\mu_{k}(-h\log h+Ah)^{k/2}+O_{k}(h^{k/2-1/(7k)+\varepsilon}),$

where $A=2-\gamma-\log 2\pi$. Their estimate on $R_{k}(h)$ implies their bound
on the moments. For more on the distribution of primes in short intervals, see
for example [1] and [6], as well as [12].

For all $k$, the optimal error term in (4) is expected to be smaller. In the
case of the variance, this was studied in [11]. In this paper, we restrict our
attention to the cases when $k$ is odd. We conjecture the following, which was
mentioned by Lemke Oliver and Soundararajan in [10].

######  Conjecture 1.1.

Let $k\geq 3$ be an odd integer, and let $h>1$. With $R_{k}(h)$ defined as
above,

$R_{k}(h)\asymp h^{(k-1)/2}(\log h)^{(k+1)/2}.$

The conjectured power of $\log h$ here comes from numerical evidence, which we
present in Section 5. For $k$ odd, we do not know, even heuristically, which
terms contribute to the main term in $R_{k}(h)$; for this reason, we do not
know what the constant should be in front of the asymptotic in Conjecture 1.1.
Nevertheless, our goal in this paper is to provide evidence for Conjecture
1.1. When $k=3$, we can show an upper bound with the correct power of $h$.

######  Theorem 1.2.

For $h\geq 2$ and $R_{3}$ defined in (3),

$R_{3}(h)\ll h(\log h)^{4}(\log\log h)^{2}.$

Another source of evidence for Conjecture 1.1 is the analog of this problem in
the function field setting, which is also studied in [9]. As we discuss in
Section 3, we can consider analogous questions over ${\mathbb{F}}[T]$ where
${\mathbb{F}}$ is a finite field, instead of over ${\mathbb{Z}}$. To state the
analog, we first revisit the techniques of Montgomery and Soundararajan in the
integer case. Upon expanding Equation 3 using Equation 2, we get

$\displaystyle R_{k}(h)$
$\displaystyle=\sum_{\begin{subarray}{c}d_{1},\dots,d_{k}\\\ 1\leq d_{i}\leq
h\\\ d_{i}\text{
distinct}\end{subarray}}\sum_{\begin{subarray}{c}q_{1},\dots,q_{k}\\\
1<q_{i}<\infty\end{subarray}}\left(\prod_{i=1}^{k}\frac{\mu(q_{i})}{\phi(q_{i})}\right)\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}e\left(\sum_{i=1}^{k}\frac{a_{i}d_{i}}{q_{i}}\right)$
$\displaystyle=\sum_{\begin{subarray}{c}q_{1},\dots,q_{k}\\\
1<q_{i}<\infty\end{subarray}}\left(\prod_{i=1}^{k}\frac{\mu(q_{i})}{\phi(q_{i})}\right)\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}\prod_{i=1}^{k}E\left(\frac{a_{i}}{q_{i}}\right),$

where $E(\alpha)=\sum_{m=1}^{h}e(m\alpha)$. The sums $E(\alpha)$ approximately
detect when $\|\alpha\|\leq\frac{1}{h}$.

This expression for $R_{k}(h)$ is closely related to a quantity studied by
Montgomery and Vaughan in [13]. They considered the related problem of the
$k$th moment of reduced residues modulo a fixed $q$, given by

$m_{k}(q;h)=\sum_{n=1}^{q}\left(\sum_{\begin{subarray}{c}1\leq m\leq h\\\
(m+n,q)=1\end{subarray}}1-h\frac{\phi(q)}{q}\right)^{k}.$

The moment $m_{k}$ satisfies
$m_{k}(q;h)=q\left(\frac{\phi(q)}{q}\right)^{k}V_{k}(q;h)$, where $V_{k}(q;h)$
is the “singular series sum,”

$V_{k}(q;h)=\sum_{\begin{subarray}{c}d_{1},\dots,d_{k}\\\ 1\leq d_{i}\leq
h\end{subarray}}\sum_{\begin{subarray}{c}q_{1},\dots,q_{k}\\\
1<q_{i}|q\end{subarray}}\left(\prod_{i=1}^{k}\frac{\mu(q_{i})}{\phi(q_{i})}\right)\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}e\left(\sum_{i=1}^{k}\frac{a_{i}d_{i}}{q_{i}}\right),$

which differs from $R_{k}(h)$ only in that the $q_{i}$ are now constrained to
divide a fixed $q$. In this paper as well as in the work of Montgomery and
Soundararajan, estimating $V_{k}(q;h)$ is a key step towards estimating
$R_{k}(h)$. Similarly, understanding $m_{k}(q;h)$ is closely related to
understanding $R_{k}(h)$. In the function field setting, we study the moments
$m_{k}(q;h)$.

Let ${\mathbb{F}}_{q}$ be a finite field with $q$ elements, and let $Q$ be a
fixed monic polynomial in ${\mathbb{F}}_{q}[T]$. Note that $Q$ in the function
field case serves the same role as $q$ in the integer case, since $q$ now
represents the size of the field. For an appropriate function field analog of
the $k$th moment of reduced residues in short intervals $m_{k}(Q;h)$, we can
adapt the methods of Montgomery–Vaughan to prove a bound on $m_{k}(Q;h)$ that
has the same shape as the bounds of Montgomery–Vaughan and
Montgomery–Soundararajan.

######  Theorem 1.3.

For any fixed $k\geq 3$ and for $Q\in{\mathbb{F}}_{q}[T]$ squarefree,

$m_{k}(Q;h)\ll\begin{cases}|Q|(q^{h})^{k/2}\left(\frac{\phi(Q)}{|Q|}\right)^{k/2}\left(1+(q^{h})^{-1/(k-2)}\left(\frac{\phi(Q)}{|Q|}\right)^{-2^{k}+k/2}\right)&\text{
if }k\text{ is even}\\\
|Q|((q^{h})^{k/2-1/2}+(q^{h})^{k/2-1/(k-2)})\left(\frac{\phi(Q)}{|Q|}\right)^{-2^{k}+k/2}&\text{
if }k\text{ is odd}\end{cases}$

The function field exponential sums are cleaner than their integer analogs,
making this proof more streamlined than the proof of Montgomery–Vaughan. As a
result, the bound is tighter; in fact, for $k=3$, Theorem 1.3 already yields a
bound where the exponent of $q^{h}$ is $1$. This is of the same shape as
Theorem 1.2, where the exponent of $h$ is $1$.

Using a more involved argument we can achieve a bound on the fifth moment of
reduced residues in short intervals.

######  Theorem 1.4.

Let $Q=\prod_{\begin{subarray}{c}P\text{irred.}\\\ |P|\leq
q^{2h}\end{subarray}}P$. For all $\varepsilon>0$,

$m_{5}(Q;h)\ll|Q|q^{2h+\varepsilon}.$

The analog of Conjecture 1.1 would predict that
$m_{5}(Q;h)\asymp|Q|q^{2h}(\log q^{h})^{3}$. Our techniques do not quite
succeed in proving such a bound for any higher odd moments, as we note in
Section 4. However, we do get as a corollary the following bound on sums of
singular series in function fields.

######  Corollary 1.5.

Let $Q=\prod_{\begin{subarray}{c}P\text{ irred.}\\\ |P|\leq
q^{2h}\end{subarray}}P$. Then

$R_{3}(q^{h})\ll V_{3}(Q;h)+q^{h}\left(\frac{|Q|}{\phi(Q)}\right)^{2}\ll
q^{h}\left(\frac{|Q|}{\phi(Q)}\right)^{19/2},$

and for all $\varepsilon>0$,

$R_{5}(q^{h})\ll V_{5}(Q;h)+\left(\frac{|Q|}{\phi(Q)}\right)^{21/2}q^{2h}\ll
q^{2h+\varepsilon}.$

The rest of this paper is organized as follows. In Section 2 we prove Theorem
1.2. In Section 3, we discuss the analogous problem in $\mathbb{F}_{q}[T]$,
and adapt the framework of Montgomery and Vaughan to the function field
setting to prove Theorem 1.3. In Section 4 we prove Theorem 1.4. Finally, in
Section 5 we provide numerical evidence for Conjecture 1.1, and in Section 6
we discuss toy problems, further directions of inquiry, and possible
applications of these questions.

##  2\. Three-term integer sums: Proof of Theorem 1.2

Our goal is to bound

$R_{3}(h)=\sum_{\begin{subarray}{c}d_{1},d_{2},d_{3}\\\ 1\leq d_{i}\leq h\\\
d_{i}\text{ distinct}\end{subarray}}\mathfrak{S}_{0}(\mathcal{D}).$

Expanding $\mathfrak{S}_{0}(\mathcal{D})$ as an exponential sum yields

$R_{3}(h)=\sum_{\begin{subarray}{c}d_{1},d_{2},d_{3}\\\ 1\leq d_{i}\leq h\\\
d_{i}\text{
distinct}\end{subarray}}\sum_{\begin{subarray}{c}q_{1},q_{2},q_{3}\\\
1<q_{i}<\infty\end{subarray}}\left(\prod_{i=1}^{3}\frac{\mu(q_{i})}{\phi(q_{i})}\right)\sum_{\begin{subarray}{c}a_{1},a_{2},a_{3}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}e\left(\sum_{i=1}^{3}\frac{a_{i}d_{i}}{q_{i}}\right).$

Our argument will follow the same thread as that of Montgomery and
Soundararajan [12], which in turn relies on the analysis of Montgomery and
Vaughan [13] of the distribution of reduced residues. To that end, we consider
$V_{3}(q;h)$, which is approximately the third centered moment of the number
of reduced residues mod $q$ in an interval of length $h$. Precisely,
$V_{3}(q;h)$ is given by

$V_{3}(q;h)=\sum_{\begin{subarray}{c}d_{1},\dots,d_{3}\\\ 1\leq d_{i}\leq
h\end{subarray}}\sum_{\begin{subarray}{c}q_{1},q_{2},q_{3}\\\
1<q_{i}|q\end{subarray}}\left(\prod_{i=1}^{3}\frac{\mu(q_{i})}{\phi(q_{i})}\right)\sum_{\begin{subarray}{c}a_{1},a_{2},a_{3}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}e\left(\sum_{i=1}^{3}\frac{a_{i}d_{i}}{q_{i}}\right).$

This is very similar to the above expression for $R_{3}(h)$; the two
differences are that the outer sum in $R_{3}(h)$ is taken over _distinct_
$d_{i}$’s, whereas the outer sum for $V_{3}(q;h)$ is not, and that the
summands $q_{i}$ range over all integers for $R_{3}(h)$, but are restricted to
factors of $q$ for $V_{3}(q;h)$.

######  Theorem 2.1.

Let $q$ be the product of primes up to $h^{4}$. Then

$V_{3}(q;h)\ll h\left(\log h\right)^{4}(\log\log h)^{2}.$

We then use Theorem 2.1 to establish Theorem 1.2. In order to derive Theorem
1.2, it suffices to show that terms arising from transforming $V_{3}(q;h)$
into $R_{3}(h)$ do not contribute more than $O(h(\log h)^{4}(\log\log
h)^{2})$; in fact they contribute on the order of $h(\log h)^{2}$, which is
the conjectured asymptotic size of $R_{3}(h)$. We begin with this derivation
of Theorem 1.2 from Theorem 2.1

In order to account for terms where $d_{1},d_{2},d_{3}$ are not necessarily
distinct, we make the following definition.

######  Definition 2.2.

Let $k\geq 2$, and let $\mathcal{D}=\\{d_{1},\dots,d_{k}\\}$ be a $k$-tuple of
not necessarily distinct integers, and fix $q$ a squarefree integer. Then the
_singular series at $\mathcal{D}$ with respect to $q$_ is given by

$\mathfrak{S}(\mathcal{D};q):=\sum_{q_{1},\dots,q_{k}|q}\left(\prod_{i=1}^{k}\frac{\mu(q_{i})}{\phi(q_{i})}\right)\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}e\left(\sum_{i=1}^{k}\frac{a_{i}d_{i}}{q_{i}}\right).$

Just as for $\mathfrak{S}(\mathcal{D})$, one can subtract off the main term of
$\mathfrak{S}(\mathcal{D};q)$ to define

$\mathfrak{S}_{0}(\mathcal{D};q):=\sum_{\mathcal{J}\subset\mathcal{D}}(-1)^{|\mathcal{D}\setminus\mathcal{J}|}\mathfrak{S}(\mathcal{J};q).$

Combining this with the definition for $\mathfrak{S}(\mathcal{D};q)$ yields
the formula

(5)
$\mathfrak{S}_{0}(\mathcal{D};q)=\sum_{1<q_{1},\dots,q_{k}|q}\left(\prod_{i=1}^{k}\frac{\mu(q_{i})}{\phi(q_{i})}\right)\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}e\left(\sum_{i=1}^{k}\frac{a_{i}d_{i}}{q_{i}}\right).$

If the $d_{i}$ are not all distinct, this expression converges for any fixed
$q$ but not in the $q\to\infty$ limit. The singular series at $\mathcal{D}$
with respect to $q$ is equal to a finite Euler product.

######  Lemma 2.3.

Let $k\geq 2$, and let $\mathcal{D}=\\{d_{1},\dots,d_{k}\\}$ be a $k$-tuple of
not necessarily distinct integers, and fix $q$ a squarefree integer. Then

$\mathfrak{S}(\mathcal{D};q)=\prod_{p|q}\left(1-\frac{1}{p}\right)^{-k}\left(1-\frac{\nu_{p}(\mathcal{D})}{p}\right),$

where $\nu_{p}(\mathcal{D})$ is the number of distinct residue classes mod $p$
occupied by elements of $\mathcal{D}$.

This lemma is proven in Lemma 3 of [12]; it is stated there for sets with
distinct elements, but their proof holds in this setting as well. They note
first that $\mathfrak{S}(\mathcal{D};q)$ is multiplicative in $q$, so that it
suffices to check the lemma for primes $p$. For a given prime $p$, they
express the condition that $\sum_{i=1}^{k}\frac{a_{i}}{q_{i}}\in{\mathbb{Z}}$
in terms of additive characters mod $p$, and then rearrange to get the result.

Consider the following expression for $\mathfrak{S}_{0}$, which is equation
(45) in [12]. For all $y\geq h$,

$\mathfrak{S}_{0}(\mathcal{D})=\sum_{\begin{subarray}{c}q_{1},q_{2},q_{3}\\\
q_{i}>1\\\ p|q_{i}\Rightarrow p\leq
y\end{subarray}}\prod_{i=1}^{3}\frac{\mu(q_{i})}{\phi(q_{i})}A(q_{1},q_{2},q_{3};\mathcal{D})+O\left(\frac{(\log
y)}{y}\right),$

where

$A(q_{1},q_{2},q_{3};\mathcal{D})=\sum_{\begin{subarray}{c}a_{1},a_{2},a_{3}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}e\left(\sum_{i=1}^{3}\frac{d_{i}a_{i}}{q_{i}}\right).$

Apply this to $R_{3}(h)$ with $y=h^{2}$ and $q=\prod_{p\leq y}p$ to get

$\displaystyle R_{3}(h)$
$\displaystyle=\sum_{\begin{subarray}{c}q_{1},q_{2},q_{3}\\\ q_{i}>1\\\
q_{i}|q\end{subarray}}\prod_{i=1}^{3}\frac{\mu(q_{i})}{\phi(q_{i})}S(q_{1},q_{2},q_{3};h)+O(1),$

where

$S(q_{1},q_{2},q_{3};h):=\sum_{\begin{subarray}{c}d_{1},d_{2},d_{3}\\\ 1\leq
d_{i}\leq h\\\ d_{i}\text{
distinct}\end{subarray}}A(q_{1},q_{2},q_{3};\\{d_{1},d_{2},d_{3}\\})=\sum_{\begin{subarray}{c}d_{1},d_{2},d_{3}\\\
1\leq d_{i}\leq h\\\ d_{i}\text{
distinct}\end{subarray}}\sum_{\begin{subarray}{c}a_{1},a_{2},a_{3}\\\ 1\leq
a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}e\left(\sum_{i=1}^{3}\frac{d_{i}a_{i}}{q_{i}}\right).$

If the condition that the $d_{i}$ should be distinct were omitted, then the
main term in $R_{3}(h)$ would be exactly $V_{3}(q;h)$. So, it suffices to
remove this condition.

Put $\delta_{i,j}=1$ if $d_{i}=d_{j}$ and $0$ otherwise, so that

$\prod_{1\leq i<j\leq 3}(1-\delta_{i,j})=\begin{cases}1&\text{ if the $d_{i}$
are distinct}\\\ $0$&\text{ otherwise},\end{cases}$

and

$S(q_{1},q_{2},q_{3};h)=\sum_{\begin{subarray}{c}d_{1},d_{2},d_{3}\\\ 1\leq
d_{i}\leq h\end{subarray}}\left(\prod_{1\leq i<j\leq
3}(1-\delta_{i,j})\right)\sum_{\begin{subarray}{c}a_{1},a_{2},a_{3}\\\ 1\leq
a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}e\left(\sum_{i=1}^{3}\frac{d_{i}a_{i}}{q_{i}}\right).$

Expanding the product yields

$1-\delta_{1,2}-\delta_{1,3}-\delta_{2,3}+\delta_{1,2}\delta_{2,3}+\delta_{1,3}\delta_{1,2}+\delta_{2,3}\delta_{1,3}-\delta_{1,2}\delta_{2,3}\delta_{1,3}.$

Note that the last four terms each require precisely that $d_{1}=d_{2}=d_{3}$
in order to be nonzero; each of these can be written as $\delta_{1,2,3}$, so
that their sum is $2\delta_{1,2,3}$. The following lemma addresses the
contribution of these last four terms.

######  Lemma 2.4.

We have

$2\sum_{d\leq h}\sum_{\begin{subarray}{c}q_{1},q_{2},q_{3}\\\ q_{i}>1\\\
q_{i}|q\end{subarray}}\prod_{i=1}^{3}\frac{\mu(q_{i})}{\phi(q_{i})}\sum_{\begin{subarray}{c}a_{1},a_{2},a_{3}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}e\left(\sum_{i=1}^{3}\frac{da_{i}}{q_{i}}\right)=2h\left(\frac{q}{\phi(q)}\right)^{2}-6h\frac{q}{\phi(q)}+4h.$

###### Proof.

Note that the left-hand expression is precisely $2\sum_{d\leq
h}\mathfrak{S}_{0}(\\{d,d,d\\};q)$. Expanding $\mathfrak{S}_{0}$ and applying
Lemma 2.3 yields

$\displaystyle 2\sum_{d\leq h}\mathfrak{S}_{0}(\\{d,d,d\\};q)$
$\displaystyle=2\sum_{d\leq
h}(\mathfrak{S}(\\{d,d,d\\};q)-3\mathfrak{S}(\\{d,d\\};q)+3\mathfrak{S}(\\{d\\};q)-1)$
$\displaystyle=2\sum_{d\leq
h}\left(\prod_{p|q}\left(1-\frac{1}{p}\right)^{-2}-3\prod_{p|q}\left(1-\frac{1}{p}\right)^{-1}+2\right)$
$\displaystyle=2h\frac{q^{2}}{\phi(q)^{2}}-6h\frac{q}{\phi(q)}+4h,$

as desired. ∎

Now consider the contribution to $R_{3}(h)$ from the terms $-\delta_{1,2}$,
$-\delta_{1,3}$, and $-\delta_{2,3}$. Via relabeling, it suffices to only
consider the term with $-\delta_{1,2}$, which is nonzero when $d_{1}=d_{2}$
and otherwise $0$.

######  Lemma 2.5.

We have

$\displaystyle\sum_{d,d_{3}\leq
h}\sum_{\begin{subarray}{c}q_{1},q_{2},q_{3}\\\ q_{i}>1\\\
q_{i}|q\end{subarray}}\prod_{i=1}^{3}\frac{\mu(q_{i})}{\phi(q_{i})}$
$\displaystyle\sum_{\begin{subarray}{c}a_{1},a_{2},a_{3}\\\ 1\leq a_{i}\leq
q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}e\left(d\left(\frac{a_{1}}{q_{1}}+\frac{a_{2}}{q_{2}}\right)\right)e\left(\frac{d_{3}a_{3}}{q_{3}}\right)$
$\displaystyle=\left(\frac{q}{\phi(q)}-2\right)\left(h\frac{q}{\phi(q)}-h\log
h+Bh+O(h^{1/2+\varepsilon})\right)$

###### Proof.

As in the previous lemma, we note that the left-hand side is
$\sum_{d,d_{3}\leq h}\mathfrak{S}_{0}(\\{d,d,d_{3}\\};q)$. We again expand and
apply Lemma 2.3, to get

$\displaystyle\sum_{d,d_{3}\leq h}\mathfrak{S}_{0}(\\{d,d,d_{3}\\};q)$
$\displaystyle=\sum_{d,d_{3}\leq
h}(\mathfrak{S}(\\{d,d,d_{3}\\};q)-2\mathfrak{S}(\\{d,d_{3}\\};q)-\mathfrak{S}(\\{d,d\\};q)+2)$
$\displaystyle=\left(\frac{q}{\phi(q)}-2\right)\left(\sum_{d,d_{3}\leq
h}\mathfrak{S}(\\{d,d_{3}\\};q)-h^{2}\right).$

By Lemma 4 of [12],

$\sum_{d,d_{3}\leq
h}\mathfrak{S}(\\{d,d_{3}\\};q)=\sum_{q_{1}|q}\frac{\mu(q_{1})^{2}}{\phi(q_{1})^{2}}\sum_{\begin{subarray}{c}1\leq
a\leq q_{1}\\\
(a,q_{1})=1\end{subarray}}\left|E\left(\frac{a}{q_{1}}\right)\right|^{2}=h\frac{q}{\phi(q)}+h^{2}-h\log
h+Bh+O(h^{1/2+\varepsilon}),$

with $B=1-\gamma-\log 2\pi$. Thus our expression becomes

$=\left(\frac{q}{\phi(q)}-2\right)\left(h\frac{q}{\phi(q)}-h\log
h+Bh+O(h^{1/2+\varepsilon})\right),$

as desired. ∎

Combining these computations yields

$\displaystyle R_{3}(h)=V_{3}(q;h)$
$\displaystyle+2h\left(\frac{q}{\phi(q)}\right)^{2}-6h\frac{q}{\phi(q)}+4h$
$\displaystyle-3\left(\frac{q}{\phi(q)}-2\right)\left(h\frac{q}{\phi(q)}-h\log
h+Bh+O(h^{1/2+\varepsilon})\right)$ $\displaystyle=V_{3}(q;h)$
$\displaystyle-h\left(\frac{q}{\phi(q)}\right)^{2}+3h\log
h\frac{q}{\phi(q)}-3Bh\frac{q}{\phi(q)}$ $\displaystyle-6h\log
h+6Bh+4h+O\left(h^{1/2+\varepsilon}\frac{q}{\phi(q)}\right)$

By Theorem 2.1, $V_{3}(q;h)\ll h(\log h)^{4}(\log\log h)^{2},$ so $R_{3}(h)\ll
h(\log h)^{4}(\log\log h)^{2}$, which completes the proof of Theorem 1.2.

###  2.1. Preparing for the proof of Theorem 2.1

The rest of this section will be devoted to the proof of Theorem 2.1; here we
begin by fixing some notation and proving several preparatory lemmas.

Throughout, we will parametrize by variables $g,x,y,z$, where
$g=\gcd(q_{1},q_{2},q_{3})$, $x=\gcd(q_{2}/g,q_{3}/g)$,
$y=\gcd(q_{1}/g,q_{3}/g)$, and $z=\gcd(q_{1}/g,q_{2}/g)$; note that $q$ is
squarefree by assumption, so each $q_{i}$ is as well, and thus also $g,x,y$,
and $z$. Thus $q_{1}=gyz$, $q_{2}=gxz$, and $q_{3}=gxy$, with $g,x,y,z$
pairwise coprime.

Then

$V_{3}(q;h)=\sum_{\begin{subarray}{c}g,x,y,z|q\\\
gxy,gxz,gyz>1\end{subarray}}\frac{\mu(g)\mu(gxyz)^{2}}{\phi(g)\phi(gxyz)^{2}}\sum_{\begin{subarray}{c}a_{1},a_{2},a_{3}\\\
0\leq a_{1}<gyz,\dots\\\ (a_{1},gyz)=\cdots=1\\\ \sum
a_{1}/gyz\in{\mathbb{Z}}\end{subarray}}E\left(\frac{a_{1}}{gyz}\right)E\left(\frac{a_{2}}{gxz}\right)E\left(\frac{a_{3}}{gxy}\right).$

We discard the alternation from $\mu(g)$ and use the bound that for all
$0\leq\alpha<1$, $|E(\alpha)|\leq F(\alpha)$, where

$F(\alpha):=\min\\{h,\|\alpha\|^{-1}\\},$

so that

(6) $V_{3}(q;h)\ll\sum_{\begin{subarray}{c}g,x,y,z|q\\\
gxy,gxz,gyz>1\end{subarray}}\frac{\mu(gxyz)^{2}}{\phi(g)\phi(gxyz)^{2}}\sum_{\begin{subarray}{c}a_{1},a_{2},a_{3}\\\
0\leq a_{1}<gyz,\dots\\\ (a_{1},gyz)=\cdots=1\\\ \sum
a_{1}/gyz\in{\mathbb{Z}}\end{subarray}}F\left(\frac{a_{1}}{gyz}\right)F\left(\frac{a_{2}}{gxz}\right)F\left(\frac{a_{3}}{gxy}\right).$

We now split the sum $V_{3}(q;h)$ into three different sums, addressed
separately. Let $T_{1}$ consist of all terms $g,x,y,z$ in (6) with $gx\geq h$.
Let $T_{2}$ consist of all terms $g,x,y,z$ in (6) with $gx<h$, $gy<h$, and
$gz<h$, and
$\left\|\frac{a_{2}}{q_{2}}\right\|,\left\|\frac{a_{3}}{q_{3}}\right\|>\frac{1}{h}$.
In particular, for terms in $T_{2}$, at most one of the three fractions
$\frac{a_{i}}{q_{i}}$ is close to $0$. Finally, let $T_{3}$ consist of all
terms $g,x,y,z$ in (6) with $gx<h$, $gy<h$, and $gz<h$ as well as the
constraints that $\left\|\frac{a_{1}}{gyz}\right\|\leq\frac{2}{h}$,
$\left\|\frac{a_{2}}{gxz}\right\|\leq\frac{2}{h}$, and
$\left\|\frac{a_{3}}{gxy}\right\|\leq\frac{2}{h}$.

Note that if two of the three fractions $\frac{a_{i}}{q_{i}}$ satisfy
$\left\|\frac{a_{i}}{q_{i}}\right\|\leq\frac{1}{h}$ (say $i=1,2$), then the
third one must satisfy $\left\|\frac{a_{3}}{q_{3}}\right\|\leq\frac{2}{h}$.
Thus after permuting the names of variables as necessary, each term
$g,x,y,z,a_{1},a_{2},a_{3}$ is contained in sums for $T_{1},T_{2}$, or
$T_{3}$. In particular,

$V_{3}(q;h)\ll T_{1}+T_{2}+T_{3}.$

We will show in Lemmas 2.9, 2.10, and 2.11 respectively that $T_{1}\ll h(\log
h)^{4}$, that $T_{2}\ll h(\log h)^{2}(\log\log h)^{2}$, and that $T_{3}\ll
h(\log h)^{4}(\log\log h)^{2}$, which completes the proof of Theorem 2.1.

We will make use of the following lemmas concerning sums of $F(\alpha)$. We
write $\widetilde{q}:=\min\\{q,h\\}$, so that $F(a/q)\leq
2\|n(a,q)/\widetilde{q}\|$.

######  Lemma 2.6.

Fix an integer $\nu\in{\mathbb{N}}$ and let $\alpha_{1}\geq\alpha_{2}\geq 1$
be two positive real numbers, and let $h\in{\mathbb{N}}$. As $h\to\infty,$

$\sum_{\begin{subarray}{c}1\leq n_{1}\leq h/(2\alpha_{1})\\\ 1\leq n_{2}\leq
h/(2\alpha_{2})\\\ 1\leq\nu+\alpha_{1}n_{1}-\alpha_{2}n_{2}\leq
h/2\end{subarray}}\frac{1}{\alpha_{1}n_{1}\alpha_{2}n_{2}(\nu+\alpha_{1}n_{1}-\alpha_{2}n_{2})}=O\left(\frac{1}{\alpha_{1}^{2}\alpha_{2}}\right)$

###### Proof.

First rewrite the inner fraction via

$\frac{1}{\alpha_{1}n_{1}\alpha_{2}n_{2}(\nu+\alpha_{1}n_{1}-\alpha_{2}n_{2})}=\frac{1}{\alpha_{1}n_{1}(\nu+\alpha_{1}n_{1})\alpha_{2}n_{2}}+\frac{1}{\alpha_{1}n_{1}(\nu+\alpha_{1}n_{1})(\nu+\alpha_{1}n_{1}-\alpha_{2}n_{2})},$

and then move the sum over $n_{2}$ inside to get

$\sum_{1\leq n_{1}\leq
h/(2\alpha_{1})}\frac{1}{\alpha_{1}n_{1}(\nu+\alpha_{1}n_{1})}\sum_{\begin{subarray}{c}1\leq
n_{2}\leq h/(2\alpha_{2})\\\
\nu+\alpha_{1}n_{1}-h/2\leq\alpha_{2}n_{2}\leq\nu+\alpha_{1}n_{1}-1\end{subarray}}\frac{1}{\alpha_{2}n_{2}}+\frac{1}{\nu+\alpha_{1}n_{1}-\alpha_{2}n_{2}}.$

Note that if $\nu+\alpha_{1}n_{1}-1<\alpha_{2}$ or
$\nu+\alpha_{1}n_{1}-h/2>h/2$, the inner sum is empty and thus the sum is $0$.
If not, then $2\leq 1+\alpha_{2}\leq\nu+\alpha_{1}n_{1}\leq h$ and the inner
sum is bounded by

$\frac{2}{\alpha_{2}}\log(\frac{1}{\alpha_{2}}\min\\{h/2,\nu+\alpha_{1}n_{1}-1\\})-\frac{2}{\alpha_{2}}\log(\frac{1}{\alpha_{2}}\max\\{1,\nu+\alpha_{1}n_{1}-h/2\\})+O(1/h).$

Thus the expression is bounded by

$\ll\frac{1}{\alpha_{2}\alpha_{1}}\sum_{\begin{subarray}{c}1\leq n_{1}\leq
h/(2\alpha_{1})\\\ 2-\nu\leq\alpha_{1}n_{1}\leq
h/2-\nu\end{subarray}}\frac{\log(\alpha_{1}n_{1}+\nu-1)+O(1/h)}{n_{1}(\nu+\alpha_{1}n_{1})}+\frac{1}{\alpha_{2}\alpha_{1}}\sum_{\begin{subarray}{c}1\leq
n_{1}\leq h/(2\alpha_{1})\\\ \alpha_{1}n_{1}\geq 1+h/2-\nu\\\
2\leq\alpha_{1}n_{1}+\nu\leq
h\end{subarray}}\frac{\log\frac{h/2}{\alpha_{1}n_{1}+\nu-h/2}+O(1/h)}{n_{1}(\nu+\alpha_{1}n_{1})}.$

For fixed $\nu$ and as $h\to\infty$, each of these sums is $O(1/\alpha_{1})$,
which gives the result. ∎

######  Lemma 2.7.

Let $d_{1}$ and $d_{2}$ be positive integers with $d_{1}<d_{2}<h$. Then

$\sum_{\begin{subarray}{c}1\leq n_{1}<d_{1}\\\ 1\leq
n_{2}<d_{2}\end{subarray}}F\left(\frac{n_{1}}{d_{1}}\right)F\left(\frac{n_{2}}{d_{2}}\right)F\left(\frac{n_{1}}{d_{1}}-\frac{n_{2}}{d_{2}}\right)\ll\begin{cases}hd_{1}^{2}&\text{
if
}\min_{n_{1},n_{2}}\left|\frac{n_{1}}{d_{1}}-\frac{n_{2}}{d_{2}}\right|<\frac{1}{h}\\\
d_{2}d_{1}^{2}&\text{ otherwise.}\end{cases}$

###### Proof.

Since $d_{1}<h$, $F(n_{1}/d_{1})=\|n_{1}/d_{1}\|^{-1}$, and similarly
$F(n_{2}/d_{2})=\|n_{2}/d_{2}\|^{-1}$.

As for $F\left(\frac{n_{1}}{d_{1}}-\frac{n_{2}}{d_{2}}\right)$,

$\displaystyle\left\|\frac{n_{1}}{d_{1}}-\frac{n_{2}}{d_{2}}\right\|<\frac{1}{h}$
$\displaystyle\Leftrightarrow\left|\frac{n_{1}}{d_{1}}-\frac{n_{2}}{d_{2}}\right|<\frac{1}{h}$
$\displaystyle\Leftrightarrow\left|\frac{d_{2}}{d_{1}}n_{1}-n_{2}\right|<\frac{d_{2}}{h}.$

Since $\frac{d_{2}}{h}<1$, for each value of $n_{1}$, there are at most $2$
values of $n_{2}$ satisfying this constraint: namely,
$n_{2}\in\left\\{\left\lfloor\tfrac{d_{2}}{d_{1}}n_{1}\right\rfloor,\left\lceil\tfrac{d_{2}}{d_{1}}n_{1}\right\rceil\right\\}$.
We first tackle these terms, using the trivial bound $F(x)\leq h$, and getting

$\displaystyle\sum_{\begin{subarray}{c}1\leq
n_{1}<d_{1}\end{subarray}}h\left\|\frac{n_{1}}{d_{1}}\right\|^{-1}\left(\left\|\frac{1}{d_{2}}\left\lfloor\frac{d_{2}}{d_{1}}n_{1}\right\rfloor\right\|^{-1}+\left\|\frac{1}{d_{2}}\left\lceil\frac{d_{2}}{d_{1}}n_{1}\right\rceil\right\|^{-1}\right)$
$\displaystyle\ll h\sum_{1\leq
n_{1}<d_{1}}\left\|\frac{n_{1}}{d_{1}}\right\|^{-2}$ $\displaystyle\ll
h\sum_{1\leq n_{1}\leq d_{1}/2}\frac{d_{1}^{2}}{n_{1}^{2}}\ll hd_{1}^{2}.$

The remaining terms are given by the sum

$\displaystyle\sum_{\begin{subarray}{c}1\leq n_{1}<d_{1}\\\ 1\leq
n_{2}<d_{2}\\\
|d_{2}n_{1}-d_{1}n_{2}|>d_{1}d_{2}/h\end{subarray}}\left\|\frac{n_{1}}{d_{1}}\right\|^{-1}\left\|\frac{n_{2}}{d_{2}}\right\|^{-1}\left\|\frac{d_{2}n_{1}-d_{1}n_{2}}{d_{1}d_{2}}\right\|^{-1}$
$\displaystyle\ll\sum_{\begin{subarray}{c}1\leq n_{1}<d_{1}/2\\\ 1\leq
n_{2}<d_{2}/2\\\
|d_{2}n_{1}-d_{1}n_{2}|>d_{1}d_{2}/h\end{subarray}}\frac{d_{1}}{n_{1}}\frac{d_{2}}{n_{2}}\frac{d_{1}d_{2}}{d_{2}n_{1}-d_{1}n_{2}},$

which by applying Lemma 2.6 with $\alpha_{2}=d_{1}$ and $\alpha_{1}=d_{2}$ is
$\ll d_{1}^{2}d_{2}$. Since $d_{2}n_{1}-d_{1}n_{2}$ is an integer, if
$|d_{2}n_{1}-d_{1}n_{2}|>d_{1}d_{2}/h$ it must in fact be at least $1$, so the
lemma applies. This completes the proof. ∎

In what follows, it will be helpful for us to approximate fractions
$\frac{a}{q}$ by a nearest multiple of $\frac{1}{h}$; to do so, we make the
following definition.

######  Definition 2.8.

Let $q>1$ and let $1\leq a<q$ with $(a,q)=1$. If $q\geq h$, the _$h$
-approximate numerator_ $n(a,q)$ is defined to as

(7) $n(a,q)=\begin{cases}\left\lceil\frac{ha}{q}\right\rceil&\text{ if
}\frac{a}{q}\leq\frac{1}{2}\\\ \\\
\left\lfloor\frac{ha}{q}\right\rfloor&\text{ if
}\frac{a}{q}>\frac{1}{2}.\end{cases}$

Meanwhile, if $q<h$, the $h$-approximate numerator $n(a,q)$ is defined to be
$a$ itself.

The key consequence of this definition is that for
$F(\alpha)=\min\\{h,\|\alpha\|^{-1}\\}$,

(8) $F\left(\frac{a}{q}\right)\leq
2\left\|\frac{n(a,q)}{\min\\{q,h\\}}\right\|^{-1}.$

###  2.2. Bounding $T_{1}$: terms with $gx\geq h$

Define

(9) $T_{1}=\sum_{\begin{subarray}{c}g,x,y,z|q\\\ gx\geq
h\end{subarray}}\frac{\mu(gxyz)^{2}}{\phi(g)^{3}\phi(xyz)^{2}}\sum_{\begin{subarray}{c}a_{1},a_{2},a_{3}\\\
(a_{1},gyz)=\cdots=1\\\
a_{1}/gyz+\cdots\in{\mathbb{Z}}\end{subarray}}F\left(\frac{a_{1}}{gyz}\right)F\left(\frac{a_{2}}{gxz}\right)F\left(\frac{a_{3}}{gxy}\right).$

We want to show the following lemma.

######  Lemma 2.9.

Let $q$ be the product of primes up to $h^{4}$, and define $T_{1}$ by (9).
Then

$T_{1}\ll h(\log h)^{4}.$

###### Proof.

Recall that $q_{1}=gyz$, $q_{2}=gxz$, and $q_{3}=gxy$. Since $gx\geq h$, $gxy$
and $gxz$ (i.e., $q_{2}$ and $q_{3}$) must also both be $\geq h$. Recall the
notation that $\widetilde{q}_{i}=\min\\{q_{i},h\\}$, so that
$\widetilde{q}_{2}=\widetilde{q}_{3}=h$.

Since $\sum_{i}\frac{a_{i}}{q_{i}}\in{\mathbb{Z}}$, the sum
$\sum_{i}\frac{n(a_{i},q_{i})}{\widetilde{q}_{i}}$ of $h$-approximate
numerators must be small, and in particular
$\left|\sum_{i}\frac{n(a_{i})}{\widetilde{q}_{i}}\right|=O(1/h)$. We can then
rewrite the sum as

(10) $T_{1}=\sum_{\begin{subarray}{c}g,x,y,z|q\\\ gx\geq
h\end{subarray}}\frac{\mu(gxyz)^{2}}{\phi(g)^{3}\phi(xyz)^{2}}\sum_{\begin{subarray}{c}1\leq
n_{1},n_{2},n_{3}\leq\widetilde{q}_{i}-1\\\
\sum_{i}n_{i}/\widetilde{q}_{i}=O(1/h)\end{subarray}}\sum_{\begin{subarray}{c}a_{1},a_{2},a_{3}\\\
(a_{i},q_{i})=1\\\ \sum_{i}a_{i}/q_{i}\in{\mathbb{Z}}\\\
n(a_{i},q_{i})=n_{i}\end{subarray}}F\left(\frac{a_{1}}{q_{1}}\right)F\left(\frac{a_{2}}{q_{2}}\right)F\left(\frac{a_{3}}{q_{3}}\right).$

By (8), the inside summand can be bounded solely in terms of the $n_{i}$, with
no dependence on the $a_{i}$’s themselves. The inside sum can then be
evaluated by counting triplets $a_{1},a_{2},a_{3}$ with $n(a_{i},q_{i})=n_{i}$
for all $i$, $(a_{i},q_{i})=1$, and $\sum_{i}a_{i}/q_{i}\in{\mathbb{Z}}$.
There are $\ll\frac{q_{1}}{h}+1$ choices of $a_{i}$ with $n(a_{i})=n_{i}$.

The constraint that $\sum_{i}\frac{a_{i}}{q_{i}}\in{\mathbb{Z}}$, after
multiplying out denominators, is equivalent to the constraint that

$a_{1}x+a_{2}y+a_{3}z\equiv 0\bmod{gxyz}.$

Once the $q_{i}$’s are fixed, a choice of $a_{1}$ determines $a_{2}$ mod $z$.
Thus fixing $a_{2}$ is equivalent to choosing a congruence class mod $gx$ for
$a_{2}$; there are $\ll\frac{gx}{h}+1\ll\frac{gx}{h}$ choices of this
congruence class with $n(a_{2},q_{2})=n_{2}$, since $gx\geq h$. Once $a_{1}$
and $a_{2}$ have been fixed, $a_{3}$ is entirely determined. Thus the total
number of triplets $a_{1},a_{2},a_{3}$ satisfying all constraints is
$\ll\left(\frac{q_{1}}{h}+1\right)\frac{gx}{h}$.

Thus $T_{1}$ is bounded by

$\displaystyle T_{1}$ $\displaystyle\ll\sum_{\begin{subarray}{c}g,x,y,z|q\\\
gx\geq
h\end{subarray}}\frac{\mu(gxyz)^{2}}{\phi(g)^{3}\phi(xyz)^{2}}\sum_{\begin{subarray}{c}1\leq
n_{i}\leq\widetilde{q}_{i}-1\\\
\sum_{i}n_{i}/\widetilde{q}_{i}=O(1/h)\end{subarray}}\left\|\frac{n_{1}}{\widetilde{q}_{1}}\right\|^{-1}\left\|\frac{n_{2}}{h}\right\|^{-1}\left\|\frac{n_{3}}{h}\right\|^{-1}\left(\frac{q_{1}}{h}+1\right)\frac{gx}{h}.$

By Lemma 2.6,

(11) $\sum_{\begin{subarray}{c}1\leq n_{1}\leq\widetilde{q}_{1}-1\\\ 1\leq
n_{2},n_{3}\leq h-1\\\
\sum_{i}n(a_{i},q_{i})/\widetilde{q}_{i}=O(1/h)\end{subarray}}\left\|\frac{n_{1}}{\widetilde{q}_{1}}\right\|^{-1}\left\|\frac{n_{2}}{h}\right\|^{-1}\left\|\frac{n_{3}}{h}\right\|^{-1}\ll
O\left(\widetilde{q}_{1}h^{2}\right).$

The application of Lemma 2.6 here is slightly subtle. In the application of
the Lemma, each $n_{i}$ is replaced with $n_{i}-\widetilde{q}_{i}$ as
necessary so that $n_{i}\in[-\widetilde{q}_{i}/2,\widetilde{q}_{i}/2]$ and
$n_{1}+n_{2}+n_{3}=O(1)$. Unless all three of $n_{1},n_{2},$ and $n_{3}$ are
very small, in which case there are $O(1)$ options for $n_{1},n_{2},n_{3}$ and
(11) holds regardless, it must be the case that not all of $n_{1},n_{2},$ and
$n_{3}$ have the same sign; by permuting the variable names one can then apply
Lemma 2.6.

Thus

$\displaystyle T_{1}$ $\displaystyle\ll\sum_{\begin{subarray}{c}g,x,y,z|q\\\
gx\geq
h\end{subarray}}\frac{\mu(gxyz)^{2}}{\phi(g)^{3}\phi(xyz)^{2}}h^{3}\min\left\\{\frac{q_{1}}{h},1\right\\}\left(\frac{q_{1}}{h}+1\right)\frac{gx}{h}$
$\displaystyle\ll\sum_{\begin{subarray}{c}g,x,y,z|q\\\ gx\geq
h\end{subarray}}\frac{\mu(gxyz)^{2}}{\phi(g)^{3}\phi(xyz)^{2}}hq_{1}gx$
$\displaystyle\ll h\sum_{\begin{subarray}{c}g,x,y,z|q\\\ gx\geq
h\end{subarray}}\frac{\mu(gxyz)^{2}}{\phi(g)\phi(gxyz)^{2}}g^{2}xyz,\text{
since $q_{1}=gyz$}$ $\displaystyle\ll h(\log h)^{4},$

as desired. ∎

###  2.3. Bounding $T_{2}$: terms with $gx,gy,gz$ small and $a_{2},a_{3}$
large

We now consider $T_{2}$, which is the sum of terms in (6) where $gx$, $gy,$
and $gz$ are all $<h$ and $\left\|\frac{a_{2}}{gxz}\right\|\geq\frac{1}{h},$
and $\left\|\frac{a_{3}}{gxy}\right\|\geq\frac{1}{h}$. That is, define

(12) $T_{2}:=\sum_{\begin{subarray}{c}g,x,y,z|q\\\
x,y,z<h/g\end{subarray}}\frac{\mu(gxyz)^{2}}{\phi(g)^{3}\phi(xyz)^{2}}\sum_{\begin{subarray}{c}a_{1},a_{2},a_{3}\\\
(a_{1},gyz)=\cdots=1\\\ a_{1}/gyz+\cdots\in{\mathbb{Z}}\\\ \|a_{2}/gxz\|\geq
1/h\\\ \|a_{3}/gxy\|\geq
1/h\end{subarray}}F\left(\frac{a_{1}}{gyz}\right)F\left(\frac{a_{2}}{gxz}\right)F\left(\frac{a_{3}}{gxy}\right).$

######  Lemma 2.10.

Let $q$ be the product of primes $p\leq h^{4}$, and let $T_{2}$ be defined as
in (12). Then

$T_{2}\ll h(\log h)^{2}(\log\log h)^{2}.$

###### Proof.

Write

$\frac{a_{1}}{gyz}=\frac{b}{gy}-\frac{c}{gz},\frac{a_{2}}{gxz}=\frac{c}{gz}-\frac{a}{x},\frac{a_{3}}{gxy}=\frac{a}{x}-\frac{b}{gy},$

where the equalities hold modulo $1$. We pick $1\leq b\leq gy,1\leq c\leq gz$
relatively prime to $gy,gz$ respectively so that the last two equalities hold,
and then the first equality is given automatically.

Upon moving the sums over $y$ and $z$ in (12) inside, we get

$T_{2}=\sum_{\begin{subarray}{c}g,x|q\\\
x<h/g\end{subarray}}\frac{\mu(gx)^{2}}{\phi(g)^{3}\phi(x)^{2}}\sum_{\begin{subarray}{c}a\\\
(a,x)=1\end{subarray}}S_{2}(g,x,a),$

where $S_{2}(g,x,a)$ denotes the sum

(13) $S_{2}(g,x,a)=\sum_{\begin{subarray}{c}y,z|q\\\
y,z<h/g\end{subarray}}\frac{\mu(gxyz)^{2}}{\phi(yz)^{2}}\sum_{\begin{subarray}{c}b,c\\\
(b,gy)=(c,gz)=1\\\ \\\
\left\|\frac{c}{gz}-\frac{a}{x}\right\|\geq\frac{1}{h}\left\|\frac{a}{x}-\frac{b}{gy}\right\|\geq\frac{1}{h}\end{subarray}}F\left(\frac{a}{x}-\frac{b}{gy}\right)F\left(\frac{b}{gy}-\frac{c}{gz}\right)F\left(\frac{c}{gz}-\frac{a}{x}\right).$

Since $gy<h$ and $gz<h$, the product $yz$ is less than $h^{2}$, so that

$\frac{yz}{\phi(yz)}\ll\log\log h^{2}\ll\log\log h.$

Thus we can replace the expression $\phi(yz)^{2}$ in the denominator in
$S_{2}(g,x,a)$ with $y^{2}z^{2}$ while losing only a factor of $(\log\log
h)^{2}$.

Let $\ell$ and $m$ be such that $2^{\ell}<y\leq 2^{\ell+1}$ and $2^{m}<z\leq
2^{m+1}$, and further define $n_{\ell}$ and $n_{m}$ to be variables ranging
from $1$ to $g2^{\ell}$ and $1$ to $g2^{m}$ respectively.

Crucially, if
$\frac{n_{\ell}}{g2^{\ell+1}}\leq\left\|\frac{a}{x}-\frac{b}{gy}\right\|\leq\frac{n_{\ell}+1}{g2^{\ell+1}}$,
then $F\left(\frac{a}{x}-\frac{b}{gy}\right)\ll
F\left(\frac{n_{\ell}}{g2^{\ell+1}}\right)$, a bound which depends only on
$\ell$ and $n_{\ell}$, and does not depend on $b$ or $y$. The same situation
holds with $g$ and $z$. The range $1\leq n_{\ell}\leq g2^{\ell}$ covers all
possibilities for $\frac{a}{x}-\frac{b}{gy}$ because of our assumption that
$\left\|\frac{a}{x}-\frac{b}{gy}\right\|\geq\frac{1}{h}$, which in particular
rules out the case that $n_{\ell}=0$. Similarly, the case that $n_{m}=0$ is
ruled out by our assumptions on $\frac{c}{gz}-\frac{a}{x}$.

Thus

$\displaystyle S_{2}(g,x,a)\ll$ $\displaystyle(\log\log
h)^{2}\sum_{\ell,m=1}^{\log_{2}\tfrac{h}{g}}\sum_{n_{\ell}=1}^{g2^{\ell+1}-1}\sum_{n_{m}=1}^{g2^{m+1}-1}\frac{1}{2^{2\ell+2m}}$
$\displaystyle\times
F\left(\frac{n_{\ell}}{g2^{\ell+1}}\right)F\left(\frac{n_{m}}{g2^{m+1}}\right)F\left(\frac{n_{\ell}2^{m}-n_{m}2^{\ell}}{g2^{\ell+m+1}}\right)\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\sum_{\begin{subarray}{c}2^{\ell}<y\leq
2^{\ell+1}\\\ 2^{m}<z\leq 2^{m+1}\\\ n_{\ell}\leq
g2^{\ell+1}\|a/x-b/(gy)\|\leq n_{\ell}+1\\\ n_{m}\leq
g2^{m+1}\|c/(gz)-a/x\|\leq
n_{m}+1\end{subarray}}\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!\\!1.$

Define

$\displaystyle C_{\ell,n_{\ell}}$
$\displaystyle=\\#\left\\{b,y:\tfrac{b}{y}\in\left(\tfrac{ga}{x}-\tfrac{n_{\ell}+1}{y},\tfrac{ga}{x}-\tfrac{n_{\ell}}{y}\right)\cup\left(\tfrac{ga}{x}+\tfrac{n_{\ell}}{y},\tfrac{ga}{x}+\tfrac{n_{\ell}+1}{y}\right),1\leq
b<g2^{\ell+1},y\leq 2^{\ell+1}\right\\},$

and define $C_{m,n_{m}}$ in the same way, so that the inside sum of
$S_{2}(g,x,a)$ is given by $C_{\ell,n_{\ell}}C_{m,n_{m}}$. The minimum spacing
of two distinct points $\frac{b_{1}}{y_{1}}$ and $\frac{b_{2}}{y_{2}}$ with
denominators $y_{i}\leq 2^{\ell+1}$ is $O(2^{-2\ell})$, so that

$C_{\ell,n_{\ell}}\ll 2^{2\ell}\frac{1}{y}+1\ll 1,$

and similarly $C_{m,n_{m}}\ll 1$. This implies that

$\displaystyle S_{2}(g,x,a)\ll$ $\displaystyle(\log\log
h)^{2}\sum_{\ell,m=1}^{\log_{2}\tfrac{h}{g}}\sum_{n_{\ell}=1}^{g2^{\ell+1}}\sum_{n_{m}=1}^{g2^{m+1}}\frac{1}{2^{2\ell+2m}}F\left(\frac{n_{\ell}}{g2^{\ell+1}}\right)F\left(\frac{n_{m}}{g2^{m+1}}\right)F\left(\frac{n_{\ell}2^{m}-n_{m}2^{\ell}}{g2^{\ell+m+1}}\right).$

Applying Lemma 2.7 to the inner sum gives

$\displaystyle S_{2}(g,x,a)\ll$ $\displaystyle(\log\log
h)^{2}\sum_{\begin{subarray}{c}\ell,m=1\\\ \ell\leq
m\end{subarray}}^{\log_{2}\tfrac{h}{g}}\frac{1}{2^{2\ell+2m}}hg^{2}2^{2\ell}\ll
h(\log\log h)^{2}g^{2}\sum_{\begin{subarray}{c}\ell,m=1\\\ \ell\leq
m\end{subarray}}^{\log_{2}\tfrac{h}{g}}\frac{1}{2^{2m}}\ll h(\log\log
h)^{2}g^{2},$

and thus

$\displaystyle T_{2}$ $\displaystyle\ll h(\log\log
h)^{2}\sum_{\begin{subarray}{c}g,x|q\\\
x<h/g\end{subarray}}\frac{\mu(gx)^{2}}{\phi(g)^{3}\phi(x)^{2}}\sum_{\begin{subarray}{c}a\\\
(a,x)=1\end{subarray}}g^{2}$ $\displaystyle\ll h(\log\log
h)^{2}\sum_{\begin{subarray}{c}g,x|q\\\
x<h/g\end{subarray}}\frac{\mu(gx)^{2}g^{2}}{\phi(g)^{3}\phi(x)}\ll h(\log
h)^{2}(\log\log h)^{2}.$

∎

###  2.4. Bounding $T_{3}$: terms with $gx,gy,gz$ small and each $a_{i}$ small

All that remains is to analyze the sum $T_{3}$, which consists of the terms in
(6) where $gx,gy,$ and $gz<h$, and for each $i$,
$\left\|\frac{a_{i}}{q_{i}}\right\|\leq\frac{2}{h}$. Precisely, we define

(14) $T_{3}:=\sum_{\begin{subarray}{c}g,x,y,z|q\\\
x,y,z<h/g\end{subarray}}\frac{\mu(gxyz)^{2}}{\phi(g)^{3}\phi(xyz)^{2}}\sum_{\begin{subarray}{c}a_{1},a_{2},a_{3}\\\
(a_{1},gyz)=\cdots=1\\\ a_{1}/gyz+\cdots\in{\mathbb{Z}}\\\
\|a_{1}/gyz\|<2/h\\\ \|a_{2}/gxz\|<2/h\\\
\|a_{3}/gxy\|<2/h\end{subarray}}F\left(\frac{a_{1}}{gyz}\right)F\left(\frac{a_{2}}{gxz}\right)F\left(\frac{a_{3}}{gxy}\right).$

######  Lemma 2.11.

Let $q$ be the product of all primes $p\leq h^{4}$ and define $T_{3}$ by (14).
Then

$T_{3}\ll h(\log h)^{4}(\log\log h)^{2}.$

###### Proof.

Since $\left|\left|\frac{a_{3}}{gxy}\right|\right|<\frac{2}{h}$, this implies
that

$\frac{1}{gxy}<\frac{2}{h},$

so if $y<\sqrt{h/2g}$, then $x>\sqrt{h/2g}$. Thus at most one of $x,y,z$ can
be $<\sqrt{h/2g}$. By relabeling if necessary, we get that

$T_{3}\ll\sum_{\begin{subarray}{c}g,x,y,z|q\\\ x,y,z<h/g\\\
y,z\geq\sqrt{h/2g}\end{subarray}}\frac{\mu(gxyz)^{2}}{\phi(g)^{3}\phi(xyz)^{2}}\sum_{\begin{subarray}{c}a_{1},a_{2},a_{3}\\\
(a_{1},gyz)=\cdots=1\\\ a_{1}/gyz+\cdots\in{\mathbb{Z}}\\\
\|a_{1}/gyz\|<2/h\\\ \|a_{2}/gxz\|<2/h\\\
\|a_{3}/gxy\|<2/h\end{subarray}}F\left(\frac{a_{1}}{gyz}\right)F\left(\frac{a_{2}}{gxz}\right)F\left(\frac{a_{3}}{gxy}\right).$

As in the proof of Lemma 2.10,

$\frac{a_{1}}{gyz}=\frac{b}{gy}-\frac{c}{gz},\frac{a_{2}}{gxz}=\frac{c}{gz}-\frac{a}{x},\frac{a_{3}}{gxy}=\frac{a}{x}-\frac{b}{gy},$

and we can reparametrize $T_{3}$ in terms of sums over $a,b,c$ instead of
$a_{1},a_{2},a_{3}$. Doing so, and moving the sums over $b,y,c,$ and $z$
inside, we get that

$T_{3}\ll h^{3}\sum_{\begin{subarray}{c}g,x|q\\\ gx\leq
h\end{subarray}}\frac{\mu(gx)^{2}}{\phi(g)^{3}\phi(x)^{2}}\sum_{\begin{subarray}{c}a\leq
x\\\ (a,x)=1\end{subarray}}S_{3}(g,x,a),$

where

$S_{3}(g,x,a)=\sum_{\begin{subarray}{c}\sqrt{h/g}\leq y\leq h/g\\\
\sqrt{h/g}\leq z\leq
h/g\end{subarray}}\frac{\mu(yz)^{2}}{\phi(yz)^{2}}\\#\left\\{b,c:\frac{b}{gy},\frac{c}{gz}\in\left(\frac{a}{x}-\frac{1}{h},\frac{a}{x}+\frac{1}{h}\right)\right\\}.$

Since $y,z\leq h$, the product $yz$ is $\leq h^{2}$, and thus
$\frac{1}{\phi(yz)^{2}}\ll\frac{(\log\log h)^{2}}{y^{2}z^{2}}$, so we can
replace $\phi(yz)^{2}$ in the denominator of $S_{3}(g,x,a)$ with $y^{2}z^{2}$
and in doing so lose a factor of $(\log\log h)^{2}$. In order to estimate
$S_{3}(g,x,a)$, we split the sums over $y$ and $z$ dyadically, defining $\ell$
such that $2^{\ell}<y\leq 2^{\ell+1}$ and $2^{m}<z\leq 2^{m+1}$.

Then

$\displaystyle S_{3}(g,x,a)$ $\displaystyle\ll(\log\log
h)^{2}\sum_{\ell,m=\tfrac{1}{2}(\log_{2}(h/g))}^{\log_{2}(h/g)}\frac{C_{\ell}C_{m}}{2^{2\ell}2^{2m}},$

where

$C_{\ell}=\\#\left\\{b,y:\frac{b}{y}\in\left(\frac{ga}{x}-\frac{g}{h},\frac{ga}{x}+\frac{g}{h}\right),1\leq
b<y,y\leq 2^{\ell+1}\right\\},$

and similarly for $C_{m}$. The minimum spacing of two distinct points
$\frac{b_{1}}{y_{1}}$ and $\frac{b_{2}}{y_{2}}$ with denominators at most
$2^{\ell+1}$ is $O\left(\tfrac{1}{2^{2\ell}}\right)$, so then $C_{\ell}\ll
2^{2\ell}\frac{g}{h}+1.$ Since $\ell\geq\tfrac{1}{2}(\log_{2}(h/g))$,
$2^{2\ell}\frac{g}{h}\geq 1$, so in particular $C_{\ell}\ll
2^{2\ell}\frac{g}{h},$ and similarly for $C_{m}$.

Plugging this in gives

$\displaystyle S_{3}(g,x,a)$ $\displaystyle\ll(\log\log
h)^{2}\sum_{\ell,m=\tfrac{1}{2}(\log_{2}(h/g))}^{\log_{2}(h/g)}\frac{2^{2\ell}2^{2m}}{2^{2\ell}2^{2m}}\frac{g^{2}}{h^{2}}\ll\frac{g^{2}}{h^{2}}(\log(h/g))^{2}(\log\log
h)^{2},$

so that

$\displaystyle T_{2}$ $\displaystyle\ll h(\log\log
h)^{2}\sum_{\begin{subarray}{c}g,x|q\\\ gx\leq
h\end{subarray}}\frac{\mu(gx)^{2}g^{2}}{\phi(g)^{3}\phi(x)^{2}}\sum_{\begin{subarray}{c}a\leq
x\\\ (a,x)=1\end{subarray}}(\log(h/g))^{2}$ $\displaystyle\ll h(\log\log
h)^{2}\sum_{\begin{subarray}{c}g,x|q\\\ gx\leq
h\end{subarray}}\frac{\mu(gx)^{2}g^{2}}{\phi(g)^{3}\phi(x)}(\log(h/g))^{2}$
$\displaystyle\ll h(\log\log h)^{3}\sum_{g\leq h}\frac{1}{g}(\log(h/g))^{3}$
$\displaystyle\ll h(\log h)^{4}(\log\log h)^{3}.$

∎

Putting Lemmas 2.9, 2.10, and 2.11 together yields Theorem 2.1.

##  3\. Function Field Analogues: Proof of Theorem 1.3

We consider analogous questions when working in ${\mathbb{F}}_{q}[T]$ rather
than in ${\mathbb{Z}}$. To begin with, let’s set up the situation in the
function field case. Fix a finite field ${\mathbb{F}}_{q}$. Rather than primes
in ${\mathbb{N}}$, consider monic irreducible polynomials in
${\mathbb{F}}_{q}[T]$.

The _norm_ of a polynomial $F\in{\mathbb{F}}_{q}[T]$ is defined as as
$|F|=q^{\deg F}$. We consider intervals in norm, where the interval $I(F,h)$
of degree $h$ is defined as

$I(F,h):=\\{G\in{\mathbb{F}}_{q}[T]:|F-G|<q^{h}\\}$

For a fixed monic polynomial $Q$, we denote

$\displaystyle\mathcal{C}(Q)$
$\displaystyle:=\left\\{\frac{A}{Q}\in{\mathbb{F}}_{q}[T]:|A|<|Q|\right\\}$
$\displaystyle\mathcal{R}(Q)$
$\displaystyle:=\left\\{\frac{A}{Q}\in{\mathbb{F}}_{q}[T]:|A|<|Q|,(A,Q)=1\right\\}$
$\displaystyle\mathcal{N}(Q)$
$\displaystyle:=\left\\{\frac{A}{Q}\in{\mathbb{F}}_{q}[T]:|A|<|Q|,Q\nmid
A\right\\}$

For $Q=1$, we instead for convenience define
$\mathcal{C}(Q)=\\{1\\}=\mathcal{R}(Q)$. If $\deg Q>0$, the set of polynomials
$F$ with $\deg F<\deg Q$ is a canonical set of representatives of
${\mathbb{F}}_{q}[T]/(Q)$; in what follows, we will identify
$\\{F\in{\mathbb{F}}_{q}[T]:\deg F<\deg Q\\}$ with ${\mathbb{F}}_{q}[T]/(Q)$.
If $Q=1$, we will take $1$ to represent the unique equivalence class of
${\mathbb{F}}_{q}[T]/(Q)$.

Our problem is then to consider the $k$th moment of the distribution of
irreducible polynomials in intervals $I(F,h)$. As in the integer case, we
begin by considering the related quantity of the distribution of reduced
residues modulo a squarefree monic polynomial $Q$. That is, for $Q$ a fixed
squarefree monic polynomial, we consider

$m_{k}(Q;h)=\sum_{F\bmod Q}\left(\left(\sum_{\begin{subarray}{c}G\in I(F,h)\\\
(G,Q)=1\end{subarray}}1\right)-\frac{q^{h}\phi(Q)}{|Q|}\right)^{k}.$

Here we are taking the centered moment $m_{k}(Q;h)$ by subtracting
$\frac{q^{h}\phi(Q)}{|Q|}$.

As in the integer case, we can express the moment $m_{k}(Q;h)$ in terms of
exponential sums. For $\alpha=\frac{F}{G}\in{\mathbb{F}}_{q}(T)$ a rational
function, let $\mathrm{res}(\alpha)$ be the coefficient of $\frac{1}{T}$ when
$\alpha$ is written as a Laurent series with finitely many positive terms.
Then we define

$e(\alpha):=e_{q}(\mathrm{res}(\alpha))=\mathrm{exp}(2\pi
i\cdot\mathrm{tr}(\mathrm{res}(\alpha))/p),$

where $q$ is a power of the prime $p$ and
$\mathrm{tr}:{\mathbb{F}}_{q}\to{\mathbb{F}}_{p}$ is the trace function. This
exponential function, like its integer analog, satisfies the crucial property
that for a monic polynomial $F\in{\mathbb{F}}_{q}[T],$

$\sum_{\alpha\in\mathcal{C}(F)}e\left(\alpha\right)=\begin{cases}1&\text{ if
}F=1\\\ 0&\text{ otherwise}.\end{cases}$

We then have the following lemma, analogous to Lemma 2 in [13].

######  Lemma 3.1.

$m_{k}(Q;h)=|Q|\left(\frac{\phi(Q)}{|Q|}\right)^{k}V_{k}(Q;h),$

where

$V_{k}(Q;h)=\sum_{\begin{subarray}{c}R_{1},\dots R_{k}|Q\\\ |R_{i}|>1\\\
R_{i}\text{
monic}\end{subarray}}\prod_{i=1}^{k}\frac{\mu(R_{i})}{\phi(R_{i})}\sum_{\begin{subarray}{c}\rho_{1},\dots,\rho_{k}\\\
\rho_{i}\in\mathcal{R}(R_{i})\\\
\sum_{i}\rho_{i}/R_{i}=0\end{subarray}}E\left(\frac{\rho_{1}}{R_{1}}\right)\cdots
E\left(\frac{\rho_{k}}{R_{k}}\right),$

and where, for $\alpha\in{\mathbb{F}}_{q}(t)$ a rational function,

$E(\alpha)=\sum_{M\in I(0,h)}e(M\alpha).$

The proof follows that of Lemma 2 in [13] very closely.

###### Proof.

Let $\kappa(R)=1$ when $(R,Q)=1$, $\kappa(R)=0$ otherwise. Then

$\displaystyle\kappa(R)=\sum_{S|(R,Q)}\mu(S)$
$\displaystyle=\sum_{S|Q}\frac{\mu(S)}{|S|}\sum_{\sigma\in\mathcal{C}(S)}e(R\sigma)$
$\displaystyle=\sum_{T|Q}\left(\sum_{\begin{subarray}{c}A\in\mathcal{C}(T)\\\
(A,T)=1\end{subarray}}e(RA)\right)\left(\sum_{T|S|Q}\frac{\mu(S)}{|S|}\right).$

Here the second factor is $\frac{\phi(Q)}{|Q|}\frac{\mu(T)}{|T|}.$ The
function $\kappa(R)$ has mean value $\frac{\phi(Q)}{|Q|}$, so we subtract
$\frac{\phi(Q)}{|Q|}$ from both sides, which deletes the term when $T=1$. We
then replace $R$ by $M+N$, and sum over $M$ to see that

$\sum_{\begin{subarray}{c}|M|<q^{h}\\\
(M+N,Q)=1\end{subarray}}1-h\frac{\phi(Q)}{|Q|}=\frac{\phi(Q)}{|Q|}\sum_{\begin{subarray}{c}R|Q\\\
|R|>1\end{subarray}}\frac{\mu(R)}{\phi(R)}\sum_{\begin{subarray}{c}A\in\mathcal{C}(R)\\\
(A,R)=1\end{subarray}}E\left(\frac{A}{R}\right)e(NA/R).$

The argument is completed upon raising both sides to the $k$th power, summing
over $N$, multiplying out the right hand side, and appealing to the fact that

$\sum_{|N|<q^{d}}e(N(\alpha_{1}+\cdots+\alpha_{k}))=\begin{cases}q^{d}&\text{
if }\sum\alpha_{i}\in{\mathbb{Z}}\\\ 0&\text{ else}.\end{cases}$

∎

One important difference between the integer setting and the function field
setting is the behavior of the sums $E(\alpha)$, which are particularly well-
behaved in ${\mathbb{F}}_{q}[T]$. These sums have also been studied by Hayes
in [8, Theorem 3.5].

######  Lemma 3.2.

Let $\alpha\in{\mathbb{F}}_{q}(t)$ be a rational function with
$\deg\alpha\leq-1$. Then

$E(\alpha)=\begin{cases}q^{h}&\text{ if }\deg\alpha<-h\\\ 0&\text{ if
}\deg\alpha\geq h.\end{cases}$

###### Proof.

Let $\mathcal{P}_{h}\subseteq{\mathbb{F}}_{q}[t]$ be the set of polynomials of
degree less than $h$. Assume first that $\deg\alpha<-h$. Then for all
$M\in\mathcal{P}_{h}$, $\deg M\alpha=\deg M+\deg\alpha\leq h-1-h-1=-2$, so the
Laurent series for $M\alpha$ has no $\frac{1}{t}$ term, and thus
$\mathrm{res}(M\alpha)=0$. But then

$E(\alpha)=\sum_{M\in\mathcal{P}_{h}}e(M\alpha)=\sum_{M\in\mathcal{P}_{h}}e_{q}(\mathrm{res}(M\alpha))=\sum_{M\in\mathcal{P}_{h}}1=q^{h}.$

Now assume that $\deg\alpha\geq-h$. Consider the map
$\mathrm{res}_{\alpha}:\mathcal{P}_{h}\to{\mathbb{F}}_{q}$ which at a
polynomial $M$ returns the residue of $M\alpha$. This map is linear over
${\mathbb{F}}_{q}$, so its image is either $0$ or all of ${\mathbb{F}}_{q}$.
Let $M=t^{-\deg\alpha-1}$. Since $-h\leq\deg\alpha\leq-1$, we have
$0\leq-\deg\alpha-1\leq h-1$, so $M$ indeed is a polynomial in
$\mathcal{P}_{h}$. On the other hand, $\mathrm{res}(M\alpha)$ is precisely the
leading coefficient of $\alpha$, which must be nonzero. Thus the image of
$\mathrm{res}_{\alpha}$ is nonzero, so it is all of ${\mathbb{F}}_{q}$. In
particular, $\mathrm{res}_{\alpha}(M)$ takes each value in ${\mathbb{F}}_{q}$
equally often. Thus

$E(\alpha)=\sum_{M\in\mathcal{P}_{h}}e_{q}(\mathrm{res}(M\alpha))$

is a balanced exponential sum, which has sum $0$. ∎

This fact and other properties of the sums $E(\alpha)$ mean that the analysis
of Montgomery and Vaughan in [13] in the function field setting is more
streamlined. In fact, their work automatically gives the analog of our desired
bound for the third moment in the function field case.

###  3.1. The analog of [13] in the function field setting

We begin with the following fundamental lemma, with an identical proof to the
integer case.

######  Lemma 3.3 (Fundamental Lemma).

Let $R_{1},\dots,R_{k}$ be squarefree monic polynomials with
$R=[R_{1},\dots,R_{k}]$. Suppose for all irreducible $P|R$, $P$ divides at
least two $R_{i}$’s. Let $G_{i}$ be positive real-valued function defined on
$\mathcal{C}(R_{i})$. Then

$\left|\sum_{\begin{subarray}{c}A_{i}\bmod{R_{i}}\\\
\sum_{i}A_{i}/R_{i}=0\end{subarray}}G_{1}\left(\frac{A_{i}}{R_{i}}\right)\cdots
G_{k}\left(\frac{A_{k}}{R_{k}}\right)\right|\leq\frac{1}{|R|}\prod_{i=1}^{k}\left(|R_{i}|\sum_{\begin{subarray}{c}A_{i}\bmod{R_{i}}\end{subarray}}\left|G_{i}\left(\frac{A_{i}}{R_{i}}\right)\right|^{2}\right)^{1/2}.$

The proof follows Montgomery-Vaughan very closely.

###### Proof.

We proceed by induction on $k$.

Assume first that $k=2$. Then we must have $R_{1}=R_{2}=R$. By Cauchy-Schwarz,

$\left|\sum_{\begin{subarray}{c}|A|<|R|\end{subarray}}G_{1}\left(\frac{A}{R}\right)G_{2}\left(\frac{A}{R}\right)\right|\leq\left(\sum_{\begin{subarray}{c}|A|<|R|\end{subarray}}\left|G_{1}\left(\frac{A}{R}\right)\right|^{2}\right)^{1/2}\left(\sum_{\begin{subarray}{c}|A|<|R|\end{subarray}}\left|G_{2}\left(\frac{A}{R}\right)\right|^{2}\right)^{1/2},$

which after a bit of rearranging gives the desired result.

For arbitrary $k$, set $D=(R_{1},R_{2})$, and write $D=ST$ with $S|R_{3}\cdots
R_{k}$ and $(T,R_{3}\cdots R_{k})=1$. Furthermore, write
$R_{1}=DR_{1}^{\prime}$ and $R_{2}=DR_{2}^{\prime}$. Consider any term in the
sum. Since $\sum_{i}\frac{A_{i}}{R_{i}}=0,$ we have
$T|\left(\frac{A_{1}}{R_{1}}+\frac{A_{2}}{R_{2}}\right)$. Thus
$\frac{A_{1}}{STR_{1}^{\prime}}+\frac{A_{2}}{STR_{2}^{\prime}}$ can be
expressed as a fraction $\frac{A}{R_{1}^{\prime}R_{2}^{\prime}S}$.

By the Chinese Remainder theorem,
$\frac{A_{1}}{STR_{1}^{\prime}}=\frac{\alpha_{1}}{R_{1}^{\prime}}+\frac{\beta_{1}}{ST}$
and
$\frac{A_{2}}{STR_{2}^{\prime}}=\frac{\alpha_{2}}{R_{2}^{\prime}}+\frac{\beta_{2}}{ST},$
where $\frac{\beta_{2}}{ST}=-\frac{\beta_{1}}{ST}+\frac{\gamma}{S}$ because
$T|\left(\frac{A_{1}}{R_{1}}+\frac{A_{2}}{R_{2}}\right)$. Thus
$\frac{A_{1}}{R_{1}}$ and $\frac{A_{2}}{R_{2}}$ can be written as
$\frac{A_{1}}{R_{1}}=\frac{A_{1}^{\prime}}{R_{1}^{\prime}}+\frac{\delta}{D}$
and
$\frac{A_{2}}{R_{2}}=\frac{A_{2}^{\prime}}{R_{2}^{\prime}}+\frac{\sigma}{S}-\frac{\delta}{D},$
with each rational function of degree less than $0$.

Let $R^{*}=R_{1}^{\prime}R_{2}^{\prime}S$. For each $A^{*}$ with
$|A^{*}|<|R^{*}|$, $\frac{A^{*}}{R^{*}}$ is uniquely of the form
$\frac{A^{*}}{R^{*}}=\frac{A_{1}^{\prime}}{R_{1}^{\prime}}+\frac{A_{2}^{\prime}}{R_{2}^{\prime}}+\frac{\sigma}{S}.$
Define

$G^{*}\left(\frac{A^{*}}{R^{*}}\right)=\sum_{\begin{subarray}{c}|\delta|<|D|\end{subarray}}G_{1}\left(\frac{A_{1}^{\prime}}{R_{1}^{\prime}}+\frac{\delta}{D}\right)G_{2}\left(\frac{A_{2}^{\prime}}{R_{2}^{\prime}}+\frac{\sigma}{S}-\frac{\delta}{D}\right).$

Then the sum in question is

$\sum_{\begin{subarray}{c}A^{*}\bmod{R^{*}}\\\ A_{i}\bmod{R_{i}}\\\
A^{*}/R^{*}+\sum_{i=3}^{k}A_{i}/R_{i}=0\end{subarray}}G^{*}\left(\frac{A^{*}}{R^{*}}\right)G_{3}\left(\frac{A_{3}}{R_{3}}\right)\cdots
G_{k}\left(\frac{A_{k}}{R_{k}}\right).$

Via Cauchy-Schwarz as well as the induction hypothesis, the above is

$\leq\frac{|T|}{|R|}\left(|R^{*}|\sum_{\begin{subarray}{c}A^{*}\bmod{R^{*}}\end{subarray}}G^{*}\left(\frac{A^{*}}{R^{*}}\right)^{2}\right)^{1/2}\prod_{i=3}^{k}\left(|R_{i}|\sum_{\begin{subarray}{c}A_{i}\bmod{R_{i}}\end{subarray}}G_{i}\left(\frac{A_{i}}{R_{i}}\right)^{2}\right)^{1/2}.$

By Cauchy-Schwarz,

$G^{*}\left(\frac{A^{*}}{R^{*}}\right)^{2}\leq\left(\sum_{\delta\bmod
D}G_{1}\left(\frac{A_{1}^{\prime}}{R_{1}^{\prime}}+\frac{\delta}{D}\right)^{2}\right)\left(\sum_{\delta\bmod
D}G_{2}\left(\frac{A_{2}^{\prime}}{R_{2}^{\prime}}+\frac{\sigma}{S}-\frac{\delta}{D}\right)^{2}\right),$

so summing over $A^{*}$ gives

$\sum_{A^{*}\bmod{R^{*}}}G^{*}\left(\frac{A^{*}}{R^{*}}\right)^{2}\leq|S|\left(\sum_{A_{1}\bmod{R_{1}}}G_{1}\left(\frac{A_{1}}{R_{1}}\right)^{2}\right)\left(\sum_{A_{2}\bmod{R_{2}}}G_{2}\left(\frac{A_{2}}{R_{2}}\right)^{2}\right).$

∎

We now present several preliminary lemmas about the sums $E(\alpha)$. The
following lemma is analogous to Lemma 4 of [13].

######  Lemma 3.4.

For any polynomial $R$,

$\sum_{\begin{subarray}{c}S\bmod
R\end{subarray}}E\left(\frac{S}{R}\right)^{2}=\max\\{q^{2h},|R|q^{h}\\}$

Moreover, for any polynomial $R$ and any rational function $\alpha$,

$\sum_{\begin{subarray}{c}S\bmod
R\end{subarray}}E\left(\frac{S}{R}+\alpha\right)^{2}\begin{cases}=\max\\{q^{2h},|R|q^{h}\\}&\text{
if }|\alpha|<q^{-h}\\\ \leq|R|q^{h-1}&\text{ if }|\alpha|\geq
q^{-h}\end{cases}$

###### Proof.

If $\deg R\leq h$, then for all $S$ with $0\neq|S|<|R|$, $h\geq\deg R-\deg S$,
and thus $E\left(\frac{S}{R}\right)^{2}=0$. Meanwhile, $E(0)^{2}=q^{2h}$, so
in this case the sum is $q^{2h}$.

Now suppose $\deg R>h$. Then $E\left(\frac{S}{R}\right)$ is nonzero if and
only if $\deg S<\deg R-h$. Thus

$\sum_{\begin{subarray}{c}S\bmod
R\end{subarray}}E\left(\frac{S}{R}\right)^{2}=\sum_{\begin{subarray}{c}S\bmod
R\\\
|S|<|R|/q^{h}\end{subarray}}E\left(\frac{S}{R}\right)^{2}=\sum_{\begin{subarray}{c}S\bmod
R\\\ |S|<|R|/q^{h}\end{subarray}}q^{2h}=|R|q^{h},$

which completes the first portion.

Fix a rational function $\alpha$. For all $\frac{S}{R}$,
$E\left(\frac{S}{R}+\alpha\right)$ is unchanged by replacing $\alpha$ with its
fractional part; i.e, subtracting off the polynomial portion of $\alpha$ so
that $|\alpha|<1$, including the possibility that $\alpha=0$.

If a term $E\left(\frac{S}{R}+\alpha\right)$ is nonzero, then
$\left|\frac{S}{R}+\alpha\right|<q^{-h}$. We’ll split into two cases, when
$|\alpha|<q^{-h}$ and when $|\alpha|\geq q^{h}$. First, if $|\alpha|<q^{-h}$,
then $\left|\frac{S}{R}+\alpha\right|<q^{-h}$ if and only if
$\left|\frac{S}{R}\right|<q^{-h}$. If $|R|\geq q^{h}$, there are $|R|/q^{h}$
values of $S$ satisfying this; if not, there is $1$ value. Thus if
$|\alpha|<q^{-h}$, we have $\sum_{\begin{subarray}{c}S\bmod
R\end{subarray}}E\left(\frac{S}{R}+\alpha\right)^{2}E\left(\frac{S}{R}+\alpha\right)=\mathrm{max}(q^{2h},|R|q^{h})$.

Meanwhile if $|\alpha|\geq q^{-h}$, then for
$\left|\frac{S}{R}+\alpha\right|<q^{-h}$ we must have
$\left|\frac{S}{R}\right|=|\alpha|\geq q^{-h}$. Thus the first
$\deg\alpha+h+1$ terms of $\frac{S}{R}$ are fixed, by the fact that they must
cancel with the corresponding terms of $\alpha$ to yield a rational function
of small enough degree. Correspondingly, the first $\deg\alpha+h+1$ terms of
$S$ are determined. We have $|S|=|R\alpha|$, so there are at most
$|R\alpha|\cdot\frac{1}{|\alpha|\cdot|q^{h+1}|}=|R|q^{h-1}$ nonzero terms
here. Thus in this case we have $\sum_{\begin{subarray}{c}S\bmod
R\end{subarray}}E\left(\frac{S}{R}+\alpha\right)^{2}\leq|R|q^{h-1}$. ∎

The following lemma corresponds to Lemma 6 of Montgomery-Vaughan.

######  Lemma 3.5.

Let $R$ be a polynomial, and let $\alpha,\beta$ be rational functions. Then

$\sum_{S\bmod
R}E\left(\frac{S}{R}+\alpha\right)E\left(\frac{S}{R}+\beta\right)\ll
E(\alpha-\beta)q^{-h}\sum_{S\bmod R}E\left(\frac{S}{R}+\alpha\right)^{2}$

###### Proof.

Again, we split into two cases. Assume first that $|\alpha-\beta|\geq q^{-h}$.
Then either $\left|\frac{S}{R}+\beta\right|\geq q^{-h}$, or
$\left|\frac{S}{R}+\alpha\right|\geq q^{-h}.$ Thus for each $\frac{S}{R}$,
either $E\left(\frac{S}{R}+\alpha\right)=0$ or
$E\left(\frac{S}{R}+\beta\right)=0$, so the product must be $0$, and thus the
sum is $0$.

Now assume that $|\alpha-\beta|<q^{-h}$, so $E(\alpha-\beta)=q^{h}$. Then
$E\left(\frac{S}{R}+\alpha\right)\neq 0$ if and only if
$E\left(\frac{S}{R}+\beta\right)\neq 0$, so

$\sum_{S\bmod
R}E\left(\frac{S}{R}+\alpha\right)E\left(\frac{S}{R}+\beta\right)=\sum_{S\bmod
R}E\left(\frac{S}{R}+\alpha\right)^{2},$

which gives the result. ∎

With these preliminaries in hand, we prove the following lemma, which
corresponds to Lemma 7 of [13].

######  Lemma 3.6.

Let $k\geq 3$, and let $R_{1},\dots,R_{k}$ be squarefree polynomials with
$|R_{i}|>1$ for all $i$. Let $R=[R_{1},\dots,R_{k}]$. Let $D=(R_{1},R_{2})$
and $D=ST$ with $S|R_{3}\cdots R_{k}$ and $(T,R_{3}\cdots R_{k})=1$. Write
$R_{1}=DR_{1}^{\prime}$, $R_{2}=DR_{2}^{\prime}$, and
$R^{*}=R_{1}^{\prime}R_{2}^{\prime}S$. Define

$S(R_{1},\dots,R_{k}):=\sum_{\begin{subarray}{c}A_{i}\bmod{R_{i}}\\\
(A_{i},R_{i})=1\\\
\sum_{i}A_{i}/R_{i}=0\end{subarray}}\prod_{i=1}^{k}E\left(\frac{A_{i}}{R_{i}}\right).$

If there exists an $i$ such that $|R_{i}|\leq q^{h}$, then
$S(R_{1},\dots,R_{k})=0$. Otherwise,

$S(R_{1},\dots,R_{k})\ll|R_{1}\cdots
R_{k}|\cdot|R|^{-1}(q^{h})^{k/2}(X_{1}+X_{2}+X_{3}),$

where

$\displaystyle X_{1}$ $\displaystyle=q^{-h/2}$ $\displaystyle X_{2}$
$\displaystyle=\begin{cases}|D|^{-1}&\text{ if }|R_{1}^{\prime}|>q^{h}\\\
0&\text{ otherwise }\end{cases}$ $\displaystyle X_{3}$
$\displaystyle=\begin{cases}|S|^{-1/2}&\text{ if }R_{1}=R_{2}\\\ 0&\text{
otherwise }\end{cases}$

###### Proof.

Assume first that for some $i$, $|R_{i}|\leq q^{h}$. Then $E(A_{i}/R_{i})=0$
whenever $A_{i}\neq 0$, so in particular for all $A_{i}$ with
$(A_{i},R_{i})=1$, so the sum is $0$. Assume from now on that $|R_{i}|>q^{h}$
for all $i$.

We now return to the proof of the Fundamental Lemma. For
$\frac{A^{*}}{R^{*}}=\frac{A_{1}^{\prime}}{R_{1}^{\prime}}+\frac{A_{2}^{\prime}}{R_{2}^{\prime}}+\frac{\sigma}{S}$,
we define

$G^{*}\left(\frac{A^{*}}{R^{*}}\right)=\sum_{\begin{subarray}{c}\delta\bmod{D}\\\
(DA_{1}^{\prime}+\delta R_{1}^{\prime},R_{1})=1\\\
(DA_{2}^{\prime}+R_{2}^{\prime}T\sigma-
R_{2}^{\prime}\delta,R_{2})=1\end{subarray}}E\left(\frac{A_{1}^{\prime}}{R_{1}^{\prime}}+\frac{\delta}{D}\right)E\left(\frac{A_{2}^{\prime}}{R_{2}^{\prime}}+\frac{\sigma}{S}-\frac{\delta}{D}\right).$

For this sum to be nonempty,
$(A_{1}^{\prime},R_{1}^{\prime})=(A_{2}^{\prime},R_{2}^{\prime})=1$. Then

$S(R_{1},\dots,R_{k})\leq\frac{|T|}{|R|}\left(|R^{*}|\sum_{A^{*}\bmod{R^{*}}}G^{*}\left(\frac{A^{*}}{R^{*}}\right)^{2}\right)^{1/2}\prod_{i=3}^{k}\left(|R_{i}|\sum_{\begin{subarray}{c}A_{i}\bmod{R_{i}}\\\
|A_{i}|<|R_{i}|/q^{h}\\\ (A_{i},R_{i})=1\end{subarray}}1\right)^{1/2}$

By Lemma 3.4, the product is $\ll|R_{3}\cdots R_{k}|q^{hk/2-h}.$ Thus it
suffices to show that

$\sum_{A^{*}\bmod{R^{*}}}G^{*}\left(\frac{A^{*}}{R^{*}}\right)^{2}\ll|R_{1}|\cdot|R_{2}|\cdot|S|q^{2h}(X_{1}^{2}+X_{2}^{2}+X_{3}^{2}).$

By Lemma 3.5,

$G^{*}\left(\frac{A^{*}}{R^{*}}\right)\ll
E\left(\frac{A^{*}}{R^{*}}\right)q^{-h}\sum_{\delta\bmod{D}}E\left(\frac{\delta}{D}+\frac{A_{1}^{\prime}}{R_{1}^{\prime}}\right).$

Lemma 3.4 then gives us the following:

$G^{*}\left(\frac{A^{*}}{R^{*}}\right)\ll\begin{cases}E\left(\frac{A^{*}}{R^{*}}\right)\max\\{q^{h},|D|\\}&\text{
if }\left|\frac{A_{1}^{\prime}}{R_{1}^{\prime}}\right|<q^{-h}\\\
E\left(\frac{A^{*}}{R^{*}}\right)|D|q^{-1}&\text{ if
}\left|\frac{A_{1}^{\prime}}{R_{1}^{\prime}}\right|\geq q^{-h}\end{cases}$

Summing over $A^{*}$ then gives

$\displaystyle\sum_{\begin{subarray}{c}A^{*}\bmod{R^{*}}\end{subarray}}G^{*}\left(\frac{A^{*}}{R^{*}}\right)^{2}$
$\displaystyle\ll\sum_{\begin{subarray}{c}A^{*}\bmod{R^{*}}\\\
|A^{*}/R^{*}|<q^{-h}\\\
|A_{1}^{\prime}/R_{1}^{\prime}|<q^{-h}\end{subarray}}E\left(\frac{A^{*}}{R^{*}}\right)^{2}\max\\{q^{2h},|D|^{2}\\}+\sum_{\begin{subarray}{c}A^{*}\bmod{R^{*}}\\\
|A^{*}/R^{*}|<q^{-h}\\\ |A_{1}^{\prime}/R_{1}^{\prime}|\geq
q^{-h}\end{subarray}}E\left(\frac{A^{*}}{R^{*}}\right)^{2}|D|^{2}$

Here as in the definition of $G^{*}$, for any nonzero term we must have
$(A_{1}^{\prime},R_{1}^{\prime})=(A_{2}^{\prime},R_{2}^{\prime})=1$. In
particular, $A_{1}^{\prime}$ can only be congruent to $0$ if
$R_{1}^{\prime}=1$. We now split into cases based on whether or not
$|R^{*}|>q^{h}$ and whether or not $|R_{1}^{\prime}|>q^{h}$. First assume that
$|R^{*}|>q^{h}$ and $|R_{1}^{\prime}|>q^{h}$. Then we have

$\displaystyle\sum_{\begin{subarray}{c}A^{*}\bmod{R^{*}}\end{subarray}}G^{*}\left(\frac{A^{*}}{R^{*}}\right)^{2}$
$\displaystyle\ll\max\\{q^{2h},|D|^{2}\\}q^{2h}\frac{|R_{1}^{\prime}|}{q^{h}}\frac{|R_{2}^{\prime}S|}{q^{h}}+|D|^{2}\sum_{\begin{subarray}{c}A^{*}\bmod{R^{*}}\\\
|A^{*}/R^{*}|<q^{-h}\\\ |A_{1}^{\prime}/R_{1}^{\prime}|\geq
q^{h}\end{subarray}}E\left(\frac{A^{*}}{R^{*}}\right)^{2}$
$\displaystyle\ll\max\\{q^{2h},|D|^{2}\\}|R^{*}|+|D|^{2}|R^{*}|q^{h}$
$\displaystyle\ll|R_{1}|\cdot|R_{2}|\cdot|S|q^{2h}\left(X_{1}^{2}+X_{2}^{2}\right).$

Now assume that $|R^{*}|>q^{h}$ but $|R_{1}^{\prime}|\leq q^{h}$. Then the
first sum is empty unless $R_{1}^{\prime}=1$ and $A_{1}^{\prime}=0$. If
$R_{1}^{\prime}=1$, then $R_{1}=D$, so $|D|>q^{h}$. The above bound then
yields

$\sum_{\begin{subarray}{c}A^{*}\bmod{R^{*}}\end{subarray}}G^{*}\left(\frac{A^{*}}{R^{*}}\right)^{2}\ll
q^{2h}|D|^{2}+\frac{|R^{*}|}{q^{h}}q^{2h}|D|^{2}=|R_{1}R_{2}S|q^{2h}\left(\frac{1}{|R^{*}|}+q^{-h}\right)\ll|R_{1}R_{2}S|q^{2h}(X_{1}^{2}).$

If $R_{1}^{\prime}\neq 1$, then the first sum is empty, so we get

$\sum_{\begin{subarray}{c}A^{*}\bmod{R^{*}}\end{subarray}}G^{*}\left(\frac{A^{*}}{R^{*}}\right)^{2}\ll\frac{|R^{*}|}{q^{h}}q^{2h}|D|^{2}=|R_{1}R_{2}S|q^{2h}(X_{1}^{2})$

Finally, assume that $|R^{*}|\leq q^{h}$ and thus $|R_{1}^{\prime}|\leq
q^{h}$. In this case the only nonzero term in either sum is when $A^{*}=0$,
which forces $A_{1}^{\prime}=A_{2}^{\prime}=\sigma=0$. But then since
$(A_{1}^{\prime},R_{1}^{\prime})=(A_{2}^{\prime},R_{2}^{\prime})=1$, we must
have $R_{1}^{\prime}=R_{2}^{\prime}=1$, so that $R_{1}=R_{2}=D$, which has
magnitude $>q^{h}$. In this case

$\sum_{\begin{subarray}{c}A^{*}\bmod{R^{*}}\end{subarray}}G^{*}\left(\frac{A^{*}}{R^{*}}\right)^{2}\ll
q^{2h}|D|^{2}=|R_{1}R_{2}S|q^{2h}\cdot|S|^{-1}=|R_{1}R_{2}S|q^{2h}X_{3}^{2}.$

∎

We now turn to the proof of Theorem 1.3, which corresponds to Lemma 8 of [13].
The main strategy here is a careful application of Lemma 3.6, keeping in mind
that we can choose which variables play the roles of $R_{1}$ and $R_{2}$.

######  Lemma 3.7.

For any fixed $k\geq 3$, for $Q\in{\mathbb{F}}_{q}[T]$ squarefree,

$m_{k}(Q;h)\ll|Q|(q^{h})^{k/2}\left(\frac{\phi(Q)}{|Q|}\right)^{k/2}\left(1+\left((q^{h})^{-1/2}+(q^{h})^{-1/(k-2)}\right)\left(\frac{\phi(Q)}{|Q|}\right)^{-2^{k}+k/2}\right)$

###### Proof.

We begin with the bound that

$m_{k}(Q;h)\ll|Q|\left(\frac{\phi(Q)}{|Q|}\right)^{k}\sum_{\begin{subarray}{c}R|Q\\\
R\text{ monic}\end{subarray}}\sum_{\begin{subarray}{c}R_{i}|Q\\\ R_{i}\text{
monic}\\\ |R_{i}|>1\\\
[R_{1},\dots,R_{k}]=R\end{subarray}}\frac{S(R_{1},\dots,R_{k})}{\phi(R_{1})\cdots\phi(R_{k})},$

where $S(R_{1},\dots,R_{k})=\sum_{\begin{subarray}{c}A_{i}\bmod R_{i}\\\
(A_{i},R_{i})=1\\\
\sum_{i}A_{i}/R_{i}=0\end{subarray}}\prod_{i=1}^{k}E(A_{i}/R_{i}).$ We will
then apply Lemma 3.6, but we’ll use the fact that we have flexibility in how
we label $R_{1},\dots,R_{k}$ in our application of Lemma 3.6. We’ll choose
$R_{1}$ and $R_{2}$ as follows.

If for any $i$ we have $|R_{i}|<q^{h}$, then $S(R_{1},\dots,R_{k})$ must be
$0$, so assume that $|R_{i}|\geq q^{h}$ for all $i$. Let
$R_{ij}=(R_{i},R_{j})$. Since $R_{i}|\prod_{i\neq j}R_{j}$,
$R_{i}|\prod_{i\neq j}R_{ij}$ as well, for all $i$. Thus for all $i$, there
exists some $j\neq i$ such that $|R_{ij}|\geq|R_{i}|^{1/(k-1)}$. If there
exists some $i,j$ so that $|R_{ij}|\geq|R_{i}|^{1/(k-1)}$ but $R_{i}\neq
R_{j}$, then pick $R_{1}$ and $R_{2}$ to be $R_{i}$ and $R_{j}$, respectively.

Meanwhile, if no such $i$ exists, then for each $i$, there is some $j\neq i$
with $R_{i}=R_{j}$. If there exists any triple $R_{i}=R_{j}=R_{l}$, then pick
$R_{1}=R_{i}$, $R_{2}=R_{j}$. If not, then the $R_{i}$’s must be equal in
pairs and otherwise disjoint, and $k$ must be even. Without loss of
generality, say that $R_{1}=R_{2},R_{3}=R_{4},\dots,R_{k-1}=R_{k}$, before the
relabeling. Write $R=UV$, where $V$ is the product of all primes dividing at
least two $R_{2i}$’s, and $U$ is the product of all primes dividing exactly
one $R_{2i}$. Then

$V^{2}|\prod_{i=1}^{k/2}\left(R_{2i},\prod_{j\neq i}R_{2j}\right),$

so there exists some $i$ with $\left|\left(R_{2i},\prod_{j\neq
i}R_{2j}\right)\right|\geq|V|^{4/k}$. Take $R_{1}$ and $R_{2}$ to be $R_{2i}$
and $R_{2i+1}$.

Now we return to our bound on $m_{k}(Q;h)$. We have

$m_{k}(Q;h)\ll|Q|\left(\frac{\phi(Q)}{|Q|}\right)^{k}(q^{h})^{k/2}\sum_{\begin{subarray}{c}R|Q\\\
R\text{ monic}\end{subarray}}\frac{1}{|R|}\sum_{\begin{subarray}{c}R_{i}|Q\\\
R_{i}\text{ monic}\\\ |R_{i}|>1\\\
[R_{1},\dots,R_{k}]=R\end{subarray}}\frac{|R_{1}\cdots
R_{k}|}{\phi(R_{1})\cdots\phi(R_{k})}(X_{1}+X_{2}+X_{3}),$

where the $X_{i}$ arise by use of Lemma 3.6 as described above.

Consider the contribution from each $X_{i}$. Since $X_{1}=q^{-h/2}$, the
$X_{1}$ terms contribute

$\displaystyle\ll|Q|\left(\frac{\phi(Q)}{|Q|}\right)^{k}(q^{h})^{k/2-1/2}\sum_{\begin{subarray}{c}R|Q\\\
R\text{ monic}\end{subarray}}\frac{1}{|R|}\sum_{\begin{subarray}{c}R_{i}|Q\\\
R_{i}\text{ monic}\\\ |R_{i}|>1\\\
[R_{1},\dots,R_{k}]=R\end{subarray}}\frac{|R_{1}\cdots
R_{k}|}{\phi(R_{1})\cdots\phi(R_{k})}$
$\displaystyle\ll|Q|\left(\frac{\phi(Q)}{|Q|}\right)^{k}(q^{h})^{k/2-1/2}\prod_{P|Q}\left(1+\frac{1}{|P|}\left(2+\frac{1}{|P|-1}\right)^{k}\right)$
$\displaystyle\ll|Q|(q^{h})^{k/2-1/2}\left(\frac{\phi(Q)}{|Q|}\right)^{-2^{k}+k}.$

Now consider the $X_{2}$ contribution. If $X_{2}\neq 0$, then
$|R_{1}^{\prime}|>q^{h}$. By our choice of $R_{1},R_{2}$, this implies that
$|D|\geq|R_{1}|^{1/(k-1)}$. But then $|D|\geq|R_{1}^{\prime}\cdot
D|^{1/(k-1)}$, so $|D|^{-1}\leq q^{-h/(k-2)}$, so in turn $X_{2}\leq
q^{-h/(k-2)}$. By the same logic as for the $X_{1}$ terms, the $X_{2}$ terms
contribute
$\ll|Q|(q^{h})^{k/2-1/(k-2)}\left(\frac{\phi(Q)}{|Q|}\right)^{-2^{k}+k}.$

Finally we consider $X_{3}$. If $X_{3}\neq 0$, then $R_{1}=R_{2}$. By our
choice of $R_{1}$ and $R_{2}$ for the application of Lemma 3.6, in this case
each $R_{i}$ is equal to some $R_{j}$. If there exists some
$R_{i}=R_{1}=R_{2}$, with $i\geq 3$, then $S=R_{1}=R_{2}$, so $|S|>q^{h}$, and
thus for these terms we get a saving of $q^{-h/2}$ and the bound for $X_{1}$
applies. If not, then $k$ is even and the $R_{i}$’s must be equal in pairs and
otherwise disjoint. Let $R=UV$ as above, where $U$ is the product of
irreducibles $P$ dividing exactly one pair of $R_{i}$’s, and $V$ is the
product of all other irreducibles $P$ dividing $R$. Write $R_{i}=U_{i}V_{i}$,
where $U_{i}=(R_{i},U)$ and $V_{i}=(R_{i},V)$. For fixed $U,V$, let $C(U,V)$
be the set of $R_{1},\dots,R_{k}$ yielding that $U$ and $V$. Then there are at
most $d_{k/2}(U)$ choices for $U_{2},U_{4},\dots,U_{k}$, and since $V_{i}|V$,
there are at most $d(V)^{k/2}$ choices for $V_{2},V_{4},\dots,V_{k}$. Thus
$\\#|C(U,V)|\leq d_{k/2}(U)d(V)^{k/2}$. Since in our application of Lemma 3.6
we have $|S|\geq|V|^{4/k},$ we have

$\displaystyle\sum_{\begin{subarray}{c}UV|Q\\\
\text{monic}\end{subarray}}\frac{1}{|UV|}\sum_{(R_{1},\dots,R_{k})\in
C(U,V)}\left(\prod_{i=1}^{k}\frac{|R_{i}|}{\phi(R_{i})}\right)X_{3}$
$\displaystyle\ll\sum_{\begin{subarray}{c}UV|Q\\\
\text{monic}\end{subarray}}\frac{d_{k/2}(U)(|U|/\phi(U))^{2}d(V)^{k/2}(|V|/\phi(V))^{k}}{|U|\cdot|V|^{1+2/k}}$
$\displaystyle=\prod_{P|Q}\left(1+\frac{k|P|}{2(|P|-1)^{2}}+\frac{2^{k/2}(|P|/(|P|-1))^{k}}{|P|^{1+2/k}}\right)$
$\displaystyle\ll\left(\frac{\phi(Q)}{|Q|}\right)^{-k/2},$

so the $X_{3}$ terms contribute
$\ll|Q|(q^{h})^{k/2}\left(\frac{\phi(Q)}{|Q|}\right)^{k/2}$, as desired. ∎

The final contribution of $X_{3}$ only arises when $k$ is even, so when $k$ is
odd we have the estimate

$m_{k}(Q;h)\ll|Q|((q^{h})^{k/2-1/2}+(q^{h})^{k/2-1/(k-2)})\left(\frac{\phi(Q)}{|Q|}\right)^{k/2-2^{k}}.$

For $k=3$ this implies that

$m_{3}(Q;h)\ll|Q|q^{h}\left(\frac{\phi(Q)}{|Q|}\right)^{-5}.$

In the case when $k=5$, we can bound $m_{5}(Q;h)$ via a more involved
argument.

##  4\. The fifth moment of reduced residues in the function field setting:
Proof of Theorem 1.4

In this section we derive a stronger bound for $m_{5}(Q;h)$ than what is given
in Lemma 3.7, which implies that

$m_{5}(Q;h)\ll|Q|(q^{h})^{13/6}\left(\frac{\phi(Q)}{|Q|}\right)^{-29.5}$

We will prove that for all $\varepsilon>0$,

$m_{5}(Q;h)\ll|Q|(q^{h})^{2+\varepsilon},$

where Conjecture 1.1 would predict a bound where the power of $q^{h}$ is $2$.

We would like to apply Lemma 3.6 to bound the size of $S(R_{1},\dots,R_{5})$.
But when applying this lemma, we can freely choose which of the $R_{i}$’s
plays the roles of $R_{1}$ and $R_{2}$. If any $R_{i}$ satisfies
$|R_{i}|<q^{h}$, the choice is immaterial, so assume that $|R_{i}|\geq q^{h}$
for all $i$. If there is any triple $R_{i},R_{j},R_{k}$ with
$R_{i}=R_{j}=R_{k}$, pick $R_{1}=R_{i}$ and $R_{2}=R_{j}$. In this case
$X_{2}$ will have no contribution, and $X_{3}$ and $X_{1}$ will each be
$\widetilde{O}(q^{-h/2})$. If there is no such triple, but there exists
$R_{i}\neq R_{j}$ with either
$\left|\frac{R_{i}}{(R_{i},R_{j})}\right|<q^{h}$, or
$\left|\frac{R_{i}}{(R_{i},R_{j})}\right|\geq q^{h}$ and $|(R_{i},R_{j})|\geq
q^{h/2}$, then we choose $R_{1}=R_{i}$ and $R_{2}=R_{j}$. In this case we have
$X_{3}=0$ and $X_{1},X_{2}$ each contributing $\widetilde{O}(q^{-h/2})$. So,
it remains to bound what happens in the remaining cases. We first show that in
those cases, up to some reordering, certain factors of $R_{2}$ and $R_{3}$ are
bounded below.

######  Lemma 4.1.

Let $(R_{1},\dots,R_{5})$ be a tuple of divisors of $Q$ such that

  * •

$|R_{i}|\geq q^{h}$ for all $i$,

  * •

no three $R_{i}$’s are equal,

  * •

for any $R_{i}$, $R_{j}$, either $R_{i}=R_{j}$, or
$\left|\frac{R_{i}}{(R_{i},R_{j})}\right|\geq q^{h}$ and
$|(R_{i},R_{j})|<q^{h/2}$, and

  * •

$R_{1}$, $R_{2}$, and $R_{3}$ are all distinct.

Then

  * •

$\left|\frac{R_{2}}{(R_{1},R_{2})}\right|\geq q^{h}$, and

  * •

$\left|\frac{R_{3}}{(R_{3},R_{1}R_{2})}\right|\geq q^{h/2}$.

######  Remark.

The bound on $\left|\frac{R_{3}}{(R_{3},R_{1}R_{2})}\right|$ above is worse
than the bound on $\left|\frac{R_{2}}{(R_{1},R_{2})}\right|$. In order to
apply Lemma 4.3 below, we will need both of them to be at least of size
$q^{h/2}$, so the bound on $\left|\frac{R_{2}}{(R_{1},R_{2})}\right|$ is
better than necessary.

However, the fact that these bounds get worse is precisely what prevents us
from applying our technique to bound higher moments. If instead we applied the
same argument to a $7$-tuple $(R_{1},\dots,R_{7})$ of divisors of $Q$, we
would not be able to guarantee that
$\left|\frac{R_{4}}{(R_{4},R_{1}R_{2}R_{3})}\right|\geq q^{h/2}$, even if we
weaken the conditions to allow reordering.

###### Proof.

The first conclusion, that $\left|\frac{R_{2}}{(R_{1},R_{2})}\right|\geq
q^{h}$, follows directly from the third assumption, since we have $R_{1}\neq
R_{2}$.

For the second conclusion, let $R_{123}=(R_{1},R_{2},R_{3})$ and let
$R_{13}=\frac{(R_{1},R_{3})}{(R_{1},R_{2},R_{3})}$ and
$R_{23}=\frac{(R_{2},R_{3})}{(R_{1},R_{2},R_{3})}$, so that $R_{13}$ is the
product of all primes dividing $R_{1}$ and $R_{3}$ but not $R_{2}$, and
$R_{23}$ is analogous. Then $(R_{3},R_{1}R_{2})=R_{13}R_{23}R_{123}$. By
assumption, $|(R_{2},R_{3})|<q^{h/2}$, so $|R_{23}R_{123}|<q^{h/2}$, and in
particular $|R_{23}|<q^{h/2}$. Now assume by contradiction that
$\left|\frac{R_{3}}{(R_{3},R_{1}R_{2})}\right|<q^{h/2}$. Then

$\displaystyle\left|\frac{R_{3}}{(R_{1},R_{3})}\right|$
$\displaystyle=\left|\frac{R_{3}}{R_{13}R_{123}}\right|=\left|\frac{R_{3}}{R_{13}R_{23}R_{123}}\right|\cdot|R_{23}|<q^{h/2}\cdot
q^{h/2}=q^{h},$

which contradicts the assumption because $R_{1}\neq R_{3}$. ∎

The following auxiliary lemma provides a standard bound on $\tau_{k}$ in the
function field setting. We will also use that
$\phi(F)\gg\frac{|F|}{\log\log|F|}$ for all $F\in{\mathbb{F}}_{q}[T]$.

######  Lemma 4.2.

Let $M=\max_{b\geq 1}(\tau_{k}(T^{b}))^{1/b}$. For any fixed $k$,

$\limsup_{\deg F\to\infty}\frac{\log\tau_{k}(F)\log\log|F|}{\log|F|}=\log M,$

and thus for all $\varepsilon>0$,
$\tau_{k}(F)=O_{\varepsilon}(|F|^{\varepsilon})$.

###### Proof.

The proof of the above lemma follows closely along the lines of Shiu [14]. We
will show one direction of the statement, adapted to our setting; the other
direction also follows very closely, so we omit it. Note first that

$1\leq(\tau_{k}(T^{b}))^{1/b}=\binom{b+k-1}{b}^{1/b}<\left(\frac{(b+k-1)e}{k-1}\right)^{(k-1)/b}\to
1$

as $b\to\infty$, so $M$ exists.

We now show that $\limsup_{\deg
F\to\infty}\frac{\log\tau_{k}(F)\log\log|F|}{\log|F|}\geq\log M$. Fix $b$ such
that $\tau_{k}(T^{b})=M^{b}$. Let

$F=\prod_{\begin{subarray}{c}\deg P=d\\\ P\text{ irred.}\end{subarray}}P^{b},$

so that $\tau_{k}(F)=\prod_{\deg
P=d}\tau_{k}(P^{b})=(\tau_{k}(T^{b}))^{\pi(d;\mathbb{F}_{q})}=M^{b\pi(d;\mathbb{F}_{q})}$.
We have that $\pi(d;{\mathbb{F}}_{q})\sim\frac{q^{d}}{d}$ as $d\to\infty$, so
that

$\log|F|=bd\log q\pi(d;{\mathbb{F}}_{q})\sim bq^{d}\log q,$

and

$\log\log|F|=d\log q+O(1).$

Thus as $d\to\infty$,

$\displaystyle\log\tau_{k}(F)$ $\displaystyle=b\pi(d;{\mathbb{F}}_{q})\log M$
$\displaystyle\sim b\log M\cdot\frac{q^{d}}{d}\sim\frac{\log
M\log|F|}{\log\log|F|},$

so $\limsup_{\deg
F\to\infty}\frac{\log\tau_{k}(F)\log\log|F|}{\log|F|}\geq\log M$.

As mentioned above, $\limsup_{\deg
F\to\infty}\frac{\log\tau_{k}(F)\log\log|F|}{\log|F|}\leq\log M$ also follows
Shiu’s proof in [14] closely. ∎

The above bound implies that for all $\varepsilon>0$,
$\tau_{k}(F)=|F|^{O(1/\log\log|F|)}=O_{\varepsilon}(|F|^{\varepsilon})$.

Here we have a final preparatory lemma before the main proposition leading to
the bound on $m_{5}(Q;h)$. In what follows, our main strategy will be
carefully isolating factors of the $R_{i}$’s in order to bound the number of
terms in our sum. In doing so, we will make use of the following bound.

######  Lemma 4.3.

Let $Q$ be a squarefree polynomial, and let $n\in{\mathbb{N}}_{\geq 2}$. Let
$\mathcal{I}\subseteq{\mathbb{F}}_{q}(t)$ be an interval of size $q^{-h}$.
That is to say, for some rational function $\alpha\in F_{q}(T)$, let
$\mathcal{I}:=\\{\beta\in{\mathbb{F}}_{q}(T):|\alpha-\beta|<q^{-h}\\}$. Assume
in the following that $X_{i},Y_{i}\in{\mathbb{F}}_{q}[T]$ for all $i$. Then

$\sum_{\begin{subarray}{c}Y_{1},\dots,Y_{n}|Q\\\ X_{i}\bmod Y_{i}\\\
(X_{i},Y_{i})=1\\\ \sum_{i}X_{i}/Y_{i}\in\mathcal{I}\\\
q^{h/2}\leq\left|\prod_{i}Y_{i}\right|\leq
q^{2h}\end{subarray}}\frac{\mu\left(\prod_{i}Y_{i}\right)^{2}}{\prod_{i}\phi(Y_{i})^{2}}\ll_{n}q^{-h}\sum_{m=h/2}^{2h}q^{m/\log
m}(\log m)^{2}.$

###### Proof.

For given $X_{1},\dots,X_{n}$ and $Y_{1},\dots,Y_{n}$, let $X$ and $Y$ be
defined so that $Y=\prod_{i}Y_{i}$ and
$\frac{X}{Y}=\sum_{i}\frac{X_{i}}{Y_{i}}$. Then for all tuples considered in
the sum, $\frac{X}{Y}\in\mathcal{I}$ and $q^{h/2}\leq|Y|\leq q^{2h}$. We’ll
proceed by counting the number of possibilities for $\frac{X}{Y}$ satisfying
this constraint, which is bounded above by the number of points in
$\mathcal{I}$ with denominator smaller than $q^{2h}$, and finally count the
number of ways of splitting $Y$ up into $Y_{1},\dots,Y_{n}$. However, we want
to also consider the weighting in the sum of $\frac{1}{\phi(Y)^{2}}$, so we
start by splitting the sum up into different sizes of $Y$, and then applying
bounds on $\phi(Y)$.

To begin with, we rewrite the sum in terms of $X$ and $Y$. Note that all
$Y_{i}$ in our sum are relatively prime, because of the Möbius factor. Thus
$Y$ is squarefree and $\phi(Y)=\prod_{i}\phi(Y_{i})$. Moreover, a choice of
$X$, $Y$, and a decomposition $Y=Y_{1}\cdots Y_{n}$ determines $X_{i}$ for
each $i$ by the Chinese Remainder Theorem. Our sum is thus equal to

$\sum_{\begin{subarray}{c}Y|Q\\\ q^{h/2}\leq|Y|\leq
q^{2h}\end{subarray}}\sum_{\begin{subarray}{c}X\in\mathcal{R}(Y)\\\
X/Y\in\mathcal{I}\end{subarray}}\frac{\mu(Y)^{2}}{\phi(Y)^{2}}\\#\\{Y_{1},\dots,Y_{n}:Y_{1}\cdots
Y_{n}=Y\\}.$

We now split the sum up according to $|Y|$, defining $m:=\deg Y$. The sum is
then equal to

$\displaystyle\sum_{m=h/2}^{2h}\sum_{\begin{subarray}{c}Y|Q\\\
|Y|=q^{m}\end{subarray}}\sum_{\begin{subarray}{c}X\in\mathcal{R}(Y)\\\
X/Y\in\mathcal{I}\end{subarray}}\frac{\mu(Y)^{2}}{\phi(Y)^{2}}\\#\\{Y_{1},\dots,Y_{n}:Y_{1}\cdots
Y_{n}=Y\\}$ $\displaystyle\ll_{n}$ $\displaystyle\sum_{m=h/2}^{2h}q^{m/\log
m}\left(\frac{q^{m}}{\log
m}\right)^{-2}\\#\\{X,Y:X/Y\in\mathcal{I},|Y|=q^{m}\\},$

by Lemma 4.2 and the fact that
$\phi(Y)^{-2}\ll\left(\frac{|Y|}{\log\log|Y|}\right)^{-2}$ Note that we can
further relax the condition that $|Y|=q^{m}$ to the condition that $|Y|\leq
q^{m}$. The number of $X/Y$ in this interval is $q^{2m-h}+O(1)$; since $m\geq
h/2$, $1$ is $O(q^{2m-h})$, so the number of points in the interval is
$O(q^{2m-h})$. Thus the sum is

$\displaystyle\ll\sum_{m=h/2}^{2h}q^{m/\log m}\left(\frac{q^{m}}{\log
m}\right)^{-2}q^{2m-h}$ $\displaystyle\ll q^{-h}\sum_{m=h/2}^{2h}q^{m/\log
m}(\log m)^{2},$

as desired. ∎

Note that the bound in the lemma is $O_{\varepsilon}(q^{-h+\varepsilon h})$
for all $\varepsilon>0$.

We now turn to bounding the contribution to the fifth moment $m_{5}(Q;h)$
coming from tuples $(R_{1},\dots,R_{5})$ satisfying the conclusions of Lemma
4.1.

######  Proposition 4.4.

Let $\mathcal{S}$ be the set of tuples $(R_{1},\dots,R_{5})$ such that

  * •

$R_{i}|Q$ for all $i$,

  * •

$q^{h}\leq|R_{i}|\leq q^{2h}$ for all $i$,

  * •

$\left|\frac{R_{2}}{(R_{1},R_{2})}\right|\geq q^{h/2}$, and

  * •

$\left|\frac{R_{3}}{(R_{3},R_{1}R_{2})}\right|\geq q^{h/2}$.

Then for all $\varepsilon>0$,

$\sum_{\begin{subarray}{c}(R_{1},\dots,R_{5})\in\mathcal{S}\end{subarray}}\prod_{i=1}^{5}\frac{1}{\phi(R_{i})}\sum_{\begin{subarray}{c}A_{i}\bmod{R_{i}}\\\
(A_{i},R_{i})=1\\\ |A_{i}/R_{i}|<q^{-h}\\\ \sum A_{i}/R_{i}=0\\\ 1\leq i\leq
5\end{subarray}}q^{5h}\ll q^{2h+\varepsilon}\frac{|Q|}{\phi(Q)}$

###### Proof.

We’ll begin by sketching an overview of the strategy. For each subset
$I\subseteq[5]$, let $R_{I}=\prod_{\begin{subarray}{c}P|R_{i}\forall i\in I\\\
P\nmid R_{i}\forall i\not\in I\end{subarray}}P$ be the product of the
irreducible factors dividing $R_{i}$ if and only if $i\in I$. Note that these
$R_{I}$’s must be pairwise relatively prime.

We start by using the constraint that
$\left|\frac{A_{1}}{R_{1}}\right|<q^{-h}$. We will count the total number of
rational functions in this interval with denominator of degree at most $2h$.
For each option of $\frac{A_{1}}{R_{1}}$, we can decompose $R_{1}=\prod_{I\ni
1}R_{I}$, so the number of ways to decompose $R_{1}$ into these $R_{I}$
factors is $\tau_{2^{k-1}-1}(R_{1})$, which we can bound based on the degree
of $R_{1}$. We then also get $\frac{A_{1}}{R_{1}}=\sum_{I\ni
1}\frac{A_{I}}{R_{I}}$, where the $A_{I}$’s are determined by the Chinese
Remainder Theorem.

We’ll then focus on the constraint that
$\left|\frac{A_{2}}{R_{2}}\right|<q^{-h}$. However,
$(R_{1},R_{2})=\prod_{1,2\in I}R_{I}$ has already been fixed, so we’ll perform
the same analysis on the remaining factors of $R_{2}$. Crucially,
$\frac{R_{2}}{(R_{1},R_{2})}$ remains relatively large by assumption, which
will ensure that we save enough by doing this. Similarly we’ll then turn to
the constraint on $\frac{A_{3}}{R_{3}}$, using our assumption that
$\frac{R_{3}}{(R_{3},R_{1}R_{2})}$ is large enough.

We begin by rewriting our sum in terms of the $R_{I}$. Again, for each subset
$I\subseteq[5]$, and for a fixed $R_{1},...,R_{5}$, we will define $R_{I}$ to
be the product of all primes $P$ so that $P$ divides $R_{i}$ for each $i\in I$
_and_ $P$ does _not_ divide $R_{j}$ for all $j\not\in I$. So, for example,
$R_{\\{1,2\\}}$ is the product of all primes dividing $R_{1}$ and $R_{2}$, but
$(R_{\\{1,2\\}},R_{j})=1$ for $j=3,4,5$. This also implies that
$(R_{I},R_{J})=1$ for each $I\neq J\subseteq[5]$. In order for the sum over
$A_{i}$ to be nonempty, $R_{I}=1$ unless $|I|\geq 2$, i.e. each irreducible
polynomial dividing an $R_{i}$ must divide at least two of them, so from now
on we will always assume that $|I|\geq 2$. Moreover, each choice of $A_{i}$ is
equivalent to a choice of $A_{i,I}$ for all subsets $I$ containing $i$, so
that $\frac{A_{i}}{R_{i}}=\sum_{I\ni i}\frac{A_{i,I}}{R_{I}}.$ Moreover,
$(A_{i},R_{i})=1$ for all $i$ if and only if $(A_{i,I},R_{I})=1$ for all
$I,i$. The remaining two conditions on each choice of $A_{i}$ are that for all
$i$, $|A_{i}/R_{i}|<q^{-h}$ and that $\sum_{i=1}^{5}A_{i}/R_{i}=0$. These
translate, respectively, to the conditions that

$\forall i,\left|\sum_{I\ni i}\frac{A_{i,I}}{R_{I}}\right|<q^{-h}\text{ and
}\forall I,\sum_{i\in I}A_{i,I}=0.$

Lastly, consider the constraint that $(R_{1},\dots,R_{5})\in\mathcal{S}$. This
means that each $R_{I}$ must divide $Q$, and for all $i$, we have
$q^{h}\leq\left|\prod_{I\ni i}R_{I}\right|\leq q^{2h}$. In order to address
the last two constraints, define $\ell_{I}$ to be the minimum element of $I$.
Then $\frac{R_{2}}{(R_{1},R_{2})}=\prod_{\ell_{I}=2}R_{I}$, and
$\frac{R_{3}}{(R_{3},R_{1}R_{2})}=\prod_{\ell_{I}=3}R_{I}$, so that these
constraints become

$\left|\prod_{\ell_{I}=2}R_{I}\right|\geq q^{h/2}\text{ and
}\left|\prod_{\ell_{I}=3}R_{I}\right|\geq q^{h/2}.$

The sum under consideration is then

$\ll q^{5h}\sum_{\begin{subarray}{c}R_{I}|Q\\\ I\subseteq[5]\\\
q^{h}\leq\left|\prod_{I\ni i}R_{I}\right|\leq q^{2h}\\\
\left|\prod_{\ell_{I}=2}R_{I}\right|\geq q^{h/2}\\\
\left|\prod_{\ell_{I}=3}R_{I}\right|\geq
q^{h/2}\end{subarray}}\frac{\mu\left(\prod_{I}R_{I}\right)^{2}}{\prod_{I}\phi(R_{I})^{|I|}}\sum_{\begin{subarray}{c}I,i\in
I\\\ A_{i,I}\in\mathcal{R}(R_{I})\\\ \forall i,\left|\sum_{I\ni
i}A_{i,I}/R_{I}\right|<q^{-h}\\\ \forall I,\sum_{i\in
I}A_{i,I}=0\end{subarray}}1$

For each $I$, if $m_{I}$ is the largest index contained in $I$,
$A_{m_{I},I}=-\sum_{\begin{subarray}{c}i\in I\\\
i<m_{I}\end{subarray}}A_{i,I}$, so if there is a valid choice of
$A_{m_{I},I}$, it is completely determined by the other $A_{i,I}$ values. Thus
we can bound our expression above by excluding $A_{m_{I},I}$ whenever $m_{I}$
is the largest element of $I$.

As before, let $\ell_{I}$ be the smallest index contained in $I$. For all
$i\in I$, the number of choices of $A_{i,I}$ is at most $\phi(R_{I})$, because
of the constraint that $(A_{i,I},R_{I})=1$. If $\ell_{I}<i<m_{I}$, then we
will use this bound to constrain the number of choices of $A_{i,I}$. We will
still need to keep track of our conditions that

$\forall i,\left|\sum_{I\ni i}\frac{A_{i,I}}{R_{I}}\right|<q^{-h},$

which depend on the choices of $A_{i,I}$ for $i>\ell_{I}$. However, if we fix
a choice of some of the terms in the sum above, the remaining terms are still
constrained to lie in an interval of size $q^{-h}$, centered at a possibly-
nonzero polynomial. So, for fixed $i$, and for each choice of $A_{i,I}$ for
all $I\ni i$ with $i>\ell_{I}$, we have that

$\left|F+\sum_{\begin{subarray}{c}J\ni i\\\
i=\ell_{J}\end{subarray}}\frac{A_{i,J}}{R_{J}}\right|<q^{-h},$

where $F$ depends on our choice of the $A_{i,I}$. That is to say, the sum
$\sum_{\begin{subarray}{c}J\ni i\\\
i=\ell_{J}\end{subarray}}\frac{A_{i,J}}{R_{J}}$ is always constrained to lie
in an interval of size $q^{-h}$, although the exact choice of interval depends
on our choice of $A_{i,I}$. In what follows, we will only use that each of
these sums must lie in an interval of size $q^{-h}$, without ever using
specific information about the interval. Thus, all of the following
computations will be equivalent no matter the choice of $A_{i,I}$, so we can
factor out the number of such choices. This yields the following sum.

$\ll q^{5h}\sum_{\begin{subarray}{c}R_{I}|Q\\\ I\subseteq[5]\\\
q^{h}\leq\left|\prod_{I\ni i}R_{I}\right|\leq q^{2h}\\\
\left|\prod_{\ell_{I}=2}R_{I}\right|\geq q^{h/2}\\\
\left|\prod_{\ell_{I}=3}R_{I}\right|\geq
q^{h/2}\end{subarray}}\frac{\mu\left(\prod_{I}R_{I}\right)^{2}}{\prod_{I}\phi(R_{I})^{|I|}}\prod_{I}\phi(R_{I})^{|I|-2}\sum_{\begin{subarray}{c}A_{\ell_{I},I}\in\mathcal{R}(R_{I})\\\
I\subseteq[5]\\\ \forall
i,\left|\sum_{\ell_{J}=i}A_{i,J}/R_{J}\right|<q^{-h}\end{subarray}}1,$

where we are using the interval centered at $0$ to denote our constraint that
$\sum_{\ell_{J}=i}A_{i,J}/R_{J}$ must lie in _some_ interval of size $q^{-h}$.

Since our only terms $A_{i,I}$ remaining in our sum are of the form
$A_{\ell_{I},I}$, there is only one per subset $I$, so to simplify our
notation we will write $A_{I}:=A_{\ell_{I},I}$ from now on.

Now we will consider subsets $I$ with $\ell_{I}=4$. There is only one of
these, namely $\\{4,5\\}$, so we rewrite the sum as follows:

$\ll q^{5h}\sum_{\begin{subarray}{c}R_{I}|Q\\\ I\subseteq[5],I\neq\\{4,5\\}\\\
q^{h}\leq\left|\prod_{I\ni i}R_{I}\right|\leq q^{2h}\\\
\left|\prod_{\ell_{I}=2}R_{I}\right|\geq q^{h/2}\\\
\left|\prod_{\ell_{I}=3}R_{I}\right|\geq
q^{h/2}\end{subarray}}\frac{\mu\left(\prod_{I}R_{I}\right)^{2}}{\prod_{I}\phi(R_{I})^{2}}\sum_{\begin{subarray}{c}A_{I}\in\mathcal{R}(R_{I})\\\
I\subseteq[5],I\neq\\{4,5\\}\\\ \forall
i,\left|\sum_{\ell_{J}=i}A_{J}/R_{J}\right|<q^{-h}\end{subarray}}\sum_{\begin{subarray}{c}R_{\\{4,5\\}}|Q\\\
A_{\\{4,5\\}}\in\mathcal{R}(R_{\\{4,5\\}})\end{subarray}}\frac{1}{\phi(R_{\\{4,5\\}})^{2}}$

In the inside sum, we have dropped the additional constraint that
$A_{\\{4,5\\}}/R_{\\{4,5\\}}$ must lie in an interval of size $q^{-h}$, since
ignoring it only increases the size of the sum. For each $R_{\\{4,5\\}}$,
there are $\phi(R_{\\{4,5\\}})$ choices of $A_{\\{4,5\\}}$, so the inner sum
becomes

$\sum_{\begin{subarray}{c}R_{\\{4,5\\}}|Q\end{subarray}}\frac{1}{\phi(R_{\\{4,5\\}})}=\frac{|Q|}{\phi(Q)},$

since $Q$ is squarefree.

Now we will consider subsets $I$ with $\ell_{I}=3$, i.e. $\\{3,4\\}$,
$\\{3,4,5\\}$, and $\\{3,5\\}$. We first bookkeep by isolating these terms in
the sum, yielding

$\ll q^{5h}\frac{|Q|}{\phi(Q)}\sum_{\begin{subarray}{c}R_{I}|Q\\\
I\subseteq[5],\ell_{I}<3\\\ q^{h}\leq\left|\prod_{\ell_{I}=1}R_{I}\right|\leq
q^{2h}\\\
q^{h/2}\leq\left|\prod_{\begin{subarray}{c}\ell_{I}=2\end{subarray}}R_{I}\right|\leq
q^{2h}\end{subarray}}\frac{\mu\left(\prod_{I}R_{I}\right)^{2}}{\prod_{I}\phi(R_{I})^{2}}\sum_{\begin{subarray}{c}A_{I}\in\mathcal{R}(R_{I})\\\
I\subseteq[5],\ell_{I}<3\\\ \forall
i,\left|\sum_{\ell_{J}=i}A_{J}/R_{J}\right|<q^{-h}\end{subarray}}\sum_{\begin{subarray}{c}\ell_{I}=3\\\
R_{I}|Q\\\ A_{I}\in\mathcal{R}(R_{I})\\\
q^{h/2}\leq\left|\prod_{\begin{subarray}{c}\ell_{I}=3\end{subarray}}R_{I}\right|\leq
q^{2h}\\\
\left|\sum_{\ell_{I}=3}A_{I}/R_{I}\right|<q^{-h}\end{subarray}}\frac{\mu\left(\prod_{\ell_{I}=3}R_{I}\right)^{2}}{\prod_{\ell_{I}=3}\phi(R_{I})^{2}}$

We now bound the inner sum using Lemma 4.3. The inner sum comprises three
terms $R_{I}$, so apply the lemma with $n=3$, to get that the inner sum is
$\ll q^{-h}o(q^{\varepsilon h})$. We repeat the process, now considering
subsets $I$ with $\ell_{I}=2$. Isolating these terms yields

$\ll q^{2h}o(q^{\varepsilon
h})\frac{|Q|}{\phi(Q)}\sum_{\begin{subarray}{c}R_{I}|Q\\\
I\subseteq[5],\ell_{I}=1\\\ q^{h}\leq\left|\prod_{\ell_{I}=1}R_{I}\right|\leq
q^{2h}\end{subarray}}\frac{\mu\left(\prod_{\ell_{I}=1}R_{I}\right)^{2}}{\prod_{\ell_{I}=1}\phi(R_{I})^{2}}\sum_{\begin{subarray}{c}A_{I}\in\mathcal{R}(R_{I})\\\
I\subseteq[5],\ell_{I}=1\\\
\left|\sum_{\ell_{I}=1}A_{I}/R_{I}\right|<q^{-h}\end{subarray}}\sum_{\begin{subarray}{c}\ell_{I}=2\\\
R_{I}|Q\\\ A_{I}\in\mathcal{R}(R_{I})\\\
q^{h/2}\leq\left|\prod_{\begin{subarray}{c}\ell_{I}=2\end{subarray}}R_{I}\right|\leq
q^{2h}\\\
\left|\sum_{\ell_{I}=2}A_{I}/R_{I}\right|<q^{-h}\end{subarray}}\frac{\mu\left(\prod_{\ell_{I}=2}R_{I}\right)^{2}}{\prod_{\ell_{I}=2}\phi(R_{I})^{2}}$

Here there are seven $R_{I}$ terms and seven $A_{I}$ terms in the inner sum,
so, again applying Lemma 4.3, the inner sum is $\ll q^{-h}o(q^{\varepsilon
h})$. Lastly, we address the terms with $\ell_{I}=1$:

$\ll q^{3h}q^{2\varepsilon
h}\frac{|Q|}{\phi(Q)}\sum_{\begin{subarray}{c}R_{I}|Q\\\
I\subseteq[5],\ell_{I}=1\\\ q^{h}\leq\left|\prod_{\ell_{I}=1}R_{I}\right|\leq
q^{2h}\end{subarray}}\frac{\mu\left(\prod_{\ell_{I}=1}R_{I}\right)^{2}}{\prod_{\ell_{I}=1}\phi(R_{I})^{2}}\sum_{\begin{subarray}{c}A_{I}\in\mathcal{R}(R_{I})\\\
I\subseteq[5],\ell_{I}=1\\\
\left|\sum_{\ell_{I}=1}A_{I}/R_{I}\right|<q^{-h}\end{subarray}}1.$

We apply Lemma 4.3 one final time, this time with $n=15$, since there are $15$
sets $I\subseteq[5]$ with $|I|\geq 2$ and $\ell_{I}=1$. This yields

$\ll q^{2h}q^{o(3\varepsilon h)}\frac{|Q|}{\phi(Q)},$

as desired. ∎

######  Theorem 4.5.

For all $\varepsilon>0$, for $Q\in{\mathbb{F}}_{q}[T]$ squarefree,

$m_{5}(Q;h)\ll|Q|q^{2h+\varepsilon}\left(\frac{|Q|}{\phi(Q)}\right)^{-4}+|Q|q^{2h}\left(\frac{|Q|}{\phi(Q)}\right)^{27}$

###### Proof.

Using Lemma 3.1, we can express

$m_{5}(Q;h)=|Q|\left(\frac{\phi(Q)}{|Q|}\right)^{5}V_{5}(Q;h),$

where

$V_{5}(Q;h)=\sum_{\begin{subarray}{c}R_{1},\dots R_{5}|Q\\\ |R_{i}|>1\\\
R_{i}\text{
monic}\end{subarray}}\prod_{i=1}^{5}\frac{\mu(R_{i})}{\phi(R_{i})}\sum_{\begin{subarray}{c}A_{1},\dots,A_{5}\bmod{R_{i}}\\\
(A_{i},R_{i})=1\\\
\sum_{i}A_{i}/R_{i}=0\end{subarray}}E\left(\frac{A_{1}}{R_{1}}\right)\cdots
E\left(\frac{A_{5}}{R_{5}}\right).$

Now apply Lemma 3.6 to bound the contribution to $V_{5}(Q;h)$ from many tuples
$R_{1},\dots,R_{5}$. If $|R_{i}|<q^{h}$ for any $i$, then these terms
contribute $0$; assume from now on that $|R_{i}|\geq q^{h}$. If for any triple
$i,j,k$ we apply Lemma 3.6 with $R_{1}=R_{i}$ and $R_{2}=R_{j}$; in this case
$X_{2}=0$ and $X_{1}$ and $X_{3}$ are $O(q^{-h/2})$, so these terms contribute
$O\left(q^{2h}\left(\frac{|Q|}{\phi(Q)}\right)^{32}\right)$. If there exist
$R_{i}\neq R_{j}$ such that either
$\left|\frac{R_{i}}{(R_{i},R_{j})}\right|<q^{h}$ or $|(R_{i},R_{j})|\geq
q^{h/2}$; in this case, $X_{3}=0$, and $X_{1}$ and $X_{2}$ are each
$O(q^{-h/2})$, so these terms contribute
$O\left(q^{2h}\left(\frac{|Q|}{\phi(Q)}\right)^{32}\right)$ as well.

Assume now that $(R_{1},R_{2},R_{3},R_{4},R_{5})$ does not fall into either of
the above cases. Then for all $i$, $|R_{i}|<q^{2h}$. To see this, assume that
$(R_{1},R_{2},R_{3},R_{4},R_{5})$ has no $i,j,k$ with $R_{i}=R_{j}=R_{k}$, and
that for all $R_{i}\neq R_{j}$, $\left|\frac{R_{i}}{(R_{i},R_{j})}\right|\geq
q^{h}$ and $|(R_{i},R_{j})|<q^{h/2}$. Assume, relabeling if necessary, that
$R_{1}\geq q^{2h}$. Since $R_{1}|\prod_{j\neq 1}(R_{1},R_{j})$, we must have
$|(R_{1},R_{j})|\geq q^{h/2}$ for some $j\neq 1$. This cannot be true for some
$j$ with $R_{j}\neq R_{1}$, so we have $R_{j}=R_{1}$. At the same time, there
can only be one $j\neq 1$ with $R_{j}=R_{1}$, so without loss of generality
our tuple must be of the form $(R_{1},R_{1},R_{3},R_{4},R_{5})$. There cannot
be an additional equal pair among $R_{3},R_{4},$ and $R_{5}$; if there is
(without loss of generality $R_{3}=R_{4}$), then
$R_{5}|(R_{1},R_{5})(R_{3},R_{5})$, so since $|R_{5}|\geq q^{h}$ either
$|(R_{1},R_{5})|\geq q^{h/2}$ or $|(R_{3},R_{5})|\geq q^{h/2}$, which along
with the lack of equal triples yields a contradiction. Now consider $R_{3}$.
Note that $R_{3}|(R_{1},R_{3})(R_{4},R_{3})(R_{5},R_{3})$, and that
$\frac{R_{3}}{(R_{1},R_{3})}|(R_{4},R_{3})(R_{5},R_{3})$. But by assumption,
$\left|\frac{R_{3}}{(R_{1},R_{3})}\right|\geq q^{h}$ and
$|(R_{4},R_{3})(R_{5},R_{3})|<(q^{h/2})^{2}=q^{h}$, which yields a
contradiction.

So, the only terms remaining are those with $|R_{i}|<q^{2h}$ for all $i$, no
equal triple, and either $\left|\frac{R_{i}}{(R_{i},R_{j})}\right|<q^{h}$ or
$|(R_{i},R_{j})|\geq q^{h/2}$ whenever $R_{i}\neq R_{j}$. By Lemma 4.1,
$(R_{1},\dots,R_{5})$ satisfies the constraints of Proposition 4.4. By
Proposition 4.4, these terms contribute
$O\left(q^{2h+\varepsilon}\frac{|Q|}{\phi(Q)}\right)$ to $V_{5}(Q;h)$ for all
$\varepsilon>0$. Thus for all $\varepsilon>0$,

$V_{5}(Q;h)\ll
q^{2h+\varepsilon}\frac{|Q|}{\phi(Q)}+q^{2h}\left(\frac{|Q|}{\phi(Q)}\right)^{32},$

so
$m_{5}(Q;h)\ll|Q|q^{2h+\varepsilon}\left(\frac{|Q|}{\phi(Q)}\right)^{-4}+|Q|q^{2h}\left(\frac{|Q|}{\phi(Q)}\right)^{27}$.
∎

As in the integer case, we particularly want to consider $Q$ to be the product
of irreducible polynomials $P$ with $|P|\leq q^{2h}$. In this case,
$\frac{|Q|}{\phi(Q)}\ll h$, so that we get the following corollary.

######  Corollary 4.6.

Fix $\varepsilon>0$ and let $Q\in{\mathbb{F}}_{q}[T]$ be given by
$Q=\prod_{\begin{subarray}{c}P\text{irred.}\\\ |P|\leq
q^{2h}\end{subarray}}P$. Then

$m_{5}(Q;h)\ll|Q|q^{2h+\varepsilon}.$

###  4.1. Proof of Corollary 1.5: Bounds on $R_{k}(q^{h})$

In this subsection, we discuss the transition from bounds on $V_{k}(Q;h)$,
from Theorem 1.4 and Lemma 3.7, to bounds on sums of singular series in
function fields. Much of this is similar to the integer case discussion in
Section 2.

As in the integer case, for $\mathcal{D}=\\{D_{1},\dots,D_{k}\\}$ a set of
distinct polynomials in $\mathbb{F}_{q}[T]$, we define the singular series

$\mathfrak{S}(\mathcal{D}):=\prod_{P\text{ monic,
irred.}}\frac{(1-\nu_{P}(\mathcal{D})/|P|)}{(1-1/|P|)^{k}}=\sum_{\begin{subarray}{c}R_{1},\dots,R_{k}\\\
1\leq|R_{i}|\end{subarray}}\left(\prod_{i=1}^{k}\frac{\mu(R_{i})}{\phi(R_{i})}\right)\sum_{\begin{subarray}{c}A_{1},\dots,A_{k}\\\
A_{i}\in\mathcal{R}(R_{i})\\\
\sum_{i}A_{i}/R_{i}=0\end{subarray}}e\left(\sum_{i=1}^{k}\frac{A_{i}D_{i}}{R_{i}}\right),$

where $\nu_{P}(\mathcal{D})$ is the number of equivalence classes of
$\mathbb{F}_{q}[T]/(P)$ occupied by elements of $\mathcal{D}$. We also define
$\mathfrak{S}_{0}(\mathcal{D})$, given by
$\mathfrak{S}_{0}(\mathcal{D}):=\sum_{\mathcal{J}\subseteq\mathcal{D}}(-1)^{|\mathcal{D}\setminus\mathcal{J}|}\mathfrak{S}(\mathcal{J})$,
and consider

$R_{k}(q^{h}):=\sum_{\begin{subarray}{c}D_{1},\dots,D_{k}\\\ D_{i}\text{
distinct}\\\ |D_{i}|\leq
q^{h}\end{subarray}}\mathfrak{S}_{0}(\\{D_{1},\dots,D_{k}\\}).$

Our results on $m_{k}(Q;h)$ (and equivalently $V_{k}(Q;h)$) imply bounds on
these sums of $k$-fold singular series, just as in the integer case in Section
2. We set $Q$ to be the product of all monic irreducible polynomials of degree
at most $2h$, so that $\frac{|Q|}{\phi(Q)}\ll_{q}h$. Just as in the integer
case, we can truncate the expression for $\mathfrak{S}_{0}(\mathcal{D})$ to
only contain terms dividing $Q$, with an acceptable error term. In particular,
we get

$R_{k}(h)=\sum_{\begin{subarray}{c}D_{1},\dots,D_{k}\\\ D_{i}\text{
distinct}\\\ |D_{i}|\leq
q^{h}\end{subarray}}\sum_{\begin{subarray}{c}R_{1},\dots,R_{k}\\\ |R_{i}|>1\\\
R_{i}|Q\end{subarray}}\prod_{i=1}^{k}\frac{\mu(R_{i})}{\phi(R_{i})}\sum_{\begin{subarray}{c}A_{1},\dots,A_{k}\\\
A_{i}\in\mathcal{R}(R_{i})\\\
\sum_{i}A_{i}/R_{i}=0\end{subarray}}e\left(\sum_{i=1}^{k}\frac{D_{i}A_{i}}{R_{i}}\right)+O(1).$

It will again be helpful for us to define the singular series of a $k$-tuple
$\mathcal{D}=(D_{1},\dots,D_{k})$ relative to the modulus $Q$. Here the
$k$-tuple can have repeated elements; since the Euler product is finite,
convergence is not a concern. We define

$\mathfrak{S}(\mathcal{D};Q):=\prod_{\begin{subarray}{c}P|Q\\\ P\text{
monic}\end{subarray}}\frac{(1-\nu_{P}(\mathcal{D})/|P|)}{(1-1/|P|)^{k}}=\sum_{\begin{subarray}{c}R_{1},\dots,R_{k}|Q\\\
R_{i}\text{
monic}\end{subarray}}\left(\prod_{i=1}^{k}\frac{\mu(R_{i})}{\phi(R_{i})}\right)\sum_{\begin{subarray}{c}A_{1},\dots,A_{k}\\\
A_{i}\in\mathcal{R}(R_{i})\\\
\sum_{i}A_{i}/R_{i}=0\end{subarray}}e\left(\sum_{i=1}^{k}\frac{A_{i}D_{i}}{R_{i}}\right).$

Note that if $\mathcal{D}$ has a repeated element, so that
$\mathcal{D}=\\{D,D,D_{3},\dots,D_{k}\\}$, then
$\mathfrak{S}(\mathcal{D};Q)=\frac{|Q|}{\phi(Q)}\mathfrak{S}(\\{D,D_{3},\dots,D_{k}\\};Q)$,
so we can remove repeated elements from $\mathcal{D}$ at the expense of a
factor of $\frac{|Q|}{\phi(Q)}$. We define $\mathfrak{S}_{0}(\mathcal{D};Q)$
to be the alternating sum
$\sum_{\mathcal{J}\subset\mathcal{D}}(-1)^{|\mathcal{D}\setminus\mathcal{J}|}\mathfrak{S}(\mathcal{J};Q),$
so we have

$R_{k}(q^{h})=\sum_{\begin{subarray}{c}D_{1},\dots,D_{k}\\\ D_{i}\text{
distinct}\\\ |D_{i}|\leq
q^{h}\end{subarray}}\mathfrak{S}_{0}(\\{D_{1},\dots,D_{k}\\};Q)+O(1).$

This is quite close to the quantity $V_{k}(Q;h)$, except with the added
constraint that the $D_{i}$’s must be distinct. It suffices to remove this
condition. To do so, we put $\delta_{ij}=1$ if $D_{i}=D_{j}$ and $0$
otherwise, so that

$\sum_{\begin{subarray}{c}D_{1},\dots,D_{k}\\\ D_{i}\text{ distinct}\\\
|D_{i}|\leq
q^{h}\end{subarray}}\mathfrak{S}_{0}(\\{D_{1},\dots,D_{k}\\};Q)=\sum_{\begin{subarray}{c}D_{1},\dots,D_{k}\\\
|D_{i}|\leq q^{h}\end{subarray}}\left(\prod_{1\leq i<j\leq
k}(1-\delta_{ij})\right)\mathfrak{S}_{0}(\\{D_{1},\dots,D_{k}\\};Q).$

We can expand the product and group terms according to which $D_{i}$’s are
required to be equal, noting that, for example,
$\delta_{12}\delta_{23}=\delta_{13}\delta_{23}$. We can also combine terms
according to symmetry; the term $\delta_{12}$ and the term $\delta_{34}$ will
have identical contributions in the final sum.

Let us now proceed with analyzing $R_{5}(q^{h})$. After some counting, we get
that we can expand the product of $\delta_{ij}$’s into

$1-10\delta_{12}+20\delta_{12}\delta_{13}+15\delta_{12}\delta_{34}-20\delta_{12}\delta_{13}\delta_{45}-30\delta_{12}\delta_{13}\delta_{14}+24\delta_{12}\delta_{13}\delta_{14}\delta_{15}.$

The term $1$ gives us precisely $V_{5}(Q;h)$, which we have already analyzed.
We can then bound each of the remaining six terms by expanding
$\mathfrak{S}_{0}$ into a sum of $\mathfrak{S}$, removing any repeated terms
in the appropriate tuple, and applying Lemma 3.7 to bound $V_{k}(Q;h)$ for
some $k<5$. For the sake of brevity we omit most of these computations, which
are very similar, but we will show that the term corresponding to
$\delta_{12}$ is $\ll\left(\frac{|Q|}{\phi(Q)}\right)^{21/2}q^{2h}$, since all
other terms are smaller.

Assume we have a tuple $\mathcal{D}=\\{D,D,D_{3},\dots,D_{k}\\}$, with one
repeated term. As mentioned above,
$\mathfrak{S}(\mathcal{D};Q)=\frac{|Q|}{\phi(Q)}\mathfrak{S}(\\{D,D_{3},\dots,D_{k}\\};Q)$.
Expanding $\mathfrak{S}_{0}$ and applying this relation shows that

$\mathfrak{S}_{0}(\mathcal{D};Q)=\left(\frac{|Q|}{\phi(Q)}-2\right)\mathfrak{S}_{0}(\\{D,D_{3},\dots,D_{k}\\};Q)+\left(\frac{|Q|}{\phi(Q)}-1\right)\mathfrak{S}_{0}(\\{D_{3},\dots,D_{k}\\};Q),$

so in this way we can remove repeated elements from our sum. The term we want
to bound is

$\displaystyle-10$
$\displaystyle\sum_{\begin{subarray}{c}D_{1},D_{3},D_{4},D_{5}\\\ |D_{i}|\leq
q^{h}\end{subarray}}\mathfrak{S}_{0}(\\{D_{1},D_{1},D_{3},D_{4},D_{5}\\};Q)$
$\displaystyle=-10\sum_{\begin{subarray}{c}D_{1},D_{3},D_{4},D_{5}\\\
|D_{i}|\leq
q^{h}\end{subarray}}\left(\frac{|Q|}{\phi(Q)}-2\right)\mathfrak{S}_{0}(\\{D_{1},D_{3},D_{4},D_{5}\\};Q)+\left(\frac{|Q|}{\phi(Q)}-1\right)\mathfrak{S}_{0}(\\{D_{3},D_{4},D_{5}\\};Q)$
$\displaystyle=-10\left(\left(\frac{|Q|}{\phi(Q)}-2\right)V_{4}(Q;h)+q^{h}\left(\frac{|Q|}{\phi(Q)}-1\right)V_{3}(Q;h)\right)$
$\displaystyle\ll\left(\frac{|Q|}{\phi(Q)}\right)^{3}q^{2h}+\left(\frac{|Q|}{\phi(Q)}\right)^{21/2}q^{2h},$

where in the last step the bounds follow from Lemma 3.7.

All other terms are smaller, so we have shown the following corollary.

######  Corollary 4.7.

Let $Q=\prod_{\begin{subarray}{c}P\text{ irred.}\\\ |P|\leq
q^{2h}\end{subarray}}P$. For all $\varepsilon>0$,

$R_{5}(q^{h})\ll V_{5}(Q;h)+\left(\frac{|Q|}{\phi(Q)}\right)^{21/2}q^{2h}\ll
q^{2h+\varepsilon}.$

Performing the same analysis when $k=3$ yields the bound

######  Corollary 4.8.

Let $Q=\prod_{\begin{subarray}{c}P\text{ irred.}\\\ |P|\leq
q^{2h}\end{subarray}}P$. Then

$R_{3}(q^{h})\ll V_{3}(Q;h)+q^{h}\left(\frac{|Q|}{\phi(Q)}\right)^{2}\ll
q^{h}\left(\frac{|Q|}{\phi(Q)}\right)^{19/2}.$

##  5\. Numerical Evidence for Odd Moments

Here we present several charts supporting our conjectures on the sizes of the
odd moments. To begin with, we have computed $\frac{1}{6}R_{3}(h)=\sum_{1\leq
d_{1}<d_{2}<d_{3}\leq h}\mathfrak{S}_{0}(\\{d_{1},d_{2},d_{3}\\})$. Below,
$\frac{1}{6}R_{3}(h)$ is plotted in black. We expect $R_{3}(h)$, and thus also
$\frac{1}{6}R_{3}(h)$, to be of the shape $Ah(\log h)^{2}$, for some constant
$A$. We found an experimental best fit value of $A=0.373727$, and for this $A$
have plotted $Ah(\log h)^{2}$ alongside $\frac{1}{6}R_{3}(h)$, as a dashed red
line.

Figure 1. $\frac{1}{6}R_{3}(h)$ for $3\leq h\leq 20000$

The fit of the theoretical red dashed curve is quite close, but there are
lower-order fluctuations; below we plot the difference between
$\frac{1}{6}R_{3}(h)$ and $Ah(\log h)^{2}$.

Figure 2. $\frac{1}{6}R_{3}(h)-Ah(\log h)^{2}$ for $3\leq h\leq 20000$

Our analysis above includes relatively little discussion about the moments of
the distribution of primes themselves. We have computed several third, fifth,
and seventh moments of the distribution of primes. Specifically, we have
computed
$\widetilde{M}_{k}(N;N^{\delta})=\frac{1}{N}\sum_{n=N}^{2N}(\psi(n+N^{\delta})-\psi(n)-N^{\delta})^{k}$,
for each of $\delta=0.25,0.5$ and $0.75$, and for each of $k=3,5,7$. For a
fixed $\delta$ and $k$, we plot $\widetilde{M}_{k}(N;N^{\delta})$ for values
of $N$ ranging from $1$ to $10^{7}$, and growing exponentially.

Each of the plots below is drawn with both $x$\- and $y$-axes on a logarithmic
scale. We expect the $k$th moment to be of size approximately
$O(H^{(k-1)/2}(\log\frac{N}{H})^{(k+1)/2}$, where $H=N^{\delta}$, so to give a
sense of size, for each plot, $N^{\delta(k-1)/2}(\log N^{1-\delta})^{(k+1)/2}$
is plotted in dashed red. We have also plotted the reflection of the red
dashed curve across the $x$-axis, since the odd moments are frequently
negative.

$\delta=0.25$

$\delta=0.5$

$\delta=0.75$

Figure 3. Plots of the third moment $M_{3}(N;N^{\delta})$ for $N\leq 10^{7}$.

$\delta=0.25$

$\delta=0.5$

$\delta=0.75$

Figure 4. Plots of the fifth moment $M_{5}(N;N^{\delta})$ for $N\leq 10^{7}$.

$\delta=0.25$

$\delta=0.5$

$\delta=0.75$

Figure 5. Plots of the seventh moment $M_{7}(N;N^{\delta})$ for $N\leq
10^{7}$.

The fit of the red line is reasonably good in all cases, but not perfect. In
every case here we seem to see that the odd moments are more frequently
positive than negative, but still take on negative values. For $\delta=0.25$,
the odd moments seem to be positive for sufficiently large $N$; it is possible
that this effect occurs for all sufficiently large $N$, where the threshold
depends on $k$ and $\delta$.

##  6\. Toy Models and Open Problems

Throughout, we have studied the sum

$R_{k}(h)=\sum_{\begin{subarray}{c}q_{1},\dots,q_{k}\\\
1<q_{i}\end{subarray}}\left(\prod_{i=1}^{k}\frac{\mu(q_{i})}{\phi(q_{i})}\right)\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\ \sum
a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}\prod_{i=1}^{k}E\left(\frac{a_{i}}{q_{i}}\right),$

where $E(\alpha)=\sum_{m=1}^{h}e(m\alpha)$. The sums $E(\alpha)$ approximately
detect when $\|\alpha\|\leq\frac{1}{h}$; the analogous sum in the function
field case precisely detects when $\alpha$ has small degree. As a result, much
of our understanding boils down to answering the following key question.

######  Question 6.1.

Let $\delta>0$ and let $Q>1/\delta$. What is

$\\#\left\\{q_{1},\dots,q_{k}\in[Q,2Q],a_{i}\bmod{q_{i}}:\left|\left|\frac{a_{i}}{q_{i}}\right|\right|\leq\delta,\sum_{i}\frac{a_{i}}{q_{i}}\in{\mathbb{Z}}\right\\}?$

We conjecture that the answer to this question is as follows.

######  Conjecture 6.2.

Let $\delta>0$ and let $Q>1/\delta$. Let $S$ be the size of the set in
Question 6.1. Then for any $\varepsilon>0$,

$S\ll\begin{cases}Q^{k+\varepsilon}\delta^{k/2}&k\text{ even}\\\
Q^{k+\varepsilon}\delta^{(k+1)/2}&k\text{ odd}.\end{cases}$

As we discussed in the introduction, Montgomery and Vaughan [13] considered
the related problem of moments of reduced residues modulo $q$. Their work
depends on the following answer to Question 6.1 above.

######  Theorem 6.3.

Let $S$ be the size of the set in Question 6.1. Then

$S\ll\begin{cases}\delta^{k/2}\sum_{\begin{subarray}{c}Q\leq r_{i}\leq 2Q\\\
1\leq i\leq k/2\end{subarray}}\frac{r_{1}^{2}\cdots
r_{k/2}^{2}}{{\mathrm{lcm}}(r_{i})}+\delta^{k/2-1/7k}\sum_{\begin{subarray}{c}Q\leq
r_{i}\leq 2Q\\\ 1\leq i\leq k\end{subarray}}\frac{r_{1}\cdots
r_{k}}{{\mathrm{lcm}}(r_{i})}&k\text{ even}\\\
\delta^{k/2-1/7k}\sum_{\begin{subarray}{c}Q\leq r_{i}\leq 2Q\\\ 1\leq i\leq
k\end{subarray}}\frac{r_{1}\cdots r_{k}}{{\mathrm{lcm}}(r_{i})}&k\text{
odd}\end{cases}$

The proof of the above theorem is identical to the proof in [13]. This agrees
with Conjecture 6.2 for the case when $k$ is even, but gives a weaker bound
when $k$ is odd.

We can also consider generalizations of Question 6.1. For example, instead of
specifying that $\left|\left|\frac{a_{i}}{q_{i}}\right|\right|\leq\delta$, we
may ask that it lie in any specified interval.

######  Question 6.4.

Let $Q>1/\delta$ and let $I_{1},\dots,I_{k}$ be $k$ intervals in $[0,1]$ with
$|I_{j}|\geq\delta$ for all $j$. What is

$\\#\left\\{q_{1},\dots,q_{k}\in[Q,2Q],a_{i}\bmod{q_{i}}:\left|\left|\frac{a_{i}}{q_{i}}\right|\right|\in
I_{i},\sum_{i}\frac{a_{i}}{q_{i}}\in{\mathbb{Z}}\right\\}?$

Answers to these questions would give us more refined understanding of sums of
singular series. The conjectures above are related to sums over
$\mathfrak{S}(\\{h_{1},\dots,h_{k}\\})$, where each $h_{i}$ lies in the same
interval $[0,h]$. We can instead ask about sums of singular series restricted
to arbitrary intervals, or along arithmetic progressions. We state the
following questions using smooth cutoff functions as opposed to intervals.

######  Question 6.5.

Let $\Phi_{1},\dots,\Phi_{k}$ be smooth functions with compact support on
${\mathbb{R}}$, and let $H\in{\mathbb{R}}_{>0}$. What is

$\sum_{h_{1},\dots,h_{k}\in{\mathbb{Z}}}\mathfrak{S}_{0}(\\{h_{1},\dots,h_{k}\\})\Phi_{1}\left(\frac{h_{1}}{H}\right)\cdots\Phi_{k}\left(\frac{h_{k}}{H}\right)?$

######  Question 6.6.

Let $\Phi_{1},\dots,\Phi_{k}$ be smooth functions with compact support on
${\mathbb{R}}$, and let $H\in{\mathbb{R}}_{>0}$. For arithmetic progressions
$a_{1}\bmod{q_{1}},\dots,a_{k}\bmod{q_{k}}$, what is

$\sum_{\begin{subarray}{c}h_{1},\dots,h_{k}\in{\mathbb{Z}}\\\ h_{i}\equiv
a_{i}\bmod{q_{i}}\end{subarray}}\mathfrak{S}_{0}(\\{h_{1},\dots,h_{k}\\})\Phi_{1}\left(\frac{h_{1}}{H}\right)\cdots\Phi_{k}\left(\frac{h_{k}}{H}\right)?$

Question 6.5 addresses the correlations of $\psi(x+h)-\psi(x)$ and
$\psi(x+h_{1}+h)-\psi(x+h_{1})$; in other words, the correlations of the
number of primes in intervals in different places. Question 6.6 addresses the
correlations of the number of primes in distinct arithmetic progressions. For
both of these questions, the main term ought to come from diagonal terms where
$h_{1}=h_{2}$, for example, thus collapsing the weight function, whereas the
error term ought to arise from off-diagonal contributions.

In the case when $k=2$, Question 6.6 has been widely studied in the context of
prime number races. The “Shanks-Rényi prime number race” is the following
problem: let $\pi(x;q,a)$ denote the number of primes $p\leq x$ with $p\equiv
a\bmod q$. Then for any $n$-tuple $(a_{1},\dots,a_{n})$ of equivalence classes
mod $q$ that are relatively prime to $q$, will we have the ordering

$\pi(x;q,a_{1})>\pi(x;q,a_{2})>\cdots>\pi(x;q,a_{n})$

for infinitely many integers $x$? Many aspects of this question have been
studied; see for example the expositions of Granville and Martin [7], and Ford
and Konyagin [4].

In [3], Ford, Harper, and Lamzouri show that, although any ordering appears
infinitely often, for $n$ large with respect to $q$, the prime number races
among orderings can exhibit large biases. They rely on the fact that counts of
primes in distinct progressions have negative correlations, which they arrange
to produce a bias. This analysis is also connected to the work of Lemke Oliver
and Soundararajan in [10], who use averages of two-term singular series in
arithmetic progressions to show bias in the distribution of consecutive
primes. It is plausible that a more precise understanding of the questions
above would lead to an extension of the work of Lemke Oliver and
Soundararajan.

## References

  * [1] T. H. Chan, _A note on primes in short intervals_ , Int. J. Number Theory 2 (2006), no. 1, 105–110. MR 2217796
  * [2] H. Cramér, _On the order of magnitude of the difference between consecutive prime numbers_ , Acta Arithmetica 2 (1936), no. 1, 23–46.
  * [3] K. Ford, A. J. Harper, and Y. Lamzouri, _Extreme biases in prime number races with many contestants_ , Math. Ann. 374 (2019), no. 1-2, 517–551. MR 3961320
  * [4] K. Ford and S. Konyagin, _Chebyshev’s conjecture and the prime number race_ , IV International Conference “Modern Problems of Number Theory and its Applications”: Current Problems, Part II (Russian) (Tula, 2001), Mosk. Gos. Univ. im. Lomonosova, Mekh.-Mat. Fak., Moscow, 2002, pp. 67–91. MR 1985941
  * [5] P. X. Gallagher, _On the distribution of primes in short intervals_ , Mathematika 23 (1976), no. 1, 4–9. MR 409385
  * [6] A. Granville and A. Lumley, _Primes in short intervals: Heuristics and calculations_ , arXiv:2009.05000, 2020.
  * [7] A. Granville and G. Martin, _Prime number races_ , Amer. Math. Monthly 113 (2006), no. 1, 1–33. MR 2202918
  * [8] D. Hayes, _The expression of a polynomial as a sum of three irreducibles_ , Acta Arithmetica 11 (1966), no. 4, 461–488.
  * [9] J. P. Keating and Z. Rudnick, _The variance of the number of prime polynomials in short intervals and in residue classes_ , Int. Math. Res. Not. IMRN (2014), no. 1, 259–288. MR 3158533
  * [10] R. J. Lemke Oliver and K. Soundararajan, _Unexpected biases in the distribution of consecutive primes_ , Proc. Natl. Acad. Sci. USA 113 (2016), no. 31, E4446–E4454. MR 3624386
  * [11] H. L. Montgomery and K. Soundararajan, _Beyond pair correlation_ , Paul Erdős and his mathematics, I (Budapest, 1999), Bolyai Soc. Math. Stud., vol. 11, János Bolyai Math. Soc., Budapest, 2002, pp. 507–514. MR 1954710
  * [12] by same author, _Primes in short intervals_ , Comm. Math. Phys. 252 (2004), no. 1-3, 589–617. MR 2104891
  * [13] H. L. Montgomery and R. C. Vaughan, _On the distribution of reduced residues_ , Ann. of Math. (2) 123 (1986), no. 2, 311–333. MR 835765
  * [14] P. Shiu, _The maximum orders of multiplicative functions_ , Quart. J. Math. Oxford Ser. (2) 31 (1980), no. 122, 247–252. MR 576341