# Sums of singular series along arithmetic progressions and with smooth
weights

Vivian Kuperberg

###### Abstract.

Sums of the singular series constants that appear in the Hardy–Littlewood
$k$-tuples conjectures have long been studied in connection to the
distribution of primes. We study constrained sums of singular series, where
the sum is taken over sets whose elements are specified modulo $r$ or weighted
by smooth functions. We show that the value of the sum is governed by
incidences modulo $r$ of elements of the set in the case of arithmetic
progressions and by pairings of the smooth functions in the case of weights.
These sums shed light on sums of singular series in other formats.

The author is supported by NSF GRFP grant DGE-1656518 as well as the NSF
Mathematical Sciences Research Program through the grant DMS-2202128, and
would like to thank Kannan Soundararajan for many helpful comments and
discussions.

##  1\. Introduction

The Hardy–Littlewood $k$-tuples conjectures, and the constants known as
singular series that appear within them, have long been studied in connection
to the distribution of primes. These conjectures state that for any $k$-tuple
$\mathcal{H}=\\{h_{1},\dots,h_{k}\\}$ of distinct integers, the number of
$k$-tuples of primes of the form $(n+h_{1},\dots,n+h_{k})$, with $n\leq x$, is
given by

(1) $\sum_{n\leq
x}\prod_{i=1}^{k}\Lambda(n+h_{i})=\mathfrak{S}(\mathcal{H})x+o(1)x,$

where $\mathfrak{S}(\mathcal{H})$ is the singular series

(2) $\mathfrak{S}(\mathcal{H})=\prod_{p\text{
prime}}\frac{1-\nu_{\mathcal{H}}(p)/p}{(1-1/p)^{k}},$

and $\nu_{\mathcal{H}}(p)$ denotes the number of distinct residue classes
modulo $p$ occupied by the elements of $\mathcal{H}$.

In [1], Gallagher showed that the Hardy–Littlewood conjectures imply that the
distribution of primes in intervals of size $h=\lambda\log x$ is Poissonian
for fixed $\lambda$, by showing that the singular series is $1$ on average. In
particular, he showed that for any fixed $k$,

$\sum_{\begin{subarray}{c}\mathcal{H}\subset[1,h]\\\
|\mathcal{H}|=k\end{subarray}}\mathfrak{S}(\mathcal{H})\sim\sum_{\begin{subarray}{c}\mathcal{H}\subset[1,h]\\\
|\mathcal{H}|=k\end{subarray}}1.$

In 2004, Montgomery and Soundararajan [7] used a more refined estimate of sums
of singular series to show that when $h$ is in a larger regime, with $h/\log
x\to\infty$ but $h=o(x)$, the Hardy–Littlewood conjectures imply that the
distribution of primes, counted with von Mangoldt weights, becomes Gaussian
with mean $\sim h$ and variance $\sim h\log\frac{x}{h}$, matching numerical
data. Instead of the singular series itself, they considered alternating sums
of singular series, defining
$\mathfrak{S}_{0}(\mathcal{H}):=\sum_{\mathcal{J}\subset\mathcal{H}}(-1)^{|\mathcal{H}\setminus\mathcal{J}|}\mathfrak{S}(\mathcal{J}).$
These sums have the effect of subtracting the main term from the outset,
making it easier to understand lower-order contributions. The analogous
Hardy–Littlewood conjecture says that

$\sum_{n\leq
x}\prod_{i=1}^{k}\left(\Lambda(n+h_{i})-1\right)=\mathfrak{S}_{0}(\mathcal{H})x+o(x),$

so that each term on the left-hand side has expectation $0$.

Montgomery and Soundararajan [7] showed that for fixed $k$,

(3) $\sum_{\begin{subarray}{c}\mathcal{H}\subset[1,h]\\\
|\mathcal{H}|=k\end{subarray}}\mathfrak{S}_{0}(\mathcal{H})=\mu_{k}(-h\log
h+A)^{k/2}+O_{k}(h^{k/2-1/(7k)+\varepsilon}),$

where $\mu_{k}=1\cdot 3\cdots(k-1)$ if $k$ is even, and $0$ if $k$ is odd, and
$A=2-\gamma_{0}-\log 2\pi$, with $\gamma_{0}$ the Euler–Mascheroni constant.
Their results depend crucially on work of Montgomery and Vaughan [8] on the
distribution of reduced residues mod $q$ in short intervals.

Here we develop analogs of the work of Montgomery and Vaughan as well as that
of Montgomery and Soundararajan by studying sums of singular series with added
conditions on the set $\mathcal{H}$. First, instead of summing over all
subsets of $[1,h]$, we restrict to sets whose elements lie in arithmetic
progressions. For a fixed modulus $r$ and congruence classes
$c_{1},\dots,c_{k}$ mod $r$, we study the sum

(4)
$R_{k}(h;r,c_{1},\dots,c_{k}):=\sum_{\begin{subarray}{c}\mathcal{H}=\\{h_{1},\dots,h_{k}\\}\subset[1,h]\\\
|\mathcal{H}|=k\\\ h_{i}\equiv
c_{i}\bmod{r}\end{subarray}}\mathfrak{S}_{0,r}(\mathcal{H}),$

where
$\mathfrak{S}_{0,r}(\mathcal{H})=\sum_{\mathcal{J}\subset\mathcal{H}}\mathfrak{S}_{r}(\mathcal{J})(-1)^{|\mathcal{H}\setminus\mathcal{J}|}$
and $\mathfrak{S}_{r}(\mathcal{H})$ is the singular series of $\mathcal{H}$
away from $r$, given by

(5) $\mathfrak{S}_{r}(\mathcal{H}):=\prod_{\begin{subarray}{c}p\text{
prime}\\\ p\nmid
r\end{subarray}}\frac{1-\nu_{\mathcal{H}}(p)/p}{(1-1/p)^{k}}.$

The study of these sums is of interest for two reasons. First, they appear in
the work of Lemke Oliver and Soundararajan in [5] on bias in the distribution
of consecutive primes in arithmetic progressions. Specifically, Lemke Oliver
and Soundararajan conjecture that if $\pi(x;q,(a,b))$ is defined as the number
of primes $p\leq x$ with $p\equiv a\bmod q$ and $p_{\text{next}}\equiv b\bmod
q$, then

$\pi(x;q,(a,b))\sim\frac{1}{q}\int_{2}^{x}\alpha(y)^{\epsilon_{q}(a,b)}\left(\frac{q}{\phi(q)\log
y}\right)^{2}\mathcal{D}(a,b;y)\mathrm{d}y,$

where $\alpha(y):-1-\frac{q}{\phi(q)\log y}$, $\epsilon_{q}(a,b)$ is a
constant defined only in terms of $q,a,$ and $b$, and

$\mathcal{D}(a,b;y):=\sum_{\begin{subarray}{c}h>0\\\ h\equiv b-a\bmod
q\end{subarray}}\sum_{\mathcal{A}\subset\\{0,h\\}}\sum_{\begin{subarray}{c}\mathcal{T}\subset[1,h-1]\\\
(t+a,q)=1\forall
t\in\mathcal{T}\end{subarray}}(-1)^{|\mathcal{T}|}\mathfrak{S}_{0,q}(\mathcal{A}\cup\mathcal{T})\left(\frac{q}{\phi(q)\alpha(y)\log
y}\right)^{|\mathcal{T}|}\alpha(y)^{h\phi(q)/q}.$

They proceed to heuristically estimate $\mathcal{D}(a,b;y)$, and thus
$\pi(x;q,(a,b))$, by estimating a weighted version of
$R_{2}(h;r,c_{1},c_{2})$. Our results generalize these arguments by estimating
$R_{k}(h;r,c_{1},c_{2})$ for all $k$, which is necessary for understanding
some of the error terms appearing in Lemke Oliver and Soundararajan’s
heuristic. Secondly, restricting sums of singular series in this manner may
shed light on other questions about sums of singular series. We show in
Theorem 1.2 that the asymptotics for (4) are governed by incidences among the
$c_{i}$’s mod $r$. As discussed in [4], we do not yet know the asymptotic
average size of sums of $\mathfrak{S}_{0}(\mathcal{H})$ when $|\mathcal{H}|$
is odd. The results of these more refined averages of singular series may
clarify where the main term should be coming from for sums of singular series
with an odd number of terms.

The sums over $\mathfrak{S}_{0,r}$ admit the expansion

$\sum_{\begin{subarray}{c}1\leq h_{1},\dots,h_{k}\leq h\\\ h_{i}\equiv
c_{i}\bmod r\>\forall i\\\
\text{distinct}\end{subarray}}\mathfrak{S}_{0,r}(\\{h_{1},\dots,h_{k}\\})=\sum_{\begin{subarray}{c}q_{1},\dots,q_{k}\\\
q_{i}>1\\\
(q_{i},r)=1\end{subarray}}\frac{\mu(q_{i})}{\phi(q_{i})}\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\
\sum_{i}a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}\sum_{\begin{subarray}{c}1\leq
h_{1},\dots,h_{k}\leq h\\\ h_{i}\equiv c_{i}\bmod
r\text{distinct}\end{subarray}}\prod_{i=1}^{k}e\left(\frac{a_{i}h_{i}}{q_{i}}\right).$

Following [7] and [8], we first consider a related quantity, where the
summands $q_{i}$ are restricted to divide a secondary modulus $q>1$ and the
$h_{i}$’s are not necessarily distinct, to get

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

where for $\alpha\in{\mathbb{R}}$,

(7) $E_{r,c_{i}}(\alpha):=\sum_{\begin{subarray}{c}m\leq h\\\ m\equiv
c_{i}\bmod r\end{subarray}}e(m\alpha).$

