Siegel–Walfisz vocabulary: , the zero-free region and exceptional sets
DefinitionDavenport_siegelWalfiszThe vocabulary for the Siegel–Walfisz theorem and the results of Davenport §§14, 18, 20–22 leading to it. Throughout, is the von Mangoldt function, a Dirichlet character modulo with complex values, and Mathlib's analytically continued Dirichlet -function (DirichletCharacter.LFunction). The character-twisted sum is the platform definition Vino.vmSumChar.
psiAP N q ais the progression sum
Davenport's (§20, first sentence) with the summation range rather than — the convention of Vino.vmSumChar and ThreePrimes.SiegelWalfisz; the two differ by the single term .
-
regionBoundary c q sis the number andInRegion c q sis the closed condition : the classical zero-free region of Davenport §14 with constant . -
IsExceptionalSet c χ Esays that is an admissible exceptional set for with respect to the region constant : has at most one element; every element of is a real zero of lying in the region, and such an element can exist only if is a real (quadratic) non-principal character; and at every point of the region outside . This packages the conclusion of Davenport §14 ("at most one exceptional real zero, and only for real ") as a predicate, so that the §20 estimate can be stated for an arbitrary region constant. Simplicity of the exceptional zero is asserted separately in the §14 theorem.
/-
# Siegel–Walfisz: vocabulary (Davenport, *Multiplicative Number Theory*, 3rd ed., §§14, 18–22)
This file fixes the objects used to state the Siegel–Walfisz theorem and the results of
Davenport §§14, 18, 20, 21 that lead to it. The character-twisted sum
`ψ(N, χ) = ∑_{n < N} Λ(n) χ(n)` is `Vino.vmSumChar q χ N` (platform definition
`Vino_dirichlet`), and `L(s, χ)` is Mathlib's `DirichletCharacter.LFunction`.
Convention: sums are over `n < N` with `N : ℕ` (as in `Vino.vmSumChar` and
`ThreePrimes.SiegelWalfisz`); Davenport sums over `n ≤ x`. The two differ by the single
term `Λ(N) ≤ log N`, which is negligible against every error term below.
-/
import Definitions.Def_Vino_dirichlet
import Mathlib.NumberTheory.LSeries.DirichletContinuation
import Mathlib.NumberTheory.ArithmeticFunction.VonMangoldt
import Mathlib.NumberTheory.DirichletCharacter.Basic
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Analysis.SpecialFunctions.Log.Basic
import Mathlib.Data.Nat.Totient
open Finset
namespace Davenport
/-- `ψ(N; q, a) = ∑_{n < N, n ≡ a (mod q)} Λ(n)`, the von Mangoldt sum over an arithmetic
progression (Davenport §20, first sentence, with `n ≤ x` replaced by `n < N`). -/
noncomputable def psiAP (N q a : ℕ) : ℝ :=
∑ n ∈ range N,
if (n : ZMod q) = (a : ZMod q) then (ArithmeticFunction.vonMangoldt n : ℝ) else 0
/-- The boundary `1 - c / log (q (|t| + 2))` of the classical zero-free region for
`L(s, χ)`, `χ` a character modulo `q`, at height `t = Im s` (Davenport §14). -/
noncomputable def regionBoundary (c : ℝ) (q : ℕ) (s : ℂ) : ℝ :=
1 - c / Real.log ((q : ℝ) * (|s.im| + 2))
/-- `s` lies in the closed region `Re s ≥ 1 - c / log (q (|Im s| + 2))`. -/
def InRegion (c : ℝ) (q : ℕ) (s : ℂ) : Prop := regionBoundary c q s ≤ s.re
/-- `E` is an *exceptional set* for `χ` (modulo `q`) with respect to the region constant `c`:
`E` has at most one element; every element of `E` is a real zero of `L(·, χ)` in `(0, 1)` lying
in the region, and such an element can exist only when `χ` is a real (quadratic) non-principal
character;
and `L(s, χ) ≠ 0` at every `s ≠ 1` of the region `Re s ≥ 1 - c / log (q (|Im s| + 2))`
outside `E`. (Davenport §14: "at most one exceptional real zero".) -/
def IsExceptionalSet {q : ℕ} [NeZero q] (c : ℝ) (χ : DirichletCharacter ℂ q) (E : Set ℂ) :
Prop :=
E.Subsingleton ∧
(∀ z ∈ E, z.im = 0 ∧ 0 < z.re ∧ z.re < 1 ∧ InRegion c q z ∧
DirichletCharacter.LFunction χ z = 0 ∧ χ.IsQuadratic ∧ χ ≠ 1) ∧
∀ s : ℂ, s ≠ 1 → InRegion c q s → s ∉ E → DirichletCharacter.LFunction χ s ≠ 0
end Davenport
Read-back
What the Lean code literally says, in plain math · claude-opus-4-8
Davenport.psiAP
psiAP takes three natural-number arguments , , and returns the real number
where is the von Mangoldt function ( when is a positive power of a prime , and otherwise, in particular ), its value being coerced from the extended-real/real-valued arithmetic function into . The index runs over the finite range : the lower endpoint is included and the upper endpoint is excluded, so the sum is over strictly, and gives the empty sum . The congruence test is performed by reducing both and from into and asking for equality there; consequently is not required to lie in (it is reduced modulo ), and no coprimality hypothesis is imposed anywhere — may share a factor with , or be . Two degenerate moduli are silently included. If then is and the test becomes the equality of integers , so the sum collapses to the single term when and to when . If then is trivial, the test always succeeds, and the sum is , i.e. the full Chebyshev sum over with no congruence restriction at all. There is no hypothesis , , or any relation between , and .
Davenport.regionBoundary
regionBoundary takes a real number , a natural number and a complex number , and returns the real number
where is coerced from to and the logarithm is the real logarithm. The value depends on only through ; the real part of plays no role in the formula. The argument of the logarithm is with , which is and hence never negative. Edge cases arising from total-function conventions: if the argument of the logarithm is , the convention applies, and division by yields , so for every and every . If then , so the logarithm is strictly positive and no division by zero occurs; in that case when , when , and when . No hypothesis constrains to be positive, small, or nonzero, and no hypothesis constrains .
Davenport.InRegion
InRegion takes a real number , a natural number and a complex number and is the proposition
that is, with the boundary value of the previous definition. The inequality is non-strict, so points exactly on the boundary curve belong to the region, and the region is unbounded to the right: every with sufficiently large real part qualifies, and there is no upper restriction on and no restriction on . Since ignores , the region is the set of with . Degenerate readings follow from regionBoundary: when the condition is exactly ; when and the condition is again exactly ; when and the condition is strictly stronger than , namely ; only for and does the region reach to the left of the line . Nothing here requires to be small, so for large the boundary may lie far to the left of and the region may include points with negative real part.
Davenport.IsExceptionalSet
IsExceptionalSet takes an implicit natural number together with the typeclass assumption that is nonzero (so ; the case is excluded here, though is not), an explicit real number , a Dirichlet character modulo with values in , and a set ; it is the conjunction of the following three statements.
-
has at most one element (it may be empty; it is not required to be nonempty).
-
Every satisfies all seven of: (so is real); ; (both inequalities strict, so lies strictly inside the interval of the real axis); lies in the region of the previous definition, i.e. , which for such a (having ) reads ; the analytically continued Dirichlet -function satisfies ; the character is quadratic (each of its values is , or ); and is not the trivial character modulo . Note that the last two conditions concern alone but sit inside the quantifier over , so they are asserted only when is nonempty: if this entire clause holds vacuously and may be trivial or non-quadratic.
-
For every complex with , if lies in the region () and , then . The point is exempted unconditionally, whether or not it belongs to ; every other point of the region that is not the single possible member of is asserted to be a non-zero of , including points with and points arbitrarily far to the right or with arbitrarily large imaginary part.
Several consequences of the literal statement are worth making explicit. There is no hypothesis on at all: if (or, more generally, whenever the region contains no point with real part , which by the analysis above happens for every since forces ), clause 2 cannot be satisfied by any , so clause 1–2 force and the definition reduces to the assertion that for all with . Similarly, when the only character modulo is the trivial one, so the requirement in clause 2 fails and is again forced to be empty. The definition does not assert that an exceptional set exists, nor that it is unique, nor that is nonempty when is quadratic; it is a predicate that a given may or may not satisfy, and satisfies clauses 1 and 2 automatically. Nothing requires the element of (when present) to be a simple zero, nor forbids other zeros of outside the region, nor says anything about zeros at . Finally, is only constrained through clause 2 (hence only when ); no primitivity, no non-triviality and no quadraticity is assumed of as a standing hypothesis of the definition.
Confirmed by the mission captain (proposal self-audit).