r/BetterOffline • • 4d ago

Lean code still needs to be verified

As stated here:

https://xenaproject.wordpress.com/2026/11/12/and-the-proof-is-checked-in-lean/

And here:

https://leanprover-community.github.io/did_you_prove_it.html

Lean code by itself still needs to be verified to see it is proving what you are claiming to be proving. I'm seeing people claim if it compiles on lean then it is all that matters on the whole anthrophic math debacle.

68 Upvotes

42 comments sorted by

12

u/j_platte 3d ago

Wouldn't it be funny if what they actually found is a very obscure bug in Lean that wouldn't matter in real-world usage because it requires the code to be as massive as what they generated here? E.g. some sort of overflow in the compiler. 

16

u/AffectionateToe812 3d ago edited 3d ago

It doesnt even need to be a bug. The ia could just have written 250k of something entirely different, call it Riemann and done.

"It is very easy to define a complicated-looking statement and call it TheRiemannHypothesis which, despite the name, is not actually a statement of the Riemann Hypothesis. A proof of this statement is then, of course, not a proof of the actual Riemann Hypothesis."

That is why the code needs to be verified.

6

u/DrJaneIPresume 3d ago

People always say about Haskell, "if it typechecks, it's right." But you can substitute multiplication for addition and it'll still typecheck.

2

u/j_platte 3d ago

Sure. Actually, that sounds like something that would be either fairly simple or nearly impossible depending on how much of the code a human would have to understand to verify what this is actually proving.

But even if this isn't something entirely different, there's a possibility be that it only compiles due to an implementation bug and I think that would be pretty funny.

1

u/AffectionateToe812 3d ago

Yeh, it would.

2

u/dizekat 3d ago

Allegedly they took the formalization that existed before LLMs. And allegedly the verification passes with several different verifiers… it could have used bugs for all of them if originally it was using all of them, but barring that it probably isn’t bugged.

46

u/totalcuriousity 4d ago

I know it's not going to be the result but would be very funny if this ends up "It works fine on my machine".

22

u/natecull 4d ago edited 4d ago

"It works fine on my machine".

Or the very popular arXiv paper version, "It works fine on my universe".

Ie "I have solved string theory! For the special case of universes which have one dimension and contain no matter. But I'm still sure my result is important and can probably be generalised by someone else".

14

u/rjavier441 4d ago

Yes 100%, it needs review and confirmation.

28

u/grumpy_autist 3d ago

So they use the same playbook as for software engineering - it compiles, passes few vibe coded checks and then just ship it to the world without actually looking at the code. And claim great success. Then everything blows up.

5

u/Accurate-Composer964 3d ago edited 3d ago

The people to look to are the professional human mathematicians. Though I have yet to see one who thinks the solution is not valid

12

u/Conqueror0149 4d ago

yeah… you can say 2+2=4 and verify it in lean and say youve solved riemann hypothesis

15

u/applestrudelforlunch 3d ago

A statement of the Riemann hypothesis is included in MathLib, and that is what the proof imports. So, that is not what is happening here.

4

u/Dry_Flower_8133 3d ago

Still could be a bug in Lean though. LLMs have been know to just simply exploit bugs in Lean to "prove" something.

11

u/applestrudelforlunch 3d ago edited 3d ago

Of course it could be, but at this point it has been verified via multiple independent Lean kernels, including kernels which themselves have been formally verified.

A statement from the Lean and MathLib communities was released today:

https://leanprover-community.github.io/blog/posts/riemann-hypothesis/

“We have full confidence that Alpöge's proof of the Riemann Hypothesis is correct, and we congratulate him on this achievement. Our rationale is outlined below….”

Which includes

“The checkers con-leche and con-ron come with a formal proof, relative to set theory, that they cannot accept a false proof, thus addressing concerns that Lean’s logic itself might have flaws that the proof could exploit.”

5

u/Dry_Flower_8133 3d ago

Fair enough. Honestly my concerns haven't really been around whether this proof is valid or not (and I haven't really been following that closely), given that information it probably is a valid proof.

