Prime sums: main amount, expected value and total remainder
New.Reduction.PrimeSums.lean
Reading
Upstream documentation written by Claude
For admissible data
Dthis file defines the main amount (D.mainAmount), the expected values_main(D.mainPrimeSum) and the total remainderrem(D.totalRemainder). It expresses the total remainder through the remaindersR_qof prime sums (totalRemainder_eq) and boundss_fin,s_∞, the direction amount and the main amount (primeSum_le,jetSize_mem_Icc,directionAmount_mem_Icc,le_mainAmount). The modulusq₀isP.q₀.
Copyright 2026 Anthropic, PBC. Apache License 2.0 · Upstream notice.
Rest of upstream introduction
Notions from other files:
lambdaKResidueClass d q nisΛ_K(n) = Λ(n) (1 - chiK d n)ifn ≡ 1moduloq, and0otherwise;Λis the von Mangoldt function andchiK dis the Legendre symbol(·/d).primeRemainder d q zisR_q(z) = ∑_{n ≤ z} λ(n) (1 / n - 1 / z) - log z / φ(q) - c_qwithλ = lambdaKResidueClass d qandc_q = (logDerivMean d q 1).re. The functionlogDerivMean d qis(∑_ψ (L'/L(quadTwist ψ d) - L'/L(ψ)) - 1) / φ(q), summed over the Dirichlet charactersψmoduloq, whereL = entireLis theL-function made entire.D.Φis the group of theD.finfinite places;D.aPlaces(Φ_a, thea-places) are those≡ 1moduloq₀, andD.bPlaces(Φ_b, theb-places) is a set of places≡ -1moduloq₀. The class of a place moduloq₀is its image underP.placeClass, and-n τstands forD.placeOfInt (-n) * τ. The weightκ = D.weightisb = a / xonΦ_banda / x₁elsewhere.D.primeSum y τiss_fin(y, τ) = ∑_{n ≤ a} Λ_K(n) (y / n - κ(-n τ))₊.D.jetSize jiss_∞(j) = log j! + j log (M / Ω)withM = D.MandΩ = P.bigOmega D.towerExp, and the direction amountD.directionAmountis∑_τ (s_∞(κ(τ)) - s_fin(κ(τ), τ)).
Declarations
lemma le_mainAmount : D.x ^ 4 * D.f * D.a ≤ D.mainAmount
Import route to Main
New.Reduction.PrimeSums → New.UpperBound.Size.ArchimedeanSize (pinned import) → New.Determinant.Twist.LongForms (pinned import) → New.Reduction.MainInequality (pinned import) → New.Reduction.OneSidedBound (pinned import) → New.Main (pinned import) → Main (pinned import)