Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Soundness of the height-509 Riemann–Siegel checker

Proved
RS5.check5_sound

by Johan Mercedes · Oct 28, 2026 · Mathlib 0df444a (Lean v4.33.1)

arda-rh65k-transfernumber-theoryriemann-zeta

Let ccc be a valid fixed-point configuration at height ttt and order KKK, with precision PPP. Let zzz be a certificate whose Boolean checker returns true, and write N,zlo,zhiN,z_{\rm lo},z_{\rm hi}N,zlo​,zhi​ for its stored fields. Set a=t/(2π)a=\sqrt{t/(2\pi)}a=t/(2π)​, p=a−⌊a⌋Np=a-\lfloor a\rfloor_{\mathbb N}p=a−⌊a⌋N​, and θmain=t2log⁡t−t2log⁡(2π)−t2−π8\theta_{\rm main}=\frac t2\log t-\frac t2\log(2\pi)-\frac t2-\frac\pi8θmain​=2t​logt−2t​log(2π)−2t​−8π​. Let

Zmain(t,ϕ)=2∑n=1⌊a⌋n−1/2cos⁡(ϕ−tlog⁡n)+(−1)⌊a⌋+1(t2π)−1/4cos⁡(2π(p2−p−1/16))cos⁡(2πp).Z_{\rm main}(t,\phi)=2\sum_{n=1}^{\lfloor a\rfloor}n^{-1/2}\cos(\phi-t\log n) +(-1)^{\lfloor a\rfloor+1}\left(\frac{t}{2\pi}\right)^{-1/4} \frac{\cos(2\pi(p^2-p-1/16))}{\cos(2\pi p)}.Zmain​(t,ϕ)=2n=1∑⌊a⌋​n−1/2cos(ϕ−tlogn)+(−1)⌊a⌋+1(2πt​)−1/4cos(2πp)cos(2π(p2−p−1/16))​.

Then t≥509t\ge509t≥509, N=⌊a⌋NN=\lfloor a\rfloor_{\mathbb N}N=⌊a⌋N​, p>0p>0p>0, and cos⁡(2πp)≠0\cos(2\pi p)\ne0cos(2πp)=0. For every real ϕ\phiϕ with ∣ϕ−θmain∣≤1/t|\phi-\theta_{\rm main}|\le1/t∣ϕ−θmain​∣≤1/t,

zlo22P≤Zmain(t,ϕ)≤zhi22P.\frac{z_{\rm lo}}{2^{2P}}\le Z_{\rm main}(t,\phi)\le \frac{z_{\rm hi}}{2^{2P}}.22Pzlo​​≤Zmain​(t,ϕ)≤22Pzhi​​.

This connects the finite integer checker to the real Riemann–Siegel main term.

