Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/proofs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ on:
paths:
- 'verification/proofs/lean4/**'
- 'verification/proofs/agda/**'
- 'verification/proofs/rocq/**'
- 'scripts/check-recheck-legs.sh'
- 'verification/pwg.json'
- 'scripts/pwg-derive.sh'
- 'scripts/pwg-check.sh'
Expand Down Expand Up @@ -207,6 +209,50 @@ jobs:
fi
echo "PASS: All.agda + Smoke.agda typecheck (${AGDA_FLAGS[*]}; --safe => postulate-free by construction)"

# PROOF-POLICY §2 recheck legs for the ratified-carrier order laws and L4 in
# full (TB.OrderLaws, TB.Monotone): a Rocq leg and a core-only Lean leg. No
# Mathlib, so unlike the lean-build packages below these legs can count
# (PROOF-POLICY §2: "No Mathlib, in Lean or elsewhere"). The gate is
# scripts/check-recheck-legs.sh, which runs the same way locally: pinned
# prover version asserted, compile, an axiom audit that fails on any axiom
# AND on an empty audit domain, then six planted controls that must each be
# caught (Admitted, sorry, a user axiom, an empty domain, and a definition
# drift that only the TB.Bridge tables can see).
# TOOLCHAIN: Ubuntu 24.04's coq package is Coq 8.18.0 (the version mathesis
# pins; the script refuses any other). Lean 4.16.0 (the repo's pin) is the
# GitHub release archive, checked against the SHA-256 observed 2026-11-17.
recheck-legs:
name: "Recheck legs (Rocq 8.18.0, Lean 4.16.0 core): order laws + L4"
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Install Coq 8.18.0 (apt) and Lean 4.16.0 (pinned, checksummed)
shell: bash
env:
LEAN_URL: https://github.com/leanprover/lean4/releases/download/v4.16.0/lean-4.16.0-linux.tar.zst
LEAN_SHA256: cdd31f1064783fff163be53e285722102f16767e65e6fb7f7cb1c232514e0c3a
run: |
set -euo pipefail
sudo apt-get update -q
sudo apt-get install -y -q --no-install-recommends coq zstd
cd "$RUNNER_TEMP"
curl --fail --proto '=https' --proto-redir '=https' --tlsv1.2 -sSL -o lean.tar.zst "$LEAN_URL"
echo "$LEAN_SHA256 lean.tar.zst" | sha256sum -c -
tar --zstd -xf lean.tar.zst
echo "$PWD/lean-4.16.0-linux/bin" >> "$GITHUB_PATH"
- name: Rocq leg (compile + Print Assumptions on every declaration)
shell: bash
run: bash scripts/check-recheck-legs.sh rocq
- name: Lean leg (check + collectAxioms on every declared theorem)
shell: bash
run: bash scripts/check-recheck-legs.sh lean
- name: Planted controls (each must be caught)
shell: bash
run: bash scripts/check-recheck-legs.sh controls

# The Lean developments actually built. `lean-source-honesty` above is a cheap
# syntactic guard that runs in seconds on every push; this is the semantic one,
# and it is what makes ADR 0003's "grade-algebra ground truth" a measured claim
Expand Down
31 changes: 31 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,37 @@ https://semver.org/spec/v2.0.0.html[Semantic Versioning].

=== [Unreleased]

==== Added

* *L4 in full and A2 (Fate is a chain) proved, and rechecked in Rocq and
core Lean (2026-11-17).*
+
The owner ruled to prove, not narrow. `+TB/Monotone.agda+` proves bond and merge
monotonicity and the lifting to the grade composition (one argument at a time, and
both at once as `+▷-mono+`). `+TB/OrderLaws.agda+` proves that `+fateLte+` is
transitive, antisymmetric and total (`+fate-isTotalOrder : IsTotalOrder _≡_ _≤F_+`),
and that `+⊑+` is a decidable preorder. No existing definition changed.
+
The repository's first Rocq development, `+verification/proofs/rocq/RatifiedOrder.v+`
(Coq 8.18.0, no `+Require+`), and a core-Lean file with no import,
`+verification/proofs/lean4/ratified-order/RatifiedOrder.lean+` (Lean 4.16.0, no
Mathlib), re-prove all of it. `+TB/Bridge.agda+` pins six restated definitions to
the Agda on a fixed sample (exhaustive for Bond and Merge), and each leg proves the
same six literals. A planted one-clause drift that keeps every theorem true is
caught only by the bridge, in both legs. `+scripts/check-recheck-legs.sh+` is the
gate. It asserts the prover version, audits every declaration for axioms, fails
on an empty audit, and runs six planted controls. CI runs it as the new
`+recheck-legs+` job.
+
Ledger: `+L4-bond-merge+`, `+L4-lifting+`, `+A2-chain+` and `+retention-order+` gain
`+PROVEN+` Agda legs. All seven L4/A2/retention rows gain `+RECONCILED+` Rocq and
Lean legs, with receipts from CI run 44006871652 on `+d5234b1+`. The census moves
from 28 obligations (`+PWG-3+` 18, ungraded 10) to 28 (`+PWG-3+` 15, `+PWG-2ii+` 7,
ungraded 6). The derivation does not reach `+PWG-1+`, because the receipts are not at
the ledger's source commit. Whether the core-Lean leg may count, given the
2026-11-09 ruling that Lean is a generator and not a leg, is put to the owner.
If it may not, the seven rows derive `+PWG-2i+`.

==== Fixed

* *Every PWG witness name now resolves, the ladder's top two rungs are
Expand Down
19 changes: 10 additions & 9 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,16 @@ Idris2 does not state L3, L6, conicality or the cancellation boundary; L5 is
Agda-only. Where Idris2 does restate a result, PROOF-POLICY §8.1 keeps it off the
Proof Witness Grade ladder as an engineering restatement — the ledger records it
under `reference`, never as a leg, so it can neither raise nor lower a grade.
And *L4 in full* is proved by none of the three: Agda covers the fate coordinate
and the fidelity dimension, Lean covers fate, and bond and merge have an Idris2
restatement only. Idris2 establishes coordinate-level monotonicity only; the
lifting for `gradeCompose` is mechanised in no prover. The ledger therefore
grades L4 as four obligations (`L4-fate` and `L4-fidelity` at `PWG-3`;
`L4-bond-merge` and `L4-lifting` ungraded), and A2 as two (`A2-directions` at
`PWG-3`; `A2-chain` ungraded, because no ladder prover states the whole chain:
Lean has totality and reflexivity, Idris2 transitivity off the ladder, and
antisymmetry is cited nowhere). The atom
*L4 in full* and *A2* (Fate is a chain) are proved in Agda since 2026-11-17.
`TB.Monotone` adds the bond and merge coordinates and the lifting to
`gradeCompose`, and `TB.OrderLaws` adds transitivity, antisymmetry and totality.
Both are rechecked in Rocq (`verification/proofs/rocq/`) and in core Lean with no
Mathlib (`verification/proofs/lean4/ratified-order/`). The ledger grades L4 as
four obligations and A2 as two (owner ruling 2026-11-16). All six, and the
retention order (a decidable preorder), derive `PWG-2ii`. Whether the core-Lean
leg may count is put to the owner (PROOF-STATUS, *Recheck legs of the order
laws and L4*). Completeness of the chain, which spec §7 also uses, is proved in
no prover. The atom
factorisation (O1's carrier half, proved on the ratified `GradeR` in
`EffectAtomsRatified.lean`; O1-coord stays open) and the tropical factorisations
— pre-ratification `GradeFactorisation.lean` veridicality-blind, ratified
Expand Down
Loading
Loading