TL;DR
The authors present FMC, a fully automated, training-free pipeline that translates natural language Olympiad math problems into verified Lean 4 statements. By combining syntax feedback loops with a lightweight problem-decomposition method for semantic checking, they release a benchmark of 3,214 natural language problems paired with 6,994 Lean statements that significantly challenges modern automated theorem provers.
What Problem Does This Paper Address?
Automated Theorem Proving (ATP) in formal languages like Lean provides mathematically sound verification without hallucinations. However, formal math data is scarce and exceptionally tedious to curate manually. While recent efforts have explored autoformalization (using LLMs to translate natural language math problems into formal code), high-level competition problems (e.g., IMO-level mathematics) remain largely out of reach. Existing pipelines either rely on expensive human annotation, fail to compile, or produce syntactically valid code that subtly misinterprets the original problem's conditions and goals.
Methods
The FMC autoformalization pipeline operates without task-specific fine-tuning, relying instead on off-the-shelf reasoning LLMs (primarily DeepSeek-R1) in three core stages:
- Few-Shot Translation: Mathematical problems are translated into Lean 4 using few-shot prompts featuring verified algebra and number theory examples. The model generates solutions for open-ended questions (e.g., "Find all $n$ such that...") and inserts
:= by sorryfor proofs. - Compiler Verification with Error Feedback: Lean 4 REPL validates syntax and type-checking via a subprocess. If compilation fails, the exact compiler error message is injected back into the prompt for re-translation.
- Semantic Alignment via Decomposition: To check if the formal code matches the problem's intent, the pipeline avoids intermediate representation languages or error-prone back-translation. Instead, the LLM extracts three elements from the original problem: data types, conditions, and the proof goal. It then checks whether the Lean statement faithfully reflects these three components. If semantic checking fails, the pipeline resamples a fresh translation from scratch.
[Natural Language Problem]
│
▼
[Translation (Few-Shot)] ◄─── (Error feedback on fail)
│
▼
[Lean 4 REPL Syntax Check] ──► (Compile Error)
│ (Pass)
▼
[Semantic Decomposition & Check] ──► (Mismatch: Retranslate from scratch)
│ (Pass)
▼
[Verified Lean Formalization]
Datasets
- FMC Dataset (Introduced): Extracted from the IMOmath repository (national and international Olympiads from 1959 to 2011). Starting from 6,980 problems, geometry questions were filtered out and multi-part questions were split, leaving 4,798 candidate problems. The final curated benchmark contains 3,214 natural language problems aligned with 6,994 Lean 4 statements (a one-to-many relationship).
- Comparison Benchmarks: Evaluated alongside or compared with existing formal benchmarks including miniF2F, ProofNet, FormalMATH / FormalMATH-Lite, FIMO, and CombiBench.
Key Insights and Ideas
- Syntax feedback helps, but semantic feedback hurts: Feeding compiler error logs back to the LLM boosted syntax pass rates from 60.0% to 66.7%. However, feeding back semantic mismatch critiques actually lowered semantic accuracy (from 29.3% down to 26.7%). The authors observed that semantic errors introduce confusing noise; it is far more effective to discard the candidate and sample a fresh, diverse formalization.
- Direct decomposition beats back-translation: Traditional Natural Language Inference (NLI) methods back-translate Lean into English before comparing. Decomposing the natural language text into
(data types, conditions, goal)directly yielded an 82.0% accuracy in semantic validation (vs. 69.0% for NLI), preventing condition-conclusion confusion without the overhead of formal intermediate languages. - Current LLM formalization bottlenecks: When formalizations fail semantically, 52% of errors stem from the proof goal (e.g., asserting an existence statement instead of solving for the explicit set of functions, or hallucinating the numeric answer to an open question) and 28% from omitted conditions (e.g., leaving out that a prime must be the maximal prime).
Key Results
- High Pipeline Yield: Out of 4,798 preprocessed competition problems, 93.39% (4,481) passed syntax verification, and 66.99% (3,214) passed semantic alignment—far outperforming the 40.5% semantic consistency achieved by StepFun-Formalizer.
- Model Capability: DeepSeek-R1 reached a 43% end-to-end formalization accuracy on a 100-problem test subset, significantly outperforming Claude 3.7 Sonnet (22%) and GPT-4o-mini (10%).
- Quality Check: Manual human expert verification on a 50-problem random sample from FMC showed 78% true semantic accuracy.
- Prover Benchmark Difficulty: Evaluating state-of-the-art automated theorem provers across 32 attempts on 1,000 FMC statements demonstrates FMC's high difficulty ceiling compared to miniF2F:
- DeepSeek-Prover-V1.5-RL: 8.6% on FMC vs. 50.0% on miniF2F
- Kimina-Prover: 17.6% on FMC vs. 63.1% on miniF2F
- Goedel-Prover-SFT: 18.3% on FMC vs. 57.6% on miniF2F
- DeepSeek-Prover-V2-671B: 40.5% on FMC vs. 82.4% on miniF2F
- Goedel-Prover-V2: 62.5% on FMC vs. 88.1% on miniF2F
Limitations and Future Work
- Geometry is omitted: Euclidean geometry problems were deliberately excluded. LLMs consistently failed to model implicit spatial constraints (e.g., interior angles summing to $180^\circ$, cyclic quadrilateral properties), resulting in formalization success rates of only ~20%.
- Combinatorics remains fragile: Modeling complex game-theoretic or combinatorial setups often yielded indexing bugs, missing cardinality constraints, or unbounded open-loop recursions.
- Open-ended solving reliance: Because Lean requires an exact proposition to prove, open problems ("Find all...") rely on the LLM's raw math-solving capability to guess the correct closed-form answer before writing the theorem statement. Wrong answers directly invalidate the formal theorem.
Summary updated