TL;DR
This paper details the first complete formalization of the ICML 2026 "AI for Math" Track 2 benchmark using the Lean 4 theorem prover. The author successfully verified 29 challenges—ranging from basic data structures like heaps to complex graph algorithms like Dijkstra’s and Kruskal’s—by bridging the gap between executable code and abstract mathematical specifications.
What Problem Does This Paper Address?
In the world of formal verification, there is a notorious "bottleneck": it is relatively easy to write an algorithm that works, but incredibly difficult to prove it is mathematically correct. This is because executable code (how a computer stores a heap or a forest) looks very different from the mathematical objects used in proofs (sets, graphs, and paths).
The paper addresses the ICML 2026 AI for Math Workshop benchmark, a suite designed to test how well formal tools can handle this translation. The challenge requires proving that specific Lean implementations of classic algorithms actually satisfy their textbook definitions without using any "shortcuts" (placeholders like sorry or admit).
Methods
The author employs a standard refinement pattern to tackle the complexity:
- Abstraction Relations: These are "bridge" predicates that link low-level data structures to high-level concepts. For example, they relate the internal state of a "Union-Find" structure to the mathematical concept of reachability in a graph.
- Inductive Invariants: To prove recursive algorithms (like Dijkstra’s), the author had to "strengthen" the invariants. A standard textbook proof might say "the shortest path is found," but a formal proof requires an invariant that holds true at every single step of the loop, covering edge cases that humans usually gloss over.
- Mathematical Exchange Principles: For Kruskal’s Minimum Spanning Tree (MST) algorithm, the author formalized the "cut property." This involves proving that if you swap an edge in a spanning tree for a "lighter" one, you still have a valid (and better) tree.
Datasets
The "dataset" in this context is the ICML 2026 AI for Math Workshop Track 2 (Phase 1) benchmark. It consists of:
- 29 Challenge Files: Each containing a specific theorem to be proven.
- 5 Problem Families: Treaps (randomized search trees), Segment Trees, Binary Heaps, Dijkstra’s Algorithm, and Kruskal’s MST.
- Environment: Built on Lean 4.28.0, utilizing
mathlib(Lean’s standard math library) andCSLib(a computer science library).
Key Insights and Ideas
- The Boundary Invariant: For Dijkstra’s algorithm, the "aha moment" is the realization that you cannot just track the priority queue. You must maintain a "boundary invariant" that records the relationship between the "settled" vertices (those with final distances) and the "unsettled" ones still in the queue.
- Semantic Tracking: For Kruskal’s algorithm, the implementation uses a Union-Find forest to keep track of components. The proof requires an explicit abstraction relation: two vertices are in the same Union-Find set if and only if they are reachable in the current forest.
- Infrastructure over Implementation: The paper highlights that the actual algorithm statements are compact, but the "infrastructure"—the lemmas about how data structures behave when you modify them—is where the bulk of the work (and the mathematical weight) lies.
Key Results
The author achieved a perfect score on the benchmark:
- Solved: 29/29 challenges.
- Score: 500/500 points.
- Compliance: The artifact contains no
sorryoradmitcommands and uses only permitted axioms (propext,Quot.sound, andClassical.choice). - Efficiency: The paper demonstrates that while Dijkstra and Kruskal are the most complex, they can be broken down into manageable layers: representation bridges, preservation lemmas, and exchange principles.
Limitations and Future Work
The paper focuses on Phase 1 of the benchmark. While it provides a complete manual solution, it does not explore how much of this process could be automated by AI—which is the ultimate goal of the ICML workshop.
The author notes that Dijkstra and Kruskal required the largest "proof infrastructure." This suggests that future work in the Lean community should focus on creating more robust, reusable libraries for graph-theoretic invariants to prevent researchers from having to "rebuild the bridge" every time they verify a new algorithm.
Summary updated