with one click
fill-sorry
Prove a specific sorry'd lemma iteratively using Lean LSP tools.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Prove a specific sorry'd lemma iteratively using Lean LSP tools.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Improve Claude Code workflow by updating assistants.md, skills, memory, or CLAUDE.md.
Fix warnings line by line and bring code into compliance with Mathlib style standards.
Improve an existing working proof for structural clarity, succinctness, or reusability.
Draft sorry'd theorem/lemma structure for a larger result from a proof sketch.
Fill a sorry one step at a time, directed by the user.
Read and discuss proofs, strategies, or math concepts without making any edits.
| name | fill-sorry |
| description | Prove a specific sorry'd lemma iteratively using Lean LSP tools. |
Prove a specific sorry'd lemma using the LSP tools iteratively.
Target: $ARGUMENTS
proof-patterns.md and pitfalls.md for strategies relevant to this proof shape.lean_goal at the sorry to understand the proof state.lean_multi_attempt: ["simp", "ring", "omega", "exact?", "aesop"].
simp?/exact?/apply?, use lean_diagnostic_messages with severity="info" on the relevant line — the suggestions are info-level diagnostics.simp, dsimp, ext, change to make the goal more concretename_parts ?LHS = ?RHS (or finer patterns like ?A + ?B = ?C + ?D) to bind names to sub-expressions. This makes the structure visible and lets closing tactics like module/abel/ring work on the named form. See proof-strategies.md for full syntax and caveats.lean_goal — often the simplified goal suggests the next stepsimpa using h to see if existing hypotheses close it after simplificationlean_state_search, lean_leansearch, lean_loogle) when you have a specific lemma shape in mind, not as a fishing expedition.lean_diagnostic_messages with severity="error" on the edited line(s) (start_line/end_line) to confirm no errors. Warnings/infos are noise during proof filling — ignore them. lean_goal succeeding does NOT mean the tactic compiled — a failing tactic (e.g., "simp made no progress") still shows a goal on the next line (the unchanged one).lean_goal after the tactic to see the new proof state.lean_diagnostic_messages (with severity="error") on the full lemma. No errors = done.When a subgoal looks like a standalone mathematical statement — general types, no proof-specific local variables — extract it as a sorry'd lemma above the current proof. Then:
Signs you should extract:
let/have bindings)The main proof should read like an outline: named lemmas composed with rw, exact, simp.
Bias toward editing the file and checking goals, not toward searching Mathlib. The LSP feedback loop (edit → lean_goal → adjust) is faster and more reliable than trying to find the perfect abstract lemma. Concretely:
simp / ext / congr will help, just try it — it takes one tool call. Don't spend 3 searches looking for a lemma that might do the same thing.simp or dsimp first to see what it simplifies to. The simplified form often makes the next step obvious.Sigma.mk.inj_iff), not for finding the perfect API to avoid writing 3 lines of tactics./draft problem, not a /fill-sorry problem. Report to the user: "This may need a restructuring — want to switch to /draft?"If the proof involved a non-obvious strategy (took multiple attempts, required a surprising lemma, or used an unusual tactic pattern), proactively save it to memory:
proof-strategies.md.claude/memory/api/ file.claude/memory/api/ file (under a "Pitfall" heading)Ask the user: "This proof used [strategy] — want me to save this pattern to memory for future use?"
lean_goal is your most important tool — use it after every tactic.