Formalizing Fermat's Last Theorem

10 hours ago (anthropic.com)

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

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.

  • I’m not very good at mathematics, but it seems like Kevin should take his girlfriend on trips more often for the good of all mathematicians.

    • We should start a gofundme to send him 2 months to a remote tribe in the Amazon. Chances are, we see the Riemann hypothesis and twin prime conjecture proven. ;)

  • "I was given £1M to run my project over 5 years; Anthropic took only 11 days but I do wonder if they spent more money…"

    Gives you an idea of the scale...

    • It sounds plausible they spent more, given the output tokens (6 billion of them) would cost $300k at API prices and presumably there will have been many more input tokens than output tokens.

      21 replies →

    • How many previous attempts with other models failed or on other problems. Perhaps this is $300k out of $100M or $1B of total budget just breadth first searching theorems in math and all the failed attempts conveniently don't get mentioned.

    • I burned $70 on fable 5.1 Max in about 2 hours. I suggest never using fable 5.1 on higher than High reasoning unless someone else is paying for it.

      1 reply →

  • "I was given £1M to run my project over 5 years; Anthropic took only 11 days but I do wonder if they spent more money…"

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

  • Forgive the authors of the article for assuming readers would complete it.

    • For any body of text (or in general, any exposition of any kind), the responsibility to explain the value of the article is very much in the author's side.

      Explaining the value of what you are showing should always go towards the start. Else, why would anyone bother with the rest?

      5 replies →

  • Isn't it the cost we care about, rather than the speed? All we know know is that a frontier AI lab was able to do it in 11 days, we have no idea how much compute they threw at it.

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?

  • The answer is we don't really know [0]:

    > In 2026, AIs designed to spot bugs in software were directed at Lean, and found several loopholes which were then fixed. Perhaps related to this effort, a purported disproof of the Collatz conjecture was announced as verified in Lean. However, this proof was soon determined to rely on a bug in Lean, and once the bug was fixed the proof was found invalid

    However it's a bit different than the usual 'bugs' we encounter in normal software development. Lean is more like a type checker. If you can write a false proof in Lean then the bug is in Lean itself, not your code.

    In other words, Lean can have bugs, but the amount of code we need to check scales with Lean itself, not with the length of proof. Just like the chance that C compiler has bugs doesn't increase as we write more C code. So the 13M lines of code doesn't really matter here.

    [0]: https://en.wikipedia.org/wiki/Lean_(proof_assistant)

  • In lean, a theorem is specified by a type (in their highly complex "dependent type system") and proof is specified by a code that produces a term of that type.

    If the compiler certifies that the code indeed produces a term of that type, then the proof is correct.

    So, only need to trust: (1) That theorem statement is correctly encoded (FLT has a very short 1 liner description really)

    (2) Lean compiler is correct

  • Lean is like a statically typed programming language and validity is guaranteed if it compiles. The only room for errors is in translating a non-Lean theorem into Lean, so that you are not proving what you think you are proving.

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

  • Yep. While I'm not focussed on these areas, I know enough from scoping out a "learn about the proof of FLT" course that it's covering all the usual suspects and says the right-enough words. Patching their weaker results with someone else's seem like a good strategy (and I could find the result on arXiv so it isn't obviously hallucinated).

    This is very different to believing the proof, which would require at least a pass understanding the general approach, seeing that it all actually fits together, then going deeper. At some point you transition to relying on the Lean all hanging together, but as mathematicians we all draw that line somewhere.

    But yeah, makes sense. Same thing if you saw news on someone's new database technique to improve performance. If they say the right words, don't say the wrong words, and if you cared enough you'd do spot checks proportional to the claim. If pressed you'd examine the source code, and run independent checks. But if smells roughly right, that's a good first approximation.

  • Yes, I'm a mathematician.

    But not an expert on this.

    While I don't know the specifics, and someone more "in-the-field" than me would recognize all the "named" theorems etc

    I am aware that there have been minor issues that have come up with the formalization specifically, and that previous proofs for lower values of n were always needed.

    Though it used to be n=5 and lower needed to be checked.

  • It's something you would have to be keeping up with as a mathematician, really.

    Vaguely. It's describing connections between a number of other mathematics results than can be connected to prove FLT. I assume all the work described is being done to make the proof more presentable, smaller, basically "prettier".

    It sounds like they established a minimum and maximum bounds for n in x^n + y^n = z^n, where one proof works for n greater than or equal to 17, and another proof for n < 37 (when prime).

    I believe the case (remembering back 40 years here) n is even is very easy, and n is composite and odd slightly less so. Neither really being in the ballpark of what they describe here.

  • I did an undergrad in math with a little research in number theory and recognized parts — eg, I myself worked through the proof for odd regular primes and that 37 is irregular, breaking the general case.

    Wiles-Taylor-Wiles was the original proof by Andrew Wiles, and its corrections.

    Galois representations is about vectors over Galois extensions, which are essentially adding roots to regular numbers (rationals, integers, etc). That ties into the Langlands program, which is a big area in number theory (that I don’t know much about).

    Together with flat deformations and Frey curve, I think they’re talking about a topic in algebraic geometry as applied to number theory.

    I also recognize the name Eisenstein from my time as an undergrad, though two decades out and not working in the field I’ve forgotten what his work on ideals implied here. Ideals are a well-known topic though, a sort of structure inside a ring (set with + and *) that is closed under operations — like evens in the integers are the 2Z ideal.

    So I’d describe it as “sensible with an undergrad background”.

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

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

  • There is no way Fermat could have fit that in the margin. Definitely vindicated.

  • The next step, if Anthropic is interested, is definitely performing refactoring to cut down on the size of the proof. It’s clear to everyone including Anthropic that this proof isn’t as concise as it could have been. When it’s concise enough to be accepted into Mathlib is when victory truly is upon us.

  • Maybe I'm misunderstanding something about how all this works, but can we have any confidence that 13 million lines of AI-generated Lean code are... correct?

    How have we not merely substituted one verification problem for another?

  • It’s common for formal proof efforts about software and hardware to involve thousands to tens of thousands of small lemmas.

    13M lines does seem extreme and there is probably a lot of inefficiency given the way the proof was developed. Cutting it down is probably a long road, but is also a very well defined problem that AIs can probably just go do with enough time and budget now.

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

    > Pretty insane.

    I don't think the count of "intermediate theorems" tells you anything. Here's something from an algebra textbook:

    ---

    Let G be a group, let H be a subgroup [of G], and let N be a normal subgroup [of G]. Then

    H ∨ N = HN = { hn | h ∈ H, n ∈ N }.

    ---

    This says that the subgroup closure of H and N, the smallest subgroup that contains them both, is identical with the set consisting of all products of an element of H (on the left) and an element of N (on the right).

    Part of the proof:

    ---

    Suppose that x and y are elements of [the set of products hn]. Then x = h₁n₁ and y = h₂n₂, where hᵢ ∈ H and nᵢ ∈ N. Now h₂⁻¹n₁h₂ = n₃ ∈ N, as N is normal in G. So n₁h₂ = h₂n₃. In this case

        xy = (h₁n₁)(h₂n₂)
           = (h₁(n₁h₂)n₂)
           = (h₁(h₂n₃)n₂)
           = (h₁h₂)(n₃n₂),
    

    which shows that xy has the correct form.

    ---

    This will translate directly into lean. If you do it this way, you will prove at least 10 of what would be described in lean as 'intermediate theorems':

        ∃ h₁ ∈ H, ∃ n₁ ∈ N, x = h₁ * n₁
        ∃ h₂ ∈ H, ∃ n₂ ∈ N, y = h₂ * n₂
        h₂⁻¹ * n₁ * h₂ ∈ N
        n₁ * h₂ = h₂ * n₃
        x * y = (h₁ * n₁) * (h₂ * n₂)
        (h₁ * n₁) * (h₂ * n₂) = (h₁ * (n₁ * h₂) * n₂)
        (h₁ * (n₁ * h₂) * n₂) = (h₁ * (h₂ * n₃) * n₂)
        (h₁ * (h₂ * n₃) * n₂) = (h₁ * h₂) * (n₃ * n₂)
        h₁ * h₂ ∈ H
        n₃ * n₂ ∈ N
    

    But none of these would be called an "intermediate theorem" in a paper proof.

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?

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

  • And human salaries for those who worked on the prover harness etc. which isn't just standard Fable.

    It also uses Prove2Me, which uses a graph like previous automated theorem provers. A fact that LLM hawks have categorically denied here before, with opposition naturally flagged.

    Now they have it in writing.

    • > A fact that LLM hawks have categorically denied here before, with opposition naturally flagged.

      Yeah, because before now there's been literally zero proof of an automated theorem prover scaffold around the LLMs being used, and big counterexamples and such being found, with raw chat logs available, where no such thing was used.

      > Now they have it in writing.

      Yeah, because now it's actually being done. They talk about it as a novel thing, because it is. You don't get to claim being "right all along" from this

  • But also achievable on a $150/mo (CAD) Max 5 subscription (I currently have 11.6B tokens in the last 30 days) according to /usage. It doesn’t break down input vs. output tokens as far as I can tell.

    • ~10B tokens a month is pretty typical overall input/output usage from my own experience and other developer accounts I've seen

    • When writing software with Codex 95+% of tokens are cache, I would assume the same in your case (if you also used it for coding).

  • What would it cost to make a team of mathematicians do the same?

    • The Kevin Buzzard post linked at the top says they budgeted £1M over 5 years for a smaller proof.

    • Buzzard was given 1kk GBP and 5 years and his goal I think wasn't the full thing like Anthropic did. So much more cash and orders of magnitude more time. The proof is about 5x the whole Mathlib library which was developed over many years by dozens of people.

      2 replies →

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

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

  • The AI labs have out considerable effort in trying to find and patch lean exploits. They explicitly set agents and have them try to prove false.

    > Daniel used OpenAI internal models to discover new soundness issues in the official Lean kernel and runtime

    https://leodemoura.github.io/blog/2026-8-24-postmortem-for-t...

    They found several bugs and they have patched them. Lots of work going into making sure lean is sound.

  • This is a crucial point. There have been many bugs in Lean (and in other proof assistants for that matter). Proof assistants work well on human input, because it was created with a certain intent.

    We simply don’t know what those 13M contain and whether it “makes sense” and doesn’t trigger Lean bugs. (There are “independent” lean verifiers, but historically they contained the same, or similar, bugs.)

  • It is possible, although the post notes that the proof was also verified by the Comparator, which means any exploited bug has to also be present in that checker. Which is not unheard of, but is much less likely than merely an exploit in Lean 4.

    • The comparator was only used to verify that the final statement indeed is a valid formalization of Fermat's Last Theorem, not that the proof leading up to it is correct.

  • That must have slipped through Kevin Buzzard's review, which is not entirely unplausible with 29500 theorems to verify...

    I think they should spend another few billion tokens and let agents try to disprove any of those statements or links between them. Then I'd be a lot more convinced.

  • Nope! :(

    Meaning, people and LLMs are finding 1=0 bugs in formal verification tools. I have no idea how likely this is in this case, though!

  • Anthropic surely is well aware. Most likely they asked separate agents multiple times to code review the proof and look for exploits.

  • Not just lean, but math foundation itself, I am not strong expert, but my understanding is that there is no fully recognized axiomatic foundation for modern math, all proposals could lead to some weird results.

    • There is, or rather are, fully recognized axiomatic foundations. You are free to choose one you like. Of the most popular ones is ZFC or ZF, but there are others (some lead to the same results some not). The main criteria for popularity is how useful it is. You can even make your own axiomatic where 2+2=5, but it would be useless.

      You probably heard about Goedel Incompleteness -- the proof that the the axiomatic itself cannot be proven, like using ZFC to prove ZFC, but that's another topic.

      It would be fun to play with this Anthropic/Lean formalization under different axiomatics.

      22 replies →

    • ZFC is probably the biggest foundation, and only Choice is apparently controversial. The results aren't that weird, they're just different and occasionally more useful than using !Choice.

      5 replies →

  • The proof system is relatively easy to verify.

    I am not entirely sure about lean, but the core algebras for systems like lean are in the 100s of lines of code.

    You can likely convince yourself it is correct in a weekend or less - especially with an Ai to help you understand it.

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.

  • It's wild to think that aging is something that needs to be cured, and isn't a part of the natural human experience. I'm so tired of people trying to play the role of God, as well as people that cheer these sorts of things on.

    • Most people want more life. For most people it's also the most terrifying part of "the natural human experience".

      If you're happy to die, why be bothered by others' trying to live longer? You won't be around. And assuming people can finance it themselves, is it really a problem for society?

      12 replies →

    • Most of the kids in history died before age 5.

      Child mortality is very low now compared to the past, thanks to the modern medicine and technology.

      I am glad humanity "played God", and reduced this unnecessary child suffering.

      1 reply →

  • I dont think it will happen. AI models are kneecapped. Only a tiny tiny tiny fraction of people are on the list of even being able to use these tools for such things.

    • Even in a world where these models are heavily restricted, surely the likes of cancer researchers will be among those who have access

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

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

  • If AI manages to prove, or disprove, I wonder what would Clay Foundation do for the prize.

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.

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

  • There's nothing about prove2me that couldn't have been coded just like any other huge coding project frontier models have proven themselves extremely good at doing. It just happened to have been made by humans.

  • By this standard, no computer has ever accomplished anything, because humans built the computer. AI bubble about to burst any second now.

    • Humans built the tool which enabled the result. AI used the tooling for eliminating the dead ends. Yes, I can appreciate the practical value of all this, but IMHO it is not a kind of breakthrough result the article gives impression of.

      8 replies →

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.

  • I will not be surprised if the number is zero. It should have already happened if it were possible.

    Proving that a conjecture is false is very different than what you are proposing. You are proposing an existing proof is simply wrong, that the proof can be checked in Lean, and that no one has bothered to check it yet.

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.

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.

  • I wonder if AI can come up with mathematical conjectures. As in, they feel it's right but can't prove it. What even happened in Fermat's brain to sense it was true?

    • Right. Once we see AI start delivering on the creative & intuition side of things that's going to be awesome. Until then I guess we'll live with exhaustive exploration of problem spaces by orchestrating swarms of agents...?

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

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

  • > What this work is, and is not

    > I am currently being funded by the EPSRC to formalize a proof of Fermat’s Last Theorem, and a naive reaction to the news above is that I no longer have any work to do. This is not the case. 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).

    > Note that mathematically this work of anthropic tells us essentially nothing: I am on record as saying that I am 99.9% sure that the proof of FLT is OK, and most people in the number theory community are 100% sure (formalization has made me more paranoid about the mathematical literature than most). From my understanding of the argument, the formalization just faithfully follows the early literature on the proof and adds nothing.

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

  • Seems to have taken it in good spirit:

    > We shared the resulting proof with Kevin Buzzard, who said:

    > > This extraordinary autoformalization achievement, which Anthropic researchers say only took 11 days, proves Fermat’s Last Theorem with no assumptions other than the axioms of mathematics. Along the way we see autoformalization of algebra, harmonic analysis, geometry and number theory, and we learn that AI autoformalization artefacts are now robust enough to be built upon; the proof is multi-layered.

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.

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.

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

  • physics is like sex: sure, it may give some practical results, but that's not why we do it

    • I mean at this point there's no doubt that LLM cans be RL maxxed and give you _some working output_ but the next frontier is whether they can create good abstractions, a.k.a use the correct level of expressivity so as to not inline everything yet not play code golf.

      1 reply →

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?

  • This stuck out to me, too. That a (presumably rather simple) coworking tool was instrumental in shaping the vast (6B token!) output is eye-opening. We have this vast power but without intermediate structure it is wasted. Much like Turing machines themselves, which are shaped by language design to get somewhere at the expense of getting everywhere.

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.

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

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?

  • There is a simple piece of code that can check simple steps, and many people agree this checker is correct. Then there is a formalization of the theorem which many people agree defines the theorem accurately. Then there is 13 million lines of proof that nobody has read, but the proof checker validated each step. That's enough.

    So, all you have to verify is the formalization of the theorem, and believe that the proof checker is free of bugs. You don't have to read the actual proof.

  • This was my question as well. The way I understand it, it's like a compiler, it implements rules, in this case logic/math rules that tell you whether something follows from assumptions you've given it.

    But how do you know you told it what you intended to tell it?

  • A human definitely didn't, but one of the benefits of formal verification is that even if the work done to achieve something is slop-y or excessively verbose, solvers like Lean guarantee that the initial proposition (assuming it was written correctly and in this case was definitely reviewed by humans) is definitively True. This is true across other domains of formal verification outside of math as well

  • The nice thing about theorem provers is that you don't need to read the intermediate lines. You need to make sure that the goal/result actually matches what you think it says - but everything in the middle is validated by the prover.

  • The point of writing Lean code is that Lean checks it accordingly. Lean is a domain specific language to encode mathematical reasoning in a way that can’t be fooled.

    Note to other users: don’t downvote this kind of comment, answer it.

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.

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!

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.

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

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

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

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

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

  • Yes. The point was not coming up with the proof from scratch. The point was writing it all down in Lean to make it fully machine checkable.

  • Of course it is. The interesting thing is that it was able to produce a Lean proof in 11 days, when there's been an ongoing project for several years to do the same thing (though a somewhat different proof) that is nowhere near done.

    • I think there's a big misunderstanding going on here, translating the proof to Lean is, well... a translation task. Formalizing the proof in a way that's useful (breaks the proof down into relatively independent blocks that can be used for other maths and, importantly, understood individually) is a quite bigger, more creative endeavor. Not sure if LLMs would be able to do it, maybe yes?

      2 replies →

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

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

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

  • Yes, but Claude formalized a different proof than Buzzard is trying to, so it helps less than you think. (It certainly helps!)

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.

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?

  • FLT was proven in 1995 by Andrew Wiles (with help of Richard Taylor).

    This is not even a new proof, or at least they don't claim that it is. It's the formalization (in Lean) of an existing proof. That means, they are 'porting' the proof to a theorem proving programming language.

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

  • Lean's proofchecker is a big piece of code, so it's possible that it has a bug (and historically has had some).

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

  • Yes. FLT follows from the fact that you can't build the equivalent representation of n-simplex turning into a hypercube in dimensions higher than 2

    /s

