Skip to content
Back to skills

Lean Canonicalization Policy

ASecurity

Use when editing canonical Lean files in this repository and you need to preserve owner order, adjacent translation layers, real bridge theorems, and low public theorem burden.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 24, 2026
databasespythongoshellgitdocumentation

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned November 24, 2026

npx -y skills add nickgou-nuke/info-geometry-lean --skill lean-canonicalization-policy --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lean Canonicalization Policy?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Lean Canonicalization Policy
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/nickgou-nuke-lean-canonicalization-policy/badge)](https://www.skillsdirectory.com/skills/nickgou-nuke-lean-canonicalization-policy)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: lean-canonicalization-policy
description: Use when editing canonical Lean files in this repository and you need to preserve owner order, adjacent translation layers, real bridge theorems, and low public theorem burden.
---

<!-- repository-context-rule -->
## Repository context rule

For repository work, the current checked-out codebase is the context. Search
existing implementation and trace actual carriers, definitions, imports,
instances, theorem statements, and uses before claiming a structure is missing
or incorrect. A local absence is not a repository-wide absence. Names,
heuristics, summaries, and documentation guide discovery but do not override
source. Follow `docs/REPO_DEEP_SEARCH_PROTOCOL.md` before repo-wide gap claims.


## Constructive Closure Mandate

Replacing witness-gated and external-certificate leftovers with native Lean 4 proofs is the highest mandate. Treat witness packets, certificate fields, external certificates, assumption interfaces, literature owners, graph edges, and physics analogies as closure debt until discharged by kernel-checked Lean or imported mathlib theorems. Follow docs/CONSTRUCTIVE_CLOSURE_MANDATE.md; never promote anonymous or unformalized sockets as complete.

# Lean Canonicalization Policy

Use this skill for theorem ownership, file splitting, wrapper elimination, bridge hygiene, and graph-guided refactors in this repository.

If the task is repo-wide, also read `skills/info-geometry-repo/SKILL.md`.

Canonicalization in this repo is morphism-first, not flattening-first.
The goal is to keep the public owner surface non-vacuous while preserving valid mathematics across noncanonical and exploratory surfaces.

## Core Classification

Every stable file should be classified as one of:
- owner
- translator
- coherence file
- capstone consumer

Every public declaration should be classified as one of:
- constructive endpoint
- lower bridge identification
- transport lemma
- wrapper or projection surface
- packaging scaffold
- capstone consumer theorem

If a file mixes several roles, split by ownership instead of keeping a mixed facade.
Do not erase a mathematically meaningful noncanonical presentation just because it is not yet stable.
Quarantine, demote, or rebuild it explicitly.

## Adjacency Rule

The stable spine uses the native `RepDepth` semantic taxonomy (defined as an inductive
type in `Architecture.lean`). Tags are `@[rep_depth <level>]`.
Primitive translators should only move one adjacent step:
- `count` → `projective`
- `projective` → `operator`
- `operator` → `krein`
- `krein` → `transport`
- `transport` → `thermo`

The first enforcement layer is Lean-native:
- `lean/InfoGeometry/Meta/Architecture.lean`
- `lean/InfoGeometry/Audit.lean`

If a file introduces new ontology and skips a layer, it is debt.
Multi-layer files are only acceptable as coherence files or capstones.
The point of cleanup is to make adjacent transports explicit, not to deny that the theory has several legitimate representation levels.

## Anti-Stale-Doc Mandate
Never read, resurrect, or use stale documentation, dead markdown notes, or obsolete transcript summaries in programming or proof design. Live Lean owner files and kernel-checked proofs decide truth. Do not invent or resurrect docstrings or taxonomies that are not strictly present in active, verified code.

## Mandatory Theorem Burden

A new public theorem in a canonical owner file is forbidden unless it survives all three tests:
1. deletion test: deleting it and unfolding definitions loses mathematics, not convenience
2. downstream test: a stronger downstream theorem actually uses it
3. non-definitional test: it is not `rfl`, `Iff.rfl`, a one-step `simp`/`simpa`, or unfold-and-rename

If it fails, keep it private, local, or as interpretation vocabulary.
If the underlying idea is mathematically meaningful but unfinished, move it to a noncanonical or quarantine surface instead of pretending it is canonical proof.

Every new public theorem in a canonical owner file should carry a `-- theorem-class: ...` tag immediately above it.

## Structural Rules

1. definitions live at the lowest natural owner
2. umbrella files import and re-export; they do not own mathematics
3. public theorems must be mathematically load-bearing
4. projection and pass-through wrappers belong behind the owner or in a Rosetta layer
5. do not invent a parallel ontology when a lower substrate already exists
6. preserve theorem names when splitting by moving the owner, not renaming the math
7. theorem count is not progress; stronger invariants and lower witness burden are progress

## Default Workflow

1. read the target file and its direct consumers
2. classify each declaration by role
3. remove proposition aliases and fake theoremification first
4. split mixed files into owner / translator / coherence / capstone layers
5. narrow imports in direct consumers
6. run `python3 tools/infra/run_locked_lake_build.py InfoGeometry.Audit` once tagged surfaces are in play
7. build the new owners and the obvious consumers
8. only after code is stable, run the DAG pipeline

When context is weak, re-read:
- `docs/OperationalIntent.md`
- `docs/Theory.md`
- the specific owner files that actually carry the morphisms

## Graph Use

Use graph tooling as a second pass only.
Before consulting any DAG artifact, verify `artifacts/dag/index/meta.json` timestamp is recent and `schemaVersion` ≥ 2.
Edge integrity is now enforced at export time via `validateEdges` — if artifacts exist, referential integrity holds.

- `theorem-surface-index` finds public theorem burden
- `semantic-quotient` separates shell from trunk
- `projection-coloring` is heuristic and can collapse after major cleanup
- `representation-depth-audit` should agree with the native Lean audit
- `representation-depth-graph` is a rendered presentation map, not the primary law
- `process-flow` artifacts are useful when deciding whether a declaration is real transport, local wrapper noise, or unresolved coherence pressure
- `meta.json` confirms artifact freshness, schema version, and build provenance (oleanHash)

## UTMOST MANDATE: Native Lean proof closure over witness/certificate scaffolding

Effective immediately, replacing witness-gated and external-certificate leftovers with native Lean proofs is the top-priority mandate.

Policy requirements:
- Witness packets, certificate fields, external certificates, and assumption interfaces are temporary scaffolding only.
- They are not final mathematical closure and not promotion authority.
- Every promoted proposition must be discharged by native Lean derivation chains in-repo (owner -> translator -> mathlib-rooted proof path).
- When a native Lean proof is not yet available, the gap must be recorded explicitly as open closure debt; do not package it as complete.
- **Do not “resolve” debt with wording.** Progress must be structural, not just textual.
- **Do not remove debt labels** unless there is a native explicit Lean proof term checked by the kernel closing that specific debt.
- **Real progress** = replacing certificate/witness fields with theorem-backed native derivations.

Files in this skill

  • SKILL.md7 KB
  • references/policy.md5.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in databases →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.