OpenMath Rocq Theorem
Instructions
Set up the Rocq proving environment, validate opam switches, and prove downloaded OpenMath theorems. Assumes the theorem workspace was already created by the openmath-open-theorem skill.
This skill package is self-contained: it consists of this SKILL.md plus the local references/ files in this directory. It does not bundle or install sibling rocq-* companion skills.
Workflow checklist
- - [ ] Environment: Verify
rocq (or coqc), dune, and opam are installed and the active opam switch matches the project's .opam-switch or opam file. See the rocq-setup skill for installation and switch management. - [ ] Companion skills: If companion Rocq skills such as
rocq-proof, rocq-ssreflect, rocq-setup, or rocq-dune are already installed in the active agent, use them. See references/companions.md for when each one is useful. This isolated package does not include their code and does not install them for you. - [ ] Preflight: Confirm the environment is healthy before proving:
CODEBLOCK0
- - [ ] Prove: Follow the minimal Rocq proving loop in references/proof_playbook.md. If
rocq-proof or rocq-ssreflect is already installed, use them as companion guidance; otherwise continue with the local workflow in this skill. - [ ] Verify: Confirm
dune build (or rocq compile <file>.v) passes and no admit or Admitted. remains:
CODEBLOCK1
- - [ ] Submit: Use the
openmath-submit-theorem skill to hash and submit the proof.
Scripts
| Action | Command | Use when |
|---|
| Check Rocq version | INLINECODE22 | Verify the active opam switch has the expected Rocq release. |
| Verify stdlib loads |
rocq -e 'From Stdlib Require Import Arith. Check Nat.add_comm.' | Confirm the standard library is reachable before proving. |
| Build project |
dune build | After each proof attempt; must exit 0 with no errors. |
| Compile single file |
rocq compile <file>.v | Quick check on a single
.v file without a full dune build. |
| Check for admits |
grep -rn 'admit\|Admitted\.' *.v | Before submitting; must return no matches. |
| Install opam deps |
opam install . --deps-only | After cloning or changing the project
opam file. |
Notes
- - Rocq version: OpenMath Rocq workspaces target Rocq 9.1.0 (current stable, September 2025) with Platform 2025.08.2.
- Companion skills:
rocq-proof (proving methodology, tactic reference, Ltac2), rocq-ssreflect (SSReflect / MathComp style), rocq-setup (opam, toolchain, editor), and rocq-dune (build system, _CoqProject, dune stanzas) are useful companions when already installed. Optional companions: rocq-mwe, rocq-bisect, rocq-extraction, rocq-mathcomp-build. - Install boundary: This isolated skill should not instruct copying unseen
rocq-* directories into ~/.agents/skills or any other global skills directory. If you are installing from the full repository, review the companion skill folders there and copy them only into a deliberate project-local skills directory such as .codex/skills or .claude/skills. - Stdlib prefix: Use
From Stdlib Require Import for Rocq 9.x. The legacy From Coq Require Import still works with a deprecation warning; prefer From Stdlib for all new proofs. - Verification status: A proof is complete only when
dune build exits 0, no admit or Admitted. remains, and the LSP panel shows no errors or warnings.
References
Load when needed (one level from this file):
OpenMath Rocq 定理
说明
搭建 Rocq 证明环境,验证 opam 切换,并证明已下载的 OpenMath 定理。假设定理工作区已由 openmath-open-theorem 技能创建。
此技能包是自包含的:由本 SKILL.md 文件及本目录下的本地 references/ 文件组成。它不打包或安装同级的 rocq-* 配套技能。
工作流检查清单
- - [ ] 环境:验证 rocq(或 coqc)、dune 和 opam 已安装,且当前激活的 opam 切换与项目的 .opam-switch 或 opam 文件匹配。安装和切换管理请参见 rocq-setup 技能。
- [ ] 配套技能:如果当前代理中已安装 rocq-proof、rocq-ssreflect、rocq-setup 或 rocq-dune 等配套 Rocq 技能,请使用它们。各技能的适用场景请参见 references/companions.md。本独立包不包含这些技能的代码,也不会为您安装它们。
- [ ] 预检:在开始证明前,确认环境健康:
bash
rocq --version
rocq -e From Stdlib Require Import Arith. Check Nat.add_comm.
dune --version
opam list rocq-prover
- - [ ] 证明:遵循 references/proof_playbook.md 中的最小 Rocq 证明循环。如果已安装 rocq-proof 或 rocq-ssreflect,将其作为配套指南使用;否则继续使用本技能中的本地工作流。
- [ ] 验证:确认 dune build(或 rocq compile .v)通过,且没有残留的 admit 或 Admitted.:
bash
dune build
grep -rn admit\|Admitted\. *.v
- - [ ] 提交:使用 openmath-submit-theorem 技能对证明进行哈希并提交。
脚本
| 操作 | 命令 | 使用时机 |
|---|
| 检查 Rocq 版本 | rocq --version | 验证当前激活的 opam 切换具有预期的 Rocq 发行版。 |
| 验证标准库加载 |
rocq -e From Stdlib Require Import Arith. Check Nat.add_comm. | 在证明前确认标准库可访问。 |
| 构建项目 | dune build | 每次证明尝试后;必须退出码为 0 且无错误。 |
| 编译单个文件 | rocq compile
.v | 快速检查单个 .v 文件,无需完整 dune 构建。 |
| 检查 admit | grep -rn admit\|Admitted\. *.v | 提交前;必须无匹配结果。 |
| 安装 opam 依赖 | opam install . --deps-only | 克隆或更改项目 opam 文件后。 |
备注
- - Rocq 版本:OpenMath Rocq 工作区目标为 Rocq 9.1.0(当前稳定版,2025 年 9 月),搭配 Platform 2025.08.2。
- 配套技能:rocq-proof(证明方法、策略参考、Ltac2)、rocq-ssreflect(SSReflect / MathComp 风格)、rocq-setup(opam、工具链、编辑器)和 rocq-dune(构建系统、_CoqProject、dune 配置)在已安装时是有用的配套技能。可选配套技能:rocq-mwe、rocq-bisect、rocq-extraction、rocq-mathcomp-build。
- 安装边界:本独立技能不应指示将未见的 rocq-* 目录复制到 ~/.agents/skills 或任何全局技能目录。如果从完整仓库安装,请查看其中的配套技能文件夹,并仅将其复制到有意的项目本地技能目录,例如 .codex/skills 或 .claude/skills。
- 标准库前缀:对于 Rocq 9.x,请使用 From Stdlib Require Import。旧版 From Coq Require Import 仍可使用,但会显示弃用警告;所有新证明请优先使用 From Stdlib。
- 验证状态:仅当 dune build 退出码为 0、没有残留的 admit 或 Admitted.、且 LSP 面板未显示错误或警告时,证明才算完成。
参考资料
需要时加载(相对于本文件一级目录):