Large Language Models and Formal Mathematical Proofs: Capabilities, Limits, and Practical Lessons

    A recent claim that a general-purpose internal research model formalized Fermat’s Last Theorem has sparked discussion about large language models in mathematics. This article explains what formal proofs are, distinguishes formalizing an existing proof from discovering a new one, examines the real significance and common misunderstandings of such demonstrations, and discusses why formal proof tasks fit LLM capabilities, where technical challenges remain, and what developers should take away.

    Large Language Models and Formal Mathematical Proofs: Capabilities, Limits, and Practical Lessons

    1. Background: A Formal Proof Claim That Sparked Discussion

    Recently, a notable claim circulated in technical communities: a model team said its general-purpose internal research model had completed work on a formal proof of Fermat’s Last Theorem. Fermat’s Last Theorem is one of the most famous problems in mathematical history. Its full proof involves extremely deep mathematical theory, and human mathematicians spent centuries before finally solving it. When the terms “large language model” and “Fermat’s Last Theorem” appear together, broad discussion is inevitable.

    A closer look, however, reveals a clear gap between what the result actually means and what the public may imagine. To understand its real value, we first need to clarify several core concepts.

    2. What Is a Formal Proof?

    2.1 From “Mathematical Proof” to “Machine-Verifiable Proof”

    A traditional mathematical proof is a reasoning process written by humans using natural language and mathematical notation. Its correctness depends on peer review. Historically, there have been cases in which flaws were discovered years after publication.

    A formal proof converts the proof process into a strict language based on formal logic and submits it to a computer for line-by-line verification. Every reasoning step must conform to a predefined axiom system and inference rules. Any jump, ambiguity, or error is rejected directly by the computer. This kind of verification is mechanical and exhaustive; there is no “the reviewer missed it” problem.

    2.2 Core Mechanisms of Proof Assistants

    Mainstream formal proof environments typically have the following characteristics:

    • Dependent type systems: Propositions are themselves types, and proofs are terms that construct those types. Proof correctness is guaranteed by type checking.
    • Interactive construction: Users advance proof goals step by step through a series of tactic commands.
    • Minimal kernel: The trusted computing base is compressed into a very small verification kernel. Other features, such as automation tactics and library management, do not affect the reliability of the final conclusion even if they have defects.

    A typical formal proof fragment looks roughly like this (illustrative pseudocode):

    1. theorem example (n : ℕ) : Proposition := by
    2. intro premise
    3. have intermediate_result_1 : ... := obtained_by_some_tactic
    4. have intermediate_result_2 : ... := derived_from_1
    5. exact final_combination

    This illustration shows that a formal proof is a highly structured “program.” It requires both an understanding of the mathematics itself and familiarity with the syntax and tactic system of the proof environment. This is exactly where large language models can play a role.

    3. The Real Significance: Positioning and Breakdown

    3.1 Key Detail: A General-Purpose Internal Research Model

    According to publicly discussed information, this work did not use a publicly released general-purpose product model. Instead, it used a general-purpose internal research model whose capabilities were roughly comparable to an advanced externally released version. This detail is important for at least three reasons.

    First, this is not a dedicated theorem-proving system trained specifically for the task. The community has seen dedicated models trained specifically for formal proof tasks. They perform strongly on specific benchmarks but have limited generalization. This result is said to come from a general-purpose model, suggesting that its mathematical reasoning ability comes more from the model’s overall emergent capabilities than from narrow-domain training.

    Second, “roughly comparable” is a vague statement. Internal research models often carry the latest experimental techniques, and evaluations of their true capabilities are not fully transparent. Positioning one with a phrase like “comparable to a certain version” reflects the current industry’s fragmented approach to disclosing model capabilities.

    3.2 The Gap Between What Is Said and What Is Used

    Looking at several industry events in recent years, a common pattern emerges: the capabilities promoted by model vendors and the products users actually access differ in both time and information.

    The structural reasons for this gap include:

    1. Limitations of evaluation benchmarks: Academic benchmarks can saturate easily and are prone to overfitting. Frontier capabilities need new, harder, and undisclosed tasks for evaluation. Historical problems such as Fermat’s Last Theorem are well suited to serve as “Show Me” style tests.
    2. Internal iteration ahead of product release: The latest model versions in the lab usually need to go through safety evaluation, productization work, and cost optimization before launch. During this period, external demonstrations often use internal versions.
    3. Simplification in communication leads to misunderstandings: A complex technical result gets compressed into a headline such as “AI proved Fermat’s Last Theorem.” The actual situation may be “the model assisted with formal transcription and verification of the proof.” The technical substance of these two statements is completely different.

    3.3 Common Misunderstandings That Need Clarification

    It is especially important to emphasize that formalizing an existing proof is different from “discovering” a proof. Fermat’s Last Theorem was already solved by human mathematicians. In this scenario, the model more likely took on the work of translating an existing mathematical argument into machine-verifiable code. This remains extremely challenging—it involves vast mathematical knowledge, very long proof chains, and strict syntax constraints—but in nature it is “formalization assistance,” not “independent mathematical discovery.” Confusing the two is the most common misreading of this event.

    4. Technical Perspective: Why LLMs Are Suited to Formal Proof

    4.1 How Task Characteristics Fit Model Capabilities

    Formal proof tasks have several naturally friendly properties for large language models:

    • Immediate feedback loop: The proof environment immediately reports an error or accepts the proof. The model can iterate and correct based on compiler feedback, similar to reinforcement learning paradigms for code generation, and the reward signal is fully objective and unambiguous.
    • Verifiable correctness: There is no need for fuzzy human preference scoring. Passing type checking means success. This provides a high-quality reward function for automated training.
    • Synthesizable data: Proof states and tactic sequences can be programmatically generated and rewritten, alleviating the scarcity of training data.

    4.2 Existing Technical Challenges

    At the same time, the difficulties are also obvious:

    1. Error accumulation in long-horizon reasoning: The formalization of a complex mathematical proposition may involve thousands of lines of proof code. Any point where the model gets stuck can cause the entire effort to fail. The model needs to maintain consistency over extremely long chains.
    2. Formalization gaps in mathematical background knowledge: Many arguments in mathematical literature rely on “obvious” intuitive leaps. Translating them into strict step-by-step derivations requires filling in a large number of intermediate details.
    3. Proof library dependencies and search space explosion: Real proofs depend heavily on existing formal mathematics libraries. How to retrieve, reuse, and combine existing lemmas is essentially a huge combinatorial search problem. Relying solely on the generative ability of a language model is far from enough.

    5. Implications for Developers and Technical Practitioners

    1. Treat demonstration results rationally: Frontier demonstrations usually represent the upper bound of laboratory capability, not the lower bound of what ordinary users can access. When evaluating a model, rely on its performance on your own real tasks.
    2. Focus on the “model + verifier” combined paradigm: Combining the generative ability of large language models with external strict verification tools is a general approach to improving output reliability. Its value extends far beyond mathematics and also applies to code testing, engineering validation, and similar scenarios.
    3. Value verifiable feedback for training: Any task for which objective, automated evaluation signals can be constructed is a high-potential direction for improving large language model capabilities.
    4. Build habits for information discernment: When facing vendor claims of capability breakthroughs, ask three questions: Which model version was used? What is the exact definition of the task? How was the result independently verified?

    6. Conclusion

    Progress in formal mathematical proof by large language models essentially reflects the maturation of the “generative AI + strict verification system” paradigm. It should neither be mythologized as “AI conquering mathematical problems” nor dismissed as simple copying. What truly deserves attention is how task definition, feedback mechanisms, and model capabilities evolve together. For developers, understanding the internal logic of this paradigm has more long-term value than chasing a single news item.