Skip to content

About

No description, website, or topics provided.

Resources

Stars

8 stars

Watchers

1 watching

Forks

Repository files navigation

MechGeoBench

MechGeoBench is a Lean 4 benchmark for formalized Euclidean geometry. It pairs geometry problem statements with machine-checked proofs built on Mathlib and provides reusable infrastructure for reducing geometric relations to algebraic goals.

For more details, see our paper MechGeo: Autoformalizing and Proving Euclidean Geometry in Lean 4.

Benchmark contents

Collection Problems Verified solutions
IMOBench 44 44
LEAP 14 14
Total 58 58

Every entry has two versions:

  • problems/ contains the formal problem statements, with each main theorem ending in by sorry. These files serve as benchmark inputs.

  • solutions/ contains complete Lean proofs of the corresponding theorems. The solution files contain no sorry placeholders.

Repository layout

MechGeoBench/
├── GeoTheorem/          # Shared geometric lemmas and algebraization infrastructure
├── IMOBench/
│   ├── problems/        # IMO problem statements
│   └── solutions/       # Verified IMO solutions
├── LEAP/
│   ├── problems/        # LEAP problem statements
│   └── solutions/       # Verified LEAP solutions
├── Convex.lean          # Definitions of convex polygon, easy to inline for benchmark without extra imports
├── lakefile.toml        # Lake package and build targets
├── lean-toolchain       # Pinned Lean toolchain
└── README.md

The shared GeoTheorem library includes ToPoly utilities used across many solutions to translate coordinate, incidence, distance, and inner-product conditions into polynomial identities that Lean tactics can discharge.

json files in solutions/ are for verification with Comparator.

Getting started

Install elan, then clone and build the repository:

git clone https://github.com/MechMath/MechGeoBench.git
cd MechGeoBench
lake exe cache get  -- downloads precompiled Mathlib artifacts
lake build   -- build all statements and solutions

The repository pins Lean v4.27.0 in lean-toolchain; elan selects it automatically. lake exe cache get downloads precompiled Mathlib artifacts and substantially reduces the initial build time.

Checking individual files

Use lake env lean to check a single problem or solution:

lake env lean IMOBench/problems/IMO_2024_p4.lean
lake env lean IMOBench/solutions/IMO_2024_p4.lean

lake env lean LEAP/problems/IMO_LeanProofBench_PB_Advanced_009.lean
lake env lean LEAP/solutions/IMO_LeanProofBench_PB_Advanced_009.lean

Paper and Citation

If you find this repository useful, please cite:

@misc{shen2026mechgeo,
  title         = {MechGeo: Autoformalizing and Proving Euclidean Geometry in Lean 4},
  author        = {Hao Shen and Junyu Guo and Tian Cui and Yuxuan Xiao and Lihong Zhi},
  year          = {2026},
  eprint        = {2608.02295},
  archivePrefix = {arXiv},
  primaryClass  = {cs.AI},
  doi           = {10.48550/arXiv.2608.02295},
  url           = {https://arxiv.org/abs/2608.02295}
}

License

Unless otherwise noted, this repository is licensed under the Apache License 2.0. Third-party materials retain their original licenses and attribution requirements; see THIRD_PARTY_NOTICES.md for details.

About

No description, website, or topics provided.

Resources

Stars

8 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages