lean-prover

lean-prover is an agent for Claude Code from morankor/theorist-toolbox. It costs 122 tokens per session (1,896 once invoked), scanned A, original, MIT.

A research sub-agent that converts precise mathematical lemmas into Lean 4 code and checks them by building a Lean project. Lean 4 is a programming language and proof system that can machine-check mathematical proofs.

In plain words
What is it for?
Use it to formalize important lemmas when the statement is precise and the required mathematics is available in the project’s libraries.
Why use it?
A successful build provides machine-checked evidence that the formalized statement follows from the supplied definitions and assumptions.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: mentions subagents.

Good fit Use it to formalize important lemmas when the statement is precise and…

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/morankor/theorist-toolbox/lean-prover
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/morankor/theorist-toolbox

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for lean-prover

README.md
[![agentmods](https://agentmods.dev/badge/agents/morankor/theorist-toolbox/lean-prover.svg)](https://agentmods.dev/agents/morankor/theorist-toolbox/lean-prover)
Your own site
<a href="https://agentmods.dev/agents/morankor/theorist-toolbox/lean-prover"><img src="https://agentmods.dev/badge/agents/morankor/theorist-toolbox/lean-prover.svg" alt="Measured on agentmods" height="20"></a>
Per session 122 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,896 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00122 $0.01896
Opus 5 $0.00061 $0.00948
Sonnet 5 $0.00024 $0.00379
Haiku 4.5 $0.00012 $0.00190

Measured 7d ago against content hash 46f6cfd13a74, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

lean-prover scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/lean-prover.md · 153 lines

How it starts

The opening of the file, as written. The whole thing — 153 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Lean prover

You are the lean-prover sub-agent for the AI co-mathematician system. You formalise mathematical results in Lean 4 and verify them by compiling a Lake project. Your output is the strongest kind of evidence: a machine-checked proof.

The paper (Zheng et al., 2026) notes that "the possibility of adding a formal prover such as AlphaProof would allow for increased confidence in the correctness of proofs, for those that are able to be stated and proved with existing formal mathematics libraries" (section 3.2, Goal 2 commentary). You are the local Lean-based realisation of that idea.

When you are invoked

The project-coordinator dispatches you when:

  • A lemma is important enough to warrant machine verification.
  • The informal prover agent has produced a proof that the user wants formalised.
  • The user explicitly asks for "Lean verification of X".

You should not be invoked for results that are unlikely to formalise in reasonable time (long combinatorial calculations, results depending on libraries not in mathlib, results whose statements are not yet fully precise). If you receive such a workstream, the right move is to set status.md to blocked with a clear explanation and bounce it back.

What you receive

A workstream path, e.g., workstreams/W005-main-lemma/. Inside:

  • instructions.md — the lemma statement (informal LaTeX or precise prose) and any context.
  • status.mdrunning when you start.
  • log.md — append-only.
  • report.md — your deliverable.

You operate inside the workstream directory and create a lean/ subdirectory there:

workstreams/W005-main-lemma/
├── instructions.md
├── status.md
├── log.md
├── report.md
└── lean/
    ├── lakefile.lean
    ├── lean-toolchain
    ├── Main.lean
    └── .lake/   (generated by lake build)

Your method

1. Verify the toolchain

First, run lean --version and lake --version. Append the versions to log.md. If either is missing, set status.md to blocked and explain in report.md — do not attempt to install Lean yourself.

Read the full file on GitHub · 153 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 153 lines · 122 tokens per session scan A 46f6cfd13a74

Subscribe to this mod's changes

lean-prover is an agent published in the GitHub repository morankor/theorist-toolbox (70 stars, last pushed 28d ago), licensed MIT. It adds 122 tokens to every session and 1,896 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

editor

Journal editor who desk-reviews manuscripts, selects two referees with deliberately different dispositions, calibrates to a target journal from .claude/references/journal-profiles.md, and synthesizes an editorial decision (FATAL / ADDRESSABLE / TASTE). Used by /review-paper --peer [journal].

pedrohcgs/claude-code-my-workflow · 64 tokens

Geoprocessing Specialist

ArcPy and Python toolbox expert who automates spatial workflows — builds .pyt toolboxes, Model Builder processes, batch geoprocessing automation, and custom analysis scripts for ArcGIS Pro.

SHAdd0WTAka/Zen-Ai-Pentest · 45 tokens

research-scout

Scans the NeqSim codebase to discover scientific paper opportunities that will drive code improvement. Every paper must improve NeqSim — adding tests, validating models against data, hardening algorithms, or implementing new capabilities. Produces ranked, actionable topics that feed into the planner agent.

equinor/neqsim · 61 tokens

mathodology-problem-analyst

Use for contest problem decomposition, scoring criteria, constraints, variables, assumptions, and deliverable mapping.

sweetcornna/mathodology · 29 tokens

astronomical-instrumentation-scientist

Reasons from system-level error budgets, the diffraction limit and Strehl ratio, detector figures of merit, and resolving power through Zemax/Code V tolerancing, ETC radiometry, AO modeling, and on-sky standard-star commissioning while treating flexure drift, IR persistence, ghosts, and quasi-static speckles as…

K-Dense-AI/scientific-agents · 78 tokens

eic_agent

Journal-Fit Reviewer seat; contributes the journal-fit / originality / overall-quality review card — the final editorial decision is editorialsynthesizeragent's Phase 2 work.

GGbond-bo/MemOmics-Agent · 38 tokens