Generalized Riemann Hypothesis proof in Lean 4, in 76k lines (down from 17M)
51 points by mikedanese
51 points by mikedanese
This is a shortened version of Alpöge's Lean proof of RH and GRH for Dirichlet L-functions (https://alpo.ge/remark.pdf), which was about 17 million lines.
There are two editions proving the same five theorems: a readable one at about 300,000 lines (start at grh/GUIDE.md) and a compact one at about 76,000.
Github repo: https://github.com/lsernau/grh-lean
The fact you can even expand 76k lines into 17M goes to show that LLMs, while capable at making things work, are really awful at making things that are maintainable and sane. Even with regular projects they will put loads of unnecessary crap, and it's irritating having to remove all of that mess that shouldn't have been there in the first place!
The fact you can even expand 76k lines into 17M goes to show that LLMs, while capable at making things work, are really awful at making things that are maintainable and sane.
I don't think this necessarily holds. It could just be that it wasn't a priority for the project.
Since the artifact is independently checkable, that seems reasonable. Shortening it can come later, and here we are.
I'm not sure if it's always a good strategy as it become more expansive to rework parts of the proof if you see later you need something slightly different. But it's maybe the best strategy for them as they have infinite token limit.
While I agree, in this case shortening it is pretty safe because if you make a mistake proof will not hold. Compare it with a complex software project, if you accumulate all the additional amount of code for a while it will be very difficult to make it more maintainable unless you have a really comprehensive testing setup.
Pretty much, yeah. There's reasons why many find removing old code difficult. "What if it breaks things?" or "I'm not sure if this is necessary anymore, but it doesn't appear to be harming anything". Such high volume of code for something that could be simpler likely indicates there's some fragility, duplication, or something else not so great happening.
The proof is based on Levent Alpöge's, with Claude (https://alpo.ge/remark.pdf). This repository is a shorter version, produced in collaboration with my colleagues at Anthropic, and Claude.
I mean, the 76k lines version is also made by Claude. I think this is less indicative of an LLM failure and more an operator issue. Alpöge published not seeing a need to trim down the solution, someone else put in that work instead. If an LLM is bloating your repo with useless crap, you need to spend time and effort to trim it out and configure the LLM to more reliably not bloat the repo.
I more suspect they published in a rush due to some combination of wanting to. juice the IPO and also avoid being scooped by openai.
This is more a classic example of "if I had more time, I would have written a shorter letter": step one was to get there in the first place (think of it as a v0), step two is to weed out all the "which means none of ... is actually necessary, and we can rewrite ... to basically three lines, and..."
Yeah exactly. And in Lean you have the perfect refactoring setup. Any cleanup you do that leaves the proof still compiling is valid.
The fact you can even expand 76k lines into 17M goes to show that LLMs, while capable at making things work, are really awful at making things that are maintainable and sane.
Humans can do this too. All it takes is a large, aging corporation and broken development processes.
Yeah but LLMs are really incredible at it. I've seen coworkers generate 300k line codebases in a month without trying. I wonder if it can be trained out of them somehow.
This is one of those ways in which LLM's are not special. People have always been liable to create mountains of unmaintainable spaghetti. The autonomous autocomplete just enables them to do it with less effort.
Yes, it's a difference in degree not kind. It used to take years to generate 300k lines of garbage, now it takes weeks.
Precisely. Previously, as humans, there are many times we do not want to manually write some boilerplate or some annoying logic over and over. An LLM doesn't have feelings and doesn't understand monotony, so it will happily add more files and more code and more files and more code etc. This causes explosions in code quantity to a degree we haven't seen before.
But an LLM was used to produce this refactored version. It’s user error on the part of the original author that he didn’t do this before publishing.
The prize should go to whoever can get it to fit [legibly] on a t-shirt.
Are you sure that this is (mathematically) possible?
Levent Alpöge suggests that at some point, he made the initial proof longer because he found it funny.
https://x.com/__alpoge__/status/2124987173439209561
For a lot of reasons, it seems silly to put much weight on the 17M lines number.
My understanding of what happened:
The real proof was the 17M machine checked Lean proof. He did not make that longer, though he certainly did release it before taking time to make it shorter, given that it's now 300K lines!
Separately, he asked an LLM to convert the machine proof into an English proof for the lulz. It came out to 250k pages. There was obviously never any value to that, who would want to treat 250K pages of verbose obtuse English LLM prose. He said he made that that proof longer because it was funny. He thought it was obvious that the English proof was a joke, but the media doesn't know the difference between a machine checked Lean proof and an English slop proof.
He does come across as a bit of a troll.
I think you're right, I got a bit confused which bits applied to which proof.
I still think my third line is correct, but the first line is irrelevant.