amazing, it's a huge achievement. can someone clarify, where the writeup says "The finished proof was checked by Lean; it uses just Lean’s three standard axioms" what does this mean? Aren't there a large set of standard axioms that are also necessary? (i.e. ZFC+)? if not, since it's only three axioms, can someone say what they were?

  • Lean's three standard axioms are documented in The Lean Language Reference.

    https://lean-lang.org/doc/reference/latest/Axioms/#standard-...

    The axiom of choice: axiom Classical.choice {α : Sort u} : Nonempty α → α

    The axiom of propositional extensionality: axiom propext {a b : Prop} : (a ↔ b) → a = b

    The quotient axiom: axiom Quot.sound : ∀ {α : Sort u} {r : α → α → Prop} {a b : α}, r a b → Eq (Quot.mk r a) (Quot.mk r b)

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

  • not really. it's one of the most difficult ones so far for sure, but pales in comparison to something like the classification of finite simple groups.

    This was initially "completed" in the 80s. You can see the timeline for cleaning up the proof in e.g. this mathoverflow answer

    https://mathoverflow.net/questions/114943/where-are-the-seco...

    it's something that some people have been waiting decades for, and is not yet completed.

  • Yep. There may be only 25-50 people alive today in the whole world who can credibly claim to understand Wiles' proof. Now we add an LLM to that list. Absolutely mind-blowing stuff.

    • But isn't that understanding discarded? It is if you mean "intermediate working state" while it was generating the LEAN code. Which raises the question: I wonder what other directions it could have gone in those intermediate states? Is it possible to snapshot the state of an LLM (or a cluster of them) "in the middle of proving FLT" and then prompt it to go in a different direction with all that context?

    • 25-50 seems like a pretty lowball estimate, I guess depending on your definition of "understand."

    • > Now we add an LLM to that list.

      No we cannot. LLMs do not, by their very nature, understand a single thing. You are giving far too much credence to hype and marketing.

      1 reply →

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!

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!

  • It's a great comedy that we move the buck from "I don't trust the human proof" to "I don't trust the Lean proof" despite the level of trust dramatically increasing. Moving to HOL-light might be another modest increase in trust, but to pretend the implementation of HOL-light has never had bugs and it's kernel could never have a bug is hubris.

    • We have a significant case split here:

      A human mathematician writes a Lean proof:

      - Unlikely that the mathematician would cheat with Lean bugs or even know how to find one. Trust increases.

      An AI writes a Lean proof:

      - AIs have been "ambitious" in their goals in the past and do know how to find Lean bugs and exploit them. Trust decreases.

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.

  • New proof: The Classification of the Finite Simple Groups (American Mathematical Society Mathematical Surveys and Monographs vol. 40).

    https://www.ams.org/publications/authors/books/postpub/surv-...

    Number 1 (1994), Number 2 (1995), Number 3 (1997), Number 4 (1999), Number 5 (2002), Number 6 (2004), Number 7 (2018), Number 8 (2018), Number 9 (2021), Number 10 (2023). 10 volumes and >4000 pages so far, number 11 is in progress, and end is in sight, probably two more volumes or so.

    https://www.ams.org/journals/notices/201806/rnoti-p646.pdf

    People were curious what is going on during 2004-2018. A progress report was published in 2018 right before publication of number 7 and 8. In a sense it was the peak, number 8 completes the proof of so-called "generic case". The rest is "special case". It doesn't mean things get easier, but in some specific sense number 8 completed proof for almost all groups.

    Now new proof's end is in sight, people are planning new new proof.

