logoalt Hacker News

Formalizing Fermat's Last Theorem

551 pointsby jlebaryesterday at 6:42 PM340 commentsview on HN

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


Comments

lalitmagantiyesterday at 6:56 PM

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

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

show 5 replies
sigmaryesterday 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.

show 3 replies
herbcsotoday at 3:31 AM

So I don't know Lean or Mathematics to any degree to really be able to say this with any level of confidence, but speaking from a pure software engineering backgrouand, how do we know that 13 MILLION lines of Lean code are bug-free? It seems to me that for a mathematical proof, bug-free would be an absolute requirement. Maybe the structure of Lean imposes that, I don't know, but that seems highly unlikely to me. That just feels like a LOT of code to be comletely error-free... What am I missing here?

show 3 replies
glimsheyesterday 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 8 replies
m_w_yesterday 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.

show 6 replies
cyodetoday at 2:20 AM

I saw the 1996 FLT documentary in high school calculus class. For me, it forever cemented that archetype of modern math researcher at the top of my mental “smart” totem pole.

It also convinced me I had no interest in that path. Setting aside the grinding work of producing a proof that can only be reached by existing years in the abstract and hyper niche isolation of the problem space (not to mention that you might never discover it or that it DNE), the anguish of the output being a paper or presentation or some other artifact of human symbology (_words_, really) that could at any moment be refuted by a single observation of a single mistake—-that sounded like hell to me.

An equivalent high schooler today probably sees things differently, in light of this news and the undeniable implications of LLMs on mathematics. Sturdy autoformalization tooling should with time completely dispel the aforementioned anguish, once our confidence in converting a human proof to Lean/etc. reaches that of a compiler translating Java application language to bytecode. Errata may always exist, but in practice these new methods will do wonders for rigor and peace of mind.

(I’m far less confident re novel discoveries. There’s too much chance of derivative findings based on something part of the training looking like genius but really just tiptoeing on the shoulders of humans, whereas autoformalization is absolutely convincing to me as transformative, particularly to check correctness of AI outputted proofs as mentioned in the post.)

somberiyesterday 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)

show 3 replies
davmreyesterday 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
KaiserPisteryesterday at 7:25 PM

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

show 8 replies
Vakaiseryesterday 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 2 replies
Goofy_Coyotetoday at 4:27 AM

For math illiterate people like me, my understanding is that FLT was already proven, but the proof was beyond complex, certainly for mere mortals like me, and now Claude has codified it, correct?

henryrobbins00yesterday 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

chvidyesterday at 7:55 PM

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

show 1 reply
andrewlayesterday at 6:57 PM

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

show 2 replies
mikmoilayesterday 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 3 replies
sva_today at 1:00 AM

Hmm kind of funny, some years ago someone claimed LLMs can do math, and I replied if it could prove fermants theorem:

https://news.ycombinator.com/item?id=33176996#33177939

> Now try to make a computer prove that there are no natural numbers a,b,c; so that a^n + b^n = c^n for any n > 2.

> > Shifting the goal posts a bit, aren't we?

I guess the goalposts did change a bit, and in a pretty short time.

margorczynskiyesterday at 10:59 PM

With how capable and cheap automatic proof verification is becoming I wonder how many proofs assumed to be true by almost all of the math community will be proven false. And not by some marginal easy to fix error by some fundamental flaw in reasoning.

show 1 reply
crawshawyesterday 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.

ojo-rojoyesterday 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
kdavisyesterday at 6:55 PM

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

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

show 2 replies
throwaboattoday at 1:39 AM

I wrote a similar DAG-based verifier as a skill a few months ago: https://github.com/sethlei/Warrant . The thing mine has that I didn't see in their's is a verification of the composition rules.

Mine also does more than just math.

kristjanssonyesterday at 6:59 PM

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

show 1 reply
throw567643u8today at 1:16 AM

13 million lines of code, a lot of which is new to Mathlib. So it hasn't built on what is already there but synthesised a bunch of new stuff.

LLM generated Lean code in the past has been known to exploit bugs in the Lean kernel, it would be foolish to rule this out happening again.

MichaelDairytoday at 3:08 AM

I think Anthropic might the frontier lab hiring contractors through data vendors to formalize mathematical textbooks for them at a rate of 170-200 dollars per hour. This was mainly through Alignerr which has the worst reputation for not paying their contractors. They have been hiring since February as far as I can recall. This is in addition to all the internal people they might have working on this. If they have been formalizing all this work for the past 9 months before having Claude use all this data needed to formalize FLT, then it wouldn't be Claude formalizing FLT in just 11 days. Same with the upcoming results they will claim Claude came up with, but in fact they have been hiring frontier researchers working on very niche topics through Micro1. It's all a marketing ploy before their IPO.

chi_featuresyesterday 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
vatsachakyesterday 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
kzrdudeyesterday 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?

show 1 reply
fspeechyesterday 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.

prometheus1992yesterday 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
vagab0ndyesterday 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
atleastoptimalyesterday 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
throw567643u8today at 1:26 AM

I'd feel so much more excited if this was done in Metamath. Tiny checker kernel, no complicated dependent types, way less to go wrong.

show 1 reply
black_knightyesterday 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!

estetlinusyesterday 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.

show 2 replies
dextroustoday at 12:40 AM

Ok, let’s get a rabid pack of agents cranking on P = NP? next!

vmilneryesterday at 10:38 PM

Formalisation of the classification of finite simple groups must be on someone’s ‘moonshot’ list.

richard_chaseyesterday 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.

max979yesterday at 11:32 PM

Pretty wild seeing this get formalized. Remember struggling to even grasp the high-level concepts of Wiles's proof.

forkbomb123yesterday 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
mawyesterday at 9:55 PM

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

dgellowyesterday at 7:40 PM

Lean continues to pay off. Such a beautiful project

enriqutoyesterday 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
drivebyhootingyesterday at 7:22 PM

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

show 1 reply
jjthebluntyesterday 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.

mnewmeyesterday 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?

show 1 reply
dist-epochyesterday at 11:42 PM

Lean required 300 GB of RAM, 96 cores, and took hours to compile and check the formalization.

Now they have the perfect stress test to hill-climb and optimize.

🔗 View 22 more comments