I think this is a real technical achievement but I feel like there's still concerns to be had with these results:

  1. Autoformalization, applications to real world, theory building are still hard problems for LLMs. We can take an LLM with a transformer based architecture with pretraining on all mathematics texts, train it in RL loops to get better proving statements with Lean (automatic verification), and use it as fairly decent heuristic over the search space of valid proofs. However that's actually still fairly narrow and doesn't necessarily apply to other cognitive skills (I.e. this doesn't imply AGI).
  2. These results seem basically uninterpretable. It's something like 17M lines of lean code. It's so immeasurably complicated that it's going to be hard to tell what the AI system actually drew from as sources, how the proof works, or build on previous work in a useful way. It gives us an oracle-like look into whether the Riemann hypothesis is true or false, but doesn't build the body of human understanding on the question.

Idk, just some rambling thoughts, but I guess I'm just skeptical on what the implications actually are of these results are for AI rather than the results themselves.

1

u/Conqueror0149 3d ago

oh can you tell me more?

3

u/applestrudelforlunch 3d ago

This is the definition of RH included in MathLib, which is to say that it is a definition that the community has agreed is valid for multiple years prior to the proof.

https://github.com/leanprover-community/mathlib4/blob/c47f9ad906c5ec32a953f99911b446cd26dcc123/Mathlib/NumberTheory/LSeries/RiemannZeta.lean#L182-L186

def RiemannHypothesis : Prop :=
∀ (s : ℂ) (_ : riemannZeta s = 0) (_ : ¬∃ n : ℕ, s = -2 * (n + 1)) (_ : s ≠ 1), s.re = 1 / 2

And that is the statement that the purported proof compiles a verification of.

2

u/Conqueror0149 3d ago

wow, so
you really think levents proof could be true?

3

u/aboba8825 3d ago

it seems like it's an actual proof, yes. Is it an elegant proof that mathematicians will be able to learn new things from? Maybe not. But it's a proof nonetheless.

1

u/Ok_Performer_7501 3d ago

Actually Levents used his own formation. Although I think its been deemed equivalent by someone allegedly. Although I think they've tested it against the original?

1

u/loewenheim 1d ago

You can say all kinds of shit without even invoking Lean at all. If you mean "... and have it accepted by the math community" then no, this is nonsense.

6

u/Ruined_Passion_7355 4d ago

For sure, though the odds or not in our favour on this one. Apparently it was in the standard library already so it wasn't vibed? Would love to be proven wrong though.

11

u/sciolisticism 3d ago

Folks are downvoting you, and I don't think the odds are necessarily in favor of this solution being real, but there is a real nit here.

In Lean, apparently there are "ground truth" like statements that are generally considered reliable for use. You cannot tell lean "actually define 2+2 to equal 5" and have it still satisfy those initial premises.

My understanding is that the proof provided satisfies all previously understood premises for the problem, and defines no new prior axioms. Which is not to say that the proof is correct, but it's not likely the kind of mechanical error where 126,000 lines into the proof it adds a new axiom that makes no sense.

2

u/aboba8825 3d ago

Yes. To me it seems the proof is correct as it doesn't rely on any exploits and Apoge does seem to provide a rough outline of his line of thinking behind the proof in his Remarks, but the main problem is going to be translating the proof into natural language which has already been shown to be quite difficult (like in the case of Navier-Stokes). LLMs can easily hallucinate when writing a natural language proof that is the equivalent of the Lean proof. Regardless of that, to me it seems to be clear that mathematical proofs can simply be brute-forced by throwing large amounts of compute at the problem, with a smart enough mathematician at the helm. After that, the job becomes formalizing the proof in natural language where humans can read and understand what the brute-force method actually accomplished.

1

u/sciolisticism 2d ago

What are your thoughts on the now-released rebuttal that argues that this was effectively tautologically proving RH=RH?

This is largely what I mean, that the ability for Lean to compile and even to validate are not the same as proving the mathematical discovery.

4

u/Mickanos 2d ago

The rebuttal is nonsense. The statement proved is not RH=RH. It jas been rigorously compared to the Mathlib version of the statement.

Introducing tautologies in the middle of a proof is useless, and does net help to produce an invalid proof that would be magically accepted.

I would suggest reading the report by the Lean and Mathlib communities instead.

1

u/Outrageous-Mixture48 3d ago

it was verified this this morning by lean fro and math lib

Joint statement by the Lean FRO and the Mathlib Initiative.
On November 20, 2026, Levent Alpöge released a proof of the Riemann Hypothesis as a Lean library comprising 17 million lines of code.
We have full confidence that Alpöge's proof of the Riemann Hypothesis is correct, and we congratulate him on this achievement.
Our rationale is outlined below.
The codebase depends directly only on Mathlib. Over the past day, part of the Lean and Mathlib communities have rallied to verify the proof's correctness. We hereby certify that both the statement and the proof of the Riemann Hypothesis are correct. The four criteria in https://xenaproject.wordpress.com/2026/11/12/and-the-proof-is-checked-in-lean/ are all satisfied.
The statement of the Riemann Hypothesis is correct. This statement is part of Mathlib: RiemannHypothesisand has been carefully vetted by experts in Lean and number theory.
**Alpöge’s library compiles correctly.**By now, dozens of people have reported correct compilation of the codebase, reproducing the same raw proof export file. The library compiles without errors or build failures.
The code proves the correct statement. Crucially, the community has added a file that isolates the statement of the Riemann Hypothesis and imports only Mathlib. That statement was compared against the theorem proved by Alpöge using two independent tools (comparator and con-leche –compare), both confirming that the theorem proved in Alpöge’s library is exactly Mathlib’s statement of the Riemann Hypothesis.
The Lean proof is valid. The exported raw proof has been checked by several proof checkers, including Lean’s official kernel, the con-lecheand con-ron checkers, and several independent checkers contributed by third parties and implemented in different programming languages. The checkers con-leche and con-ron come with a formal proof, relative to set theory, that they cannot accept a false proof, thus addressing concerns that Lean’s logic itself might have flaws that the proof could exploit. An extensive overview is available at https://math.mit.edu/~drew/grh/. These checks ran on an inert export of the proof, out of reach of hypothetical malicious code in the Lean proof sources.
Thanks are owed to everyone in the community who provided resources for the verification.

1

u/Accmaxxing 1d ago

Yes but proving the statement is correct takes about 2 minutes.