Preamble
import Definitions.Def_ArdaRH65K_Probes_ArbEconomics_Sound
import Definitions.Def_ArdaRH65K_RS4_Sound
import Definitions.Def_ArdaRH65K_RS5_Sound
import Definitions.Def_ArdaRH65K_RS_B2
import Definitions.Def_ArdaRH65K_RS_B3
import Definitions.Def_ArdaRH65K_RS_C0
import Definitions.Def_ArdaRH65K_RS_Entire
import Definitions.Def_ArdaRH65K_RS_Fold
import Definitions.Def_ArdaRH65K_RS_Kernel
import Definitions.Def_ArdaRH65K_RS_Mellin
import Definitions.Def_ArdaRH65K_RS_Strip
import Definitions.Def_ArdaRS_Arithmetic
import Definitions.Def_ArdaRS_Band
import Definitions.Def_ArdaRS_Config64
import Definitions.Def_ArdaRS_Dyadic
import Definitions.Def_ArdaRS_DyadicOps
import Definitions.Def_ArdaRS_Evaluator
import Mathlib
import Mathlib.Analysis.Complex.Exponential
import Mathlib.Analysis.Real.Pi.Bounds
import Mathlib.Analysis.SpecialFunctions.Log.Deriv
import Mathlib.Analysis.SpecialFunctions.Pow.Real
import Mathlib.Analysis.SpecialFunctions.Sqrt
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Basic
import Mathlib.Analysis.SpecialFunctions.Trigonometric.Bounds
import Mathlib.Tactic
import Mathlib.Tactic.IntervalCases
import Theorems.Thm_ArbEcon_cpow_term
import Theorems.Thm_ArbEcon_step_sound
import Theorems.Thm_ArbEcon_trig_sound
import Theorems.Thm_DIntvProd_DIntv_add_sound
import Theorems.Thm_RS4_log_one_add_near
import Theorems.Thm_RS5_lg_lo
namespace ArbEcon
end ArbEcon
namespace ArbEcon.Trig
end ArbEcon.Trig
namespace ArbEcon.sgn
end ArbEcon.sgn
namespace DIntvProd
end DIntvProd
namespace DIntvProd.DIntv
end DIntvProd.DIntv
namespace RS4
end RS4
namespace RS4.Cert
end RS4.Cert
namespace RS4.Lser
end RS4.Lser
namespace RS4.negIf
end RS4.negIf
namespace RS4.sgnI
end RS4.sgnI
/-  RS5_Sound.lean -- lane B5: SOUNDNESS of the t >= 509 checker `RS5.check5`.

    This file is lane B4's `RS4_Sound` sections 1-9 (the checker's facts over the reals, the DIntv
    assembly and the soundness theorem) re-stated for `RS5.Checks5`, which differs from `RS4.Checks`
    ONLY in the height floor (`509 * 2^tq <= tn` instead of `10000 * 2^tq <= tn`).  The floor is used by
    exactly two facts, `t_ge` and `tn_pos`; every other proof is unchanged text.  The height-free
    helpers of `RS4_Sound` (`Zmain`, `Lser`, `log_one_add_near`, `lp_real`, `ballD_mem`, ...) and all
    computable definitions of `RS4_Eval` are REUSED (selective `open RS4 (...)`), not duplicated.

    ## The headline

      `RS5.check5_sound` : `Valid c t K` and `check5 c z = true` imply
        `509 <= t`, `rsNn t = z.N`, `0 < rsFrac t`, `cos (2 pi rsFrac t) ≠ 0`, and for EVERY phase
        `phi` with `|phi - rsThetaMain t| <= 1/t`:  `zlo / 2^(2P) <= RS4.Zmain t phi <= zhi / 2^(2P)`.

    conjecture1_proved = False.  Finite interval arithmetic at one height; nothing about RH.
-/



open Real Finset
open ArbEcon DIntvProd
open RS4 (Cert lpPos lpNeg sgnI ballD negIf dstate phTrig mainBox c0Box zBox QuotOK Zmain Lser
  log_one_add_near      )

section
namespace RS5
end RS5
open RS5

noncomputable section

/-! ## 1. the checker's facts, over the reals -/

section Facts

variable {c : Cfg} {t : ℝ} {K : ℕ} {z : Cert}























































/-! ## 2. the Dirichlet state: `psum t N` and `log N` -/







/-! ## 3. the phase ball -/











/-! ## 4. the C0 amplitude `(t/2pi)^(-1/4) = a^(-1/2)` -/









/-! ## 5. the angles `2 pi p` and `2 pi (p - p^2 + 1/16)` -/















end Facts

/-! ## 6. the quotient `Psi = cos v / cos 2 pi p` (denominator bounded away from 0) -/







/-! ## 7. the main sum as `Re (e^{i phi} psum t N)` -/



/-! ## 8. the DIntv assembly -/

section Assembly

variable {c : Cfg} {t : ℝ} {K : ℕ} {z : Cert}









end Assembly

/-! ## 9. THE SOUNDNESS THEOREM -/

Formal statement

theorem RS5.check5_sound {c : Cfg} {t : ℝ} {K : ℕ} (hv : Valid c t K) (z : Cert)
    (h : check5 c z = true) :
    509 ≤ t ∧ RSInt.rsNn t = z.N ∧ 0 < RSInt.rsFrac t ∧
      Real.cos (2 * π * RSInt.rsFrac t) ≠ 0 ∧
      ∀ φ : ℝ, |φ - RSInt.rsThetaMain t| ≤ 1 / t →
        (z.zlo : ℝ) / 2 ^ (2 * c.P) ≤ Zmain t φ ∧ Zmain t φ ≤ (z.zhi : ℝ) / 2 ^ (2 * c.P) := by sorry
Source
https://github.com/DrMurphyIsIn/Arda/blob/af4fde8972eb6d4e78c7d9a95933b18b81adf52d/telperion/examples/zeta_reflection/lean/RS5_Sound.lean#L706-L753

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me