prove by parcadei/continuous-claude-v3
npx skills add https://github.com/parcadei/continuous-claude-v3 --skill prove专为希望获得验证证明但无需学习 Lean 语法的数学家设计。
使用此技能前,请检查 Lean4 是否已安装:
# 检查 lake 是否可用
command -v lake &>/dev/null && echo "Lean4 已安装" || echo "Lean4 未安装"
如果未安装:
# 安装 elan(Lean 版本管理器)
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh
# 重启 shell,然后验证
lake --version
首次运行 /prove 将通过 lake build 下载 Mathlib(约 2GB)。
/prove every group homomorphism preserves identity
/prove Monsky's theorem
/prove continuous functions on compact sets are uniformly continuous
┌─────────────────────────────────────────────────────────────┐
│ 📚 研究 → 🏗️ 设计 → 🧪 测试 → ⚙️ 实现 → ✅ 验证 │
└─────────────────────────────────────────────────────────────┘
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
目标: 理解这是否/如何能被形式化。
使用 Loogle 搜索 Mathlib(主要 - 类型感知搜索)
loogle-search "pattern_here"
loogle-search "Nontrivial _ ↔ _" # 查找 Nontrivial 引理 loogle-search "(?a → ?b) → List ?a → List ?b" # 类似 Map 的函数 loogle-search "IsCyclic, center" # 多个概念
查询语法:
* `_` = 任意单一类型
* `?a`, `?b` = 类型变量(相同变量名表示相同类型)
* `Foo, Bar` = 必须同时提及两者
2. 外部搜索 - 已知的证明策略是什么?
* 如果可用,使用 Nia MCP:`mcp__nia__search`
* 如果可用,使用 Perplexity MCP:`mcp__perplexity__search`
* 回退到 WebSearch 查找论文/参考文献
* 检查:其他地方(Coq, Isabelle)是否有现有的形式化?
3. 识别障碍
* 哪些引理不在 Mathlib 中?
* 证明是否需要超出 ZFC 的公理?(选择公理、排中律等)
* 该陈述本身是否成立?(搜索反例)
4. 输出: 证明策略和障碍的简要摘要
检查点: 如果发现障碍,使用 AskUserQuestion:
sorry 的骨架)目标: 在填充细节之前构建证明结构。
* 导入
* 所需的定义
* 主要定理陈述
* 辅助引理(标记为 `sorry`)
2. 为每个 sorry 添加注释:
-- SORRY: 需要证明(直接)
-- SORRY: 需要证明(复杂 - 约 50 行)
-- 公理候选:v₂ 约束 - 将在阶段 3 测试
3. 验证骨架(包含 sorry)可编译
输出: 带有注释结构的 proofs/<定理名称>.lean 文件
目标: 在尝试证明之前捕获错误的引理。
对于每个标记为"公理候选"的 sorry:
生成测试用例
-- 创建 #eval 或 example 语句 #eval testLemma (randomInput1) -- 应返回 true #eval testLemma (randomInput2) -- 应返回 true
运行测试
lake env lean test_lemmas.lean
如果发现反例:
* 报告该反例
* 使用 AskUserQuestion:"引理为假。选项:(a) 限制定义域,(b) 重新表述,(c) 中止"
检查点: 仅当所有公理候选都通过测试时才继续。
sorry)目标: 完成证明。
标准迭代循环:
sorrysorry 被填充sorry 重复此过程活动工具:
目标: 确认证明质量。
公理审计
lake build && grep "depends on axioms" output
* 标准:propext, Classical.choice, Quot.sound ✓
* 自定义公理:列出每一个
2. sorry 计数
grep -c "sorry" proofs/<文件>.lean
* 对于"完整"证明,必须为 0
3. 生成摘要
✓ 机器已验证(或 ⚠️ 部分 - N 个公理)
定理:<陈述>
证明策略:<简要描述>
已证明:
- <引理 1>
- <引理 2>
公理化(如有):
- <公理>:<需要的原因>
文件:proofs/<名称>.lean
按顺序使用任何可用的工具:
| 工具 | 最擅长 | 命令 |
|---|---|---|
| Loogle | 类型签名搜索(主要) | loogle-search "pattern" |
| Nia MCP | 库文档 | mcp__nia__search |
| Perplexity MCP | 证明策略、论文 | mcp__perplexity__search |
| WebSearch | 通用参考文献 | WebSearch 工具 |
| WebFetch | 特定论文/页面内容 | WebFetch 工具 |
Loogle 设置: 需要包含 Mathlib 索引的 ~/tools/loogle。运行 loogle-server & 以进行快速查询。
如果没有可用的搜索工具,请谨慎进行并注明"研究阶段已跳过"。
工作流在以下情况下会暂停以等待用户输入:
sorry┌─────────────────────────────────────────────────────┐
│ ✓ 机器已验证 │
│ │
│ 定理:∀ φ : G →* H, φ(1_G) = 1_H │
│ │
│ 证明策略:直接应用 Mathlib 中的 │
│ MonoidHom.map_one。 │
│ │
│ 阶段: │
│ 📚 研究:在 Mathlib.Algebra.Group.Hom 中找到 │
│ 🏗️ 设计:单一引理,无需 `sorry` │
│ 🧪 测试:不适用(平凡) │
│ ⚙️ 实现:3 行 │
│ ✅ 验证:0 个自定义公理,0 个 `sorry` │
│ │
│ 文件:proofs/group_hom_identity.lean │
└─────────────────────────────────────────────────────┘
| 领域 | 示例 |
|---|---|
| 范畴论 | 函子、自然变换、Yoneda 引理 |
| 抽象代数 | 群、环、同态 |
| 拓扑学 | 连续性、紧致性、连通性 |
| 分析学 | 极限、导数、积分 |
| 逻辑学 | 命题逻辑、一阶逻辑 |
/loogle-search - 按类型签名搜索 Mathlib(用于阶段 1 研究)/math-router - 用于计算(积分、方程)/lean4 - 直接访问 Lean 语法每周安装量
203
仓库
GitHub 星标
3.6K
首次出现
2026年1月22日
安全审计
安装于
opencode197
codex194
gemini-cli192
github-copilot190
cursor189
amp184
For mathematicians who want verified proofs without learning Lean syntax.
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.
/prove every group homomorphism preserves identity
/prove Monsky's theorem
/prove continuous functions on compact sets are uniformly continuous
┌─────────────────────────────────────────────────────────────┐
│ 📚 RESEARCH → 🏗️ DESIGN → 🧪 TEST → ⚙️ IMPLEMENT → ✅ VERIFY │
└─────────────────────────────────────────────────────────────┘
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 concepts
Query syntax:
* `_` = any single type
* `?a`, `?b` = type variables (same var = same type)
* `Foo, Bar` = must mention both
2. 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)?
3. 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)
4. Output: Brief summary of proof strategy and obstacles
CHECKPOINT: If obstacles found, use AskUserQuestion:
Goal: Build proof structure before filling details.
Create Lean file with:
sorryAnnotate 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
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:
CHECKPOINT: Only proceed if all axiom candidates pass testing.
Goal: Complete the proofs.
Standard iteration loop:
Tools active:
Goal: Confirm proof quality.
Axiom Audit
lake build && grep "depends on axioms" output
Sorry Count
grep -c "sorry" proofs/<file>.lean
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
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".
The workflow pauses for user input when:
┌─────────────────────────────────────────────────────┐
│ ✓ 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 │
└─────────────────────────────────────────────────────┘
| 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 |
/loogle-search - Search Mathlib by type signature (used in Phase 1 RESEARCH)/math-router - For computation (integrals, equations)/lean4 - Direct Lean syntax accessWeekly Installs
203
Repository
GitHub Stars
3.6K
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykWarn
Installed on
opencode197
codex194
gemini-cli192
github-copilot190
cursor189
amp184
开源项目教练指南 - 诊断问题、制定行动计划、优化开源项目运营
31,600 周安装