MechGeo: Autoformalizing and Proving Euclidean Geometry in Lean 4

📅 2026-08-03
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the challenge of automatically formalizing and verifying proofs for International Mathematical Olympiad (IMO)-level Euclidean geometry problems. It introduces GeoFormalizer, a Mathlib-native agent framework that translates informal problem statements into a geometric intermediate representation (GeoIR) and then into Lean 4, iteratively refining the formalization through structural diagnosis and semantic evaluation. Complementing this, GeoProver generates lemmas via geometric proof planning and algebraizes subgoals, producing algebraic certificates using Singular or SymPy, all verified by the Lean kernel. The approach achieves the first large-scale, kernel-verified automated proofs and counterexample generation for IMO geometry, incorporating a counterexample-guided diagnostic mechanism that significantly enhances weak models’ formalization performance. On 43 historical IMO problems, it proves 29 directly, generates Lean-verified counterexamples for the remaining 14—later proving corrected versions—and establishes the largest automated, kernel-verified IMO geometry proof set to date, including 12 new proofs and formal refutations of two previously conjectured statements on Lean-IMO-Bench.
📝 Abstract
We present MechGeo, a Mathlib native agentic framework that jointly addresses faithful autoformalization and certified proof construction for Euclidean geometry. In this framework, GeoFormalizer represents informal problems in GeoIR, deterministically translates them into Lean 4, and iteratively repairs candidate statements using structural diagnostics and semantic evaluation. GeoProver constructs geometric proof plans, derives intermediate lemmas, and selectively algebraizes suitable subgoals through a library verified in Lean. Singular or SymPy may generate algebraic certificates, but all resulting proofs and counterexamples are checked by Lean's kernel. Experiments across seven LLM backbones show substantial improvements in autoformalization, particularly for models with weaker direct translation performance. On 43 historical IMO geometry problems, GeoFormalizer generates formal statements that GeoProver proves in 29 cases; for the remaining 14, it constructs counterexamples verified in Lean and proves all repaired statements after expert correction. Together with IMO 2026 Problem 2, this yields, to the best of our knowledge, the largest reported collection of automated, kernel-checked Lean proofs for IMO geometry problems. On the 14 geometry statements in LEAP's Lean-IMO-Bench, MechGeo proves 12 for the first time, formally refutes the remaining two, and proves both repaired statements. These results establish counterexample guided diagnosis, geometric reasoning, and certified symbolic computation as a practical foundation for trustworthy formal geometry.
Problem

Research questions and friction points this paper is trying to address.

autoformalization
Euclidean geometry
formal proof
counterexample
certified reasoning
Innovation

Methods, ideas, or system contributions that make the work stand out.

autoformalization
certified proof
counterexample-guided diagnosis
geometric reasoning
symbolic computation