I call bullshit on 13 million lines makes no sense

  • The repo is public. You can just go look! It's really not that surprising; FLT is huge and has a ton of dependencies that need to be implemented, and there's a degree of sloppification that is probably blowing up the size by a few factors.

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

  • The whole point was for the formalization to be clean enough so it could be reused in other parts of mathematics as I understand it. 13M lines of AI slop which have never been checked do not sound like what the original goal for such a formalization was. Also Claude didnt prove anything it just translated an already existing proof by Wiles into Lean, so it didn't actually contribute anything other than "Guys we did this thing, look how great our model is!". We never questioned that a printer can print faster than a human can write, but we dont let printers write novels.

    • Then why is the guy not cleaning it up. Clearly he thinks it’s done and he’s moving on to do side things. He also explicitly said it went on to do more than what he was required to do.

      Are you hallucinating? Because huge portion of what you wrote directly and logically contradicts the quotation I wrote.

An aside on Lean and it's massive library of results: As someone who's put non trivial effort into slowly learning geometric algebra, lie theory and other slightly advanced math topics, I have to say my brain cannot read Lean. It feels so unprocessable.

I've tried the various intros to Lean multiple times (even before Lean 4 came out) and something about the way Lean proofs are written does not align with how I think about proofs. My very brief attempts at Isabelle / RCoq feel more natural.