In order to state our result, we will need to fix some notation concerning
perfect matchings of $[1,k]$. For $k\geq 1$, a _perfect matching_ $\sigma$ of
$[1,k]$ is a set $\sigma=\\{(i,j)\\}$ of unordered pairs in $[1,k]$ so that
each element is paired with exactly one other element, i.e. each $i$ appears
in exactly one pair $(i,j)$, and $i\neq j$. Since each pair $(i,j)\in\sigma$
is unordered, we will generally choose to write the representative with $i<j$,
so that $\sigma\\{(i,j)\\}$ with $i<j$. Let $\mathcal{B}_{k}$ denote the set
of perfect matchings of $[1,k]$, so that

(8)
$\mathcal{B}_{k}:=\left\\{\sigma=\\{(i,j)\\}:\begin{array}[]{l}\forall(i,j)\in\sigma,1\leq
i<j\leq k\\\ \forall i\in[1,k],\exists!j\in[1,k]\text{ with
}(i,j)\in\sigma\text{ or }(j,i)\in\sigma\end{array}\right\\}.$

Note that when $k$ is odd, $\mathcal{B}_{k}=\varnothing$. Moreover, for a set
of integers $\\{a_{1},\dots,a_{k}\\}$, we will denote by
$\mathcal{B}(a_{1},\dots,a_{k})$ the set of matchings of
$\\{a_{1},\dots,a_{k}\\}$ into pairs, so that
$\mathcal{B}_{k}=\mathcal{B}([1,k])$.

In Section 2, we prove the following result, which mirrors Theorem 1 of [7].

######  Theorem 1.1.

Fix a modulus $r\geq 1$, an integer $k\geq 1$, and $k$ congruence classes
$c_{1},\dots,c_{k}$ modulo $r$. Define $\mathcal{B}_{k}$ as in (8). Let $q\geq
1$ be a squarefree integer with $(r,q)=1$, and define
$V_{k}(q,h;r,c_{1},\dots,c_{k})$ as in (6). For $h\geq 3$,

$V_{k}(q,h;r,c_{1},\dots,c_{k})=\sum_{\begin{subarray}{c}\sigma\in\mathcal{B}_{k}\end{subarray}}\prod_{(i,j)\in\sigma}V_{2}(q,h;r,c_{i},c_{j})+O_{r,k}\left(h^{k/2-1/(7k)}\left(\frac{q}{\phi(q)}\right)^{2^{k}+k/2}\right).$

In order to state our main result on the asymptotics of
$R_{k}(h;r,c_{1},\dots,c_{k})$, we define some further notation. For
$1\leq\ell\leq r$, define

$\mathcal{C}_{\ell}:=\left\\{i:c_{i}\equiv\ell\bmod r\right\\}.$

Note that some of the sets $\mathcal{C}_{\ell}$ may be empty, and that
$\bigcup_{\ell=1}^{r}\mathcal{C}_{\ell}=[1,k]$. We will say that a partition
$\mathcal{P}=\\{\mathcal{S}_{1},\dots,\mathcal{S}_{M}\\}$ of $[1,k]$ _refines_
$\\{\mathcal{C}_{\ell}\\}_{\ell\in[1,k]}$ if for each
$\mathcal{S}_{m}\in\mathcal{P}$, there exists some $\ell$ with
$\mathcal{S}_{m}\subset\mathcal{C}_{\ell}$; note that $\ell$ is then unique.
For such a partition, write
$\mathcal{P}\preceq\\{\mathcal{C}_{\ell}\\}_{\ell\in[1,k]}$ and define
$c(\mathcal{S}_{m})$ to be the value $\ell$ with
$\mathcal{S}_{m}\subset\mathcal{C}_{\ell}$.

######  Theorem 1.2.

Fix a modulus $r\geq 1$ and an integer $k\geq 1$, as well as $k$ congruence
classes $c_{1},\dots,c_{k}$ modulo $r$. Define $R_{k}(h;r,c_{1},\dots,c_{k})$
by (4). Then for $h\geq 3$,

$\displaystyle R_{k}(h;r,c_{1},\dots,c_{k})=$ $\displaystyle\sum_{0\leq j\leq
k/2}(-1)^{j}\sum_{\begin{subarray}{c}\mathcal{P}\preceq\\{\mathcal{C}_{\ell}\\}_{\ell\in[1,k]}\\\
\mathcal{P}=\\{\mathcal{S}_{1},\dots,\mathcal{S}_{k-j}\\}\\\
|\mathcal{S}_{m}|=2\>\forall 1\leq m\leq j\\\ |\mathcal{S}_{m}|=1\>\forall
j<m\leq k-j\end{subarray}}\left(\frac{h}{r}\sum_{\begin{subarray}{c}d|Q\\\
d>1\end{subarray}}\frac{\mu(d)^{2}}{\phi(d)}\right)^{j}$ (9)
$\displaystyle\sum_{\sigma\in\mathcal{B}(j+1,\dots,k-j)}\prod_{(i_{1},i_{2})\in\sigma}V_{2}(Q,h;r,c(\mathcal{S}_{i_{1}}),c(\mathcal{S}_{i_{2}})),+O_{r,k}(h^{k/2-1/(7k)+\varepsilon}).$

In particular, if $\\#\widetilde{\mathcal{B}}(c_{1},\dots,c_{k})$ is the
number of ways to pair the $c_{i}$’s such that every pair has equal values,
then

$R_{k}(h;r,c_{1},\dots,c_{k})=\\#\widetilde{\mathcal{B}}(c_{1},\dots,c_{k})\left(-h\frac{\phi(r)}{r}\log
h+C_{0}(r)h\right)^{k/2}+O_{r,k}(h^{k/2}(\log h)^{k/2-1}).$

######  Remark.

When all the $c_{i}$’s are congruent mod $r$, then
$\\#\widetilde{\mathcal{B}}(c_{1},\dots,c_{k})=\mu_{k}$ and this theorem
implies Theorem 2 of [7]. When the $c_{i}$’s are not all congruent, the
estimate depends crucially on the precise arrangement of the $c_{i}$’s.
Nevertheless, while the value of the main term is dependent on the $c_{i}$’s,
we always have the upper bound
$R_{k}(h;r,c_{1},\dots,c_{k})\ll_{r,k}h^{k/2}(\log h)^{k/2}$.

The framework of Theorems 1.1 and 1.2 also applies to sums of singular series
weighted by smooth functions. Let $f_{1},\dots,f_{k}:{\mathbb{R}}){\geq
0}\to{\mathbb{C}}$ be functions with compact supports contained in
$(0,\infty)$ and such that $|\hat{f_{i}}(\xi)|\ll\xi^{-2}$, where the Fourier
transform $\hat{f}$ is defined as

$\hat{f}(\xi):=-\int_{\infty}^{\infty}f(x)e^{-2\pi ix\xi}\mathrm{d}x.$

For $h\in{\mathbb{N}}$, we are interested in the quantity

(10)
$R_{k}(h;f_{1},\dots,f_{k}):=\sum_{\begin{subarray}{c}h_{1},\dots,h_{k}\in{\mathbb{Z}}\\\
\text{distinct}\end{subarray}}\prod_{i=1}^{k}f_{i}\left(\frac{h_{i}}{h}\right)\mathfrak{S}_{0}(\\{h_{1},\dots,h_{k}\\}).$

The size of $R_{k}(h;f_{1},\dots,f_{k})$ as $h\to\infty$ is similar in
structure to the analogous result for sums of singular series along arithmetic
progressions: the main term is a sum over perfect matchings of $[1,k]$, and
for each matching $\sigma$ the contribution is determined by interactions of
$f_{i}$ and $f_{j}$ for each pair $(i,j)\in\sigma$.

We set some notation before stating our results. Define

(11)
$V(q,h;f_{1},\dots,f_{k}):=\sum_{1<q_{1},\dots,q_{k}|q}\prod_{i=1}^{k}\frac{\mu(q_{i})}{\phi(q_{i})}\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\
\sum_{i}a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}E_{f_{1},h}\left(\frac{a_{1}}{q_{1}}\right)\cdots
E_{f_{k},h}\left(\frac{a_{k}}{q_{k}}\right),$

where for $\alpha\in{\mathbb{R}}$ and $f$ smooth, with compact support, and
such that $|\hat{f}(\xi)|=O(|\xi|^{-2})$,

(12)
$E_{f,h}(\alpha):=\sum_{m=-\infty}^{\infty}f\left(\frac{m}{h}\right)e(m\alpha).$

Since $f$ is smooth, $E_{f,h}(\alpha)$ is a smoother indicator function of
values of $\alpha$ that are close to $0$. In particular, by Poisson summation,

$E_{f,h}(\alpha)=h\sum_{n=-\infty}^{\infty}\hat{f}(h(n-\alpha)).$

By assumption, $\hat{f}(\xi)=O(|\xi|^{-2})$. For any real number $\alpha$,
only one value of $\alpha-n$ will be in the interval $[-1/2,1/2)$; let
$\overline{\alpha}$ denote this value, so that $\overline{\alpha}$ is the
representative of $\alpha\bmod 1$ satisfying $-1/2\leq\overline{\alpha}<1/2$.
Then

(13)
$E_{f,h}(\alpha)=h\hat{f}(-h\overline{\alpha})+h\sum_{n=1}^{\infty}O((hn)^{-2})=h\hat{f}(-h\overline{\alpha})+O(h^{-1}).$

The following results about $V_{k}(q,h;f_{1},\dots,f_{k})$ hold, analogous to
Theorem 1.1 and Lemma 3.2.

######  Theorem 1.3.

Fix $k\geq 1$ and $k$ smooth functions $f_{1},\dots,f_{k}:{\mathbb{R}}_{\geq
0}\to{\mathbb{C}}$ with compact supports
$\mathrm{supp}(f_{i})\subset(0,\infty)$ and such that
$|\hat{f}_{i}(\xi)|=O(|\xi|^{-2})$ for all $1\leq i\leq k$. Define
$\mathcal{B}_{k}$ as in (8). Let $q\geq 1$ be a squarefree integer, and define
$V_{k}(q,h;f_{1},\dots,f_{k})$ as in (11). For $h\geq 3$,

