lean4-theorem-proving

Repair Lean 4 proofs using compiler feedback and mathlib search.

4|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/GeneralReasoning/env-skillsbench --skill lean4-theorem-proving-generalreasoning
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lean4-theorem-proving
Source: https://github.com/GeneralReasoning/env-skillsbench/tree/main/lean4-proof/environment/skills/lean4-theorem-proving
Command: npx skills add https://github.com/GeneralReasoning/env-skillsbench --skill lean4-theorem-proving-generalreasoning

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Lean 4 theorem proving often suffers from cryptic type-class errors, scattered Domain knowledge, and slow repair cycles. This Skill unit consolidates domain knowledge, automated tooling, and compiler-guided workflows to speed up proving correct Lean code, from first failure to a clean, working proof.

Core Features & Use Cases

  • Interactive slash commands and automation scripts for search, analysis, optimization, and repair of Lean 4 proofs.
  • Compiler-guided repair workflows that exploit Lean's feedback to propose minimal patches, prioritize fixes, and reduce wasted edits.
  • LSP-integrated workflows and mathlib discovery patterns to locate lemmas, definitions, and tactics quickly during proof development.
  • Subagent-style workflows for batch proof analysis, axiom hygiene, and proof refactoring for large projects.

Quick Start

Run the slash command to start repairing a Lean file: /lean4-theorem-proving:repair-file MyProof.lean

Frequently Asked Questions about lean4-theorem-proving

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I repair Lean 4 proofs when I get cryptic type-class errors?

To repair Lean 4 proofs with cryptic type-class errors, use compiler-guided workflows that leverage LSP feedback loops to propose minimal patches, prioritize fixes, and isolate sorries. This reduces wasted edits and accelerates the repair cycle.

What is the best way to find missing lemmas in Lean 4 mathlib during proof development?

Finding missing lemmas in Lean 4 mathlib is achieved through LSP-integrated workflows and mathlib search patterns that quickly locate definitions, lemmas, and tactics during proof development.

How do I fix a broken Lean 4 file using compiler repair workflows?

To fix a broken Lean 4 file, run the interactive slash command to start repairing. The workflow analyzes failures, recommends minimal patches, and isolates sorries to guide you from first failure to a clean working proof.

Can I automate batch proof analysis and refactoring for large Lean 4 projects?

Yes, you can automate batch proof analysis, axiom hygiene, and proof refactoring for large Lean 4 projects by coordinating with subagent-style workflows designed for scalable proof work.

Why does my Lean 4 theorem proving workflow suffer from slow repair cycles?

Lean 4 theorem proving workflows suffer from slow repair cycles due to scattered domain knowledge and cryptic errors. Consolidating automated tooling and compiler feedback loops speeds up proving correct Lean code.

Do I need specific automation tools to isolate sorries in Lean 4 proofs?

You need automation scripts and interactive slash commands to isolate sorries in Lean 4 proofs. These tools coordinate with the live compiler to prioritize fixes and reduce wasted edits.