logoalt Hacker News

Formalizing Fermat's Last Theorem

375 pointsby jlebartoday at 6:42 PM245 commentsview on HN

https://xenaproject.wordpress.com/2026/09/04/flt-anthropic-h...


Comments

glimshetoday at 9:41 PM

"The proof is not the modern proof which I have been formalizing myself following ideas of Khare, Taylor etc, but the Darmon–Diamond–Taylor exposition from 1995 of the Wiles–Taylor–Wiles argument, via the Langlands–Tunnell theorem and Ribet’s level-lowering theorem. Anthropic’s repository develops Fontaine theory (to study flat deformations of Galois representations) and develops enough of Mazur’s work on the Eisenstein ideal to conclude that no Frey curve can have a point of order p>=17. This means that their FLT proof only works for p>=17, however FLT was already formalized for odd regular primes by Best-Birkbeck-Brasca-Rodriguez, and the smallest irregular prime is 37, so it’s all good."

My question to any mathematician reading this: does the above make ANY sense to you?

I ask that because I can read most technical material related to computer engineering, programming, hardware specifications etc. Even if I don't fully understand all details, I can follow them pretty well. So I wonder if professional mathematicians can look at the above and still make sense of it like experienced software engineers do for computer stuff.

show 4 replies
lalitmagantitoday at 6:56 PM

I suggest also reading Kevin Buzzard's blog post on this as well which was just posted: https://xenaproject.wordpress.com/2026/09/04/flt-anthropic-h...

Provides great context on this accomplishment and what it means but also doesn't mean.

show 3 replies
sigmartoday at 7:04 PM

>The speed with which we were able to produce this proof demonstrates that it is now possible to formalize large swaths of mathematics, which may both catch errors in the common body of mathematical proofs and reduce the burden of refereeing new work.

^ this section should have been in the first few paragraphs imho. Explaining why this is relevant shouldn't be so far down.

m_w_today at 7:00 PM

> Along the way, it wrote 13 million lines of Lean and proved 29,500 intermediate theorems.

Pretty insane. I suppose it lends further credence to the idea that anything that can be shown to be correct can be done by a model.

davmretoday at 7:43 PM

> a team of agents completed the proof in a little under two weeks, consuming about six billion output tokens from a general-purpose internal research model roughly comparable to Claude Fable 5.1.

At $50/M output tokens, this would have cost on the order of $300k (plus a bit for input/prefill tokens) at API rates.

show 5 replies
somberitoday at 7:12 PM

On a tangential note, I highly recommend this book by Simon Singh. https://en.wikipedia.org/wiki/Fermat's_Last_Theorem_(book)

KaiserPistertoday at 7:25 PM

13M LoC, are we sure it didn't exploit any latent issues in the lean proof system?

Vakaisertoday at 7:01 PM

We'll increasingly observe announcements of this kind as AI tooling scales. As impressive as agentic coding is, it pales in comparison to the value proposition of medical, mathematical, and physics research.

I optimistically expect to witness the advent of a global 'panacea' in my lifetime thanks to AI's efforts. Cost effective large scale genetic engineering, a cure for every disease, potentially even a cure for aging.

The future is both beautiful and terrifying.

show 1 reply
mikmoilatoday at 9:34 PM

"The effort succeeded when we switched to using Prove2Me, an open collaborative platform for formalizing mathematics designed by Tianyi Peng and his collaborators at Columbia University."

So in the end, it required tooling crafted by humans.

show 2 replies
andrewlatoday at 6:57 PM

Wow -- looks like thanks to Claude, Lean checks off another box on https://www.cs.ru.nl/~freek/100/

show 1 reply
crawshawtoday at 8:36 PM

More (strong) evidence that agents make formal methods far more useful. The cost of creating that Lean proof has dropped dramatically.

Hopefully this helps mathematicians. It seems very clear to me that it will help software engineers apply formal methods to more of our software.

chvidtoday at 7:55 PM

Looking forward to the 5 billion LoC proof of the Riemann hypothesis.

henryrobbins00today at 8:07 PM

Back in February, I was talking with my PhD advisor about using Lean to formally verify automated optimization modeling outputs. It eventually turned into this paper [1]. It’s been truly incredible to see how much the frontier models have progressed in both autoformalization and automated theorem proving in the last six months. Back in February, it was cool to see them prove the validity of some simple cutting planes. Now it can churn out a min-cut max-flow duality formalization (not to mention FLT). Very exciting times!