I think it's a pity that the future of proofs is Lean. I'd love for someone to come up with a more digestable proof language!

  • The nice thing is, once all of these proofs are formalized in a machine-checkable language, it should be relatively straightforward to translate the corpus between different languages, if someone finds something with a nicer syntax.

  • If you're doing it for fun anyway, why not use the language that gives you the most pleasure?

  • Interesting to find this comment, I’ve been dipping my toes into formal methods and was doing a RCoq tutorial yesterday (really basic stuff), and I also noticed that the proofs in RCoq have a more pen -and-paper proof feel to them.

  • Hearing someone say "the future of proofs is Lean" is a bit like hearing someone say "the future of programming is Rust." Sorry to disappoint, or happy to inform, there are hundreds of programming languages actively being used, and Rust is not even the most used language. To think that proof assistants, fancy programming languages, would be any different is suspiciously motivated.

Proving FLT was such a profoundly emotional and spiritual experience for Andrew Wiles, it almost brought a tear to my eye:

https://news.ycombinator.com/item?id=49203626

It is truly saddening to think that machines will deprive us of this wonder and experience.

But truly exciting to dream about what lies beyond the limits of our biology.

  • Formalizing is not the same as discovering. There is still plenty of room for human ingenuity.

  • Makes me wonder, if we make a tradeoff for comfort and advancement from our biology's "limits" - and that tradeoff is spiritual fulfillment.

    Seeing it hit across: the work we used to do outdoors, the sleep-wake-dark cycle we adhered to for millennia, and more

So, what I am thinking is that, the AI generated numbers or tried to find numbers "a", "b" and "c" to check if aⁿ + bⁿ = cⁿ

Can not we do it by code?