RH Lean Explorer Sernau readable · Comparator passedChecked

Readable edition · 803 Lean files

The prime number theorem for the remainders `R_q`

New.Reduction.Zeros.PrimeNumberTheorem.lean

Open interactive viewer Raw Lean source · Pinned source

Reading

Upstream documentation written by Claude

Let d be a prime and q ≥ 1. The remainder R_q(y) is an integral of the error 𝓔_q(t) in the weighted count (primeRemainder_eq_integral_countError_sub), so it varies slowly. For odd d prime to q its absolute value is at most (log y) ^ (-B) for all large y, for every natural number B; so it tends to 0, which characterises the constant c_q in its definition.

Copyright 2026 Anthropic, PBC. Apache License 2.0 · Upstream notice.

Rest of upstream introduction

Rest of upstream introduction

Notions from other files:

  • lambdaKResidueClass d q n is λ(n) = Λ(n) (1 - (n/d)) for n ≡ 1 mod q, and 0 for other n.
  • entireL ψ is L(s, ψ), multiplied by s - 1 if ψ is principal; quadTwist ψ d is the product of ψ and the Legendre symbol (·/d).
  • logDerivMean d q is the function G_q that continues ∑ λ(n) n ^ (-s) - s / (φ(q) (s - 1)) when d is odd and prime to q.
  • primeRemainder d q y is R_q(y) = ∑_{n ≤ y} λ(n) (1/n - 1/y) - log y / φ(q) - c_q with c_q = re G_q(1).

Relation to the literature

Known result: Prime number theorem in arithmetic progressions with an error term that saves every power of the logarithm. It is a case of the Siegel–Walfisz theorem. Source: Montgomery and Vaughan, Multiplicative Number Theory I, 2007, Cor. 11.19. Form here: the modulus is fixed, and the count is the smoothed sum ∑_{n ≤ y} λ(n) (1/n - 1/y) over the prime powers n ≡ 1 mod q; for d ≡ 3 mod 4 the primes that split in ℚ(√-d) have weight zero.

Pinned source lines

Declarations

Import route to Main

New.Reduction.Zeros.PrimeNumberTheorem → New.Reduction.OneSidedBound (pinned import) → New.Main (pinned import) → Main (pinned import)

X Reddit Email LinkedIn