Adapted from Charlie Dorsey’s Apache-2.0 Weil Bounds Toolkit for Lean Pool’s module system, Mathlib version, quality requirements and compilation performance.
CRT factorization and Fourier completion #
Exact Bézout/CRT factorization, reduced-modulus bounds, sharp centered Fourier completion and weighted partial summation. The underlying techniques are standard; see Iwaniec–Kowalski (2004), Ch. 12 §12.2, for completion methods. The declared hypotheses govern each estimate.
CRT region: exact unit-sum splitting via the chosen Bézout coefficients; standard CRT, locally proved. No additional analytic hypothesis is hidden here.
The Bezout coefficient of n in the identity for the coprime pair m, n.
Equations
- KloostermanWeil.crtLeftCoeff m n = n.gcdA m
Instances For
The Bezout coefficient of m in the identity for the coprime pair m, n.
Equations
- KloostermanWeil.crtRightCoeff m n = n.gcdB m
Instances For
The standard additive character of b*x + a/x, summed over residue-class units.
Equations
- KloostermanWeil.kloostermanUnitSum N a b = ∑ x : (ZMod N)ˣ, ZMod.stdAddChar (b * ↑x + a * ↑x⁻¹)
Instances For
The Chinese remainder equivalence on unit groups of coprime residue rings.
Equations
Instances For
Reduction region: bound for a source-defined reduced modulus/sum. No theorem here identifies that reduced sum with a full-modulus sum.
The common divisor removed from the numerator and modulus.
Equations
- KloostermanWeil.reducedDivisor A q = A.gcd q
Instances For
The modulus after division by gcd(A, q).
Equations
Instances For
The numerator after division by gcd(A, q).
Equations
Instances For
Completion region: character orthogonality, full finite DFT and sharp interval Fourier completion; method context [IwaniecKowalski2004].
Identify units with the subtype of elements satisfying IsUnit.
Equations
Instances For
The reciprocal additive phase on units, extended by zero on nonunits.
Equations
- KloostermanWeil.reciprocalPhase N a x = if IsUnit x then ZMod.stdAddChar (a * x⁻¹) else 0
Instances For
The average of the reciprocal phase over all residue classes.
Equations
- KloostermanWeil.reciprocalMean N a = (↑N)⁻¹ * ∑ x : ZMod N, KloostermanWeil.reciprocalPhase N a x
Instances For
Subtract the full residue-class average from the reciprocal phase.
Equations
Instances For
The additive-character sum over L consecutive residue classes starting at x.
Equations
- KloostermanWeil.intervalCharacterKernel N h x L = ∑ j ∈ Finset.range L, ZMod.stdAddChar (h * (x + ↑j))
Instances For
Sum the mean-centered reciprocal phase along a consecutive interval.
Equations
- KloostermanWeil.centeredIntervalSum N a x L = ∑ j ∈ Finset.range L, KloostermanWeil.centeredReciprocalPhase N a (x + ↑j)
Instances For
Finite Fourier completion for any mean-zero function, using only a uniform bound on its nonzero Fourier coefficients.
Centered incomplete reciprocal-phase completion at the reduced squarefree modulus.
The interval length is unrestricted. The PrimeNondegenerateWeil premise is proved in
LeanPool.KloostermanWeil.Weil.PrimeKloosterman.
Weighted region: discrete partial summation with reciprocal weights, an explicit consequence of the preceding centered interval bound.
The reciprocal weight 1 / (Y + i), viewed as a complex number.
Equations
- KloostermanWeil.reciprocalNatWeight Y i = ↑(↑(Y + i))⁻¹
Instances For
Discrete partial summation for reciprocal weights. A uniform bound C on all initial partial sums over a consecutive interval starting at Y>0 gives an explicit 2C/Y weighted bound.
The centered reciprocal-phase interval sum with weights 1 / (Y + j).
Equations
- KloostermanWeil.weightedCenteredIntervalSum N a x Y L = ∑ j ∈ Finset.range L, KloostermanWeil.centeredReciprocalPhase N a (x + ↑j) * KloostermanWeil.reciprocalNatWeight Y j
Instances For
Partial summation applied to the centered reduced-modulus completion. The interval length remains unrestricted.