$V_{k}(q,h;f_{1},\dots,f_{k})=\sum_{\begin{subarray}{c}\sigma\in\mathcal{B}_{k}\end{subarray}}\prod_{(i,j)\in\sigma}V_{2}(q,h;f_{i},f_{j})+O_{f_{1},\dots,f_{k}}\left(h^{k/2-1/(7k)}\left(\frac{q}{\phi(q)}\right)^{2^{k}+k/2}\right).$

######  Lemma 1.4.

Fix $h\geq 1$ and let $f_{1},f_{2}:{\mathbb{R}}_{\geq 0}\to{\mathbb{C}}$ be
smooth functions with compact supports $\mathrm{supp}(f_{i})\subset(0,\infty)$
such that $|\hat{f_{i}}(\xi)|\ll O(|\xi|^{-2})$. Define $Q:=\prod_{p\leq
h^{2}}p$, and define $V_{2}(q,h;f_{1},f_{2})$ via (11). Then

(14)
$V_{2}(Q,h;f_{1},f_{2})=(-\hat{f_{1}}(0)\hat{f_{2}}(0)+\\{\mathcal{M}f\\}(2))h^{2}-\frac{\\{\mathcal{M}f^{\prime}\\}(1)}{2}h\log
h+O_{f_{1},f_{2}}(h),$

where $\\{\mathcal{M}f\\}(s)$ is the Mellin transform of $f$, defined by

(15) $\\{\mathcal{M}f\\}(s):=\int_{0}^{\infty}x^{s-1}f(x)\mathrm{d}x.$

Using precisely the same techniques as in the case of arithmetic progressions,
an analog to Theorem 1.2 also holds for the smooth functions setting, where
the input to each summand is clarified by Lemma 1.4.

######  Theorem 1.5.

Fix an integer $k$ and smooth functions $f_{1},\dots,f_{k}:{\mathbb{R}}_{\geq
0}\to{\mathbb{C}}$ with compact support such that
$\mathrm{supp}(f_{i})\subset(0,\infty)$ and such that
$|\hat{f_{i}}(\xi)|=O(|\xi|^{-2})$ for each $1\leq i\leq k$. Define
$R_{k}(h;f_{1},\dots,f_{k})$ via (10). Then for $h\geq 3$,

$\displaystyle R_{k}(h;f_{1},\dots,f_{k})=$ $\displaystyle\sum_{0\leq j\leq
k/2}(-1)^{j}\sum_{\begin{subarray}{c}\mathcal{P}=\\{\mathcal{S}_{1},\dots,\mathcal{S}_{k-j}\\}\\\
|\mathcal{S}_{m}|=2\>\forall 1\leq m\leq j\\\ |\mathcal{S}_{m}|=1\>\forall
j<m\leq k-j\end{subarray}}\left(h\sum_{\begin{subarray}{c}d|Q\\\
d>1\end{subarray}}\frac{\mu(d)^{2}}{\phi(d)}\right)^{j}$ (16)
$\displaystyle\sum_{\sigma\in\mathcal{B}(j+1,\dots,k-j)}\prod_{(i_{1},i_{2})\in\sigma}V_{2}(Q,h;f_{\mathcal{S}_{i_{1}}},f_{\mathcal{S}_{i_{2}}}),+O_{r,k}(h^{k/2-1/(7k)+\varepsilon}),$

where the sum is taken over partitions of $[1,k]$ where each part has either
$1$ or $2$ elements, and for $|\mathcal{S}_{m}|=1$, $f_{\mathcal{S}_{m}}$
denotes $f_{j}$ where $j\in\mathcal{S}_{m}$.

The proofs of Theorems 1.3 and 1.5 are identical to the proofs of Theorems 1.1
and 1.2, so we omit them. However, Theorems 1.3 and 1.1, which provide
asymptotics for $V_{k}$ in the cases of smooth weighting and arithmetic
progressions, rely on lemmas about sums of $E_{f,h}(\alpha)$. The results are
fundamentally the same, but the flavor of several of these lemmas is somewhat
different in the smooth case, so we record them in Section 5. We also provide
the proof of Lemma 1.4, which is similar to the proof of Lemma 3.2.

The organization of this paper is as follows. In Section 2, we prove Theorem
1.1. In Section 3, we compute certain sums of 2-term singular series which
will then be used in the proof of Theorem 1.2. In Section 4, we prove Theorem
1.2. Finally, in Section 5 we discuss the smooth case.

##  2\. Proof of Theorem 1.1

The arguments in this section closely follow the arguments in the proof of
Lemma 8 in [8] and Theorem 1 in [7]. Here we outline the argument; where it
differs, we present detailed explanations, but many steps are cited to [8] and
[7].

The functions $E_{r,c_{i}}(\alpha)$, defined in (7), are modular versions of
sums $E(\alpha):=\sum_{m\leq h}e(m\alpha)$. The sums $E(\alpha)$ are large if
$\alpha$ is close to an integer and otherwise exhibit large amounts of
cancellation. Since $E_{r,c_{i}}(\alpha)$ is summed only over $m$ in a set
congruence class modulo $r$, it will also take large values when $\alpha$ is
close to a multiple of $r$. For any $c,r$, write

$\displaystyle E_{r,c}(\alpha)$ $\displaystyle=\sum_{\begin{subarray}{c}m\leq
h\end{subarray}}\frac{1}{r}\sum_{\begin{subarray}{c}n=1\end{subarray}}^{r}e\left(\frac{(m-c)n}{r}\right)e(m\alpha)$
$\displaystyle=\frac{1}{r}\sum_{\begin{subarray}{c}n=1\end{subarray}}^{r}e(-cn/r)\sum_{m\leq
h}e(m\alpha+mn/r),$

so that

$|E_{r,c}(\alpha)|\leq\frac{1}{r}\sum_{n=1}^{r}\min\left\\{h,\frac{1}{\|\alpha+n/r\|}\right\\}.$

Define

(17)
$F_{r}(\alpha):=\frac{1}{r}\sum_{n=1}^{r}\min\left\\{h,\frac{1}{\|\alpha+n/r\|}\right\\},$

so that $|E_{r,c}(\alpha)|\leq F_{r}(\alpha).$ We can then closely follow the
analysis of Montgomery and Vaughan in [8] and Montgomery and Soundararajan in
[7]. In particular, $F_{r}(\alpha)$ can be bounded, up to some dependence on
$r$, by the same bounds as appear in Lemmas 4,5,6, and 7 of [8] and using the
same arguments. We arrive at the following result.

######  Theorem 2.1.

Fix $r,k,q\geq 1$. Let $\mathcal{S}(q)$ denote the set of $k$-tuples
$(q_{1},\dots,q_{k})$ such that for all $i$, $q_{i}|q$, $q_{i}>1$, and the
$q_{i}$’s are not equal in pairs and otherwise distinct; that is to say, there
is no reordering permutation $\sigma$ of the $k$ indices with
$q_{\sigma(i)}=q_{\sigma(i+k/2)}$ for all $1\leq i\leq k/2$, and no other
equalities. Then

$\displaystyle\sum_{\begin{subarray}{c}(q_{1},\dots,q_{k})\in\mathcal{S}(q)\end{subarray}}\prod_{i=1}^{k}\frac{\mu(q_{i})^{2}}{\phi(q_{i})}\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\
\sum_{i}a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}\prod_{i=1}^{k}F_{r}\left(\frac{a_{i}}{q_{i}}\right)\ll_{r}qh^{k/2-1/7k}\left(\frac{\phi(q)}{q}\right)^{k/2-2^{k}}.$

Theorem 2.1 accounts for all terms in $V_{k}(q,h;r,c_{1},\dots,c_{k})$ except
for those terms where the $q_{i}$’s are equal in pairs and otherwise distinct.
When $k$ is odd, there are no such terms, so assume that $k$ is even. By the
same argument as in [7], we can drop the assumption that the pairs are
distinct, so that the terms left to be estimated are given by

$\sum_{\begin{subarray}{c}\sigma\in\mathcal{B}_{k}\end{subarray}}\sum_{\begin{subarray}{c}(q_{i})_{(i,j)\in\mathcal{B}_{k}}\\\
1<q_{i}|q\end{subarray}}\prod_{(i,j)\in\mathcal{B}_{k}}\frac{\mu(q_{i})^{2}}{\phi(q_{i})^{2}}\sum_{\begin{subarray}{c}(b_{i})_{(i,j)\in\mathcal{B}_{k}}\\\
1\leq b_{i}\leq q_{i}\\\
\sum_{i}b_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}\prod_{(i,j)\in\mathcal{B}_{k}}J_{r,c_{i},c_{j}}(b_{i},q_{i}),$

where for each $i$,

$J_{r,c_{i},c_{j}}(b_{i},q_{i}):=\sum_{\begin{subarray}{c}1\leq a_{i}\leq
q_{i}\\\ (a_{i},q_{i})=1\\\
(b_{i}-a_{i},q_{i})=1\end{subarray}}E_{r,c_{i}}\left(\frac{a_{i}}{q_{i}}\right)E_{r,c_{j}}\left(\frac{b_{i}-a_{i}}{q_{i}}\right).$

Each term $\sigma$ in our sum is identical up to changing labels, so without
loss of generality we will work with the term $\sigma=\\{(i,k/2+i):1\leq i\leq
k/2\\}$, so that $q_{i}=q_{i+k/2}$ for all $1\leq i\leq k/2$. This term is
given by

(18) $\sum_{\begin{subarray}{c}q_{1},\dots,q_{k/2}\\\
1<q_{i}|q\end{subarray}}\prod_{i=1}^{k/2}\frac{\mu(q_{i})^{2}}{\phi(q_{i})^{2}}\sum_{\begin{subarray}{c}b_{1},\dots,b_{k/2}\\\
1\leq b_{i}\leq q_{i}\\\
\sum_{i}b_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}\prod_{i=1}^{k/2}J_{r,c_{i},c_{k/2+i}}(b_{i},q_{i}).$

