lean-proof-repair
Skill3 starsChanged 25 days agoApache-2.0View on GitHub
USE FOR: repairing broken Lean 4 proofs after toolchain upgrades, Mathlib bumps, or simp drift. DO NOT USE FOR: writing new proofs (@lean-proof) or bisecting commits (@lean-bisect). TRIGGERS: proof repair, broken proof, toolchain upgrade, Mathlib bump, simp drift.
In this repository65 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-guard-judge-evalSkill
- applied-data-information-securitySkill
- applied-engineering-disciplinesSkill
- applied-legal-reasoningSkill
- epistemic-discovery-engineSkill
- epistemic-mappingSkill
- hol-metamath-adapterSkill
- isabelle-isar-adapterSkill
- itp-cross-portingSkill
- lean-ai-formalizationSkill
- lean-applied-reasoningSkill
- lean-axiom-closureSkill
- lean-bigraph-modelingSkill
- lean-bisectSkill
- lean-blueprintSkill
- lean-buildSkill
- lean-causal-reasoningSkill
- lean-competitive-mathSkill
- lean-convergence-verificationSkill
- lean-core-onlySkill
- lean-dag-visualizerSkill
- lean-deep-auditSkill
- lean-doc-feedbackSkill
- lean-doc-improvementSkill
- lean-doc-requirementsSkill
- lean-enforcementSkill
- lean-formalization-breakdownSkill
- lean-gatewaySkill
- lean-integration-protocolSkill
- lean-knowledge-formalizationSkill
- lean-math-analysisSkill
- lean-math-discreteSkill
- lean-math-dynamicalSkill
- lean-math-foundationsSkill
- lean-math-optimizationSkill
- lean-math-stochasticSkill
- lean-mweSkill
- lean-nested-learningSkill
- lean-package-researchSkill
- lean-pedagogical-expositionSkill
- lean-proof-refactorSkill
- lean-proof-reviewSkill
- lean-proofSkill
- lean-prSkill
- lean-quality-engineSkill
- lean-replay-verificationSkill
- lean-reportSkill
- lean-researchSkill
- lean-retroactive-auditSkill
- lean-retro-methodologySkill
- lean-review-councilSkill
- lean-security-formalizationSkill
- lean-setupSkill
- lean-specificationSkill
- lean-tautology-triageSkill
- lean-upstream-portingSkill
- lean-vendor-substrateSkill
- lean-zettelkastenSkill
- math-product-managementSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
Snapshot Diagnostics via LSP (
lean_diagnostics): Call lean_diagnostics on the broken file to collect exact line/column error spans and … - Very specific: line 42
Inspect Pre/Post Goal State (
lean_goal): Call lean_goal at the failing tactic line with target: "tactic" and target: "altproof" to … - Very specific: line 49
STOP: if repairing the proof appears to require weakening the theorem statement or adding a new hypothesis.
- Very specific: line 52
STOP: after 3 failed repair attempts on the same goal and run lean_counterexample_search(strategy: "dense") to check whether an upstream …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Lean 4 Automated & Interactive Proof Repair
Diagnose and repair broken Lean 4 tactic scripts caused by toolchain bumps, Mathlib API renames, simp
normal-form drift, or
upstream
definition changes without weakening theorem statements.
Routing
- USE FOR: fixing broken proofs after
lean-toolchainorlake-manifest.jsonupdates, replacing renamed Mathlib lemmas, stabilizing brokensimpcalls intosimp only [...], and recovering fromomega/ring/aesopregressions. - DO NOT USE FOR: authoring new proofs from scratch (delegate to
@lean-proof); bisecting toolchain commits (delegate to@lean-bisect); refactoring already-green proofs (delegate to@lean-proof-refactor). - TRIGGERS: proof repair, broken proof, toolchain upgrade, Mathlib bump, unknown identifier in proof,
simp made no progress,unsolved goalsafter bump.
Workflow
- Snapshot Diagnostics via LSP (
lean_diagnostics): Calllean_diagnosticson the broken file to collect exact line/column error spans and classify each failure (UnknownIdentifier,TypeMismatch,UnsolvedGoals,SimpNoProgress,HeartbeatTimeout). - Inspect Pre/Post Goal State (
lean_goal): Calllean_goalat the failing tactic line withtarget: "tactic"andtarget: "altproof"to compare the live goal against the expected intermediate state. - Apply Targeted Repair Pattern:
- Renamed / moved lemma: inspect live hover/signatures with
lean_navigate(operation: "hover" | "definition")or querylean_search(source: "code" | "loogle")for the type shape and substitute the new identifier.
- Renamed / moved lemma: inspect live hover/signatures with
Recovery & STOP
- STOP if repairing the proof appears to require weakening the theorem statement or adding a new
hypothesis; escalate to
@lean-specification(specifierrole). - STOP after 3 failed repair attempts on the same goal and run
lean_counterexample_search(strategy: "dense")to check whether an upstream definition change invalidated the theorem statement.
Handoffs
- Predecessors:
skill:lean-gateway,skill:lean-build(surfaces broken build targets),skill:lean-bisect(identifies breaking commit),skill:lean-proof. - Successors:
skill:lean-proof-review(4-layer soundness audit),skill:lean-replay-verification(fresh kernel replay),skill:lean-enforcement.
Detailed reference
Full encyclopedic reference, decision trees, and lookup tables live in
references/lean-proof-repair-handbook.md .
See also
../../references/lean-proof-repair-handbook.md-- Completelean-proof-repairHandbook../lean-gateway/SKILL.md-- Top-level skill router
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

