Euclean: Automated Geometry Problem Formalization with Unified Verification in Lean

Linbin Tang, Jingyan You, Zilin Kang, Hanzhang Liu, Sophia Zhang, Zenan Li, Chenrui Cao, Liangcheng Song, Jiaao Wu, Xian Zhang, Fan Yang

TL;DR

This paper introduces Euclean, a novel framework for automatically translating informal geometry problems into formal proofs within the Lean theorem prover's standard library (Mathlib). By creating the largest geometry formalization datasets to date, Euclean enables general-purpose AI theorem provers to tackle geometry problems, unifying formal reasoning across mathematical domains.

What Problem Does This Paper Address?

For years, AI systems have excelled at formalizing and solving mathematical problems in areas like algebra and number theory using theorem provers like Lean. However, geometry has remained a fragmented domain. Existing approaches often rely on custom, domain-specific languages (DSLs) or external solvers, which lack the rigorous guarantees of established proof assistants and hinder the development of unified AI models. This fragmentation increases the "trusted computing base" and makes it difficult to leverage existing tools for geometry. Furthermore, formalizing geometry in a standard library like Mathlib is challenging because it requires making implicit assumptions (like non-degeneracy and topological configurations) explicit, which is a departure from how these problems are typically presented.

Methods

Euclean tackles this challenge with a four-stage pipeline:

  1. Constraint Explication: The system identifies and explicitly states implicit assumptions from natural language problem descriptions, such as "point P on segment BC" being translated into precise topological constraints. This also includes "non-degeneracy" conditions, ensuring geometric objects are well-defined (e.g., distinct points for a line).
  2. Configuration Anchoring ("Prove-First" Reasoning): To resolve ambiguities, the model first generates an informal proof sketch. This forces it to commit to a specific geometric configuration, which then guides the explication of necessary constraints.
  3. Formalization Mapping: Informal geometric concepts are mapped to their canonical representations within Mathlib, ensuring compatibility with the existing library.
  4. Iterative Repair: The generated formal statements are verified by the Lean compiler. Any compilation errors are fed back to the model, allowing it to iteratively refine the formalization until it's syntactically correct.

The core strategy is to ground geometry in Mathlib's analytic framework (Euclidean space over real numbers) rather than custom axiomatic systems, enabling direct use of existing mathematical infrastructure.

Datasets

The authors introduce two new, large-scale datasets for geometry formalization in Lean:

  • OMNI-Geometry: Contains 768 competition-level geometry problems, filtered from the OMNI-Math dataset.
  • Numina-Geometry: A significantly larger dataset with 177,597 problems, derived from the NuminaMath dataset, covering a broad range of difficulty.

These datasets are notable for being native to Mathlib, meaning they use standard Lean definitions and axioms, unlike previous efforts that relied on custom systems.

Key Insights and Ideas

  • The "Prove-First" Strategy is Key: Forcing an informal proof sketch before formalization is a surprisingly effective way to resolve ambiguities and anchor the geometric configuration, leading to more accurate formalizations.
  • Mathlib-Native is Crucial for Transfer Learning: By formalizing geometry within Mathlib, AI models trained on general mathematical problems can immediately leverage this knowledge for geometry, demonstrating true unification. This avoids the need for separate, specialized geometry models or extensive retraining.
  • Implicit Assumptions are the Hardest Part: The biggest hurdle in formalizing geometry isn't just translating terms, but making implicit diagrammatic assumptions (like non-degeneracy and relative positioning) explicit. Euclean's constraint explication is central to this.
  • Iterative Repair is Essential for Lean's Strictness: Lean's compiler is unforgiving. The feedback-driven iterative repair loop is critical for navigating its strict syntax and type system to produce valid formalizations.

Key Results

  • Scalable Formalization: Euclean successfully formalizes a vast number of geometry problems, creating the largest Mathlib-native geometry datasets to date (OMNI-Geometry: 768 problems, Numina-Geometry: 177,597 problems).
  • High Human Evaluation Scores: For OMNI-Geometry, human evaluators achieved 48.89% TOP1 and 73.33% TOP5 accuracy on automatically generated formalizations, indicating high semantic faithfulness.
  • Improved AI Theorem Proving: Training the Goedel v2 theorem prover on the Numina-Geometry dataset improved its proof success rate on geometry problems from 13.6% to 15.1%, demonstrating the dataset's utility for advancing unified neural theorem proving. This improvement was achieved without geometry-specific training for the base model, highlighting the power of Mathlib compatibility.

Limitations and Future Work

  • Semantic Validation Challenges: While compilation ensures syntactic correctness, fully verifying the semantic consistency of formalizations (i.e., ensuring they match the intended problem) remains difficult at scale and often requires human judgment.
  • Mathlib Coverage: The pipeline's expressiveness is limited by the current coverage of geometry concepts within Mathlib.
  • LLM Reliance: The system relies on LLMs to identify and explicate implicit constraints, which can sometimes lead to under-specified or overly strong hypotheses.
  • Text-Only Approach: Euclean currently processes only textual problem descriptions, not geometric diagrams. The authors acknowledge that future work could incorporate multimodal approaches.

The authors suggest extending Euclean's coverage to analytic and solid geometry, refining the balance of constraints, and leveraging frontier theorem provers for more effective training data generation.

Summary updated

BibTeX
@inproceedings{tang2026euclean,
  author = {Linbin Tang and Jingyan You and Zilin Kang and Hanzhang Liu and Sophia Zhang and Zenan Li and Chenrui Cao and Liangcheng Song and Jiaao Wu and Xian Zhang and Fan Yang},
  title = {{Euclean: Automated Geometry Problem Formalization with Unified Verification in Lean}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=OUtgFOscnh},
}
Figure