I’ll also share a Python package I wrote for automated theorem proving that has been super useful in my own research [2].

[1] https://arxiv.org/abs/2608.25220

[2] https://github.com/henryrobbins/open-atp

aaraujo002today at 7:02 PM

They released the code here: https://github.com/anthropics/fermats-last-theorem

ojo-rojotoday at 7:57 PM

I'm really impressed by mathematicians. It's cool that Fermat had the intuition to conjecture that "aⁿ + bⁿ = cⁿ" could not be satisfied for n > 2, and that other mathematicians can create proofs, and that others still can understand AI's formulation of those proofs. Really cool.

show 1 reply
kdavistoday at 6:55 PM

Impressive! Buzzard's group[1] got scooped.

[1] https://github.com/ImperialCollegeLondon/FLT

show 1 reply
black_knighttoday at 9:34 PM

I wonder if any piece of the lean code is in a shape which means it could be contributed to one of the Lean libraries.

My experience is that it takes a lot of human input to make Fable write code nice enough for a formalisation library others can work on. But since this is certainly a lot of prerequisites formalised as well, it would be nice if not all of the effort was wasted on one capstone proof!

kristjanssontoday at 6:59 PM

Well, time to set down the glass beads and dive into a an alpine lake.

chi_featurestoday at 8:12 PM

There's a wonderful documentary by BBC Horizon with Andrew Wiles from 1996 – highly recommend! I saw it in the 90's and it's a documentary for everyone. It captures the effort, struggle, highs and lows of a 7 year effort working on Fermat's Last Theorem.

show 2 replies
fspeechtoday at 8:09 PM

First I have to say this is sooner than expected, even though I never doubted that this could be done. I am grateful that they dedicated resources to accomplish this. It is clear that agents are very good at discerning and holding onto very weak signals from RL traing on long horizon tasks, so much so that in my own experience even very chaotic agent thinking can converge to meaningful solutions if there is a verifier. I have not dug through the proof yet so I don't know how readable it is to a human. But it has been a dream of mine to understand the FLT proof. I think LLMs will be a big part of making it truly accessible to humans.

mawtoday at 9:55 PM

I have discovered a truly marvellous proof of this, which this margin is too narrow bear the load.

richard_chasetoday at 8:59 PM

Anyone know of a good Lean tutorial? I've played around with it a bit but never really learned it properly.

kzrdudetoday at 7:25 PM

The part about prove2.me was interesting. That means that a co-working tool was instrumental in the project, and I think AI companies will take note of this. Is this proof specific or will we need to give agents access to JIRA or similar tools to solve large projects in the future?

atleastoptimaltoday at 7:07 PM

It seems clear AI has the potential to perform any cognitive task at far greater speeds, reliability, and scale than any human. The question is whether it will be allowed to scale to that point, and what will happen to humans after this occurs.

show 1 reply
estetlinustoday at 7:24 PM

I can recommend the book telling the full story behind Fermats Last Theorem (by Simon Singh). It’s quite fascinating, and paved with really, _really_ weird characters each chipping in on the final solution.

vagab0ndtoday at 8:55 PM

> it wrote 13 million lines of Lean

Is this basically like opening up a black box and seeing 13 million gears all rotating seemingly randomly and still having no idea how the machine actually works?

show 1 reply
forkbomb123today at 7:40 PM

I'm so curious what happens to this project that intended on proving FLT by 2029 now

the project: https://imperialcollegelondon.github.io/FLT/

show 1 reply
prometheus1992today at 7:32 PM

Can someone with more knowledge help me with this silly question in my head?

>>Along the way, it wrote 13 million lines of Lean and proved 29,500 intermediate theorems

Did a human check the 13 million lines of code? How does QA'ing this type of work works?

show 6 replies
jjtheblunttoday at 9:24 PM

>. Claude produced the first end-to-end, computer-checked proof of FLT. Along the way, it wrote 13 million lines of Lean and proved 29,500 intermediate theorems.

I'm just old enough to remember Paul Erdo"s and his notion of 'The Book', which he defined to be a book the "Supreme Fascist" (God) had which held the most elegant proofs of mathematical theorems.