Let $\mathcal{J}\subset[1,k/2]$ be the subset of $i$’s with $0<b_{i}<q_{i}$
instead of $b_{i}=q_{i}$. For $i\not\in\mathcal{J}$, we have

$J_{i,k/2+i}(q_{i},q_{i})=\sum_{\begin{subarray}{c}1\leq a_{i}\leq q_{i}\\\
(a_{i},q_{i})=1\end{subarray}}E_{r,c_{i}}\left(\frac{a_{i}}{q_{i}}\right)E_{r,c_{k/2+i}}\left(-\frac{a_{i}}{q_{i}}\right),$

which, when summed over $1<q_{i}|q$ with the weight
$\frac{\mu(q_{i})^{2}}{\phi(q_{i})^{2}}$, is equal to
$V_{2}(q,h;r,c_{i},c_{k/2+i})$. Thus, (18) is equal to

(19)
$\sum_{\begin{subarray}{c}\mathcal{J}\subset[1,k/2]\end{subarray}}\prod_{i\not\in\mathcal{J}}V_{2}(q,h;r,c_{i},c_{k/2+i})W_{\mathcal{J}}(q,h;r,(b_{i})_{i\in\mathcal{J}}),$

where

$W_{\mathcal{J}}(q,h;r,(b_{i})_{i\in\mathcal{J}}):=\sum_{\begin{subarray}{c}(q_{i})_{i\in\mathcal{J}}\\\
1<q_{i}|q\end{subarray}}\prod_{i\in\mathcal{J}}\frac{\mu(q_{i})^{2}}{\phi(q_{i})^{2}}\sum_{\begin{subarray}{c}(b_{i})_{i\in\mathcal{J}}\\\
0<b_{i}<q_{i}\\\
\sum_{i\in\mathcal{J}}b_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}\prod_{i\in\mathcal{J}}J_{c_{i},c_{k/2+i}}(b_{i},q_{i}).$

The term $\mathcal{J}=\varnothing$ gives the desired main term, so it remains
to show that the terms with $\mathcal{J}\neq\varnothing$ are smaller. By
following the reasoning on page 11 of [7], we get that

$W_{\mathcal{J}}(q,h;r,(b_{i})_{i\in\mathcal{J}})\ll_{r}h^{|\mathcal{J}|/2}\left(\frac{q}{\phi(q)}\right)^{2^{|\mathcal{J}|}},$

and that for any $c_{1},c_{2}\bmod r$,

$V_{2}(q,h;r,c_{1},c_{2})\ll_{r}h\frac{q}{\phi(q)}.$

Applying these estimates to (19) completes the proof of Theorem 1.1.

##  3\. Auxiliary lemmas: two-term computations

In order to prove Theorem 1.2, we will ultimately invoke Theorem 1.1, which
will then relate quantities involving $k$-term singular series to quantities
involving $2$-term singular series. In this section, we state two lemmas which
compute, respectively, sums of two-term singular series in arithmetic
progressions, and the quantity $V_{2}(Q,h;r,c_{1},c_{2})$ when $Q$ is the
product of all primes below $h^{2}$, which will be applied in Section 4.

The following lemma is a computation of sums of two-term singular series to
the modulus $q$. Its proof is nearly identical to the proof of Proposition 2.1
in [5], so we omit it. Similar quantities were previously studied in [2] and
[6].

######  Lemma 3.1.

Fix $r,h\geq 1$, and let $v\bmod r$ be any residue class. Define

$S(r,v,h):=\sum_{\begin{subarray}{c}1\leq m\leq h\\\ m\equiv v\bmod
r\end{subarray}}(h-m)\mathfrak{S}_{r}(\\{0,m\\}).$

Then when $v=0$,

$S(r,v,h)=\frac{h^{2}}{2r}-\frac{h}{2}\phi(r)\left(\log\frac{h}{r}+\log
2\pi+\gamma_{0}+\sum_{p|r}\frac{\log
p}{p-1}\right)+O_{r}(h^{1/2+\varepsilon}),$

where $\gamma_{0}$ denotes the Euler–Mascheroni constant. Meanwhile, if $v\neq
0$, then if $d=(v,r)$,

$\displaystyle S(r,v,h)=\frac{h^{2}}{2r}$
$\displaystyle-\frac{h}{2}\frac{\phi(r)}{r}\frac{1}{\phi(r/d)}\Lambda(r/d)$
$\displaystyle+\frac{h}{\phi(r/d)}\sum_{\chi\neq\chi_{0}\bmod{r/d}}\overline{\chi}(v/d)L(0,\chi)L(1,\chi)A_{r,\chi}+O_{r}(h^{1/2+\varepsilon}),$

with

(20) $A_{r,\chi}=\prod_{p|r}\left(1-\frac{\chi(p)}{p}\right)\prod_{p\nmid
r}\left(1-\frac{(1-\chi(p))^{2}}{(p-1)^{2}}\right).$

######  Lemma 3.2.

Fix integers $r,h\geq 1$ and two congruence classes $c_{1},c_{2}\bmod r$.
Define

$Q=\prod_{\begin{subarray}{c}p\leq h^{2}\\\ p\nmid r\end{subarray}}p,$

so that $Q$ is the product of all primes below $h^{2}$ that do not divide $r$.
Let $V_{2}(Q,h;r,c_{1},c_{2})$ be defined as in (6). Then if $c_{1}\equiv
c_{2}\bmod r$,

$V_{2}(Q,h;r,c_{1},c_{1})=\frac{h}{r}\sum_{\begin{subarray}{c}d|Q\\\
d>1\end{subarray}}\frac{\mu(d)^{2}}{\phi(d)}-h\frac{\phi(r)}{r}\log
h+C_{0}(r)h+O_{r}(h^{1/2+\varepsilon}),$

where

(21)
$C_{0}(r)=\frac{\phi(r)}{r}\left(\log\frac{r}{2\pi}-\gamma_{0}-\sum_{p|r}\frac{\log
p}{p-1}\right),$

and $\gamma_{0}$ is the Euler–Mascheroni constant. If $c_{1}\not\equiv
c_{2}\bmod r$, define $d=(c_{1}-c_{2},r)$, with $d<r$. Then

$\displaystyle V_{2}(Q,h;r,c_{1},c_{2})=-$ $\displaystyle
h\frac{\phi(r)}{r^{2}\phi(r/d)}\Lambda(r/d)$ (22)
$\displaystyle+\frac{2h}{r\phi(r/d)}\sum_{\chi\neq\chi_{0}\bmod{r/d}}\overline{\chi}\left(\frac{c_{1}-c_{2}}{d}\right)L(0,\chi)L(1,\chi)A_{r,\chi}+O_{r}(h^{1/2+\varepsilon}),$

where $A_{r,\chi}$ is defined in (20).

###### Proof.

Begin by expanding

$\displaystyle V_{2}(Q,h;r,c_{1},c_{2})$
$\displaystyle=-E_{r,c_{1}}(1)E_{r,c_{2}}(1)+\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}\sum_{\begin{subarray}{c}1\leq
a\leq q\\\
(a,q)=1\end{subarray}}E_{r,c_{1}}\left(\frac{a}{q}\right)E_{r,c_{2}}\left(-\frac{a}{q}\right)$
$\displaystyle=-\frac{h^{2}}{r^{2}}+\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}\sum_{\begin{subarray}{c}1\leq
a\leq q\\\ (a,q)=1\end{subarray}}\sum_{\begin{subarray}{c}m_{1},m_{2}\leq h\\\
m_{i}\equiv c_{i}\bmod
r\end{subarray}}e\left((m_{1}-m_{2})\frac{a}{q}\right).$

Assume first that $c_{1}\equiv c_{2}\bmod r$. Then

(23)
$V_{2}(Q,h;r,c_{1},c_{1})=-\frac{h^{2}}{r^{2}}+\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}\sum_{\begin{subarray}{c}1\leq
a\leq q\\\ (a,q)=1\end{subarray}}\sum_{\begin{subarray}{c}|m|\leq h\\\
r|m\end{subarray}}\frac{1}{r}(h-|m|)e\left(m\frac{a}{q}\right).$

Let $\mathbf{c}_{q}(m)$ denote the Ramanujan sum
$\sum_{\begin{subarray}{c}1\leq a\leq q\\\
(a,q)=1\end{subarray}}e\left(m\frac{a}{q}\right)$. The expression (23) is then

$\displaystyle V_{2}(Q,h;r,c_{1},c_{1})$
$\displaystyle=-\frac{h^{2}}{r^{2}}+\frac{1}{r}\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}\left(h\mathbf{c}_{q}(0)+2\sum_{1\leq
m\leq h/r}(h-rm)\mathbf{c}_{q}(rm)\right)$
$\displaystyle=-\frac{h^{2}}{r^{2}}+\frac{h}{r}\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}+\frac{2}{r}\sum_{1\leq
m\leq h/r}(h-rm)\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}\mathbf{c}_{q}(rm).$

The inside sum over $q|Q$ is multiplicative and, since $Q$ is the product of
primes $p\leq h^{2}$ not dividing $r$, it is given by

$\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}\mathbf{c}_{q}(rm)=\prod_{\begin{subarray}{c}p|m\\\
p\nmid
r\end{subarray}}\left(1+\frac{1}{p-1}\right)\prod_{\begin{subarray}{c}p\nmid
m\\\ p\nmid
r\end{subarray}}\left(1-\frac{1}{(p-1)^{2}}\right)+O_{r}(h^{-2})=\mathfrak{S}_{r}(\\{0,m\\})+O_{r}(h^{-2}),$

by the definition of $\mathfrak{S}_{r}$ in (5).

Then

$V_{2}(Q,h;r,c_{1},c_{1})=-\frac{h^{2}}{r^{2}}+\frac{h}{r}\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}+\frac{2}{r}\sum_{1\leq
m\leq h/r}(h-rm)\mathfrak{S}_{r}(\\{0,m\\})+O_{r}(1),$

which by Lemma 3.1 is equal to

