Help us improve
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
Share bugs, ideas, or general feedback.
By cameronfreer
Automate theorem proving in Lean 4: draft formalizations from informal math, auto-prove theorems with multi-cycle repair, refactor proofs using mathlib, and eliminate axioms — all via LSP-driven commands and agents.
npx claudepluginhub cameronfreer/lean4-skills --plugin lean4Autonomous end-to-end formalization from informal sources
Autonomous multi-cycle theorem proving with hard stop rules
Save progress with a safe commit checkpoint
Diagnostics, cleanup, and migration help
Draft Lean declaration skeletons from informal claims
Remove nonconstructive axioms by refactoring proofs to structure (kernels, measurability, etc.). Use after checking axiom hygiene to systematically eliminate custom axioms.
Golf Lean 4 proofs after they compile; improve proofs for directness, clarity, performance, and brevity without changing semantics. Use after successful compilation to achieve 30-40% size reduction.
Compiler-guided iterative proof repair with two-stage repair escalation (fast → strong). Use for error-driven proof fixing with small sampling budgets (K=1).
Strategic resolution of stubborn sorries; may refactor across files within the header fence. Use when fast pass fails or for complex proofs.
Executes bash commands
Hook triggers when Bash tool is used
Uses power tools
Uses Bash, Write, or Edit tools
Share bugs, ideas, or general feedback.
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge.
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
Multi-agent collaborative theorem proving with LeanTree and Ensue Memory Network
Prove, clean up, golf, and bring Lean 4 code up to mathlib standards
Skills for developing with Lean 4 and Mathlib — proof methodology, toolchain setup, bisection, and more
Draft and submit bug reports, feature requests, and insights for lean4-skills as GitHub issues. Commands may share Lean code snippets with GitHub — review every draft before confirming.
Programming as Theory Building guidelines for coding agents, grounded in Peter Naur's paper and focused on preserving program theory during code work.
Self-evolving Claude Code system that learns from corrections, manages context, and improves every session
Draft and submit bug reports, feature requests, and insights for lean4-skills as GitHub issues. Commands may share Lean code snippets with GitHub — review every draft before confirming.
Lean 4 workflow pack for AI coding agents. Gives your agent a structured prove/review/golf loop, mathlib search, axiom checking, and safety guardrails. The workflows are host-agnostic — Claude Code, Codex, Gemini CLI, Cursor, and others all use the same core skill; only the invocation surface differs.
| Workflow | Description |
|---|---|
| draft | Draft Lean declaration skeletons from informal claims |
| formalize | Interactive formalization — drafting plus guided proving |
| autoformalize | Autonomous end-to-end formalization from informal sources |
| prove | Guided cycle-by-cycle theorem proving |
| autoprove | Autonomous multi-cycle proving with stop rules |
| checkpoint | Save point (per-file + project build, axiom check, commit) |
| review | Read-only quality review |
| refactor | Leverage mathlib, extract helpers, simplify proof strategies |
| golf | Improve proofs for directness, clarity, performance, and brevity |
| learn | Interactive teaching and mathlib exploration |
| doctor | Diagnostics and migration help |
Claude Code: invoke as /lean4:<name>. Other hosts: follow the corresponding workflow in SKILL.md.
Typical session: draft (or formalize / autoformalize) → prove (or autoprove) → review → refactor → golf → checkpoint → git push.
draft — Skeleton-only drafting from informal claims. Use when you want Lean declarations without a full prove run.formalize — Interactive synthesis. Drafts a skeleton, then runs guided prove cycles with user interaction.autoformalize — Autonomous synthesis. Extracts claims from a source, drafts skeletons, and proves them unattended.prove — Guided proof engine for existing declarations. Asks preferences at startup, prompts before each commit, pauses between cycles.autoprove — Autonomous proof engine for existing declarations. Auto-commits, loops until a stop condition fires (max cycles, max time, or stuck).--commit controls per-fill commit behavior. When stuck, both force a review + replan.formalize and autoformalize wrap drafting around that same engine. Statement and header changes belong there — prove and autoprove keep declaration headers immutable..lean files without a command activates the skill for one bounded pass — fix the immediate issue, then suggest the right next command: draft / formalize for statement work, prove / autoprove for proof work.See plugin README for the full command guide.
/plugin marketplace add cameronfreer/lean4-skills
/plugin install lean4
Optionally, install the contribution helper to draft bug reports, feature requests, or shareable insights from your editor:
/plugin install lean4-contribute
Clone (shallow) and follow the setup for your host:
git clone --depth 1 https://github.com/cameronfreer/lean4-skills.git
AGENTS.md + env vars. See INSTALLATION.md → CodexGEMINI.md + env vars. See INSTALLATION.md → Gemini.opencode/skills/ + env vars. See INSTALLATION.md → OpenCodeThe skill works standalone, but plays especially well with lean-lsp-mcp — faster mathlib search and sub-second feedback instead of 30+ second lake build cycles. Works with any MCP-capable host.
What you get:
lean_goal — exact goal state at any linelean_local_search / lean_leanfinder / lean_leansearch / lean_loogle — mathlib searchlean_multi_attempt — test multiple tactics in parallellean_hammer_premise — premise suggestions for simp/aesop/grindlean_diagnostic_messages — per-file error/warning check without a full lake buildClaude Code (run from your Lean project root):
# User-scoped — available in all your projects
claude mcp add --transport stdio --scope user lean-lsp -- uvx lean-lsp-mcp
# Or project-scoped — shared via .mcp.json
claude mcp add --transport stdio --scope project lean-lsp -- uvx lean-lsp-mcp