https://en.wikipedia.org/wiki/Paul_Erdős#Personal_life

It would be interesting to see how Erdo"s would name such a huge proof by Claude using Lean.

enriqutotoday at 8:15 PM

but i don't understand... isn't Wiles's proof and its numerous rewritings already in the training set?

show 3 replies
dgellowtoday at 7:40 PM

Lean continues to pay off. Such a beautiful project

vatsachaktoday at 8:52 PM

This is quite useless actually. The whole point of formalizing FLT was to clean up modern number theory into reusable abstractions that prove it.

If its 13 million LoC, it might involve so much spaghetti that its unusable other than the result

show 1 reply
mnewmetoday at 9:24 PM

Do I miss something? But isnt there the whole code and paper of Kevin Buzzard in the training data of Claude?

drivebyhootingtoday at 7:22 PM

LLMs are pretty good at slogging through. When will they come up with brilliant breakthroughs like Andrew Wiles?

EGregtoday at 9:26 PM

So Fermat’s Last Theorem has been proven a long time ago? By Andrew Wiles right? Is this like Appel and Haken >>> Seymour and Robin Thomas proof of 4CT?

show 1 reply
catigulatoday at 8:14 PM

An AI safety company!

ReptileMantoday at 7:57 PM

Why didn't you ran them to find simpler proof? This could also be big.

show 1 reply
ex-aws-dudetoday at 7:32 PM

To ask a dumb question is there any chance there can be a bug in these generated proofs that makes it think its true?

Or is it the case that as long as you verify the initial statements you are trying to prove the rest doesn't matter

show 1 reply
stabblestoday at 7:30 PM

Now /simplify. Can it be half the size? Will someone at some point prove that the proof cannot be simplified further?

show 1 reply
jrflotoday at 7:06 PM

Holy shit, this has to be one of the most difficult proofs to formalize due to it's length and complexity right?

show 1 reply
mhmdfromkaraktoday at 7:45 PM

that's crazy

threethirtytwotoday at 9:28 PM

>The work certainly achieves some of the aims of the EPSRC project, and indeed it goes much further in terms of what is formalized (I only promised the EPSRC that I would reduce FLT to the 1980s; this repo proves the whole thing). But I also promised several other things to EPSRC: firstly, that I would be making pull requests to Lean’s mathematics library, adding fundamental objects from modern number theory; this is ongoing. And secondly, and perhaps most importantly, that I would be creating a dynamic document enabling humans to explore the modern proof. My guess is that it is unlikely that Anthropic are going to do this; they will feel that their job is done with the formalization (and they did not formalize the modern proof anyway).

What is even the point? Have claude do it.

I'm not trying to be snarky here. I'm being serious. What is the point? This is an important question that needs to be answered. If something is definitively better, why not have that something take over?

I know people talk about the importance of human endeavor or the "joy" of doing something. But I don't care for those answers because it's weak. The question is deeper than this. AI is better than us, what is the logical point other than attempting to monopolize human effort even though it is inferior.

bluecalmtoday at 7:16 PM

Very impressive! I was a child when that proof came out. I've read a book about it a few years later and used it on my final high school exam. I remember some friends trying to understand parts of it at univ. It was all like black magic to me and the vibe was "maybe a few people in the world understand it".

I hope soon enough we will have one of the big ones proved by AI!

lseplottoday at 7:02 PM

https://github.com/anthropics/fermats-last-theorem/blob/main...

  status: "self-assessed"
13 million lines of Lean, where the Lean and Nanoda kernels missed the Collatz hack.

Fable, please translate to HOL-light. Make no mistakes. You are doing great!

show 1 reply
victor22today at 8:40 PM

I call bullshit on 13 million lines makes no sense

show 1 reply
QuesnayJrtoday at 8:37 PM

Holy shit. The proof of FLT is a giant detour through several different areas of mathematics, so formalizing it is a lot of work.

An interesting next target would be formalizing the classification of finite simple groups. The original proof scattered over thousands of pages of journal articles, plus Aschbacher and Smith's 1300 page 2 volume monograph. It's so long it's hard to know if there are any gaps. Researchers have been working on a streamlined new proof, but it's already many volumes long.

saadyousfitoday at 9:16 PM

[flagged]

OhNoNotAgain_99today at 9:32 PM

[dead]

🔗 View 6 more comments