rocq-proof-adapter
Skill3 starsChanged 13 days agoApache-2.0View on GitHub
USE FOR: translating Rocq / Coq proofs (SSReflect, MathComp, Ltac2, lia/lra) into Lean 4. DO NOT USE FOR: Isabelle ports (@isabelle-isar-adapter) or HOL/Metamath (@hol-metamath-adapter). TRIGGERS: Rocq, Coq, SSReflect, MathComp, move:, elim:, bigop, Coq to Lean.
In this repository43 other files it gives its agents.
- AGENTS.mdAGENTS.md
- counterexample-first-provingSkill
- hol-metamath-adapterSkill
- isabelle-isar-adapterSkill
- itp-cross-portingSkill
- lean-ai-formalizationSkill
- lean-asymptotic-algorithmsSkill
- lean-bisectSkill
- lean-blueprintSkill
- lean-buildSkill
- lean-computational-reflectionSkill
- lean-core-onlySkill
- lean-corpus-auditSkill
- lean-dependency-managementSkill
- lean-doc-syncSkill
- lean-egraph-cpsat-superoptSkill
- lean-gatewaySkill
- lean-kernel-optimizationSkill
- lean-knowledge-formalizationSkill
- lean-math-analysisSkill
- lean-math-discreteSkill
- lean-math-dynamicalSkill
- lean-math-foundationsSkill
- lean-math-optimizationSkill
- lean-math-stochasticSkill
- lean-mweSkill
- lean-pedagogical-expositionSkill
- lean-proof-refactorSkill
- lean-proof-repairSkill
- lean-proof-reviewSkill
- lean-proofSkill
- lean-researchSkill
- lean-retro-methodologySkill
- lean-review-councilSkill
- lean-security-formalizationSkill
- lean-setupSkill
- lean-specificationSkill
- lean-tautology-triageSkill
- lean-unboxed-limbs-swarSkill
- lean-upstream-prSkill
- lean-verification-gateSkill
- lean-worker-wrapper-cpsSkill
- research-councilSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 51
Load Dialect & Concordance Map: Read references/dialects/rocq.json and query lean_search(source: "concordance") for the relevant …
- Very specific: line 63
STOP: if an SSReflect rewrite relies on keyed canonical-structure projection unification that fails in Lean's type-directed rw.
- Very specific: line 67
STOP: if ssrnat truncated subtraction m - n is used as a boolean predicate m - n == 0 for m <= n.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Rocq / Coq & MathComp Proof Adapter (coq_mathcomp -> lean4)
Translate Rocq/Coq formalizations -- including SSReflect intro/discharge pipelines (move:, elim:, case:,
rewrite //=),
Mathematical
Components (finType, bigop, matrix), Hierarchy Builder (HB.instance), and Equations -- into
idiomatic Lean 4.
Routing
- USE FOR: porting Coq/Rocq
.vtheories, SSReflect proof scripts, MathComp algebraic/combinatorial developments, and MathComp-Analysis filter/measure proofs into Lean 4. - DO NOT USE FOR: Isabelle
.thytheories (delegate to@isabelle-isar-adapter); HOL Light.mlor Metamath.mmfiles (delegate to@hol-metamath-adapter). - TRIGGERS: Rocq, Coq, SSReflect, MathComp,
move:,elim:,case:,apply/,\big[,finType,zmodType,HB.instance,lia,lra.
Workflow
- Load Dialect & Concordance Map: Read
references/dialects/rocq.jsonand querylean_search(source: "concordance")for the relevantCONC-01..20mechanisms. - Translate Signatures & Canonical Structures (
CONC-04,CONC-13,CONC-17):- Map
(T : finType)->{T : Type*} [Fintype T] [DecidableEq T]. - Map
(R : ringType)/(R : comRingType)->{R : Type*} [Ring R]/[CommRing R]. - Map
\sum_(i < n | P i) F i->∑ i ∈ Finset.univ.filter P, F i(overFin n).
- Map
- Translate SSReflect Bookkeeping to Structured Lean 4:
move=> x /andP [h1 h2]->rintro x ⟨h1, h2⟩(since LeanAndneeds no boolean view/andP).elim: n => [| n ih] //=->induction n with | zero => simp | succ n ih => ....
Recovery & STOP
- STOP if an SSReflect
rewriterelies on keyed canonical-structure projection unification that fails in Lean's type-directedrw; state the intermediate step explicitly withhaveorcalc. - STOP if
ssrnattruncated subtractionm - nis used as a boolean predicatem - n == 0form <= n; translatem <= ndirectly toNat.le(m <= n) and solve withomega.
Handoffs
- Predecessors:
skill:lean-gateway,skill:itp-cross-porting,skill:lean-specification. - Successors:
skill:lean-proof,skill:lean-proof-review,skill:lean-verification-gate.
Detailed reference
- Layer-1 Fast Lookup Card (read first):
references/cards/rocq-proof-adapter-tables.mdFull encyclopedic reference, decision trees, and lookup tables live inreferences/handbooks/rocq-proof-adapter-handbook.md.
See also
../../references/handbooks/rocq-proof-adapter-handbook.md-- Completerocq-proof-adapterHandbook../lean-gateway/SKILL.md-- Top-level skill router
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

