本文へ移動
cccskills
無料GitHub で公開

proof-skeleton-generator

Generate structured proof skeletons with tactics, strategies, and intermediate lemmas for theorems in Isabelle/HOL or Coq. Use when users need to: (1) Create proof outlines for theorem statements, (2) Generate proof structure with tactic placeholders, (3) Identify key lemmas needed for a proof, (4) Plan proof strategies (induction, case analysis, forward/backward reasoning), (5) Scaffold proofs with intermediate steps and subgoals, or (6) Convert theorem statements into detailed proof templates. Supports both Isabelle/HOL and Coq equally.

インストール方法を見る

含まれるファイル(4)

  • SKILL.md7.1 KB
  • references/coq_tactics.md5.2 KB
  • references/examples.md9.9 KB
  • references/isabelle_tactics.md3.9 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Proof Skeleton Generator

Generate structured proof skeletons with tactics, proof strategies, and key lemmas for theorems in Isabelle/HOL or Coq.

Workflow

1. Analyze the Theorem Statement

Examine the theorem to understand:

  • Quantifiers: Universal (∀/forall) or existential (∃/exists)
  • Logical structure: Implications, conjunctions, disjunctions
  • Data types involved: Lists, natural numbers, custom types
  • Complexity: Simple equality vs. complex property

2. Choose Target System

Ask the user which proof assistant to target:

  • Isabelle/HOL: Uses Isar structured proofs, automatic tactics
  • Coq: Uses Ltac tactics, more explicit proof terms
  • Both: Generate skeletons for both systems

If not specified, default to generating both versions.

3. Determine Proof Strategy

Based on the theorem structure, identify the appropriate proof technique:

Induction - When theorem involves recursive types:

  • List induction for list properties
  • Natural number induction for arithmetic
  • Structural induction for custom datatypes
  • Strong induction when needed

Case Analysis - When theorem involves:

  • Boolean conditions
  • Option types (None/Some)
  • Sum types or custom constructors
  • Conditional expressions

Direct Proof - When theorem is:

  • Simple equality that simplifies
  • Follows directly from definitions
  • Provable by automatic tactics

Forward Reasoning - Build up facts:

  • Establish intermediate lemmas
  • Chain implications
  • Construct witnesses for existentials

Backward Reasoning - Work from goal:

  • Apply rules to reduce goal
  • Split conjunctions
  • Introduce implications

4. Identify Required Lemmas

Determine helper lemmas that may be needed:

  • Standard library lemmas: Check if already available
  • Custom lemmas: Properties that need separate proof
  • Induction hypotheses: How they'll be used
  • Intermediate facts: Steps in the main proof

5. Generate Proof Skeleton

Use the reference files for tactics and patterns:

Create a skeleton that includes:

  1. Proof structure with appropriate method (induction, cases, etc.)
  2. Case labels for each subgoal
  3. Strategy comments explaining the approach
  4. Tactic placeholders (sorry/admit) for incomplete steps
  5. Intermediate assertions (have/assert) for key facts
  6. Helper lemmas with their own skeletons

6. Structure the Output

Organize the proof skeleton clearly:

For Isabelle/HOL:

(* Helper lemmas if needed *)
lemma helper_name:
  "statement"
  sorry

(* Main theorem *)
theorem theorem_name:
  assumes "assumptions"
  shows "conclusion"
proof (method)
  case case_name
  (* Goal: ... *)
  (* Strategy: ... *)
  (* Key steps:
     1. ...
     2. ...
  *)
  show ?case sorry
next
  (* Additional cases *)
qed

For Coq:

(* Helper lemmas if needed *)
Lemma helper_name :
  statement.
Proof.
  (* proof *)
  admit.
Admitted.

(* Main theorem *)
Theorem theorem_name :
  statement.
Proof.
  intros.
  induction ... as [| ...].
  - (* Case: ... *)
    (* Strategy: ... *)
    admit.
  - (* Case: ... *)
    (* IH: ... *)
    (* Strategy: ... *)
    admit.
Admitted.

Key Principles

Clarity

  • Add comments explaining the proof strategy
  • Label each case clearly
  • Document what the induction hypothesis provides
  • Explain non-obvious steps

Completeness

  • Include all necessary cases
  • Identify all required helper lemmas
  • Show the structure of nested proofs
  • Indicate where automation might work

Practicality

  • Use sorry (Isabelle) or admit (Coq) for incomplete steps
  • Suggest automatic tactics where applicable
  • Note when sledgehammer (Isabelle) might help
  • Indicate which steps are trivial vs. challenging

