Analyze failed or stuck proofs and propose auxiliary lemmas to help complete the proof in Isabelle/HOL or Coq. Use when encountering proof failures, stuck proof states, unprovable subgoals, or when needing to strengthen induction hypotheses. Identifies missing lemmas, suggests proof strategies, and generates helper lemmas with appropriate statements and proof sketches. Supports inductive proofs, case analysis, rewriting, and complex proof obligations.
npx skills add https://github.com/ArabelaTso/Skills-4-SE --skill lemma-discovery-assistant
Analyze stuck or failed proofs and propose auxiliary lemmas that can help complete the proof.
When proofs fail or get stuck, the issue is often a missing auxiliary lemma. This skill helps identify what lemmas are needed by:
Unprovable subgoal:
Weak induction hypothesis:
Missing intermediate steps:
Insufficient rewrite rules:
Examine the current proof context:
What to look for:
Questions to ask:
Determine what's preventing progress:
Gap types:
Formulate precise lemma statement:
Lemma characteristics:
Example patterns:
(* Isabelle *)
lemma helper_name: "⟦ assumptions ⟧ ⟹ conclusion"
(* Coq *)
Lemma helper_name : assumptions → conclusion.
Provide guidance on proving the lemma:
Strategy types:
Show how the lemma helps the main proof:
Problem: Induction hypothesis too weak.
Solution: Strengthen the induction hypothesis.
Example (Isabelle):
Stuck proof:
lemma "length (reverse xs) = length xs"
proof (induction xs)
case Nil
then show ?case by simp
next
case (Cons x xs)
(* Stuck: reverse (x # xs) = reverse xs @ [x]
but we don't have a lemma about length of append *)
then show ?case sorry
qed
Proposed lemma:
lemma length_append: "length (xs @ ys) = length xs + length ys"
proof (induction xs)
case Nil
then show ?case by simp
next
case (Cons x xs)
then show ?case by simp
qed
Usage: Apply length_append in the induction step.
Problem: Statement too specific to prove by induction.
Solution: Generalize with accumulator or additional parameter.
Example (Coq):
Stuck proof:
Fixpoint reverse {A} (l : list A) : list A :=
match l with
| [] => []
| x :: xs => reverse xs ++ [x]
end.
Lemma reverse_involutive : forall A (l : list A),
reverse (reverse l) = l.
Proof.
induction l.
- reflexivity.
- simpl. (* Stuck: need reverse (reverse l ++ [a]) = a :: l *)
Abort.
Proposed lemma:
Lemma reverse_append : forall A (l1 l2 : list A),
reverse (l1 ++ l2) = reverse l2 ++ reverse l1.
Proof.
induction l1; intros; simpl.
- rewrite app_nil_r. reflexivity.
- rewrite IHl1. rewrite app_assoc. reflexivity.
Qed.
Usage: Use reverse_append to handle the append in the goal.
Problem: Simplification doesn't reach desired form.
Solution: Add rewrite rules for specific patterns.
Example (Isabelle):
Stuck proof:
lemma "map f (map g xs) = map (f ∘ g) xs"
proof (induction xs)
case Nil
then show ?case by simp
next
case (Cons x xs)
(* Need: (f ∘ g) x = f (g x) *)
then show ?case sorry
qed
Proposed lemma:
lemma comp_apply: "(f ∘ g) x = f (g x)"
by (simp add: comp_def)
Usage: Add to simplification set or apply explicitly.
Problem: Need properties about data structure operations.
Solution: Prove fundamental properties of the structure.
Example (Coq):
Stuck proof:
Fixpoint insert (x : nat) (t : tree) : tree := (* ... *)
Lemma insert_member : forall x t,
member x (insert x t) = true.
Proof.
induction t.
- (* Stuck: need properties of member and insert *)
Abort.
Proposed lemmas:
Lemma member_insert_eq : forall x y t,
x = y → member x (insert y t) = true.
Lemma member_insert_neq : forall x y t,
x ≠ y → member x (insert y t) = member x t.
Lemma member_insert : forall x y t,
member x (insert y t) = (x =? y) || member x t.
Usage: Case split on x = y and apply appropriate lemma.
For Isabelle-specific lemma patterns, tactics, and the sledgehammer tool, see references/isabelle_lemmas.md.
Key features:
try and try0 for tactic explorationFor Coq-specific lemma patterns, tactics, and proof search, see references/coq_lemmas.md.
Key features:
Search and SearchAbout for finding lemmasauto, eauto for proof searchLtacFor detailed lemma patterns organized by category, see references/proof_patterns.md.
Categories include:
Scenario: Proving correctness of insertion sort.
Main theorem (Isabelle):
lemma insertion_sort_correct:
"sorted (insertion_sort xs) ∧ mset (insertion_sort xs) = mset xs"
Stuck proof:
proof (induction xs)
case Nil
then show ?case by simp
next
case (Cons x xs)
(* Need to show:
sorted (insert x (insertion_sort xs))
mset (insert x (insertion_sort xs)) = mset (x # xs) *)
then show ?case sorry
qed
Analysis:
insert functioninsert preserves sortinginsert preserves multisetProposed lemmas:
(* Lemma 1: insert preserves sorting *)
lemma insert_sorted:
"sorted xs ⟹ sorted (insert x xs)"
proof (induction xs)
case Nil
then show ?case by simp
next
case (Cons y ys)
then show ?case
by (auto simp: sorted_Cons)
qed
(* Lemma 2: insert preserves multiset *)
lemma mset_insert:
"mset (insert x xs) = {#x#} + mset xs"
proof (induction xs)
case Nil
then show ?case by simp
next
case (Cons y ys)
then show ?case by (auto simp: ac_simps)
qed
(* Lemma 3: sorted definition for cons *)
lemma sorted_Cons:
"sorted (x # xs) = (sorted xs ∧ (∀y ∈ set xs. x ≤ y))"
by (auto simp: sorted_append)
Revised main proof:
lemma insertion_sort_correct:
"sorted (insertion_sort xs) ∧ mset (insertion_sort xs) = mset xs"
proof (induction xs)
case Nil
then show ?case by simp
next
case (Cons x xs)
have "sorted (insertion_sort xs)" using Cons by simp
then have "sorted (insert x (insertion_sort xs))"
by (rule insert_sorted)
moreover have "mset (insert x (insertion_sort xs)) = {#x#} + mset (insertion_sort xs)"
by (rule mset_insert)
moreover have "mset (insertion_sort xs) = mset xs"
using Cons by simp
ultimately show ?case by (auto simp: ac_simps)
qed
Possible issues:
Solutions:
Possible issues:
Solutions:
For detailed guidance on specific aspects:
Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.
Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances
Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.
Build and distribute Expo development clients locally or via TestFlight
Use when you have a written implementation plan to execute in a separate session with review checkpoints
Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.
Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.
Take arabelatso/lemma-discovery-assistant from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.