What is the true core of AI cracking the Riemann Hypothesis, and what exactly is "Lean"?
The AI and mathematics communities are all abuzz with the same piece of news: the 167-year-old Riemann Hypothesis has been proven!
On November 20, Anthropic mathematician Levent Alpöge announced on his personal website that he had completed a formal proof of the Riemann Hypothesis in collaboration with Claude, and released the results as a Lean codebase. The entire project contains 175187 Lean source files, totaling approximately 17.37 million lines of code.
The Lean and Mathlib communities subsequently announced that they have full confidence in the correctness of this proof. MIT mathematician Andrew Sutherland also published independent verification results, showing that all modules have completed compilation and passed verification by the Lean kernel and multiple independent checkers.
The entire mathematics community was immediately shaken, because the Riemann Hypothesis is far too important.
In 1859, German mathematician Riemann put forward a conjecture when studying the distribution of prime numbers. Prime numbers are natural numbers greater than 1 that can only be divided evenly by 1 and themselves, such as 2, 3, 5, 7, 11, 13, 17... They seem to be scattered randomly in the set of natural numbers, but mathematicians can estimate the number of primes within a certain range. There is an extremely precise pattern behind them, which is closely related to the "zeros" of the Riemann zeta function.
The Riemann Hypothesis asserts that the real part of all non-trivial zeros of the zeta function is exactly equal to 1/2.
Although this conjecture only has dozens of words, it is one of the most famous unsolved problems in modern mathematics, and also one of the seven "Millennium Prize Problems" of the Clay Mathematics Institute, with a bonus of 1 million US dollars. The only overlapping problem in the two "most important problem" lists spanning a hundred years is the Riemann Hypothesis.
There are more than a thousand propositions in mathematical literature that take the establishment of the Riemann Hypothesis as a premise. If it is proven, all these propositions will be promoted to theorems. If it is overturned, a considerable part of them will collapse accordingly.
However, doubts about this proof also exist. According to Tianyancha, on November 19, Anthropic was just listed on NASDAQ, setting a new record for the largest IPO in human history. The next day, Alpöge released his statement. He himself admitted that the timing was "very bad".
Why choose the time point right after the listing? Perhaps Anthropic also wants to boost its stock price through this "major result" of proving the Riemann Hypothesis. But in any case, for friends who pay attention to the development of AI large model technology, the core that is worth exploring in depth actually lies in:
What on earth is a "Lean module"? Why is the proof not presented in the form of a hundreds-page traditional paper, but turned into 170,000 Lean modules? What changes will it bring to future scientific research?
1. What exactly is a Lean module?
We can start with the simplest mathematical reasoning: A=B, B=C, so A=C.
This is such an ordinary reasoning even for primary school students that it is not worth writing a special explanation. However, if you want the computer to confirm that this step is correct, it needs to know what types of objects A, B and C are respectively, what definition the equal sign adopts, whether the previous two conditions are valid, and which logical rule is called in the final step.
In other words, when humans read a mathematical proof, they can often automatically complete the omitted steps by virtue of their long-term accumulated mathematical knowledge. But computers cannot rely on this tacit understanding, and they need a sufficiently clear instruction so that every reasoning link can be checked.
Thus, the Lean code system came into being.
This is a formal proof system and also a programming language. Mathematicians can write definitions, theorems, conditions and proof processes into forms that Lean can understand, and then the computer will check them strictly.
For example:
theorem example (A B C : Nat)
(h1 : A = B) (h2 : B= C) : A= C:= by
exact h1.trans h2
This piece of code tells Lean: If A=B and B=C, then A=C can be proved through the transitivity of equalities.
Doesn't it look very simple? Everyone can understand it. However, this also reveals the core feature of formal mathematics, that is, where mathematicians say "it is obviously true", the machine must write it clearly with logic.
Lean does not just judge whether the statement "sounds correct", but checks the entire reasoning process. This is the biggest difference between formal mathematics and traditional mathematical writing.
And when the proof goes from A=B to the Riemann Hypothesis, the complexity is not at the same order of magnitude at all.
A large mathematical theorem may require tens of thousands of definitions, lemmas and auxiliary conclusions behind it. There are also complex dependencies between them: A depends on B, B depends on C and D, and D depends on E, F, G.
Therefore, Lean does not package 170,000 mathematical steps into 170,000 files, but splits the entire mathematical project into a large number of independently manageable modules.
175187 modules are not equal to 175187 independent proofs. More accurately, they are the source code files in this formal proof project.
You can imagine it as a super complex "mathematical building".
The most basic part covers basic mathematical objects such as natural numbers, real numbers, complex numbers, sets and functions, and the upper layer includes tools such as limits, integrals, series, complex analysis and number theory. Further up are more specialized theories.
Eventually, these modules jointly support the top-level Riemann Hypothesis, and there are strict dependencies between these modules.
The truly important point of the 170,000 files is not the "huge quantity", but that mathematical knowledge is organized in a way similar to software engineering for the first time.
Here we also need to mention Mathlib. It is one of the most important open-source mathematical libraries in the Lean ecosystem, which has accumulated a large number of formalized mathematical definitions, theorems and proofs. Therefore, Alpöge and Claude did not rebuild the entire mathematical world from "1+1=2", but directly called the already formalized mathematical knowledge.
Just like software engineers do not need to redevelop an operating system and basic function libraries when developing a complex software, formal mathematics has begun to have its own "infrastructure".
2. Why does AI need 170,000 Lean modules?
Then the question arises, since Lean is responsible for the entire system engineering, what did Claude do in it?
First of all, it must be made clear that this is not a situation where Claude suddenly outputs a piece of proof in the chat window, mathematicians read it for a few moments, think it makes sense, and then announce that the Riemann Hypothesis has been solved.
According to the instructions released by Alpöge on November 20, he and Claude have continued to cooperate around this problem, and finally sorted the proof into a Lean formal project for public release. The instructions mention that the mathematical idea of this work is related to the Stepanov method, involving mathematical tools such as Fourier analysis, theta lifts and automorphic forms.
Are you a little confused when you see these terms? This also precisely shows that proving the Riemann Hypothesis is a complex task that needs to cross multiple professional fields and organize a large number of intermediate conclusions.
The whole process is closer to a scientific research collaboration mode of "humans put forward directions + AI participates in exploration and formalization + machines carry out continuous verification".
The first step is to find the proof route. The Riemann Hypothesis itself has been studied for more than a century. The real difficulty is not writing out the proposition, but finding a path that can prove it.
Alpöge stated in the public announcement that he was responsible for guiding the research into the key mathematical structure, and Claude participated a lot in the derivation and formalization work in the subsequent stage. That is to say, AI did not discover a mathematical world out of thin air, but carried out high-intensity exploration on the basis of mathematicians' research directions and existing mathematical knowledge.
The second step is to split complex problems into sub-problems.
This is where Lean modules really play their role. For example, a key conclusion requires three premises A, B and C, and A depends on A1, A2, A3... After formalization, each goal can become a clear theorem, and each theorem can be called by other modules.
It is a bit like developing a large-scale software. When the program is complex to a certain extent, it is impossible for one person to write a whole block, so it is split into functions, components and modules. The same goes for mathematical proofs: once entering the formal system, similar splitting can also be carried out.
The third step is to convert mathematical reasoning into Lean code.
Traditional mathematicians may know that "a certain inequality should be used here" and "this conclusion can be deduced from a certain theorem". However, when actually writing it into Lean code, a lot of details often need to be handled: variable types, boundary conditions, implicit assumptions, function definitions, theorem parameters and dependencies between modules.
These are exactly the areas where large AI models can participate in large quantities.
AI can try to generate proof code and call existing theorems in Mathlib. If Lean reports an error, adjust the code according to the error message; continue compilation, modification and verification.
Thus, the whole process forms a loop: first put forward mathematical goals, then AI generates proofs, Lean checks, finds errors, AI modifies, and finally checks again.
The biggest difference from ordinary AI chat is that the AI here cannot muddle through by "sounding right", and the code must finally pass the inspection of the formal system.
The fourth step is to reuse existing mathematical knowledge.
This step may be the most easily underestimated. If every time a new theorem is proved, all basic mathematics must be re-proved, formal mathematics can hardly develop to the current scale.
Mathlib formalizes and saves a large number of mathematical results in advance, and new proofs can directly call these results. Therefore, these 170,000 modules are not 170,000 isolated files, but a huge network of mathematical knowledge.
The real capability AI obtains is not just "fast calculation speed", but the ability to find existing tools in this knowledge network, split complex problems, and then reorganize new proofs.
This is also why formal mathematics may become an important test field for AI to carry out scientific research.
Of course, the question also follows: if 170,000 modules are mainly generated with AI participation, why should we trust that there are no errors in it?
3. Why can the Lean system be trusted when working with AI?
A well-known shortcoming of large AI models is that they are prone to hallucinations, and often "talk nonsense in a serious manner".
It can completely generate a seemingly very professional mathematical derivation, but in fact it may not be valid at all. Therefore, for this proof of the Riemann Hypothesis, if only Claude generates 17.37 million lines of code and then lets Claude judge by itself that "the proof is successful", the credibility is obviously insufficient.
This is where the key value of Lean is reflected: AI is responsible for finding proofs, and Lean is responsible for checking proofs.
Lean has a core component called Kernel, which can be understood as a very strict logic checker. AI puts forward proof schemes and can also generate a large amount of code, but in the end all proofs must be submitted to Kernel for inspection. As long as one step does not conform to the logical rules of the system, it cannot pass.
It's like an engineer designed a bridge with AI, but in the end it must go through independent structural checking.
Verification also has steps. The first thing to check is the most basic problem: whether the code can be compiled normally.
The joint statement of the Lean and Mathlib communities shows that Alpöge's codebase depends on Mathlib, and all modules can be compiled successfully. The community also confirmed that the final proof corresponds to the Riemann Hypothesis with the standard definition in Mathlib, rather than a weakened version that has been quietly modified.
This point is very important, because AI can completely prove a wrong proposition.
Verification must answer two questions at the same time: first, is there any error in the proof? Second, is the proof exactly the proposition we want to prove?
The community's verification is also carried out around these two problems. The verification record released by MIT mathematician Andrew Sutherland shows that the complete code has been checked by the official Lean Kernel, and multiple independently implemented checkers are also used for cross verification. Related checks include full compilation, dependency axiom audit, Kernel replay and independent checker verification.
The result is that no problems have been found in these checks.
This is why the Lean and Mathlib communities finally announced that they have full confidence in the correctness of this formal proof.
But the interesting point is that even if AI's proof of the Riemann Hypothesis is accepted, it does not mean that humans have understood this proof.
Lean can confirm that this set of logical deductions from AI is valid, but it will not tell you why mathematicians came up with such a route? Which idea is the most critical? Why can a certain structure solve the Riemann Hypothesis? Can this proof be extended to other problems?
A human-readable version of the proof is still waiting to be released.
The subversive point here is that in the past, mathematicians first gave proofs, and computers were at most responsible for auxiliary calculations.