LeanGeo: Formalizing Competitional Geometry problems in Lean

Chendong Song, Zihan Wang, Frederick Pu, Haiming Wang, Xiaohan Lin, Junqi Liu, Jia Li, Zhengying Liu · DOI

Euclidean geometry has long been a "white whale" for automated theorem proving. While Large Language Models (LLMs) have become surprisingly adept at algebra and number theory, geometry remains a stubborn challenge. This is largely because geometric reasoning often relies on "diagrammatic intuition"—the mental leaps we make when looking at a figure—which is notoriously difficult to translate into the rigid, symbolic logic required by formal proof assistants like Lean.

A new framework, LeanGeo, introduced in the paper "LeanGeo: Formalizing Competitional Geometry Problems in Lean," aims to bridge this gap. By creating a comprehensive library of geometric theorems and a rigorous benchmark of competition-level problems, the authors provide the tools needed to move AI from "guessing" geometric proofs to formally verifying them within the Lean 4 ecosystem.

The LeanGeo Library and Framework

The core of the system is the LeanGeo library, built upon the axiomatic framework of SystemE. It includes 260 geometric theorems and 52 new definitions, covering essential concepts such as Midpoints, Radical Axes, and Circumcenters. This library fills a critical void in Lean 4's Mathlib, which is primarily focused on algebraic geometry rather than synthetic Euclidean geometry.

The LeanGeo library structure and theorem counts across various geometric categories, including Basic, Metrics, Triangle, Circle, and Quadrilateral.

LeanGeo uses custom tactics like euclid_apply to allow models to invoke high-level theorems just as a human mathematician would. Furthermore, to handle the "trivial" parts of a proof—such as verifying collinearity or managing different case analyses of a diagram—LeanGeo interfaces with the CVC5 SMT solver. This allows the prover to focus on high-level logic while the SMT solver handles the underlying "grunt work" of diagrammatic verification.

Formalization of Competition Problems

One of the primary challenges in formalizing geometry is that natural language descriptions often "hand-wave" away different diagram configurations. LeanGeo forces the prover to account for every case, ensuring a level of logical soundness that previous automated solvers struggled to guarantee.

A comparison between a natural language geometry problem, its formal statement in LeanGeo, and various possible graph configurations that the formalization must account for.

As illustrated in the figure above, a single natural language statement can correspond to multiple diagrammatic configurations (e.g., points being in different relative orders on a line or circle). LeanGeo's formal statements are designed to be both human-readable and mathematically rigorous, making them compatible with the broader Lean ecosystem.

Methods: Synthetic Data and Reinforcement Learning

To train LLMs in this new formal language, the authors developed a pipeline that generated 5,000 synthetic theorem-proof pairs. They then employed Reinforcement Learning (RL) via the Kimina-Prover framework to fine-tune models.

A key technique introduced was the "instilling method." During training, the model is prompted with a random subset of theorems from the library. This forces the model to develop "discernment"—the ability to select the correct tool for a specific problem in a "noisy" environment. This approach significantly improved the models' ability to search the library effectively, raising the pass@1 rate of their base model from 2.52% to 10.92%.

Benchmarking and the "Olympic Gap"

The authors evaluated several state-of-the-art models on LeanGeo-Bench, a new benchmark consisting of 122 problems. These problems were sourced from high school competitions, Evan Chen’s geometry textbook, and include 43 IMO problems (every geometry problem since 2000).

The results highlight both the progress and the remaining challenges in the field:

  • Gemini 2.5 Pro achieved the highest overall success rate at pass@4 (27.05%).
  • o4-mini performed best at pass@1 (19.67%), showing strong "first-guess" capabilities.
  • The "Olympic Gap": Notably, none of the models could solve any of the 62 Olympic-level (OP/IMO) problems.

This underscores that while we are making progress on standard competition problems, IMO-level geometry remains an unsolved frontier for AI.

Conclusion

LeanGeo represents a significant step toward a "Grand Unified Theory" of automated reasoning. Because it lives inside Lean, it can seamlessly integrate with Mathlib, allowing for proofs that combine Euclidean reasoning with advanced trigonometric identities or coordinate algebra. Future work will focus on native proof reconstruction to eliminate reliance on external SMT certificates and scaling the system to handle even more complex geometric configurations.

Summary updated

BibTeX
@inproceedings{song2026leangeo,
  author = {Chendong Song and Zihan Wang and Frederick Pu and Haiming Wang and Xiaohan Lin and Junqi Liu and Jia Li and Zhengying Liu},
  title = {{LeanGeo: Formalizing Competitional Geometry problems in Lean}},
  booktitle = {COLM},
  year = {2026},
  url = {https://openreview.net/forum?id=KSWJ4RRhAC},
}
Figure