# Hol Metamath Adapter

> USE FOR: translating HOL Light (.ml tactical scripts) and Metamath (set.mm ZFC proofs) into Lean 4. DO NOT USE FOR: Rocq ports (@rocq-proof-adapter) or Isabelle ports (@isabelle-isar-adapter). TRIGGERS: HOL Light, Metamath, set.mm, MESON_TAC, REAL_ARITH_TAC, WORD_BLAST, uzind, 3eqtri.

- Skill: `r-irbe/hol-metamath-adapter` (Agent Skill)
- Install (CLI): `npx get-skill add r-irbe/hol-metamath-adapter`
- Raw SKILL.md: https://api.skillmd.com/api/skills/r-irbe/hol-metamath-adapter/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: r-irbe (https://skillmd.com/u/r-irbe)
- Updated: 2026-11-16
- Page: https://skillmd.com/skills/r-irbe/hol-metamath-adapter

---


# HOL Light & Metamath (`set.mm`) Proof Adapter (`hol_light` / `metamath` -> `lean4`)
Translate HOL Light OCaml tactical scripts (`THEN`, `THENL`, `MESON_TAC`, `REAL_ARITH_TAC`, `REAL_RING`,
`WORD_BLAST`, `real^N`
analysis)
and Metamath `set.mm` ZFC deduction trees (`syl`, `mpd`, `3eqtri`, `uzind`, `fsum`, extensible slot
structures) into structured
Lean 4 +
Mathlib4.
## Routing
- **USE FOR:** porting HOL Light `.ml` theorems (multivariate analysis, Flyspeck, `s2n-bignum` word proofs)
  and Metamath `set.mm`
  /
  `iset.mm` theorems into Lean 4.
- **DO NOT USE FOR:** Rocq/MathComp `.v` ports (delegate to `@rocq-proof-adapter`); Isabelle/Isar `.thy` ports
  (delegate to
  `@isabelle-isar-adapter`).
- **TRIGGERS:** HOL Light, Metamath, `set.mm`, `MESON_TAC`, `REAL_ARITH_TAC`, `REAL_RING`, `WORD_BLAST`,
  `SUBGOAL_THEN`, `3eqtri`,
  `uzind`,
  `fsum`.
## Workflow
1. **Load Dialect & Concordance Map**: Read `references/dialects/hol_light.json` or
  `references/dialects/metamath.json` and query
   `lean_search(source: "concordance")` for `CONC-01..20`.
2. **Lift Untyped / Predicate Domains to Lean Types (`CONC-04`, `CONC-14`)**:
   - Metamath `x e. N`, `y e. R`, `G e. Grp` -> typed binders `(x : Nat)`, `(y : Real)`, `{G : Type*} [Group
  G]`.
   - HOL Light `s : A -> bool` finite sums `nsum (m..n) f` -> `∑ i ∈ Finset.Icc m n, f i`.
3. **Collapse Low-Level Plumbing Chains into High-Level Tactics (`CONC-05`, `CONC-13`, `CONC-18`)**:
   - Collapse 20-100 step Metamath `syl`/`mpd`/`addass`/`leadd1i` chains into `tauto`, `ring`, `linarith`,
  `omega`, or
  `positivity`.
## Recovery & STOP
- **STOP** when porting Metamath `m - n` where `m, n e. N`: in `set.mm`, `N c_ Z c_ C` so `2 - 5 = -3`,
  whereas in Lean `(2 - 5 :
  Nat) = 0`!
  Either cast to `Int` via `zify` or prove `n <= m` before using `Nat.sub`.
- **STOP** when porting HOL Light `has_integral` on improper oscillating functions; verify `IntegrableOn f s
  volume` for Mathlib
  Bochner
  integration.
## 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/hol-metamath-adapter-tables.md`](../../references/cards/hol-metamath-adapter-tables.md)
Full encyclopedic reference, decision trees, and lookup tables live in
[`references/handbooks/hol-metamath-adapter-handbook.md`](../../references/handbooks/hol-metamath-adapter-handbook.md) .
## See also
- [`../../references/handbooks/hol-metamath-adapter-handbook.md`](../../references/handbooks/hol-metamath-adapter-handbook.md) --
  Complete
  `hol-metamath-adapter` Handbook
- [`../lean-gateway/SKILL.md`](../lean-gateway/SKILL.md) -- Top-level skill router

