This repository is an ATP workbench built around LLM-guided proof search, Lean verification, and experiment-friendly tooling.
InitTranslate the problem, identify imports, and retrieve exact Lean declarations.PlannerGenerate multiple proof candidates instead of committing to a single chain of thought.ProverAttempt Lean proofs candidate by candidate.VerifierScore, prune, and repair branches using proof feedback.SummarizerProduce the final proof report or next-step recommendation.
flowchart LR
U[User Theorem / Task] --> I[Init Layer]
I --> R[Retrieval Layer]
I --> P[Planner]
R --> P
P -->|candidate tactics / plans| S[Search Tree]
S --> PR[Prover]
PR -->|attempt next branch| E[LeanExecutor]
E -->|proof states / errors| V[Verifier]
V -->|reprioritize / prune / repair| S
E -->|solved branch| O[Proof Result]
V -->|logs / metrics| B[Benchmark Runner]
subgraph runtime[Python ATP Runtime]
I
R
P
S
PR
E
V
B
end
subgraph backend[Lean Backend]
L[lean-interact + Lean REPL]
end
E <--> L
The main control loop is:
Initprepares theorem context and importsRetrievalsupplies Lean declarations and external notesPlannerproposes multiple tactic continuationsSearch Treetracks active proof branchesProverattempts candidate branches one by oneLeanExecutorruns branches against LeanVerifierscores progress and decides what to expand next
uv sync
cd ATP && lake build && cd ..
uv run examples/minimal_atp.py
uv run examples/llm_guided_atp.py
uv run examples/run_benchmark.py
uv run pytest tests/test_llm_loop.py
uv run pytest tests/test_lean_executor.py
uv run pytest tests/test_pipeline.pyIf you want to connect models and Lean tools end to end, you will also need the relevant API keys and a working Lean environment.
See examples/minimal_atp.py for a smallest end-to-end instance. It does three things:
- creates an
InMemoryStore - stores one theorem and its tactic script
- runs that theorem through
LeanExecutor
- add stronger theorem-premise graphs instead of flat retrieval
- learn branch scoring from logged proof trajectories
- add benchmark suites like MiniF2F-style Lean subsets
- mix symbolic search policies with LLM-generated tactic priors