Riemann proves Riemann?

A step-by-step walk through J. L. Nielsen's critique (25 Nov 2026) of Alpöge's Lean proof of the Riemann Hypothesis. Every step in the diagram is a section below, with the Lean source behind it. (YouTube video)

The machine, drawn twice

geometry side (should be independent)zeta side (the analytic formulas)

Click any box, arrow or number to jump to its section.

    Summary

    Alpöge published a program in Lean, a language where a computer checks every step of a proof. The plan: build a geometric object and measure a number from it, its “height”1, hand that number to a check2 against two limits that come from the zeta-function side3. If the measured number always fits, zeta can have no zeros off the critical line, which is exactly the Riemann Hypothesis (RH). The program ends there, and Lean accepts it.4

    Nielsen says the program never does the measuring: the geometric object is empty, the check meant to confirm it answers “yes” to anything, and the height starts at zero✕. Instead, the program takes a formula from the zeta side, pastes it into the height field, and confirms the height field matches the formula, which of course it does1. That pasted number is what goes into the check2, where it meets limits from the same zeta side3. So the key comparison sets the zeta side against itself, and the whole proof rests on that copy: Riemann proves Riemann.4 All of this sits on the proof’s main route, which the source confirms step by step.

    What the proof claims

    Sections 1 to 4 match the diagram in “What the proof claims” mode.

    1

    What the proof claims · step 1

    Build a geometric object and measure its height h

    The geometric object

    In the code the geometric object is a “divisor datum” X : DivX D. Its geometric part should describe an actual variety: its function field, sections, volumes, positivity properties and surfaces.

    A genuine test for this exists: geoOf. It requires a natural number c > 0 tying X to a geometric family (IsGeoOf), and genuine surfaces (HasTrueSurf).

    X : DivX D, geometric part (intended)

    function fieldof a real variety
    global sectionsa real subspace
    volume, normsmeasured values
    nef, big, …proved facts
    lattice → sectionsa real map
    source…/AutomorphicMembership/OverIx.lean · lines 14–17
    abbrev GeoP : Type 1 := ∀ D : D7, Formalism.L2.Pj.Core D → DivX D → Prop
    
    def geoOf (Q : ∀ D : D7, GlobalTheory.ShFam.KitClass D) : GeoP := fun D J X =>
      (∃ c : ℕ, 0 < c ∧ GlobalTheory.ShFam.IsGeoOf (Q D) J c X) ∧ GlobalTheory.ShFam.Pad.HasTrueSurf X

    The height

    Each geometric object carries a DivData record. Its field h is the height field: it holds the height, one real number for each word u (type B.Word → ℝ).

    In the intended proof this number is measured from the geometry, resting on degree and Chern-number results. These lemmas exist for that job:

    object

    h = ?
    Intended: the height is read off the geometric object.
    source…/IwasawaDecomposition/ExistsDivStageOfPk.lean · lines 91–94
      let Dd : DivData B.LL B.Word :=
        { RR := RR, Nu := Nu, Bk := bkOf (p.what₂ e W₀ n η hη) p.cR, h := h,
          HH := sFrame Nu h + RR.muMax, HH_ge := le_rfl, etaF := etaF, Dall := p.Dall, delP := p.delp,
          delP_le_one := p.delp_le_one }

    Here h is a parameter of exists_divStage_of_pk, declared as (h : B.Word → ℝ) on line 76 of the same file. Section ✕ shows what the callers pass in.

    2

    What the proof claims · step 2

    Send the measured h to the check

    The check is called WordFacts. It must hold for every word u. The height enters it as D.div.h u (highlighted in blue), in two of its three clauses.

    If h really is a measurement of the geometric object, this is where geometry meets analysis.

    h WordFacts
    Intended: the measured height goes into the check.
    source…/Divisibility/RecBridge.lean · lines 128–133
    def WordFacts {D : D7} (L : SizeData₂ D) (C Cabs : ℝ) (u : D.what₂.Word) : Prop :=
      (D.div.Nu u).L.map ((D.div.Bk u).restrictScalars (𝓞 D.what₂.LL)) ≤ D.div.cc ∧
      (D.div.Bk u ≠ 0 → Formalism.HN.htMap (D.div.Nu u).b (D.div.Nu u).X D.div.RR.dualB D.div.RR.dualX (D.div.Bk u) ≤
        D.div.h u) ∧
      D.div.RR.muDual + D.div.h u - L.Fo ≤ L.MAIN u +
        C * (D.host.TT.card : ℝ) * L.sc.a * L.La + C * (D.R.m : ℝ) * (L.B0 + L.Nc) * L.sc.x ^ (Cabs * L.sc.eps)
    3

    What the proof claims · step 3

    The zeta side supplies a lower and an upper limit

    The same WordFacts clauses, now looking at what surrounds h (highlighted in red). Everything else comes from the zeta side.

    Lower limit: a pairing height, htMap … (D.div.Bk u), must be at most h. Call it P.
    Upper limit: muDual + h − Fo must be at most MAIN u plus an error term.

    In short: P ≤ h and μ + h − Fo ≤ MAIN + error. The first clause of WordFacts is a lattice condition that doesn't involve h.

    Intended: an independently measured h lands between two zeta-side limits.
    source…/Divisibility/RecBridge.lean · lines 128–133
    def WordFacts {D : D7} (L : SizeData₂ D) (C Cabs : ℝ) (u : D.what₂.Word) : Prop :=
      (D.div.Nu u).L.map ((D.div.Bk u).restrictScalars (𝓞 D.what₂.LL)) ≤ D.div.cc ∧
      (D.div.Bk u ≠ 0 → Formalism.HN.htMap (D.div.Nu u).b (D.div.Nu u).X D.div.RR.dualB D.div.RR.dualX (D.div.Bk u) ≤
        D.div.h u) ∧
      D.div.RR.muDual + D.div.h u - L.Fo ≤ L.MAIN u +
        C * (D.host.TT.card : ℝ) * L.sc.a * L.La + C * (D.R.m : ℝ) * (L.B0 + L.Nc) * L.sc.x ^ (Cabs * L.sc.eps)
    4

    What the proof claims · step 4

    If h always fits, zeta has no zeros off the line: RH

    If the check holds for every word, the code passes it, together with four other links, into LinkGLOBAL. That yields ChainTied, which is turned into a window inequality for each character. The conclusion is EveryCharacter: no Dirichlet L-function has a zero with real part above ½.

    rh_of_every then takes the character of modulus one, whose L-function is ζ, and rewrites with LFunction_modOne_eq to get the Riemann Hypothesis. Main.lean states it with Mathlib's own RiemannHypothesis, and Lean accepts the file. The full chain, checked call by call, is under the proof’s main route.

    h fits between the limits, for every word u↓ LinkGLOBAL → ChainTied no zeros with Re s > ½, every character (EveryCharacter)↓ modulus one: the L-function is ζ RiemannHypothesis (Mathlib)↓ Lean checks the file ✓ accepted
    source…/SharpRestriction/GlobalTheoremInputs.lean · lines 162–164
    def LinkGLOBAL {eps : ℝ} (Fm : FamP eps) (Cabs CH C0 eD eL : ℝ) : Prop :=
      ChosenE Fm C0 CH → GlobalTheoremInputs Fm Cabs CH C0 →
        ∃ K cHH eK CL x0 : ℝ, ∀ x ≥ x0, x ∈ Fm.Win → ChainTied Fm eD eL K cHH eK CL x
    source…/GammaFactorNonvanishing/CritLine.lean · lines 29–32
    theorem Formalism.VW.rh_of_every (h : UpperTheory.EveryCharacter) : RiemannHypothesis :=
      Formalism.VW.rh_of_right fun s hs hs1 => by
        have := h 1 (1 : DirichletCharacter ℂ 1) s hs (Or.inr hs1)
        rwa [LFunction_modOne_eq] at this
    source…/Kernels/MainTheorems.lean · lines 7–9 · src/Main.lean · line 4
    theorem allChi : UpperTheory.EveryCharacter := UpperTheory.FinalTheorems.everyCharacter
    
    theorem rhOfAll : RiemannHypothesis := Formalism.VW.rh_of_every allChi
    
    theorem riemannHypothesis : RiemannHypothesis := rhOfAll

    What the code does

    Sections ✕ and 1 to 4 match the diagram in “What the code does” mode. Watch the colours: the geometry side turns into the zeta side.

    Nielsen's chain is the proof's main route

    Each theorem below calls the next one in the source, from the final theorem down to the key step. Both of Nielsen's findings enter this route: the always-True geometry check (✕) and the pasted height (1–2). Every name links to its line at the commit.

    1. riemannHypothesis the final theorem
    2. rhOfAll applies rh_of_every to allChi
    3. ✕takes its input from nonempty_hyps_definite_side_of_closed_bound, which passes geoCl anyGeometry (line 60, line 63, line 67)
    4. 1–2takes the shape step shape_closed_link_n_of_green → wire_sel_alt → wire4F_alt, which hands h_eq to the check (line 92)
    5. zeroFreeAll_of_topG the key step
    ✕

    What the code does · ✕

    Nothing is measured

    The geometric object is empty

    The geometric object built for the proof is divXFl, and its geometry is geoDegenerate. Every field is a placeholder:

    • the function field is just the base field F;
    • the sections are everything (⊤);
    • volumes and norms are 0;
    • positivity properties are simply True;
    • points and metrics are one-point types (PUnit).

    The map meant to tie the lattice to the geometry, iMj, is the zero map. The only real numbers inside are flag-variety degrees (flagDegZ, dimFl), with no variety behind them.

    X : DivX D, geometric part (actual)

    function fieldF (base field)
    global sections⊤ (everything)
    volume, norms0
    nef, big, …True
    lattice → sectionszero map
    Same rows as section 1, filled the way the code fills them.
    source…/LatticeGeometry/Inhabited.lean · lines 241–283
    @[reducible] def geoDegenerate (F : Type) [Field F] [NumberField F] [StarRing F] (Tau : Type) [Fintype Tau] : DV.Geo F where
      ⋯
      Fn := fun _ => F
      ⋯
      Eff := fun _ _ => True
      ⋯
      H0 := fun _ _ => ⊤
      ⋯
      inter := fun N v => if h : 0 < Formalism.DegreeFormula.dimFl Tau N then flagDegZ Tau N (v ⟨0, h⟩) else flagDegZ Tau N 0
      nef := fun _ _ => True
      big := fun _ _ => True
      ⋯
      pts := fun _ _ => PUnit
      ⋯
      vol := fun _ _ => 0
      ⋯
      pn := fun _ _ _ _ _ _ => 0
    source…/LatticeGeometry/Inhabited.lean · lines 829–861
    def divXFl : DivX D :=
      { X0 with
        geo := geoDegenerate D.what₂.LL D.what₂.Tau
        ⋯
        degHH := fun _ _ _ => 0
        ⋯
        iMj := fun j _ => (0 : (X0.MjH j).V →ₗ[D.what₂.LL] D.what₂.LL)
        iMj_mem := fun _ _ _ => Submodule.mem_top }

    The check says True to anything

    The proof doesn't use the real geometry check geoOf from section 1. It uses anyGeometry, which ignores its three inputs and returns True. The wrapper GeoCl accepts any proof of that, so the certificate is the single word trivial. anyGeometry appears on 118 lines across 24 files.

    divEx_of_ox takes three hypotheses named after published results and discards them (fun _ _ _). On the live route, zero_free_all_of_green_v_win fills two inputs with trivial. Its third input, h, comes from nonempty_hyps_definite_side_of_closed_bound, which passes geoCl anyGeometry.

    Nielsen's test: any filler keeps this compiling. Only a check that is always False would stop it.

    a real surface
    →
    anyGeometry
    →
    True
    Whatever goes in, the answer is True.
    source…/AutomorphicMembership/OverIx.lean · line 19 · …/AutomorphicMembership/NotGeoClFalse.lean · lines 21–24
    def anyGeometry : GeoP := fun _ _ _ => True
    
    inductive GeoCl (Γ : GeoP) : ∀ D : D7, Formalism.L2.Pj.Core D → DivX D → Prop
      | base {D : D7} {J : Formalism.L2.Pj.Core D} {X : DivX D} : Γ D J X → GeoCl Γ D J X
      | step {D : D7} (N : ∀ u, Submodule (𝓞 D.what₂.LL) (D.div.Nu u).V) (h : D.what₂.Word → ℝ)
          {J : Formalism.L2.Pj.Core D} {X : DivX D} : GeoCl Γ D J X → GeoCl Γ (setDiv D N h) (coreS N h J) (divTr N h X)
    source…/IwasawaDecomposition/TupPinsOfMuIsW.lean · lines 204–213
    theorem divEx_prov (𝒮 : Slots) (hOx : 𝒮.Ox = OX anyGeometry) : DivEx 𝒮 :=
      StepW.of_all fun _ _ _ _ w _ _ hpin Z l =>
        let ⟨Y, h1, h2, h3, h4⟩ := exists_divT w hpin.some Z l
        ⟨Y, h1, h2, h3, fun O t hX hp ht => by
          rw [hOx]
          exact ⟨⟨trivial, lamAre_heq hp ht (hX ▸ h4)⟩⟩⟩
    
    theorem divEx_of_ox : GlobalTheory.NT.RayField → GlobalTheory.Published.PrincipalIdealSt → GlobalTheory.Published.CMCurveGoodOutsidePrimeSt → ∀ 𝒮 : Slots,
        𝒮.Ox = OX anyGeometry → DivEx 𝒮 :=
      fun _ _ _ 𝒮 hOx => divEx_prov 𝒮 hOx
    source…/ThirdPlaceSeries/TopPlug.lean · lines 12–15 · …/ThirdPlaceSeries/SiegelEisensteinSecondTermHypotheses.lean · line 44, line 67
    theorem UpperTheory.Top.zero_free_all_of_green_v_win (hG : GlobalTheory.GLq.Green) (hV : UpperTheory.Top.VWin)
        (h : Nonempty (_root_.GlobalTheory.Fc.HypsAlt (fun 𝒞 => Closed 𝒞 fun Fm _ => LinkN Fm) _root_.GlobalTheory.Fc.DefiniteSideCondition)) : Formalism.HC.ZeroFreeAll :=
      h.elim fun h => UpperTheory.Top.zeroFreeAll_of_topG (la := 3 / 2) (by norm_num)
        (_root_.GlobalTheory.Fc.forall_goal_of_shape_of_hyps _ _ _ _ (_root_.UpperTheory.Top.shape_closed_link_n_of_green hG) trivial trivial h) fun ψ => UpperTheory.Top.supplyChi ψ (hV ψ)
    
    theorem nonempty_hyps_definite_side_of_closed_bound : ⋯ := by
      ⋯
        SExt.none (geoCl anyGeometry) (fun _ _ _ _ _ _ _ _ _ _ _ _ _ x => ⟨x.1.1.1⟩) hOpenA

    The height starts at 0, and the measuring lemmas are never called

    When the families are first built, the height argument is zero: exists_divStage_of_pk receives (fun _ => 0) as its h. Two other constructors, DivModel.exists_divStage (shown on the right) and DivInhab.exists_divStage, write h := fun _ => 0 directly. Section 1 replaces this zero, but not with a measurement.

    Each of the six measuring lemmas from section 1 appears exactly once in the 175,188 files: at its own definition. Nothing calls them.

    One rule, degHH_def, is meant to fix a degree from a section's norm. Because norms are 0 here, it only applies if 0 = r² with r > 0, which never happens. It holds automatically and constrains nothing.

    source…/IwasawaDecomposition/StartStateUntwistedEmptyLocal.lean · lines 54–55
      obtain ⟨V, hV, -, -, hη, -, hB⟩ := exists_divStage_of_pk B w.C (Gc B w.px) P.q.p P.q.e P.q.W₀ P.q.n (fun _ _ => 0)
        (fun _ _ => le_rfl) (frames_unit P.q.t) (fun u => ((w.C.fm u).lat 0).L) (fun _ => 0) (6 * K.s.x ^ (-K.C.P.CF))
    -- argument order (ExistsDivStageOfPk.lean line 77): B C G p e W₀ n η hη hXo Ln h etaF
    -- so (fun _ _ => 0) is η, a weight; the highlighted (fun _ => 0) is the height h
    source…/AutomorphicMembership/ExistsDivStage.lean · lines 347–348
                         Bk := fun _ => 0
                         h := fun _ => 0
    source…/Divisibility/PlaceRankTwoOne.lean · lines 142–146
      degHH_def : ∀ j, 1 ≤ j → j ≤ D.R.m → ∀ c τ (s : X.geo.Fn (X.Yv j c)), IsNV X j c τ s →
        ∀ (r : (D.what₂.LL →+* ℂ) → ℝ) (ρ : D.what₂.places.Pl → ℝ), (∀ σ, 0 < r σ) →
          (∀ σ y, X.geo.pn (X.Yv j c) σ _ (metH j c τ σ) (X.geo.cx (X.Yv j c) σ s) y = r σ ^ 2) →
          (∀ w y, vF j c τ w s y = ρ w) → (Function.support ρ).Finite →
          X.degHH j c τ = degLine D r ρ

    The two grey lines starting -- are added explanations, not source.

    1

    What the code does · step 1

    The zeta formula is pasted into h

    The zeta formula

    The number that ends up in the height field is hExpl6. It is built entirely from zeta-side quantities: SZbP, kernel-place mean bounds, L6lo terms, and the log of kapR.

    The only thing it reads from the geometric object is kapR, and that is itself a copy of the zeta-side constant kapSharp. The object's lattices MjH are copies too (mjLat R F j, the zeta-side lattice). That is why the conditions saying they “match the zeta side” are proved by rfl.

    SZbP+∑ kernel-place means−∑ L6lo−log kapR
    Every ingredient of hExpl6 is zeta-side; even kapR is a copied constant.
    source…/LocalRingCardinality/KernelPlaceMeanBound.lean · lines 25–27
    def hExpl6 (D : D7) (L : SizeData₂ D) (X : DivX D) (C : ℝ) (u : D.what₂.Word) : ℝ :=
      SZbP D L C u + (∑ j ∈ SizeData₂.lifts D, kernelPlaceMeanBound D L C u j) - (∑ j ∈ SizeData₂.lifts D, L6lo D L C j) -
        meanE D (fun e => Real.log (X.kapR e))
    source…/IwasawaDecomposition/TupPinsOfMuIsW.lean · line 84, line 114 · …/AutomorphicMembership/MapSeqIndAll.lean · line 137
      MjH := mjH Z
      kapR := fun _ => kapSharp D
    
    def mjH (_Z : ReadL R F X0 Y) (j : ℕ) : HLat D.what₂.LL := mjLat R F j

    The paste

    ht is defined as the zeta formula. setDiv rebuilds the geometric object with its height field replaced: h := h. pt calls setDiv with p.ht. The height field, meant for an independent measurement, now holds the zeta formula the check will compare against.

    The zeta formula is pasted over the zero in the height field.
    source…/GlobalTwisting/SetUnipotentTranslate.lean · lines 25–30
    @[reducible] def setDiv (D : D7) (N : ∀ u, Submodule (𝓞 D.what₂.LL) (D.div.Nu u).V) (h : D.what₂.Word → ℝ) : D7 :=
      { D with
        div := { D.div with
          Nu := fun u => { D.div.Nu u with L := N u }
          h := h
          HH := max 1 (sFrame (fun u => { D.div.Nu u with L := N u }) h + D.div.RR.muMax)
    source…/GlobalTwisting/SetUnipotentTranslate.lean · lines 379–382
    def ht : D.what₂.Word → ℝ := DV.hExpl6 D p.L Y.X C.Csz
    
    def pt : Pt C where
      D := setDiv D (nPrime p.L) p.ht

    The self-check

    The code must now prove “height = formula”. The formula was just written into the height, so Lean unfolds the left side, finds exactly the right side, and accepts rfl (“equal by definition”).

    Nielsen checks the four places that build this data: two use rfl and two copy the equation from an earlier family. None derives the height from geometry.

    Unfold the left side and it is literally the right side.
    source…/GlobalTwisting/SetUnipotentTranslate.lean · lines 394–400
      xa :=
        { ties := { Y.ties with }
          X := divTr (nPrime p.L) p.ht Y.X
          nuDef := p.nuDef
          nprimeDef := fun _ => rfl
          rrDef := Y.rrDef
          h_eq := fun _ => rfl
    2

    What the code does · step 2

    The pasted h goes to the check

    Every family must have it

    The check runs over families of type FamP. One of the fields every such family is required to have is h_eq: its height equals the zeta formula hExpl6.

    So “height = zeta formula” isn't something one construction happens to do. Every family the proof can use has it by definition. No family with an independently measured height can enter the check.

    FamP (every family)

    ⋯⋯
    X (geometric object)DivX
    h_eqdiv.h = hExpl6
    The equation is a required field of the family type.
    source…/ParConsts.lean · line 31, line 73
    structure FamP (eps : ℝ) extends FamCore eps where
      ⋯
      h_eq : ∀ x, x1 < x → ∀ (i : Ix x) u, (D x i).div.h u = DV.hExpl6 (D x i) (L x i) (X x i) Csz u

    Where it enters the check

    On the proof's main route, the key step hands the field to the check at line 92 of Wire4F.lean: fun u => Fm.h_eq x hx i u.

    The equation is then read back as hhx: “the height equals hExpl6”.

    slope_bound_of_word_facts takes the check WordFacts, which bounds D.div.h u, and turns it into the bound it needs on hExpl6 with rw [← hh u]. The same move happens in linkDIV_at_words.

    The only thing the “height” contributes to the check is the pasted zeta formula.

    h = hExpl6 WordFacts
    Same picture as claim 2, but what goes in is the zeta formula.
    source…/Wire4F.lean · line 92 (inside wire4F_alt)
        (Fm.nprimeDef x hx i) (fun u => Fm.h_eq x hx i u)
    source…/Divisibility/RecBridge.lean · line 565, line 687
      have hhx : ∀ u, (Fm.D x i).div.h u = hExpl6 (Fm.D x i) (Fm.L x i) (Fm.X x i) Fm.Csz u := Fm.h_eq x hx1 i
    source…/Divisibility/RecBridge.lean · lines 320–325
    theorem slope_bound_of_word_facts (L : SizeData₂ D) (Z : DivX D) (N : NChoice D) (T : ThData D) (Csz C Cabs : ℝ)
        (hh : ∀ u, D.div.h u = hExpl6 D L Z Csz u) (hW : ∀ u, WordFacts L C Cabs u) (h5 : Compl3 L Z Csz C) :
        Formalism.MainNotions.LocalQuadraticParts.Conclusion1 D L Z N T Csz C Cabs := by
      refine ⟨fun u => (hW u).1, fun u hu => ?_, fun _ u => ?_, h5⟩
      · rw [← hh u]; exact (hW u).2.1 hu
      · rw [← hh u]; exact (hW u).2.2
    3

    What the code does · step 3

    The zeta side supplies the limits

    The limits are the same as in claim 3, and they really are zeta-side. The lower limit is built from Bk, set to bkOf …, the zeta side's own period pairing (or 0, which switches the clause off).

    According to Nielsen, the clauses are proved by divClausesR_of from about 40 zeta-side matrix estimates in DivInputsR: operator norms, covolumes, valuations. None of them opens the geometric certificate.

    The limits are zeta-side, as claimed; what changed is the dot.
    source…/IwasawaDecomposition/ExistsDivStageOfPk.lean · line 92
        { RR := RR, Nu := Nu, Bk := bkOf (p.what₂ e W₀ n η hη) p.cR, h := h,
    source…/Divisibility/ConstantGeTwentyEight.lean · line 184
    theorem divClausesR_of [IsTotallyComplex K] {Pl : Type} [Fintype Pl] [DecidableEq Pl] (wf0 : Df0.WF) (wf1 : Df1.WF)
      ⋯

    The count of “about 40 estimates” is Nielsen's; it was not recounted here.

    4

    What the code does · step 4

    Zeta formula vs zeta limits: Riemann proves Riemann

    The comparison

    Put sections 1–3 together. With h = hExpl6, the check reads P ≤ hExpl6 and μ + hExpl6 − Fo ≤ MAIN + error. Cancel the middle term and what is left is μ + P − Fo ≤ MAIN + error: zeta-side quantities on both sides. Nothing independent is squeezed.

    This then flows through the same route as claim 4 to RiemannHypothesis. In Nielsen's words, the formal comparison is “Riemann to Riemann”.

    Claim 3's picture again; every part is now zeta-side.

    Nielsen's removal test

    Take out the fake geometry check and the program still compiles, so it was doing nothing. Take out the pasted height and the program breaks, and nothing else supplies one. Try it:

    Compiles. The proof goes through.
    zeta formula→pasted into h→compared with zeta limits→“RH”

    These outcomes are Nielsen's reported results; they were not rebuilt here.

    Nielsen's toy version

    A 30-line program with the same pattern: a geometry check that is always true, a height set to the target number, and an equation closed by rfl. Lean accepts it with no extra axioms.

    Note the highlighted hRH: the toy theorem takes RH as an input and hands it back. It shows the copy pattern; it is not a fake proof of RH built from nothing.

    from the paperNielsen, Appendix A, pages 16–17 (not in the repository)
    import Mathlib.NumberTheory.LSeries.RiemannZeta
    
    def anyGeometry : ∀ (_ : Nat), Prop := fun _ => True
    def targetFormula : Nat := 42
    
    structure DegenerateModel where
      vol : Nat := 0
      height : Nat
      h_eq : height = targetFormula
    
    structure Bundle where
      geoOk : anyGeometry 0
      model : DegenerateModel
    
    def buildBundle : Bundle :=
      { geoOk := trivial
        model :=
          { vol := 0
            height := 42          -- <-- the assignment (chop this out)
            h_eq := rfl } }       -- <-- closes by definition
    
    private lemma valid_bundle_of_manufactured (b : Bundle) :
        anyGeometry 0 ∧ b.model.height = targetFormula :=
      ⟨b.geoOk, b.model.h_eq⟩
    
    theorem claimed_rh (hRH : RiemannHypothesis) :
        (∃ b : Bundle, anyGeometry 0 ∧ b.model.height = targetFormula) ∧ RiemannHypothesis := by
      let b := buildBundle
      exact ⟨⟨b, valid_bundle_of_manufactured b⟩, hRH⟩
    
    #print axioms claimed_rh

    Glossary

    Lean terms and the names used on this page

    Lean basics

    Lean
    A programming language for writing mathematical proofs that a computer checks step by step.
    Lean accepts
    Lean's kernel, its small checking core, found no step that fails to follow. It checks that the steps fit together, not what the names mean.
    Mathlib
    Lean's standard library of mathematics. It holds the official statement RiemannHypothesis that the program proves.
    RH
    The Riemann Hypothesis: every non-trivial zero of the zeta function ζ has real part ½, so it lies on the critical line.
    Dirichlet L-function
    A family of functions that generalise ζ, one for each character χ. At modulus one the L-function is ζ itself. EveryCharacter says none of them has a zero with real part above ½.
    rfl
    “Equal by definition.” Proves an equation when both sides unfold to the same expression.
    True, trivial
    True is the statement that always holds, and trivial is its proof. A check defined as True passes for any input.
    sorry, axiom
    A sorry is a placeholder for a missing proof; an axiom is a statement accepted without proof. The code uses neither, beyond Lean's three standard axioms.
    commit
    A saved version of the code, named by a hash such as 712a6aef. Every code link on this page points to that version.

    Names used on this page

    geometric object
    What the proof should measure: a variety with sections, volumes and positivity properties. In the code: a “divisor datum”, of type DivX D.
    height h, height field
    The number the proof should measure from the geometric object, one real number per word u. It is stored in the height field div.h.
    zeta side
    Everything built from the analytic formulas for ζ and the L-functions. The code calls it the “row side”.
    zeta formula hExpl6
    The zeta-side formula that the code writes into the height field.
    the check (WordFacts)
    The condition that the height lies between a lower and an upper limit, for every word u.
    lower and upper limit
    Lower: a pairing height P, built from Bk, must be at most h. Upper: μ + h − Fo must be at most MAIN + error. Both are zeta-side.
    geometry check
    The test that the geometric object is real. geoOf is a real one; anyGeometry always returns True. GeoCl wraps either.
    certificate
    The proof that a geometry check passed. With anyGeometry it is just trivial.
    setDiv
    Rebuilds a geometric object with a new value in its height field.
    measuring lemmas
    Six lemmas written to get geometric facts out of the object, listed in section 1. None is ever used.
    removal test
    Nielsen's experiment: take out one part and see whether the program still compiles.