$-\frac{h^{2}}{r^{2}}+\frac{h}{r}\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}+\frac{h^{2}}{r^{2}}-h\frac{\phi(r)}{r}\left(\log\frac{h}{r}+\log
2\pi+\gamma_{0}+\sum_{p|r}\frac{\log
p}{p-1}\right)+O_{r}(h^{1/2+\varepsilon}).$

After a little rearranging this gives the desired result.

Now assume $c_{1}\not\equiv c_{2}\bmod r$. In this case,

$\displaystyle V_{2}(Q,h;r,c_{1},c_{2})$
$\displaystyle=-\frac{h^{2}}{r^{2}}+\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}\sum_{\begin{subarray}{c}1\leq
a\leq q\\\ (a,q)=1\end{subarray}}\sum_{\begin{subarray}{c}|m|\leq h\\\ m\equiv
c_{1}-c_{2}\bmod r\end{subarray}}\frac{1}{r}(h-|m|)e\left(m\frac{a}{q}\right)$
$\displaystyle=-\frac{h^{2}}{r^{2}}+\sum_{\begin{subarray}{c}|m|\leq h\\\
m\equiv c_{1}-c_{2}\bmod
r\end{subarray}}\frac{1}{r}(h-|m|)\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}\mathbf{c}_{q}(m)$
$\displaystyle=-\frac{h^{2}}{r^{2}}+\sum_{\begin{subarray}{c}|m|\leq h\\\
m\equiv c_{1}-c_{2}\bmod
r\end{subarray}}\frac{1}{r}(h-|m|)\mathfrak{S}_{r}(\\{0,m\\})+O_{r}(1),$

where if $m\equiv c_{1}-c_{2}\bmod r$, then $m\neq 0$.

Applying Lemma 3.1 completes the proof. ∎

##  4\. Proof of Theorem 1.2

Throughout this section, fix $r,k,h\geq 1$ and set
$Q=\prod_{\begin{subarray}{c}p\leq y\\\ p\nmid r\end{subarray}}p$, where
$y=h^{k+1}$.

Begin with the expansion

(24)
$R_{k}(h;r,c_{1},\dots,c_{k})=\sum_{\begin{subarray}{c}q_{1},\dots,q_{k}\\\
1<q_{i}|Q\end{subarray}}\prod_{i=1}^{k}\frac{\mu(q_{i})}{\phi(q_{i})}\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\
\sum_{i}a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}\sum_{\begin{subarray}{c}d_{1},\dots,d_{k}\\\
1\leq d_{i}\leq h\\\ \text{distinct}\\\ d_{i}\equiv c_{i}\bmod
r\end{subarray}}e\left(\sum_{i=1}^{k}\frac{a_{i}d_{i}}{q_{i}}\right)+O_{r}(1),$

where the error term is due to our choice of $Q$. The expression on the right-
hand side of (24) is very close to $V_{k}(Q,h;r,c_{1},\dots,c_{k})$, but in
order to apply Theorem 1.1, we will need to remove the distinctness condition
on the $d_{i}$’s. As in the proof of Theorem 2 from [7], removing this
condition will be the bulk of our work.

This distinctness condition is heavily dependent on the congruence classes
$c_{1},\dots,c_{k}$; in particular, if $c_{i}\not\equiv c_{j}\bmod r$, then
$d_{i}$ and $d_{j}$ never coincide and the distinctness condition is
immaterial. Our arguments follow those of [7] closely, but with additional
bookkeeping in order to account for the congruence classes
$c_{1},\dots,c_{k}\bmod r$.

For a given tuple $(d_{1},\dots,d_{k})$ with $1\leq d_{i}\leq h$ and
$d_{i}\equiv c_{i}\bmod r$ for all $i$, put $\delta_{ij}=1$ if $d_{i}=d_{j}$
and $\delta_{ij}=0$ otherwise. Then

$\prod_{\ell=1}^{r}\prod_{\begin{subarray}{c}i,j\in\mathcal{C}_{\ell}\\\
i<j\end{subarray}}(1-\delta_{ij})=\begin{cases}1&\text{ if the }d_{i}\text{
are distinct }\\\ 0&\text{ otherwise.}\end{cases}$

When the left-hand side above is expanded, it is a linear combination of
products of the $\delta$ symbols. Let $\Delta$ denote one such product, and
let $|\Delta|$ denote the number of $\delta_{ij}$ in the product. As in [7],
define an equivalence relation on these $\delta$-products by setting
$\Delta_{1}\sim\Delta_{2}$ if $\Delta_{1}$ and $\Delta_{2}$ have the same
value for all choices of $d_{i}$’s; for example,
$\delta_{12}\delta_{23}\sim\delta_{12}\delta_{13}\sim\delta_{12}\delta_{23}\delta_{13}.$

Recall that a partition
$\mathcal{P}=\\{\mathcal{S}_{1},\dots,\mathcal{S}_{M}\\}$ of $[1,k]$ _refines_
$\\{\mathcal{C}_{\ell}\\}_{\ell\in[1,k]}$ if for each
$\mathcal{S}_{m}\in\mathcal{P}$, there exists some $\ell$ with
$\mathcal{S}_{m}\subset\mathcal{C}_{\ell}$; note that $\ell$ is then unique.
For such a partition, write
$\mathcal{P}\preceq\\{\mathcal{C}_{\ell}\\}_{\ell\in[1,k]}$ and define
$c(\mathcal{S}_{m})$ to be the value $\ell$ with
$\mathcal{S}_{m}\subset\mathcal{C}_{\ell}$. Given a partition $\mathcal{P}$
refining $\\{\mathcal{C}_{\ell}\\}_{\ell\in[1,k]}$, let

$\Delta_{\mathcal{P}}=\prod_{m=1}^{M}\prod_{\begin{subarray}{c}i<j\\\
i,j\in\mathcal{S}_{m}\end{subarray}}\delta_{ij}.$

Every equivalence class of $\delta$-products contains a unique
$\Delta_{\mathcal{P}}$, where the condition that $\mathcal{P}$ refines
$\\{\mathcal{C}_{\ell}\\}_{\ell\in[1,k]}$ corresponds precisely to the fact
that we are only considering $\delta_{ij}$ when $c_{i}\equiv c_{j}\bmod r$.
Equivalence classes of $\delta$-products are thus in bijection with partitions
of $[1,k]$ that refine $\\{\mathcal{C}_{\ell}\\}_{\ell\in[1,k]}$. For a
partition $\mathcal{P}$, put

$w(\mathcal{P})=\sum_{\Delta\sim\Delta_{\mathcal{P}}}(-1)^{|\Delta|},$

so that

$\prod_{\ell=1}^{r}\prod_{\begin{subarray}{c}i,j\in\mathcal{C}_{\ell}\\\
i<j\end{subarray}}(1-\delta_{ij})=\prod_{\mathcal{P}\preceq\\{\mathcal{C}_{\ell}\\}_{\ell\in[1,k]}}w(\mathcal{P})\Delta_{\mathcal{P}},$

and the sum over $a_{i}$’s in (24) is equal to

$\sum_{\begin{subarray}{c}\mathcal{P}\preceq\\{\mathcal{C}_{\ell}\\}_{\ell\in[1,k]}\\\
\mathcal{P}=\\{\mathcal{S}_{1},\dots,\mathcal{S}_{M}\\}\end{subarray}}w(\mathcal{P})\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\
\sum_{i}a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}\prod_{m=1}^{M}E_{r,c(\mathcal{S}_{m})}\left(\sum_{i\in\mathcal{S}_{m}}\frac{a_{i}}{q_{i}}\right).$

By the same reasoning as in [7], the contribution to
$R_{k}(h;r,c_{1},\dots,c_{k})$ from terms where $|\mathcal{S}_{m}|\geq 3$ for
some $m$ is $O_{r}(h^{(k-1)/2+\varepsilon})$, so that

$\displaystyle
R_{k}(h;r,c_{1},\dots,c_{k})=\sum_{\begin{subarray}{c}\mathcal{P}\preceq\\{\mathcal{C}_{\ell}\\}_{\ell\in[1,k]}\\\
\mathcal{P}=\\{\mathcal{S}_{1},\dots,\mathcal{S}_{M}\\}\\\
|\mathcal{S}_{m}|\leq 2\>\forall m\end{subarray}}$ $\displaystyle
w(\mathcal{P})\sum_{\begin{subarray}{c}q_{1},\dots,q_{k}\\\
1<q_{i}|Q\end{subarray}}\prod_{i=1}^{k}\frac{\mu(q_{i})}{\phi(q_{i})}$ (25)
$\displaystyle\cdot\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\ 1\leq
a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\
\sum_{i}a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}\prod_{m=1}^{M}E_{r,c(\mathcal{S}_{m})}\left(\sum_{i\in\mathcal{S}_{m}}\frac{a_{i}}{q_{i}}\right)+O_{r,k}(h^{(k-1)/2+\varepsilon}).$

Suppose that $\mathcal{P}$ consists of $j$ doubleton sets
$\mathcal{S}_{1},\dots,\mathcal{S}_{j}$ and $k-2j$ singleton sets
$\mathcal{S}_{j+1},\dots,\mathcal{S}_{k-j}$. Note that the number of these
partitions depends on the partition $\\{\mathcal{C}_{\ell}\\}$, because of the
constraint that $\mathcal{P}\preceq\\{\mathcal{C}_{\ell}\\}_{\ell\in[1,k]}$.
The term in $R_{k}(h;r,c_{1},\dots,c_{k})$ corresponding to a fixed such
partition $\mathcal{P}$ is

(26) $(-1)^{j}\sum_{\begin{subarray}{c}q_{1},\dots,q_{k}\\\
1<q_{i}|Q\end{subarray}}\prod_{i=1}^{k}\frac{\mu(q_{i})}{\phi(q_{i})}\sum_{\begin{subarray}{c}a_{1},\dots,a_{k}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\
\sum_{i}a_{i}/q_{i}\in{\mathbb{Z}}\end{subarray}}\prod_{m=1}^{j}E_{r,c(\mathcal{S}_{m})}\left(\sum_{i\in\mathcal{S}_{m}}\frac{a_{i}}{q_{i}}\right)\prod_{m=j+1}^{k-j}E_{r,c(\mathcal{S}_{m})}\left(\frac{a_{\mathcal{S}_{m}}}{q_{\mathcal{S}_{m}}}\right),$

