# Lean Verification Gate

> USE FOR: deterministic Lean 4 CI gates: axiom-closure lockdown, cold kernel replay, and pre-review checks. DO NOT USE FOR: semantic proof review (@lean-proof-review) or council voting (@lean-review-council). TRIGGERS: verification gate, enforcement, axiom closure, print axioms, replay verification, CI gate.

- Skill: `r-irbe/lean-verification-gate` (Agent Skill)
- Install (CLI): `npx get-skill add r-irbe/lean-verification-gate`
- Raw SKILL.md: https://api.skillmd.com/api/skills/r-irbe/lean-verification-gate/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/lean-verification-gate

---


# Lean 4 Deterministic Verification Gate (Enforcement, Axiom Closure & Replay)

Execute all deterministic, machine-verifiable trust gates over a Lean 4 build before semantic human/council review.

## Routing
- **USE FOR:** project-wide `#print axioms` lockdown (`[propext, Classical.choice, Quot.sound]`), cold kernel
  replay (`lake build` / `lean4checker`), zero-`sorry` / `autoImplicit false` linting, and pre-council CI checks.
- **DO NOT USE FOR:** single-file mathematical faithfulness review (`@lean-proof-review`) or whole-corpus quality scoring (`@lean-corpus-audit`).

## Workflow
1. **Static & Hygiene Gate** -- Run `lean_diagnostics` and enforcement scripts to verify `0 sorry`, `0 admit`,
  `set_option autoImplicit false`, and `0` forbidden metaprograms (`native_decide` / `Lean.ofReduceBool` unless
  explicitly whitelisted).
2. **Transitive Axiom Closure** -- Invoke `lean_axiom_closure` across all exported declarations and verify every
  transitive closure is a subset of `[propext, Classical.choice, Quot.sound]`.
3. **Kernel Replay Verification** -- After `sorry` removal or toolchain bumps, run targeted/cold `lake build`
  replay so cached `.olean` artifacts cannot mask unchecked terms.
4. **Emit Gate Certificate** -- Record the exact module manifest count and axiom set before handing off to `@lean-proof-review` or `@lean-review-council`.

## Recovery & STOP
- Any custom `axiom`, `sorryAx`, or unapproved `Lean.ofReduceBool` / `Lean.trustCompiler` dependency is a hard
  blocker; return immediately to `@lean-proof` or `@lean-sair-kernel-optimization`.
- Always quote the scanned declaration/module count (never treat an empty scan manifest as a pass).

## Handoffs
- **Predecessors:** `lean-proof`, `lean-sair-kernel-optimization`, `lean-proof-repair`.
- **Successors:** `lean-proof-review`, `lean-review-council`, `lean-doc-sync`.

## Detailed reference
- Fast 3-table lookup card: [`../../references/cards/lean-verification-gate-tables.md`](../../references/cards/lean-verification-gate-tables.md)
- Full handbook: [`../../references/handbooks/lean-verification-gate-handbook.md`](../../references/handbooks/lean-verification-gate-handbook.md)
- Verification template: [`../../templates/core/Template_Verification.md`](../../templates/core/Template_Verification.md)

## See also
- [`../lean-proof-review/SKILL.md`](../lean-proof-review/SKILL.md) -- 4-layer semantic proof review
- [`../lean-corpus-audit/SKILL.md`](../lean-corpus-audit/SKILL.md) -- Whole-corpus 7-dimension audit

