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
