OpenMath Lean Theorem
Instructions
Set up the Lean proving environment, validate toolchains, and prove downloaded OpenMath theorems locally. Assumes the theorem workspace was already created by the openmath-open-theorem skill.
This skill does not run benchmark providers, prompt-based agent comparisons, or trace persistence workflows. Those belong to the separate openmath-lean-benchmark skill.
Workflow checklist
- - [ ] Environment: Verify
lean, lake, and elan are installed and match the workspace lean-toolchain. - [ ] External skills: Install required Lean proof skills from leanprover/skills. Preferred manual install:
npx leanprover-skills install lean-proof
npx leanprover-skills install mathlib-build
If you use preflight auto-install, first review the upstream repo and then pass an explicit target such as
--install-dir .codex/skills or
--install-dir .claude/skills so the write location is deliberate. Do not run auto-install without an explicit install dir.
- - [ ] Preflight: Run
python3 scripts/check_theorem_env.py <workspace> (see references/preflight.md). - [ ] Prove: Use
lean-proof / mathlib-build skills to complete the proof. See references/proofplaybook.md for the OpenMath-specific proving loop. - [ ] Verify: Confirm
lake build -q --log-level=info passes and no sorry remains. - [ ] Submit: Use the
openmath-submit-theorem skill to hash and submit the proof.
Scripts
| Script | Command | Use when |
|---|
| Preflight check | INLINECODE14 | After download, before proving; validates toolchain, required skills, and initial build. |
| Preflight (auto) |
python3 scripts/check_theorem_env.py <workspace> --auto-install-skills --install-dir <path> | Auto-install missing Lean skills during preflight into an explicit skills dir. |
Notes
- - Lean version: Scaffolds pin
leanprover/lean4:v4.28.0 and mathlib4 v4.28.0 (set by openmath-open-theorem's download_theorem.py). - External skills: Not bundled. Required:
lean-proof, mathlib-build. Optional: lean-mwe, lean-bisect, nightly-testing, mathlib-review, lean-setup. Manual npx leanprover-skills install ... is preferred; preflight auto-install additionally requires git, explicit user approval, and an explicit install dir. - Benchmarking: For agent evaluation, prompt comparison, or regression testing on the bundled Lean benchmark corpus, use the separate
openmath-lean-benchmark skill.
References
Load when needed (one level from this file):
OpenMath Lean定理
指令
设置Lean证明环境,验证工具链,并在本地证明已下载的OpenMath定理。假设定理工作区已由openmath-open-theorem技能创建。
本技能不运行基准测试提供程序、基于提示的智能体比较或追踪持久化工作流。这些功能属于独立的openmath-lean-benchmark技能。
工作流检查清单
- - [ ] 环境:验证lean、lake和elan已安装,且与工作区lean-toolchain匹配。
- [ ] 外部技能:从leanprover/skills安装所需的Lean证明技能。推荐手动安装:
bash
npx leanprover-skills install lean-proof
npx leanprover-skills install mathlib-build
如果使用预检自动安装,请先审查上游仓库,然后传递显式目标,如--install-dir .codex/skills或--install-dir .claude/skills,以确保写入位置经过慎重考虑。未指定显式安装目录时,请勿运行自动安装。
- - [ ] 预检:运行python3 scripts/checktheoremenv.py (参见references/preflight.md)。
- [ ] 证明:使用lean-proof/mathlib-build技能完成证明。关于OpenMath特定的证明循环,请参见references/proofplaybook.md。
- [ ] 验证:确认lake build -q --log-level=info通过,且无剩余sorry。
- [ ] 提交:使用openmath-submit-theorem技能对证明进行哈希并提交。
脚本
| 脚本 | 命令 | 使用时机 |
|---|
| 预检检查 | python3 scripts/checktheoremenv.py <workspace> | 下载后、证明前;验证工具链、所需技能和初始构建。 |
| 预检(自动) |
python3 scripts/check
theoremenv.py
--auto-install-skills --install-dir | 在预检期间自动安装缺失的Lean技能到显式技能目录。 |
备注
- - Lean版本:脚手架锁定leanprover/lean4:v4.28.0和mathlib4 v4.28.0(由openmath-open-theorem的download_theorem.py设置)。
- 外部技能:不捆绑。必需:lean-proof、mathlib-build。可选:lean-mwe、lean-bisect、nightly-testing、mathlib-review、lean-setup。推荐手动npx leanprover-skills install ...;预检自动安装额外需要git、显式用户批准和显式安装目录。
- 基准测试:如需对捆绑的Lean基准测试语料库进行智能体评估、提示比较或回归测试,请使用独立的openmath-lean-benchmark技能。
参考资料
需要时加载(相对于此文件一级目录):