prove
Formal theorem proving with research, testing, and verification phases
Install
mkdir -p .claude/skills/prove && curl -L -o skill.zip "https://mcp.directory/api/skills/download/2012" && unzip -o skill.zip -d .claude/skills/prove && rm skill.zipInstalls to .claude/skills/prove
About this skill
/prove - Machine-Verified Proofs (5-Phase Workflow)
For mathematicians who want verified proofs without learning Lean syntax.
Prerequisites
Before using this skill, check Lean4 is installed:
# Check if lake is available
command -v lake &>/dev/null && echo "Lean4 installed" || echo "Lean4 NOT installed"
If not installed:
# Install elan (Lean version manager)
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh
# Restart shell, then verify
lake --version
First run of /prove will download Mathlib (~2GB) via lake build.
Usage
/prove every group homomorphism preserves identity
/prove Monsky's theorem
/prove continuous functions on compact sets are uniformly continuous
The 5-Phase Workflow
┌─────────────────────────────────────────────────────────────┐
│ 📚 RESEARCH → 🏗️ DESIGN → 🧪 TEST → ⚙️ IMPLEMENT → ✅ VERIFY │
└─────────────────────────────────────────────────────────────┘
Phase 1: RESEARCH (before any Lean)
Goal: Understand if/how this can be formalized.
-
Search Mathlib with Loogle (PRIMARY - type-aware search)
# Use loogle for type signature search - finds lemmas by shape loogle-search "pattern_here" # Examples: loogle-search "Nontrivial _ ↔ _" # Find Nontrivial lemmas loogle-search "(?a → ?b) → List ?a → List ?b" # Map-like functions loogle-search "IsCyclic, center" # Multiple conceptsQuery syntax:
_= any single type?a,?b= type variables (same var = same type)Foo, Bar= must mention both
-
Search External - What's the known proof strategy?
- Use Nia MCP if available:
mcp__nia__search - Use Perplexity MCP if available:
mcp__perplexity__search - Fall back to WebSearch for papers/references
- Check: Is there an existing formalization elsewhere (Coq, Isabelle)?
- Use Nia MCP if available:
-
Identify Obstacles
- What lemmas are NOT in Mathlib?
- Does proof require axioms beyond ZFC? (Choice, LEM, etc.)
- Is the statement even true? (search for counterexamples)
-
Output: Brief summary of proof strategy and obstacles
CHECKPOINT: If obstacles found, use AskUserQuestion:
- "This requires [X]. Options: (a) restricted version, (b) accept axiom, (c) abort"
Phase 2: DESIGN (skeleton with sorries)
Goal: Build proof structure before filling details.
-
Create Lean file with:
- Imports
- Definitions needed
- Main theorem statement
- Helper lemmas as
sorry
-
Annotate each sorry:
-- SORRY: needs proof (straightforward) -- SORRY: needs proof (complex - ~50 lines) -- AXIOM CANDIDATE: v₂ constraint - will test in Phase 3 -
Verify skeleton compiles (with sorries)
Output: proofs/<theorem_name>.lean with annotated structure
Phase 3: TEST (counterexample search)
Goal: Catch false lemmas BEFORE trying to prove them.
For each AXIOM CANDIDATE sorry:
-
Generate test cases
-- Create #eval or example statements #eval testLemma (randomInput1) -- should return true #eval testLemma (randomInput2) -- should return true -
Run tests
lake env lean test_lemmas.lean -
If counterexample found:
- Report the counterexample
- Use AskUserQuestion: "Lemma is FALSE. Options: (a) restrict domain, (b) reformulate, (c) abort"
CHECKPOINT: Only proceed if all axiom candidates pass testing.
Phase 4: IMPLEMENT (fill sorries)
Goal: Complete the proofs.
Standard iteration loop:
- Pick a sorry
- Write proof attempt
- Compiler-in-the-loop checks (hook fires automatically)
- If error, Godel-Prover suggests fixes
- Iterate until sorry is filled
- Repeat for all sorries
Tools active:
- compiler-in-the-loop hook (on every Write)
- Godel-Prover suggestions (on errors)
Phase 5: VERIFY (audit)
Goal: Confirm proof quality.
-
Axiom Audit
lake build && grep "depends on axioms" output- Standard: propext, Classical.choice, Quot.sound ✓
- Custom axioms: LIST EACH ONE
-
Sorry Count
grep -c "sorry" proofs/<file>.lean- Must be 0 for "complete" proof
-
Generate Summary
✓ MACHINE VERIFIED (or ⚠️ PARTIAL - N axioms) Theorem: <statement> Proof Strategy: <brief description> Proved: - <lemma 1> - <lemma 2> Axiomatized (if any): - <axiom>: <why it's needed> File: proofs/<name>.lean
Research Tool Priority
Use whatever's available, in order:
| Tool | Best For | Command |
|---|---|---|
| Loogle | Type signature search (PRIMARY) | loogle-search "pattern" |
| Nia MCP | Library documentation | mcp__nia__search |
| Perplexity MCP | Proof strategies, papers | mcp__perplexity__search |
| WebSearch | General references | WebSearch tool |
| WebFetch | Specific paper/page content | WebFetch tool |
Loogle setup: Requires ~/tools/loogle with Mathlib index. Run loogle-server & for fast queries.
If no search tools available, proceed with caution and note "research phase skipped".
Checkpoints (automatic)
The workflow pauses for user input when:
- ⚠️ Research finds obstacles
- ❌ Testing finds counterexamples
- 🔄 Implementation hits unfillable sorry after N attempts
Output Format
┌─────────────────────────────────────────────────────┐
│ ✓ MACHINE VERIFIED │
│ │
│ Theorem: ∀ φ : G →* H, φ(1_G) = 1_H │
│ │
│ Proof Strategy: Direct application of │
│ MonoidHom.map_one from Mathlib. │
│ │
│ Phases: │
│ 📚 Research: Found in Mathlib.Algebra.Group.Hom │
│ 🏗️ Design: Single lemma, no sorries needed │
│ 🧪 Test: N/A (trivial) │
│ ⚙️ Implement: 3 lines │
│ ✅ Verify: 0 custom axioms, 0 sorries │
│ │
│ File: proofs/group_hom_identity.lean │
└─────────────────────────────────────────────────────┘
What I Can Prove
| Domain | Examples |
|---|---|
| Category Theory | Functors, natural transformations, Yoneda |
| Abstract Algebra | Groups, rings, homomorphisms |
| Topology | Continuity, compactness, connectedness |
| Analysis | Limits, derivatives, integrals |
| Logic | Propositional, first-order |
Limitations
- Complex proofs may take multiple iterations
- Novel research-level proofs may exceed capabilities
- Some statements are unprovable over ℚ (need ℝ extension)
Behind The Scenes
- Lean 4.26.0 - Theorem prover
- Mathlib - 100K+ formalized theorems
- Godel-Prover - AI tactic suggestions (via LMStudio)
- Compiler-in-the-loop - Automatic verification on every write
- Research tools - Nia, Perplexity, WebSearch (graceful degradation)
See Also
/loogle-search- Search Mathlib by type signature (used in Phase 1 RESEARCH)/math-router- For computation (integrals, equations)/lean4- Direct Lean syntax access
More by parcadei
View all skills by parcadei →You might also like
flutter-development
aj-geddes
Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.
drawio-diagrams-enhanced
jgtolentino
Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
ui-ux-pro-max
nextlevelbuilder
"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."
nano-banana-pro
garg-aayush
Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.
fastapi-templates
wshobson
Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.
Related MCP Servers
Browse all serversInfraNodus offers powerful text analysis and semantic analysis tools to find content gaps and improve research, SEO, and
Unlock AI-ready web data with Firecrawl: scrape any website, handle dynamic content, and automate web scraping for resea
Boost productivity with Task Master: an AI-powered tool for project management and agile development workflows, integrat
Use any LLM for deep research. Performs multi-step web search, content analysis, and synthesis for comprehensive researc
Empower AI with the Exa MCP Server—an AI research tool for real-time web search, academic data, and smarter, up-to-date
Search and analyze arXiv research papers directly from AI assistants. Full-text search, paper recommendations, citation
Stay ahead of the MCP ecosystem
Get weekly updates on new skills and servers.