Project
Project Orion
An AI-assisted mathematical formalization engine for Lean 4. Given an underdeveloped area of Mathlib, it decomposes it into a structured blueprint and proves every entry automatically — producing a complete, verified library with zero sorry and zero axiom.
Overview
First End-to-End Result
Target: Graded Order Combinatorics — level sets, rank-generating polynomials, and saturated chains over graded posets.
| Metric | Value |
|---|---|
| Definitions | 2 |
| Theorems proved | 16 |
| Lean 4 source | 250 lines, 3 files |
sorry / axiom | 0 |
| Automated cost | ~$15.80 |
| Wall time | 1h 10m |
The output compiles cleanly against Lean 4 v4.29.0-rc2 and Mathlib.
Architecture
The system is organized into five pillars, each an independent Python module:
- Edge Finder — Identifies underdeveloped “pockets” in Mathlib by combining LLM concept generation, LeanExplore search, and algorithmic scoring.
- Proof Oracle — Proves individual lemmas by spawning fresh Claude Code sessions equipped with
lean-lsp-mcp(compiler diagnostics) andLeanExplore(Mathlib search) via MCP. Every proof is hard-gated:lake env leanmust report zero errors, zerosorry, zeroaxiom. - Library Architect — Decomposes a mathematical theme into a dependency-ordered blueprint. Uses a two-pass pipeline: skeleton pass for mathematical intent, then a grounded expansion pass using LeanExplore to anchor every signature against real Mathlib declarations.
- Library Weaver — Walks the dependency DAG in topological order, accumulates Lean source files, and invokes the Proof Oracle for each entry.
- Proof Foundry (future) — Assembles verified proofs into Mathlib-conformant pull requests.
Key Design Decisions
- Hard verification gate. Every proof is verified by
lake env lean— the actual Lean compiler, not an LLM self-report. - Grounded signatures. Library Architect searches real Mathlib declarations before generating Lean 4 signatures, eliminating hallucinated API names — the #1 failure mode in LLM-generated formal math.
- Docs-first development. Every subsystem has a design document written before implementation and a walkthrough written after.