On formalizing The Music of the Primes

2026-11-28 [home]

The views and opinions expressed in this post are strictly my own: They do not reflect any official policy, position, or endorsement of my employer.

Motivations

I have long been fascinated by prime numbers (see my homepage's list of things I particularly enjoy). It started around 15 years ago when I first saw the claim that the natural numbers sum to -112.

This clickbait fact led me to YouTube which eventually introduced me to the Riemann Zeta Function:

ζ(s)=1+12s+13s+14s+15s+⋯ (ℜ(s)>1)

Now, I called it "clickbait" because the ordinary sum diverges. It is the analytic continuation of the zeta function that gives:

ζ(-1)=-112

Regardless, I found this deeply interesting and always found myself re-visiting this topic. When the news of Levent Alpöge's proof circulated on Friday, November 20, 2026, I was both elated and sad that, this too, was collateral damage in the saga of frontier labs strip mining mathematics.

However, hours later, news of Alessandro Masullo’s 940-page manuscript The Music of the Primes reached me. I could not believe it.

Background

I am not a mathematician. I am simply a human who likes programming and prime numbers way too much. For a coherent introduction into this topic, I find that 3Blue1Brown's But what is the Riemann hypothesis? Visualizing the zeta function is a lovely starting point.

For months, I have been experimenting with LLMs and their abstractions in curating and reviewing a personal proofs repository. I push results as they develop. When I have the time, I write them up and post them under the Proofs heading on my homepage.

My interest in maths has led me down a path of experimenting and writing many different types of programs: For example, I grew frustrated with how Claude Code operates for research work, so I started prototyping my own harness. I used this prototype interactively to review a proof and its implementation for faster unrounded floating-point scaling in Go 1.27.

After seeing the utility, I went all-in. I maintain a bespoke research-first harness that I have daily driven since August 2026.

Additionally, I recently published an experimental abstraction that I believe is what is next beyond the agentic coding harness: patel.codes/godel, which is named after one of my favorite mathematicians.

When I saw Masullo's announcement, I wanted to back the "little guy" so to speak. I wanted the human-authored proof to work, and checking it was something I could do now.

It was significantly more comprehensible, and at the time, there was significant doubt of the timeline to refactor the ~17 million lines of Lean code that Alpöge published.1

Divergence

The words of Terence Tao at ICM 2026 really stuck with me. I did not want to just keep poking a machine and generating proofs without a commitment to making the material and impact more understandable. After months of experimenting with tooling aligned with this philosophy, creating and understanding proofs I generate, and submitting a subset of them to OEIS to close open conjectures2, I have hundreds of other proofs that simply sit in my backlog because I haven't the time to properly get to them.

With this in hand, I felt that Masullo's manuscript was the next challenge. Using patel.codes/godel, I created thatnealpatel/grh. I used my intuition that I had been building for months to seed a workflow that could attack the formalization task at scale.

For those unfamiliar, there is a difference in using agents to develop new maths versus formalize existing maths. The former is significantly harder and (at least as of writing) has shown to still require some human expert attention. The latter, while usually routine, becomes harder when the formalization target is a 940-page PDF that has no TeX source.

Finally, the challenge and complexity of this task excited me. Not only does patel.codes/godel export a dead-simple interface for writing workflows in a graph format, it also actuates a self-improvement loop wherein the program is permitted to change its own source code in response to evidence it needs to evolve.3

I had spent much of the first day building an understanding for which parts of the manuscript to hand to my agents overnight. I had plans to focus on the parallel development of the earlier chapters when I woke up, but I surmised that they were not risky to the development of the proof argument itself.

Instead, the later chapters seemed to be more worth spending time and tokens on, especially as I slept.

Convergence

The next morning, one of the notes that caught my eye was about the introduction. I had tasked my agents to look at the later chapters, but page 29 was where Masullo explained how to get from the trace formula to a statement about the zeros. One of the bounds he needed was supposed to follow from “simple estimates.”

But the calculation in my overnight log went the other way. Even over the rationals, an integral that needed to stay bounded grew without bound as the approximations improved. I figured it was time to find some mathematicians.

I have been a member of the leanprover Zulip for some short time now. I stumbled across a thread titled "Formalising Masullo's proof of GRH" some 18 hours after starting my formalization. Eagerly, I read the thread and discovered that two other folks (who are mathematicians) had championed similar efforts:

  1. Masullo: The Music of the Primes — Riemann Hypothesis specialization (Prove2Me)

  2. https://github.com/mccorvie/riemann-masullo

The Prove2Me effort fizzled out due to contamination of the arguments from Alpöge's proof being used to "repair" Masullo's manuscript. It was retired shortly after I discovered it, with the following disclaimer:

DANGER – DO NOT TRUST THIS PROJECT!

Up until this point, the mccorvie/riemann-masullo project only4 had around 20 contributors. As the day went on, I became more sure of a block. As a complete non-expert, I flocked to the Zulip thread and sent my first message:

neal:

Hi, nearly 24 hours ago I started one of my self-improving programs with the goal of closing this proof and creating a final artifact that is useful for human expert attention: It's presently available at https://github.com/thatnealpatel/grh

My read is that https://github.com/mccorvie/riemann-masullo is canonical for contributing. I don't want to add noise. I assume an independent project trying to close the same goal is welcome if I curate the boundary between my own project and what might be useful for mccorvie/riemann-masullo?

A short while later, Ryan McCorvie5 reached out to me personally. McCorvie had been reading my repo. Some of my results were less general than the statements in the manuscript, he said, but the work he found most useful was in Chapters 10–13, which his project had not formalized yet.

He proposed copying proofs over with attribution once the prerequisite definitions were in place. He also asked me whether I thought that I had resolved any of the problems in the manuscript. I told him no. What I could offer was more specific: Four places where he could compare a claim in the paper with a result in my repository.

Separately, in an Appendix B pull request, McCorvie recorded that a definition and three lemmas from my project were copied unchanged. They helped prove that, outside of a small exceptional set, a particular L-function could not get too close to zero. I had started the weekend hoping to help check a 940-page manuscript and ended up with four little pieces of Lean that someone else actually needed. How fun!

Elsewhere, the Chapter 1 proof names the two ideas it uses from my project: One estimate controlled the function near its zeros, and another let the authors choose a height where those zeros would not spoil the bound.

Beyond these, there were a few other relevant ideas6 7 that I only found out made it in after pointing my agents at the project. All in all, it was wonderful to see intentional curation being rewarded.

Closing thoughts

It was beyond thrilling to work against a clock, even if largely imagined. The warm welcome from folks in the leanprover Zulip was the cherry on top.

At the time of writing, McCorvie’s project is the de facto formalization8 and has traced Masullo's main claim to one unresolved cancellation step.

With his project following the manuscript theorem by theorem, I wanted to use mine for a different question: Where the printed argument didn’t work, what could we prove instead?

So, I went back to page 11.




  1. That significant doubt cleared up on November 25, 2026: https://github.com/lsernau/grh-lean ↩

  2. For example, A logarithmic bound for A400000, Proving Kimberling's harmonic-floor conjecture, and Refuting two prime-counting conjectures. ↩

  3. As it turned out, this entire exercise taught me a lot about how difficult it is to define good self-improvement nodes in the graph. I plan to write this up as a standalone post at a later time. ↩

  4. A day later (on Sunday, November 22), the project hit the front page of HN which spiked its contributor base substantially. ↩

  5. I asked if he would be comfortable with being referenced here. ↩

  6. For example, mccorvie/riemann-masullo#6389 ↩

  7. For example, disk factorization and averaging argument, non-trivial character-case for global converse theorem, and zero-free disk estimate for the quartic Dirichlet zero proof ↩

  8. Masullo (author) and Conrad (reviewer) have since reached out to McCorvie to discuss how to use the formalization. ↩