一键导入
sorrifier
Isolates failing proof steps by replacing them with `sorry` and extracting them into standalone lemmas to modularize and decouple complex Lean 4 proofs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Isolates failing proof steps by replacing them with `sorry` and extracting them into standalone lemmas to modularize and decouple complex Lean 4 proofs.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
A no-op skill used only by the agent-capability tests to confirm a harness can mount and invoke a skill. Has no real behavior; invoke it when asked to during a capability probe.
Use when editing .lean files, debugging Lean 4 builds (type mismatch, sorry, failed to synthesize instance, axiom warnings, lake build errors), searching mathlib for lemmas, formalizing mathematics in Lean, or learning Lean 4 concepts. Also trigger when the user asks for help with Lean 4, mathlib, or lakefile. Do NOT trigger for Coq/Rocq, Agda, Isabelle, HOL4, Mizar, Idris, Megalodon, or other non-Lean theorem provers.
Lean 4 theorem proving toolkit: search lemmas, verify proofs, repair/simplify code, and get LLM-assisted informal proofs
Code transformation tools for repairing, simplifying, and extracting Lean proofs
LLM-assisted tools for informal proofs, proof strategy discussion, and code simplification
Search tools for finding Lean theorems, lemmas, and definitions in Mathlib
| name | sorrifier |
| description | Isolates failing proof steps by replacing them with `sorry` and extracting them into standalone lemmas to modularize and decouple complex Lean 4 proofs. |
Structural refactoring workflow for isolating broken proof steps. Replaces failing logic with sorry, extracts it into a standalone lemma, and reconstructs the call site so the main theorem compiles cleanly.
This workflow uses two tools from other skills. All commands go through the logging wrapper.
| Tool | Skill | Purpose |
|---|---|---|
uv run --no-project .claude/skills/cli/lean_check.py FILE | verification | Diagnose compilation errors and pinpoint failing lines |
uv run --no-project .claude/skills/cli/axle.py sorry2lemma | code-transform | Extract sorry into standalone lemma with --reconstruct-callsite |
For full parameter reference, see verification/reference-lean-check.md and code-transform/reference-axle-sorry2lemma.md.
Follow these steps sequentially:
Run uv run --no-project .claude/skills/cli/lean_check.py FILE to identify failing lines.
lean_messages for entries with severity: "error".sorryEdit the Lean code: replace the failing tactic/expression with sorry.
sorry to the smallest failing block, not the entire theorem.Run uv run --no-project .claude/skills/cli/lean_check.py FILE again.
declaration uses 'sorry' are expected.Run uv run --no-project .claude/skills/cli/axle.py sorry2lemma with:
--reconstruct-callsite (required) — replaces sorry with the extracted lemma call--names <theorem> — target only the specific theorem--no-include-whole-context if local context variables need capturingRun uv run --no-project .claude/skills/cli/lean_check.py FILE one last time.
Broken state:
import Mathlib.Tactic
theorem sum_of_squares_helper (n : ℕ) : (n + 1)^2 = n^2 + 2*n + 1 := by
have h1 : (n + 1)^2 = (n + 1) * (n + 1) := by ring
rw [h1]
exact magic_solve n -- error: unknown identifier
After sorrify + extract:
uv run --no-project .claude/skills/cli/axle.py sorry2lemma file.lean --environment lean-4.28.0 --names sum_of_squares_helper --reconstruct-callsite
import Mathlib.Tactic
lemma sum_of_squares_helper_lemma_1 (n : ℕ) (h1 : (n + 1) ^ 2 = (n + 1) * (n + 1)) :
(n + 1) * (n + 1) = n ^ 2 + 2 * n + 1 := by
sorry
theorem sum_of_squares_helper (n : ℕ) : (n + 1)^2 = n^2 + 2*n + 1 := by
have h1 : (n + 1)^2 = (n + 1) * (n + 1) := by ring
rw [h1]
exact sum_of_squares_helper_lemma_1 n h1
have statement, not the entire theorem.lemma_1). Rename to something meaningful.informal_prover or manual proof.