You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 828399a
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix(lean): #125 — law axioms carry Coq's occupancy preconditions; axiom audit + CI job (#165)
## What
Fixes#125. The Lean law axioms in `proofs/lean4/FilesystemCNO.lean`
were stated unconditionally, so `mkdir_rmdir_inverse` +
`mkdir_idempotent` + `mkdir_not_identity` derived `False` (the issue's
own derivation). The Coq versions carry occupancy preconditions
(`no_dir_at path fs ->`); this PR gives the Lean axioms the same
preconditions, and adds a machine-checked axiom audit plus a CI job so
the shape cannot silently regress.
## Changes
- **`FilesystemCNO.lean`** — the three inverse laws
(`mkdir_rmdir_inverse`, `create_unlink_inverse`, `rename_inverse`) now
take `noDirAt` / `noFileAt` / `noEntryAt` hypotheses, defined
semantically at lines 60–77. A new theorem
`unconditional_mkdir_rmdir_inverse_is_false` proves the old
unconditional statement is refutable from the remaining axioms, so the
precondition is not decoration. Axiom count 21 → 21 (three strengthened,
none added).
- **`LambdaCNO.lean`** — `subst_closed_term` is now a theorem (immediate
from the semantic `Closed`); the unrestricted η axiom is gone and
`eta_equivalence` is a theorem restricted to `noLambda body = true`,
with `unrestricted_eta_equivalence_is_false` proving the general claim
refutable. Axiom count 3 → 1 (`y_combinator_not_identity`).
- **`AxiomAudit.lean`** (new) — 96 `#guard_msgs` checks: (A) the exact
signature of every remaining axiom, (B) `#print` of the three occupancy
predicates, (C) negative controls: the #125 `example : False` derivation
and the unrestricted η use must *fail* to elaborate, (D) `#print axioms`
for every theorem (no `sorryAx` anywhere).
- **`check-core.sh`** (new) — builds the six core modules (CNO, OND,
CNOCategory, CNOBridge, FilesystemCNO, LambdaCNO) with plain `lean` at
the pinned toolchain, then runs the audit. No Mathlib needed
(QuantumCNO/StatMech stay on the lake path).
- **`proofs.yml`** — new job `lean` (ubuntu-24.04, elan v4.2.4 fetched
by sha256, `actions/checkout@v7.0.1` only, `contents: read`).
`actions.lock` unchanged; `gh actions-lock --no-fix` and
`--verify-local` clean; actionlint clean.
- Docs: `docs/proof-debt.adoc` ledger rows dated 2026-09-22,
`PROOF-STATUS.adoc`, `AUDIT.adoc` row `AUDIT-2026-09-22-A`,
`docs/COOKBOOK.adoc` Coq example carries the precondition; `Justfile`
`verify-lean-core`; `.gitignore` for `_out/`.
## Evidence (measured locally, `leanprover/lean4:v4.16.0`)
| control | result |
|---|---|
| positive: `check-core.sh` on this branch | rc=0, `6 modules compiled,
96 guards matched` |
| M1: delete the `noDirAt p fs →` hypothesis (line 128) | rc=1 at `lean
FilesystemCNO` — `191:8: error: function expected`, `300:2` (consumers
that supply the precondition break) |
| M2: weaken `noDirAt … : Prop := True` | six modules build; audit fails
at exactly one guard, `AxiomAudit.lean:170` (`#print noDirAt` generated
`fun p fs => True`); the #125 `False` derivation compiles again against
that tree |
| restore | `cmp` identical to the pristine file; rc=0 again |
M2 is the reason the audit exists: a weakened predicate is not caught by
the build, only by the guard.
## Out of scope (pre-existing, noted for the record)
- `asciidoctor docs/proof-debt.adoc` reports `dropping cells from
incomplete row` in the QuantumCNO §(d) table: literal `|0⟩` pipes inside
cells, present on `main` at line 204 before this PR. Left untouched;
separate issue.
- `elan toolchain install` exits non-zero when the toolchain is already
present; the script guards it with `elan toolchain list`.
- Coq-dated records (`proof-debt-triage.adoc`, `CHANGELOG.adoc`,
`ROADMAP.adoc`) not edited.
## Second commit: trusted-base gate
The governance `Trusted-base reduction policy` job went red on the first
push: `1/78 undocumented`, the Coq axiom `y_not_cno` at
`proofs/coq/lambda/LambdaCNO.v:399`. It is not annotated inline; on
`main` it counted as documented only because an unrelated §(d) sentence
in the ledger contained the file path, and the gate accepts any mention
of the path. Marking `subst_closed_term` as discharged removed that
sentence. The second commit cites `y_not_cno` by `file:line` in the
ledger row that already names it, and puts the PR number in the
`AUDIT.adoc` row. Reproduced locally with standards main's
`check-trusted-base.sh`: `origin/main` 80/80, branch before 77/78, after
78/78.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01QYY8Gp4v4x2J7iSNn1vZ57
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
0 commit comments