Ramanujan sums and the singular series of the three primes problem
DefinitionVino_ramanujananalytic-number-theorycircle-methodnumber-theorysingular-series
Ramanujan's sum is the complete exponential sum over reduced residues,
It is the local object attached to the modulus : multiplicative in , periodic in modulo , and bounded by .
The singular series of the three primes problem is built from it. Its -th term is
and the two truncations recorded here are the sum over the divisors of a modulus ,
and the sum over . For squarefree the first factors as a product of local densities
which is the shape in which the singular series is usually quoted. The factor at vanishes precisely when is even; that is the parity obstruction of the three primes theorem.
Definition code
import Definitions.Def_CircleMethod_char
import Mathlib.NumberTheory.ArithmeticFunction.Moebius
import Mathlib.Algebra.BigOperators.Group.Finset.Basic
namespace Vino
/-- Ramanujan's sum `c_q(n) = ∑_{a < q, (a,q) = 1} e(an/q)`. -/
noncomputable def ramanujan (q : ℕ) (n : ℤ) : ℂ :=
∑ a ∈ (Finset.range q).filter (fun a => Nat.Coprime a q),
CircleMethod.e ((a : ℝ) * (n : ℝ) / (q : ℝ))
/-- The local factor at a prime `p` of the singular series of the three primes
problem: `1 - (p-1)^{-2}` if `p ∣ n`, and `1 + (p-1)^{-3}` otherwise. -/
noncomputable def threePrimeFactor (p : ℕ) (n : ℤ) : ℝ :=
if (p : ℤ) ∣ n then 1 - 1 / ((p : ℝ) - 1) ^ 2 else 1 + 1 / ((p : ℝ) - 1) ^ 3
/-- The `q`-th term of the singular series of the three primes problem,
`μ(q) c_q(n) / φ(q)^3`. -/
noncomputable def singTerm (q : ℕ) (n : ℤ) : ℂ :=
((ArithmeticFunction.moebius q : ℤ) : ℂ) * ramanujan q n / ((Nat.totient q : ℂ)) ^ 3
/-- The singular series of the three primes problem truncated to the divisors of
a modulus `Q`: `𝔖_Q(n) = ∑_{q ∣ Q} μ(q) c_q(n) / φ(q)^3`. -/
noncomputable def singSeriesDvd (Q : ℕ) (n : ℤ) : ℂ :=
∑ q ∈ Q.divisors, singTerm q n
/-- The singular series of the three primes problem truncated at `Q`:
`𝔖_{<Q}(n) = ∑_{1 ≤ q < Q} μ(q) c_q(n) / φ(q)^3`. -/
noncomputable def singSeriesTrunc (Q : ℕ) (n : ℤ) : ℂ :=
∑ q ∈ Finset.Ico 1 Q, singTerm q n
end Vino
Source
R. C. Vaughan, The Hardy-Littlewood Method, 2nd ed., Cambridge Tracts in Mathematics 125, Cambridge University Press, 1997, Chapter 3, Section 3.2; G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 6th ed., Oxford University Press, 2008, Section 16.6 (Ramanujan's sum).