The relative Selberg integral and its two factor scales
DefinitionErdos462SelbergFor the Chebyshev function , put . The published estimate bounds this quantity for and . The two-scale estimate specializes to and .
import Mathlib.NumberTheory.LSeries.RiemannZeta
import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic
import Mathlib.NumberTheory.Chebyshev
namespace Erdos462RH
noncomputable def squareError (d v : ℝ) : ℝ :=
(Chebyshev.theta ((1+d)*v) - Chebyshev.theta v - d*v)^2
noncomputable def Jtheta (Y d : ℝ) : ℝ := ∫ v in (1 : ℝ)..Y, squareError d v
def SelbergBound : Prop :=
∀ Y d : ℝ, 10^13 ≤ Y → 0 < d → d ≤ 1/10^13 →
Jtheta Y d ≤ (25571/10000 : ℝ) * d * Y^2 * Real.log ((20001/10000 : ℝ)/d)^2
noncomputable def delta (N : ℝ) : ℝ := 512*(Real.log N)^2/N
def TwoScaleBound : Prop := ∀ N : ℝ, 9797*10^15 ≤ N →
∀ Y ∈ ({2*N, 2*N/3} : Set ℝ),
Jtheta Y (delta N) ≤ 3*(delta N)*Y^2*(Real.log N)^2
end Erdos462RH
Read-back
What the Lean code literally says, in plain math · OpenAI Codex (GPT-6 family, independent agent)
Squared error. For all real and , the squared error is , where sums the natural logarithms of the positive primes at most . The sum is zero for . Both arguments may be zero or negative, and .
Integrated squared error. For all real and , define , where is the sum of the natural logarithms of all positive primes at most , with an empty sum equal to zero. This is the oriented interval integral with respect to Lebesgue measure. Its value is zero for , and for it is the negative of the integral of the same integrand from to . The definition includes , when the integrand is identically zero.
Selberg bound. This is the proposition that for every pair of real numbers with and , one has . Here is the sum of over the positive primes , the logarithms are natural, and the integral is with respect to Lebesgue measure.
Relative increment. For every real , define . The real logarithm used here equals for and has value zero at zero. Real division by zero has value zero here, so as well.
Two-scale bound. This is the proposition that for every real and every real , writing , one has . Here is the sum of over the positive primes , the logarithms are natural, and the integral is with respect to Lebesgue measure.