Large Language Models for Complex Mathematical Conjectures: An Engineering Practice from Verification to Proof
This article examines how large language models can assist with complex mathematical conjectures when combined with formal verification. It outlines a pipeline for formalizing statements, generating proof sketches, and iterating on verifier feedback; discusses engineering challenges such as scarce formal data, search-space explosion, and readability; and sets realistic boundaries for LLM-assisted mathematics and lessons for developers.
1. Background: When LLMs Meet Formal Mathematics
In recent years, large language models have shown notable capabilities in code generation, logical reasoning, and related tasks. A natural question follows: can this capability transfer to mathematical proof? Mathematical proof differs fundamentally from ordinary code generation. Code can be validated by running tests, but a mathematical proof must satisfy strict logical completeness. Any hidden assumption or skipped step can cause the proof to fail.
This is where formal verification tools become useful. By translating mathematical theorems and their proofs into a machine-checkable formal language, a computer can verify the correctness of each reasoning step line by line. The value of large language models is that they can generate candidate proofs under the syntactic constraints of a formal system, which are then checked by a verifier, forming a generate-verify-revise loop.
2. Technical Path: A Complete Pipeline for Formal Proof
2.1 Step 1: Formalizing the Mathematical Statement
An informal mathematical proposition often depends on substantial context and implicit conventions. Translating it into a formal language requires:
- Concept alignment: Confirm the definition in the formal library that corresponds to each mathematical object in the proposition.
- Statement reconstruction: Convert the natural-language “if … then …” structure into strict universal quantifiers and implications.
- Boundary handling: Clarify the domains of variables and how degenerate cases such as the empty set or zero elements are handled.
Example (pseudo-code-style formal statement):
-- Formalize "any even number greater than 2 can be expressed as the sum of two primes"theorem conjecture :∀ n : ℕ, n > 2 → Even n →∃ p q, Nat.Prime p ∧ Nat.Prime q ∧ p + q = n := bysorry -- to be proved
This step looks mechanical but is full of pitfalls. Incorrect quantifier order or missing implicit conditions can make subsequent proof work rest on false premises.
2.2 Step 2: Generating Proof Sketches
Once the formal statement is ready, the model’s task is to generate a proof strategy. Common strategies include:
- Decomposition and dimensionality reduction: Break the main goal into several lemmas and tackle them separately.
- Analogy transfer: Retrieve previously proved theorems with similar structure from the formal library and reuse their proof frameworks.
- Case analysis: Partition the parameter space and handle each case.
- Constructive proof: Directly construct an object satisfying the property instead of relying purely on logical derivation.
2.3 Step 3: Verifier Feedback and Iterative Revision
This is the part of the pipeline that cannot be replaced by the machine. The verifier strictly checks every reasoning step, and the error types it reports usually include:
| Error type | Typical symptom | Correction approach |
|---|---|---|
| Type mismatch | Natural numbers and integers are conflated | Introduce type conversion or a unified representation |
| Unproven premise | A lemma that has not been established is used | Complete the lemma proof first |
| Quantifier handling error | An existential proposition is used as a universal one | Reconstruct the proof logic |
| Missing degenerate case | Boundary conditions are not covered | Add branch discussions |
The model regenerates proof fragments based on the error information and repeats until everything passes. In practice, the convergence speed of this loop depends heavily on the quality of the feedback. The more precisely the verifier locates the error, the more efficiently the model can revise.
3. Key Challenges in Engineering Practice
3.1 Scarcity of Formal Materials
Unlike the massive amount of text on the internet, high-quality formal mathematical corpora are limited in scale. Mitigation methods include:
- Automated translation: Use models to translate published proofs into formal language, then filter them through a verifier to synthesize training data.
- Self-play: Let the model generate candidate propositions and attempt proofs, using successful pairs as reinforcement learning signals.
- Curriculum learning: Progress gradually from simple lemmas to complex theorems, avoiding direct attacks on highly difficult targets.
3.2 Explosion of the Search Space
Proof search is essentially finding a path through a huge strategy space. Relying purely on the model to generate a complete proof in one shot has a low success rate. A more feasible approach is hierarchical search:
High level: the model plans the proof skeleton (lemma list, proof order)Mid level: for each lemma, select a proof strategyLow level: generate concrete derivation steps and verify each one
Combined with classic techniques such as Monte Carlo tree search or beam search, this can significantly improve the completion rate for long proofs.
3.3 Balancing Correctness and Readability
A proof that passes machine verification is not necessarily human-readable. If the goal is for mathematicians to understand and generalize the proof ideas, a de-formalization step is also needed: translate the machine proof back into natural language and ensure the fidelity of the translation. This is itself a bidirectional translation problem worthy of research.
4. Capability Boundaries and Realistic Expectations
It is important to recognize that current technology still has clear limitations in the following areas:
- Original insight: Models are good at combining known techniques, but breakthrough new mathematical ideas, such as entirely new invariants or correspondences, still mainly depend on human mathematicians.
- Very long dependency reasoning: For proofs spanning dozens of pages and hundreds of lemmas, context consistency remains difficult.
- Statement-level errors: If the formalized statement itself deviates from the semantics of the original conjecture, then even if the proof passes verification, it does not mean the conjecture has been solved.
Therefore, the more accurate positioning of “LLM + formal verification” today is as a super assistant to mathematicians, taking on high-intensity labor such as formal translation, proof assistance, and error checking, while core mathematical intuition and strategic judgment remain in human hands.
5. Implications for Developers
Progress in this field also offers lessons for broader software engineering:
- Separating generation from verification is a general architecture for trustworthy AI systems: let generative models explore boldly and let deterministic tools enforce strict checks.
- Generation under formal constraints can significantly reduce hallucination rates by turning “free text generation” into “constrained structure filling.”
- The quality of the feedback loop determines iteration efficiency, which also holds in scenarios such as code review and automated testing.
Conclusion
From assisting in verifying a single lemma to eventually potentially participating in tackling major conjectures, large language models are gradually entering mathematics, one of the most robust fortresses of human intelligence. The road is still long, but a three-party collaboration paradigm of “strict machine verification + human strategic guidance + efficient model generation” has already taken shape. For developers, understanding this generate-verify-iterate methodology may have more long-term value than focusing on any single breakthrough.