where we are slightly abusing notation in the final product by identifying the
singletons $\mathcal{S}_{m}$ with their unique element.

For $1\leq m\leq j$, define $b_{m}$ and $s_{m}$ by the relations

$\frac{b_{m}}{s_{m}}=\sum_{i\in\mathcal{S}_{m}}\frac{a_{i}}{q_{i}}\bmod
1,\qquad 1\leq b_{m}\leq s_{m},\qquad(b_{m},s_{m})=1,$

and define

$H_{m}\left(\frac{b}{s}\right)=E_{r,c(\mathcal{S}_{m})}\left(\frac{b}{s}\right)\sum_{\begin{subarray}{c}d_{1},d_{2}|Q\\\
1<d_{i}\end{subarray}}\frac{\mu(d_{1})\mu(d_{2})}{\phi(d_{1})\phi(d_{2})}\sum_{\begin{subarray}{c}e_{1},e_{2}\\\
1\leq e_{i}\leq d_{i}\\\ (e_{i},d_{i})=1\\\
\tfrac{e_{1}}{d_{1}}+\tfrac{e_{2}}{d_{2}}=\tfrac{b}{s}\bmod
1\end{subarray}}1.$

Then (26) is equal to

(27) $\sum_{\begin{subarray}{c}s_{1},\dots,s_{j}\\\
s_{i}|Q\end{subarray}}\sum_{\begin{subarray}{c}b_{1},\dots,b_{j}\\\ 1\leq
b_{i}\leq s_{i}\\\
(b_{i},s_{i})=1\end{subarray}}\prod_{i=1}^{j}H_{i}\left(\frac{b_{i}}{s_{i}}\right)\sum_{\begin{subarray}{c}q_{j+1},\dots,q_{k-j}\\\
1<q_{i}|Q\end{subarray}}\sum_{\begin{subarray}{c}a_{j+1},\dots,a_{k-j}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\
\sum_{i}a_{i}/q_{i}+\sum_{i}b_{i}/s_{i}\in{\mathbb{Z}}\end{subarray}}\prod_{i=j+1}^{k-j}\frac{\mu(q_{i})}{\phi(q_{i})}E_{r,c(\mathcal{S}_{i})}\left(\frac{a_{i}}{q_{i}}\right).$

Now separate the indices $i$ with $s_{i}=1$. To do so, let
$\mathcal{L}=\\{i:s_{i}>1\\}$. We can again rewrite (27) as

(28)
$\sum_{\mathcal{L}\subset[1,j]}M(\mathcal{L})\prod_{i\not\in\mathcal{L}}H_{i}(1),$

where

$M(\mathcal{L})=\sum_{\begin{subarray}{c}(s_{i})_{i\in\mathcal{L}}\\\
1<s_{i}|Q\end{subarray}}\sum_{\begin{subarray}{c}(b_{i})_{i\in\mathcal{L}}\\\
1\leq b_{i}\leq s_{i}\\\
(b_{i},s_{i})=1\end{subarray}}\prod_{i\in\mathcal{L}}H_{i}\left(\frac{b_{i}}{s_{i}}\right)\sum_{\begin{subarray}{c}q_{j+1},\dots,q_{k-j}\\\
1<q_{i}|Q\end{subarray}}\sum_{\begin{subarray}{c}a_{j+1},\dots,a_{k-j}\\\
1\leq a_{i}\leq q_{i}\\\ (a_{i},q_{i})=1\\\
\sum_{i}a_{i}/q_{i}+\sum_{i}b_{i}/s_{i}\in{\mathbb{Z}}\end{subarray}}\prod_{i=j+1}^{k-j}\frac{\mu(q_{i})}{\phi(q_{i})}E_{r,c(\mathcal{S}_{i})}\left(\frac{a_{i}}{q_{i}}\right).$

Note that
$M(\varnothing)=V_{2k-j}(Q,h;r,c(\mathcal{S}_{j+1}),\dots,c(\mathcal{S}_{k-j}))$.

By precisely the same arguments as in [7], the contributions when
$|\mathcal{L}|\geq 1$ can be absorbed into the error term. Moreover,

$\displaystyle H_{i}(1)$
$\displaystyle=E_{r,c(\mathcal{S}_{i})}(1)\sum_{\begin{subarray}{c}d|Q\\\
d>1\end{subarray}}\frac{\mu(d)^{2}}{\phi(d)}$
$\displaystyle=\left(\frac{h}{r}+O(1)\right)\sum_{\begin{subarray}{c}d|Q\\\
d>1\end{subarray}}\frac{\mu(d)^{2}}{\phi(d)}.$

Thus the expression (28) is equal to

$\left(\frac{h}{r}\sum_{\begin{subarray}{c}d|Q\\\
d>1\end{subarray}}\frac{\mu(d)^{2}}{\phi(d)}\right)^{j}V_{k-2j}(Q,h;r,c(\mathcal{S}_{j+1}),\dots,c(\mathcal{S}_{k-j}))+O_{r,k}(h^{(k-1)/2+\varepsilon}).$

Inserting this back into (25) yields

$\displaystyle R_{k}(Q,h;r,c_{1},\dots,c_{k})=\sum_{0\leq j\leq k/2}(-1)^{j}$
$\displaystyle\sum_{\begin{subarray}{c}\mathcal{P}\preceq\\{\mathcal{C}_{\ell}\\}_{\ell\in[1,k]}\\\
\mathcal{P}=\\{\mathcal{S}_{1},\dots,\mathcal{S}_{M}\\}\\\
|\mathcal{S}_{m}|\leq 2\>\forall m\\\
|\mathcal{P}|=k-j\end{subarray}}\left(\frac{h}{r}\sum_{\begin{subarray}{c}d|Q\\\
d>1\end{subarray}}\frac{\mu(d)^{2}}{\phi(d)}\right)^{j}V_{k-2j}(Q,h;r,c(\mathcal{S}_{j+1}),\dots,c(\mathcal{S}_{k-j}))+O_{r,k}(h^{(k-1)/2+\varepsilon}).$

We are finally prepared to appeal to Theorem 1.1. If $k$ is odd, then so is
$k-2j$, so there is no main term. Suppose that $k$ is even. Recall that
$\mathcal{B}(j+1,\dots,k-j)$ denotes the set of perfect matchings of the set
$\\{j+1,\dots,k-j\\}$. Then the main term is

(29) $\displaystyle\sum_{0\leq j\leq
k/2}(-1)^{j}\sum_{\begin{subarray}{c}\mathcal{P}\preceq\\{\mathcal{C}_{\ell}\\}_{\ell\in[1,k]}\\\
\mathcal{P}=\\{\mathcal{S}_{1},\dots,\mathcal{S}_{M}\\}\\\
|\mathcal{S}_{m}|\leq 2\>\forall m\\\
|\mathcal{P}|=k-j\end{subarray}}\left(\frac{h}{r}\sum_{\begin{subarray}{c}d|Q\\\
d>1\end{subarray}}\frac{\mu(d)^{2}}{\phi(d)}\right)^{j}\sum_{\sigma\in\mathcal{B}(j+1,\dots,k-j)}\prod_{(i_{1},i_{2})\in\sigma}V_{2}(Q,h;r,c(\mathcal{S}_{i_{1}}),c(\mathcal{S}_{i_{2}})),$

which proves the first claim in Theorem 1.2.

By Lemma 3.2,
$V_{2}(Q,h;r,c(\mathcal{S}_{i_{1}}),c(\mathcal{S}_{i_{2}}))=O_{r,k}(h)$ unless
$c(\mathcal{S}_{i_{1}})=c(\mathcal{S}_{i_{2}})$. So, the largest term comes
from those $\sigma$ with $c(\mathcal{S}_{i_{1}})=c(\mathcal{S}_{i_{2}})$ for
all $(i_{1},i_{2})\in\sigma$. Note that the error term is then quite large; it
is only smaller by a factor of $(\log h)^{-1}$.

If there exists some $\sigma$ with
$c(\mathcal{S}_{i_{1}})=c(\mathcal{S}_{i_{2}})$ for all
$(i_{1},i_{2})\in\sigma$, then it must be that $|\mathcal{C}_{\ell}|$ is even
for all $\ell$. Moreover, each term in this sum corresponds to a perfect
pairing of $[1,k]$ such that for each pair $(i_{1},i_{2})$,
$c_{i_{1}}=c_{i_{2}}$; either two indices are paired by lying in the same
$\mathcal{S}_{m}$, or by lying in the same element of $\sigma$. The choice of
$\mathcal{P}$ then corresponds to choosing $j$ of these pairs. Note also that
$V_{2}(Q,h;r,c,c)=V_{2}(Q,h;r,c^{\prime},c^{\prime})+O_{r}(h^{1/2+\varepsilon})$
for any $c,c^{\prime}\bmod r$, which allows us to simplify the main term in
this case to get

$\\#\widetilde{\mathcal{B}}(c_{1},\dots,c_{k})\sum_{0\leq j\leq
k/2}(-1)^{j}\binom{k/2}{j}\left(\frac{h}{r}\sum_{\begin{subarray}{c}d|Q\\\
d>1\end{subarray}}\frac{\mu(d)^{2}}{\phi(d)}\right)^{j}V_{2}(Q,h;r,0,0)^{k/2-j},$

where $\\#\widetilde{\mathcal{B}}(c_{1},\dots,c_{k})$ is the number of ways to
pair the $c_{i}$’s such that every pair has equal values. By the binomial
theorem, this is