Correctness

  • Ensure case analysis is exhaustive
  • Verify induction is on the right variable
  • Check that the proof structure matches the goal
  • Validate that lemmas are actually needed

Proof Strategy Selection Guide

When to Use Induction

List properties: forall xs, P xs

  • Induction on xs
  • Base case: empty list
  • Inductive case: x :: xs with IH P xs

Natural number properties: forall n, P n

  • Induction on n
  • Base case: 0 or Suc 0
  • Inductive case: Suc n with IH P n

Recursive function properties: When function is defined recursively

  • Induct on the recursive argument
  • IH mirrors the recursive call

When to Use Case Analysis

Conditional expressions: if b then ... else ...

  • Split on b (true/false cases)

Option types: match opt with None => ... | Some x => ...

  • Case on None and Some x

Sum types: match x with Left a => ... | Right b => ...

  • Case on each constructor

When to Use Direct Proof

Definitional equalities: f x = g x where definitions unfold

  • Unfold definitions and simplify

Trivial goals: Provable by auto, simp, reflexivity

  • Try automatic tactics first

When to Use Lemmas

Repeated subgoals: Same property needed multiple times

  • Extract as separate lemma

Complex intermediate facts: Multi-step derivations

  • Prove as helper lemma

Standard properties: Check standard library first

  • Import and use existing lemmas

Common Patterns

Induction with Simplification

proof (induction xs)
  case Nil
  show ?case by simp
next
  case (Cons x xs)
  show ?case using Cons.IH by simp
qed

Case Analysis with Subproofs

proof (cases x)
  case Constructor1
  show ?thesis
  proof -
    (* detailed steps *)
  qed
next
  case Constructor2
  (* ... *)
qed

Forward Reasoning Chain

proof -
  have step1: "fact1" by simp
  have step2: "fact2" using step1 by simp
  show ?thesis using step2 by simp
qed

Backward Reasoning with Rules

proof (rule some_rule)
  show "premise1" sorry
  show "premise2" sorry
qed

Tips

  • Start with structure: Get the proof skeleton right before filling details
  • Use comments liberally: Explain strategy and key steps
  • Identify IH usage: Note where induction hypothesis is applied
  • Check standard library: Many lemmas already exist
  • Suggest automation: Note where auto, simp, blast might work
  • Be realistic: Mark challenging steps as sorry/admit
  • Both systems: Ensure semantic equivalence when generating both
  • Nested induction: Handle carefully with clear variable names
  • Termination: Note when termination proofs are needed

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Applies abstract interpretation using different abstract domains (intervals, octagons, polyhedra, sign, congruence) to statically analyze program variables and infer invariants, value ranges, and relationships. Use when analyzing program properties, inferring loop invariants, detecting potential errors, or understanding variable relationships through static analysis.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

Uses abstract interpretation to automatically infer loop invariants, function preconditions, and postconditions for formal verification. Generates invariants that capture program behavior and support correctness proofs in Dafny, Isabelle, Coq, and other verification systems. Use when adding formal specifications to code, generating verification conditions, inferring contracts for functions, or discovering loop invariants for proofs.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

Performs abstract interpretation over source code to infer possible program states, variable ranges, and data properties without executing the program. Reports potential runtime errors including out-of-bounds accesses, null dereferences, type inconsistencies, division by zero, and integer overflows. Use when analyzing code for potential runtime errors, performing static analysis, checking safety properties, or verifying program behavior without execution.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

Performs abstract interpretation to produce summarized execution traces and high-level program behavior representations. Highlights key control flow paths, variable relationships, loop invariants, function summaries, and potential runtime states using abstract domains (intervals, signs, nullness, etc.). Use when analyzing program behavior, understanding execution paths, computing loop invariants, tracking variable ranges, detecting potential runtime errors, or generating program summaries without concrete execution.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

Create ACSL (ANSI/ISO C Specification Language) formal annotations for C/C++ programs. Use this skill when working with formal verification, adding function contracts (requires/ensures), loop invariants, assertions, memory safety annotations, or any ACSL specifications. Supports Frama-C verification and generates comprehensive formal specifications for C/C++ code.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

CLI-based browser automation with persistent page state using ref-based element interaction. Use when users ask to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

日本語の概要は準備中です。原文の説明を表示しています。

ArabelaTso/Skills-4-SE2532026年8月21日 更新

ArabelaTso のスキルをすべて見る

このスキルの問題を報告する