$\\#\widetilde{\mathcal{B}}(c_{1},\dots,c_{k})\left(V_{2}(Q,h;r,0,0)-\frac{h}{r}\sum_{\begin{subarray}{c}d|Q\\\
d>1\end{subarray}}\frac{\mu(d)^{2}}{\phi(d)}\right)^{k/2}.$

By Lemma 3.2, this is

$\\#\widetilde{\mathcal{B}}(c_{1},\dots,c_{k})\left(-h\frac{\phi(r)}{r}\log
h+C_{0}(r)h\right)^{k/2}+O_{r,k}(h^{(k-1)/2+\varepsilon}),$

for $C_{0}(r)$ defined in (21), which gives the result.

##  5\. Weighting by smooth functions

We now consider sums of singular series weighted by smooth functions and the
proofs of Theorems 1.3 and 1.5. Theorem 1.3 follows arguments identical to
those in the proof of Theorem 1.1 as well as Theorem 1 of [7]. In particular,
all estimates used in bounding $E(\alpha)$ in the proof of Theorem 1 of [7]
hold for the sums $E_{f_{i},h}(\alpha)$ that we consider in the smooth
setting, and the remainder of the proof is identical.

Accordingly, for the proof of Theorem 1.3 we restrict our attention to
relevant estimates of the sums $E_{f_{i},h}(\alpha)$, which is the only place
where the proof differs. These estimates, the equivalents of Lemmas 4 and 6
from [8], are contained in Section 5.1.

Similarly for Theorem 1.5, the proof is identical to that of Theorem 1.2
presented in Section 4, so we omit it. In Section 5.2, we prove Lemma 1.4,
whose proof follows similar lines as the proofs in Section 3.

###  5.1. Exponential sums weighted by smooth functions

######  Lemma 5.1.

Let $m,h\geq 1$, let $f_{1},f_{2}:{\mathbb{R}}\to{\mathbb{R}}$ be a smooth
functions with compact support such that $|\hat{f_{i}}(\xi)|=O(|\xi|^{-2})$,
and define $E_{f_{i},h}$ by (12). Then

(30) $\sum_{\begin{subarray}{c}\mu\bmod m\\\ \mu\neq
0\end{subarray}}E_{f_{1},h}\left(\frac{\mu}{m}\right)E_{f_{2},h}\left(\frac{\mu}{m}\right)\ll_{f_{1},f_{2}}mh^{-2}\min\\{m^{3},h^{3}\\}.$

Moreover, for any $\alpha\in{\mathbb{R}}$,

(31) $\sum_{\begin{subarray}{c}\mu\bmod
m\end{subarray}}E_{f_{1},h}\left(\frac{\mu}{m}+\alpha\right)E_{f_{2},h}\left(\frac{\mu}{m}+\alpha\right)=h^{2}\hat{f}\left(-\frac{h}{m}(\overline{m\alpha})\right)^{2}+O_{f}(mh^{-2}\min\\{m^{3},h^{3}\\}).$

###### Proof.

Begin with the second statement. Expand via (13) to get

$\displaystyle\sum_{\begin{subarray}{c}\mu\bmod m\end{subarray}}$
$\displaystyle
E_{f_{1},h}\left(\frac{\mu}{m}+\alpha\right)E_{f_{2},h}\left(\frac{\mu}{m}+\alpha\right)$
$\displaystyle=h^{2}\sum_{\begin{subarray}{c}\mu\bmod
m\end{subarray}}\hat{f_{1}}(-h(\overline{\mu/m+\alpha}))\hat{f_{2}}(-h(\overline{\mu/m+\alpha}))$
$\displaystyle\qquad+O\Big{(}mh^{-2}+\sum_{\begin{subarray}{c}\mu\bmod
m\end{subarray}}\hat{f}_{1}(-h(\overline{\mu/m+\alpha}))+\hat{f}_{2}(-h(\overline{\mu/m+\alpha}))\Big{)}$
$\displaystyle=h^{2}\sum_{\begin{subarray}{c}\mu\bmod
m\end{subarray}}\hat{f_{1}}(-h\overline{(\mu/m+\alpha)})\hat{f_{2}}(-h\overline{(\mu/m+\alpha)})+O_{f_{1},f_{2}}\left(\min\\{m,m^{2}h^{-2}\\}\right).$

Let $\mu_{0}$ be the value of $\mu$ such that
$\left|\overline{\frac{\mu}{m}+\alpha}\right|$ is minimized; then
$\overline{\frac{\mu}{m}+\alpha}=\overline{m\alpha}/m$. If $m\leq h$, then

$\displaystyle h^{2}\sum_{\begin{subarray}{c}\mu\bmod
m\end{subarray}}\hat{f}_{1}$
$\displaystyle(-h(\overline{\mu/m+\alpha}))\hat{f}_{2}(-h(\overline{\mu/m+\alpha}))$
$\displaystyle=h^{2}\hat{f}_{1}\left(-\frac{h}{m}\overline{m\alpha}\right)\hat{f}_{2}\left(-\frac{h}{m}\overline{m\alpha}\right)+h^{2}\sum_{\begin{subarray}{c}\mu\bmod
m\\\
\mu\neq\mu_{0}\end{subarray}}\hat{f}_{1}(-h(\overline{\mu/m+\alpha}))\hat{f}_{2}(-h(\overline{\mu/m+\alpha}))$
$\displaystyle\ll_{f_{1},f_{2}}h^{2}+O(m^{4}h^{-2}),$

using the fact that $|\hat{f}_{i}(\xi)|=O(|\xi|^{-2})$. On the other hand, if
$m>h$, then

$\displaystyle h^{2}\sum_{\begin{subarray}{c}\mu\bmod
m\end{subarray}}\hat{f}_{1}$
$\displaystyle(-h(\overline{\mu/m+\alpha}))\hat{f}_{2}(-h(\overline{\mu/m+\alpha}))$
$\displaystyle=h^{2}\sum_{\begin{subarray}{c}\mu\bmod m\\\
|\overline{\mu/m+\alpha}|\leq
m/h\end{subarray}}\hat{f}_{1}(-h(\overline{\mu/m+\alpha}))\hat{f}_{2}(-h(\overline{\mu/m+\alpha}))$
$\displaystyle\qquad+h^{2}\sum_{\begin{subarray}{c}\mu\bmod m\\\
|\overline{\mu/m+\alpha}|>m/h\end{subarray}}\hat{f}_{1}(-h(\overline{\mu/m+\alpha}))\hat{f}_{2}(-h(\overline{\mu/m+\alpha}))$
$\displaystyle\ll_{f_{1},f_{2}}h^{2}\frac{m}{h}\hat{f}(0)^{2}+h^{2}\frac{m}{h}$
$\displaystyle\ll_{f_{1},f_{2}}mh,$

as desired.

Equation (30) follows from the proof of (31) for $\alpha=0$ upon excluding the
term $m=0$. ∎

######  Remark.

In the case of analogous exponential sums in the function field case of
polynomials over $\mathbf{F}_{q}[t]$, as explored in [4], the sum analogous to
$\sum_{\mu\bmod m}E\left(\frac{\mu}{m}+\alpha\right)^{2}$ can be bounded by
the analog of $mh$ _whenever_ $\alpha$ is large, i.e. whenever $\alpha$ is a
rational function of sufficiently large degree (see Lemma 3.4 of [4]). The
equivalent statement here would be that $\sum_{\mu\bmod
m}E\left(\frac{\mu}{m}+\alpha\right)^{2}$ is bounded by $mh$ whenever $\alpha$
is far away from an integer. However, this is not true: if $m$ is even and
$\alpha$ is very close to $\frac{1}{2}$, say, then this sum will still have a
contribution of size $h^{2}$.

In the function field case of [4], the simplified and stronger bounds
correspondingly yield a simplified proof of the analog of Theorem 1.3. The
smooth weights $f_{i}$ make the exponential sums here cleaner, but because the
function field-style bounds are not available for the sums in Lemma 5.1, the
simplified proof of the analog of Theorem 1.3 in the function field case also
fails to apply.

The following lemma corresponds to Lemma 6 of Montgomery and Vaughan’s work.

######  Lemma 5.2.

Let $f_{1},f_{2}:{\mathbb{R}}\to{\mathbb{R}}$ be smooth functions with compact
support such that $|\hat{f_{i}}(\xi)|=O(|\xi|^{-2})$, and define $E_{f_{i},h}$
by (12). Fix $\alpha_{1},\alpha_{2}\in{\mathbb{R}}$. Then

(32) $\sum_{\begin{subarray}{c}\mu\bmod
m\end{subarray}}E_{f_{1},h}\left(\frac{\mu}{m}+\alpha_{1}\right)E_{f_{2},h}\left(\frac{\mu}{m}+\alpha_{2}\right)\ll(m+h)E_{f_{1}\overline{f_{2}}}(\alpha_{1}-\alpha_{2})+O(m).$

###### Proof.

By Lemma 3 from [8],

$\displaystyle\sum_{\mu\bmod m}$ $\displaystyle
E_{f_{1},h}\left(\frac{\mu}{m}+\alpha_{1}\right)E_{f_{2},h}\left(\frac{\mu}{m}+\alpha_{2}\right)$
$\displaystyle=\sum_{\mu\bmod
m}h^{2}\hat{f_{1}}\left(-h\frac{\mu}{m}-h\alpha_{1}\right)\hat{f_{2}}\left(-h\frac{\mu}{m}-h\alpha_{2}\right)+O(m)$
$\displaystyle\ll(m+h)\int_{-\infty}^{\infty}\hat{f_{1}}(-ht-h\alpha_{1})\hat{f_{2}}(-ht-h\alpha_{2})h^{2}\mathrm{d}t+O(m),$

keeping in mind that $f_{i}(x)\asymp f_{i}(y)$ whenever $|x-y|\leq 1/h$. The
integral is the convolution of $\hat{f_{1}}$ and $\hat{f_{2}}$:

$\displaystyle(m+h)\int_{-\infty}^{\infty}\hat{f_{1}}(-ht-h\alpha_{1})\hat{f_{2}}(-ht-h\alpha_{2})h^{2}\mathrm{d}t$
$\displaystyle=(m+h)h\int_{-\infty}^{\infty}\hat{f_{1}}(u)\hat{f_{2}}(u+h\alpha_{1}-h\alpha_{2})\mathrm{d}u$
$\displaystyle=(m+h)h\hat{f_{1}}\ast\hat{\overline{f_{2}}}(h\alpha_{2}-h\alpha_{1})k$
$\displaystyle=(m+h)E_{f_{1}\overline{f_{2}},h}(\alpha_{1}-\alpha_{2})+O(m/h),$

which yields the desired bound. ∎

######  Remark.

The bound in Lemma 5.2 improves on the analogous lemma in [8] by a factor of
$\log h$. However, the improvement in this lemma does not affect the error
term in Theorem 1.3.

###  5.2. Proof of Lemma 1.4

######  Lemma 5.3.

Fix $h\geq 1$, and let $f:{\mathbb{R}}_{\geq 0}\to{\mathbb{C}}$ be a smooth
function with compact support $\mathrm{supp}(f)\subset(0,\infty)$ and such
that $|\hat{f}(\xi)|\ll O(|\xi|^{-2})$. Define

$S(f,h):=\sum_{m=1}^{\infty}f\left(\frac{m}{h}\right)\mathfrak{S}(\\{0,m\\}).$

Then

$S(f,h)=\\{\mathcal{M}f\\}(2)h-\frac{\\{\mathcal{M}f^{\prime}\\}(1)}{2}\log
h+\frac{\\{\mathcal{M}f^{\prime}\\}(1)}{2}\left(\gamma_{0}-\log
2\pi-\frac{\\{\mathcal{M}f^{\prime\prime}\\}}{\\{\mathcal{M}f^{\prime}\\}(1)}\right)+O_{f}(h^{-1/2+\varepsilon}),$

where $\gamma_{0}$ denotes the Euler–Mascheroni constant and for a function
$g$, $\\{\mathcal{M}g\\}(s)$ is the Mellin transform of $g$ defined in (15).

###### Proof.

The proof proceeds almost entirely along the lines of Proposition 2.1 in [5],
so we will be brief. Define for $\mathrm{Re}(s)>1$

$F(s):=\sum_{n\geq 1}\frac{\mathfrak{S}(\\{0,n\\})}{n^{s}},$

so that

(33) $S(f,h)=\frac{1}{2\pi
i}\int_{(2)}F(s)h^{s}\\{\mathcal{M}f\\}(s)\mathrm{d}s.$

As noted in [5] and [7], $F(s)$ admits a meromorphic continuation to
$\mathrm{Re}(s)>-1/2$ via

$F(s)=\zeta(s)\zeta(s+1)\prod_{p\text{
prime}}\left(1-\frac{1-1/p^{s})^{2}}{(p-1)^{2}}\right).$

Since $f$ is smooth and has compact support, $\\{\mathcal{M}f\\}(s)$ is
analytic in $\mathrm{Re}(s)>0$. It can be extended meromorphically to the
complex plane via the identity

$\\{\mathcal{M}f\\}=-\frac{1}{s}\\{\mathcal{M}f^{\prime}\\},$

which follows from integration by parts. Thus $\\{\mathcal{M}f\\}(s)$ has
simple poles at all nonpositive integers and no other poles.

The result follows from moving the line of integration in (33) to
$\mathrm{Re}(s)=-1/2+\varepsilon$ and recording the contributions from the
simple pole at $s=1$ and the double pole at $s=0$. ∎

We are now ready to prove Lemma 1.4.

###### Proof.

Begin by expanding

$\displaystyle V_{2}$ $\displaystyle(Q,h;f_{1},f_{2})$
$\displaystyle=-E_{f_{1},h}(1)E_{f_{2},h}(1)+\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}\sum_{\begin{subarray}{c}1\leq
a\leq q\\\
(a,q)=1\end{subarray}}E_{f_{1},h}\left(\frac{a}{q}\right)E_{f_{2},h}\left(-\frac{a}{q}\right)$
$\displaystyle=-h^{2}\hat{f_{1}}(0)\hat{f_{2}}(0)+O_{f_{1},f_{2}}(1)$
$\displaystyle\qquad+\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}\sum_{\begin{subarray}{c}1\leq
a\leq q\\\
(a,q)=1\end{subarray}}\sum_{m_{1},m_{2}=1}^{\infty}f_{1}\left(\frac{m_{1}}{h}\right)f_{2}\left(-\frac{m_{2}}{h}\right)e\left((m_{1}-m_{2})\frac{a}{q}\right)$
$\displaystyle=-h^{2}\hat{f_{1}}(0)\hat{f_{2}}(0)+O_{f_{1},f_{2}}(1)+\sum_{m_{1},m_{2}=1}^{\infty}f_{1}\left(\frac{m_{1}}{h}\right)f_{2}\left(-\frac{m_{2}}{h}\right)\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}\mathbf{c}_{q}(m_{1}-m-2),$

where $\mathbf{c}_{q}(m)$ is a Ramanujan sum. Just as for the arithmetic
progressions case, this simplifies to

$\displaystyle=-h^{2}\hat{f_{1}}(0)\hat{f_{2}}(0)+\sum_{\begin{subarray}{c}m_{1},m_{2}=1\\\
m_{1}\neq
m_{2}\end{subarray}}^{\infty}f_{1}\left(\frac{m_{1}}{h}\right)f_{2}\left(-\frac{m_{2}}{h}\right)\mathfrak{S}(\\{0,m_{1}-m_{2}\\})$
$\displaystyle\qquad+\sum_{m=1}^{\infty}f_{1}\left(\frac{m}{h}\right)f_{2}\left(-\frac{m}{h}\right)+O_{f_{1},f_{2}}(1),$

since for any $m\neq 0$, by our choice of $Q$,

$\sum_{q|Q}\frac{\mu(q)^{2}}{\phi(q)^{2}}\mathbf{c}_{q}(m)=\prod_{p|m}\left(1+\frac{1}{p-1}\right)\prod_{p\nmid
m}\left(1-\frac{1}{(p-1)^{2}}\right)=\mathfrak{S}(\\{0,m\\})+O(h^{-2}).$

The sum over $m$ can be interpreted as a Riemann sum as $h\to\infty$, yielding

$\displaystyle\sum_{m=1}^{\infty}f_{1}\left(\frac{m}{h}\right)f_{2}\left(-\frac{m}{h}\right)$
$\displaystyle=h\int_{0}^{\infty}f_{1}(x)f_{2}(-x)\mathrm{d}x+O_{f_{1},f_{2}}(1)$
$\displaystyle=h(f_{1}\ast f_{2})(0)+O_{f_{1},f_{2}}(1).$

Similarly, the sum over $m_{1}$ and $m_{2}$ can also be interpreted as a
Riemann integral (and also as the convolution of $f_{1}$ and $f_{2}$),
yielding

$\displaystyle\sum_{\begin{subarray}{c}m_{1},m_{2}=1\\\ m_{1}\neq
m_{2}\end{subarray}}^{\infty}$ $\displaystyle
f_{1}\left(\frac{m_{1}}{h}\right)f_{2}\left(-\frac{m_{2}}{h}\right)\mathfrak{S}(\\{0,m_{1}-m_{2}\\})$
$\displaystyle=\sum_{m=1}^{\infty}\mathfrak{S}(\\{0,m\\})\sum_{n=1}^{\infty}\left(f_{1}\left(\frac{n}{h}\right)f_{2}\left(\frac{m-n}{h}\right)+f_{1}\left(\frac{n}{h}\right)f_{2}\left(\frac{-m-n}{h}\right)\right)$
$\displaystyle=\sum_{m=1}^{\infty}\mathfrak{S}(\\{0,m\\})h\left((f_{1}\ast
f_{2})\left(\frac{m}{h}\right)\right)+O_{f_{1},f_{2}}\left(\sum_{m=1}^{Ch}\mathfrak{S}(\\{0,m\\})\right),$

where $C$ is a constant large enough that $f_{1}(x)=f_{2}(x)=0$ for any
$|x|\geq C/2$; note that $C$ depends only on $f_{1}$ and $f_{2}$. By the
results of [1] and [7], the error term is $O_{f_{1},f_{2}}(h)$. For the inside
sum, apply Lemma 5.3 with $f=f_{1}\ast f_{2}$ to get

$\displaystyle\sum_{\begin{subarray}{c}m_{1},m_{2}=1\\\ m_{1}\neq
m_{2}\end{subarray}}^{\infty}$ $\displaystyle
f_{1}\left(\frac{m_{1}}{h}\right)f_{2}\left(-\frac{m_{2}}{h}\right)\mathfrak{S}(\\{0,m_{1}-m_{2}\\})$
$\displaystyle=\\{\mathcal{M}f\\}(2)h^{2}-\frac{\\{\mathcal{M}f^{\prime}\\}(1)}{2}h\log
h+O_{f_{1},f_{2}}(h),$

which, after collecting terms, implies the result. ∎

## References

  * [1] P. X. Gallagher, _On the distribution of primes in short intervals_ , Mathematika 23 (1976), no. 1, 4–9. MR 409385
  * [2] D. A. Goldston, _Linnik’s theorem on Goldbach numbers in short intervals_ , Glasgow Math. J. 32 (1990), no. 3, 285–297. MR 1073669
  * [3] A. Granville and K. Soundararajan, _Sieving and the Erdős-Kac theorem_ , Equidistribution in number theory, an introduction, NATO Sci. Ser. II Math. Phys. Chem., vol. 237, Springer, Dordrecht, 2007, pp. 15–27. MR 2290492
  * [4] V. Kuperberg, _Odd moments in the distribution of primes_ , arXiv:2109.03767, 2021.
  * [5] 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
  * [6] 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
  * [7] by same author, _Primes in short intervals_ , Comm. Math. Phys. 252 (2004), no. 1-3, 589–617. MR 2104891
  * [8] 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