diff --git a/.github/workflows/proofs.yml b/.github/workflows/proofs.yml index b47f846..fe9cff4 100644 --- a/.github/workflows/proofs.yml +++ b/.github/workflows/proofs.yml @@ -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' @@ -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 diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index ecc8ba4..161e9ef 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -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 diff --git a/README.adoc b/README.adoc index 12493c2..e32b087 100644 --- a/README.adoc +++ b/README.adoc @@ -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 diff --git a/docs/status/PROOF-STATUS.adoc b/docs/status/PROOF-STATUS.adoc index 8c3a8b9..65cd427 100644 --- a/docs/status/PROOF-STATUS.adoc +++ b/docs/status/PROOF-STATUS.adoc @@ -36,8 +36,8 @@ toc::[] | Agda `TB.Grade.{falsified-absorbL,falsified-absorbR,misbound-absorbL,conflated-absorbL,unknown-absorbL,total-absorb-Q}`, `TB.Tier.deceptive-absorbs-▷`; Lean `FateA.falsified_two_sided_zero`, `GradeR.gBotR_two_sided_zero`. | L4 (monotonicity), in full -| stem:[\triangleright] is monotone in both arguments w.r.t. stem:[\sqsubseteq] on every coordinate of the ratified carrier. Coverage differs by prover: the Agda covers the fate coordinate (`fateL4Mono{R,L}`) and the fidelity dimension (`dplusMono{R,L}`) only; the bond and merge coordinates have an Idris2 restatement only. Idris2 establishes coordinate-level monotonicity only; the grade-level lifting for `gradeCompose` that spec §7's Knaster–Tarski argument invokes is mechanised in no prover. Per PROOF-POLICY §8.1 Idris2 is an engineering prover and is not on the PWG ladder, so bond, merge and the grade-level lifting currently have no gradeable theory leg. The PWG ledger therefore grades L4 as four obligations, `L4-fate`, `L4-fidelity`, `L4-bond-merge` and `L4-lifting` (owner ruling 2026-11-16); L4 in full is their conjunction. -| Idris2 `Trope.Soundness.{fateL4MonoR,fateL4MonoL}`, `Trope.Order.{bondComposeMono,mergeComposeMono}`; Agda `TB.Order.{fateL4MonoR,fateL4MonoL}`; Lean `FateA.{comp_mono_right,comp_mono_left}` (fate coordinate only; `FateA.le` is defined on `Fate` alone and the Lean tree carries no `Bond`, `Merge` or `GradeR` order). +| stem:[\triangleright] is monotone in both arguments w.r.t. stem:[\sqsubseteq] on every coordinate of the ratified carrier, and the grade composition is too. *Proved in full in Agda since 2026-11-17* (owner ruling: prove, not narrow): fate (`TB.Order.fateL4Mono{R,L}`), fidelity (`TB.Order.dplusMono{R,L}`), bond and merge (`TB.Monotone.{bondL4Mono,mergeL4Mono}{R,L}`), and the grade-level lifting for `gradeCompose` that spec §7 invokes (`TB.Monotone.gradeL4Mono{R,L}`, and `TB.Monotone.▷-mono` for both arguments at once). Each part is rechecked in Rocq and in core Lean (see *Recheck legs of the order laws and L4* below). The PWG ledger grades L4 as four obligations, `L4-fate`, `L4-fidelity`, `L4-bond-merge` and `L4-lifting` (owner ruling 2026-11-16); L4 in full is their conjunction. Spec §7 also uses that each coordinate is a *complete* chain; completeness is not part of L4 or A2 and is proved in no prover. +| Agda `TB.Order.{fateL4MonoR,fateL4MonoL,dplusMonoR,dplusMonoL}`, `TB.Monotone.{bondL4MonoR,bondL4MonoL,mergeL4MonoR,mergeL4MonoL,gradeL4MonoR,gradeL4MonoL,▷-mono}`; Rocq (`verification/proofs/rocq/RatifiedOrder.v`) and core Lean (`TropeRatified.*`, `verification/proofs/lean4/ratified-order/`) the same names (`▷-mono` is `gcomp_mono`); Idris2 `Trope.Soundness.{fateL4MonoR,fateL4MonoL}`, `Trope.Order.{bondComposeMono,mergeComposeMono}` (reference, §8.1); Mathlib Lean `FateA.{comp_mono_right,comp_mono_left}` (fate only, `BRIDGE-PENDING`). | L5 (deception infectiousness) | Once a coordinate is at its deceptive bottom no composition restores an honest value; applying any further effect to a deceptive term keeps it deceptive. A corollary of L3. @@ -48,12 +48,12 @@ toc::[] | Lean `GradeR.instCommMonoid`, `FateA.comp_comm`; Agda `TB.Grade.grade-comm`. | Retention order is a decidable preorder -| stem:[\sqsubseteq] is decidable, reflexive and transitive on grades. -| Idris2 `Trope.Laws.decGradeLte`, `Trope.Coords.{fateLteRefl,bondLteRefl,mergeLteRefl}`, `Trope.Fidelity.dLteRefl`, `Trope.Order.{fateLteTrans,bondLteTrans,mergeLteTrans,dLteTrans}`, `Trope.Soundness.gradeLteTrans`. +| stem:[\sqsubseteq] is decidable, reflexive and transitive on grades. Proved in Agda since 2026-11-17, and rechecked in Rocq and core Lean. +| Agda `TB.Order.⊑-refl`, `TB.OrderLaws.{⊑-trans,⊑-dec,⊑-isPreorder}`; Rocq and core Lean `gle_refl`, `gle_trans`, `gle_dec`; Idris2 (reference) `Trope.Laws.decGradeLte`, `Trope.Coords.{fateLteRefl,bondLteRefl,mergeLteRefl}`, `Trope.Fidelity.dLteRefl`, `Trope.Order.{fateLteTrans,bondLteTrans,mergeLteTrans,dLteTrans}`, `Trope.Soundness.gradeLteTrans`. | Fate is a chain (A2) -| `Dropped ⊑ Predicated` and `Predicated ⋢ Dropped`; the v0.1 antichain is dissolved in the stated direction only. That `Fate` is a chain (a total order) is not mechanised as one claim: Lean states totality and reflexivity (`FateA.le_total`, `FateA.le_refl`), Idris2 proves transitivity (`Trope.Order.fateLteTrans`, an engineering restatement §8.1 keeps off the ladder), and antisymmetry has no cited proof in any prover. The PWG ledger grades the two directional facts (`A2-directions`) and the chain (`A2-chain`, ungraded) separately (owner ruling 2026-11-16). -| Idris2 `Trope.Soundness.{fateDroppedLtePredicated,fatePredicatedNotLteDropped}`; Agda `TB.Order.{fateDroppedLtePredicated,fatePredicatedNotLteDropped}`. +| `Fate` is a chain: stem:[\sqsubseteq] on `Fate` is reflexive, transitive, antisymmetric and total, ordered Falsified ⊏ Dropped ⊏ Predicated ⊏ Atten(unknown) ⊏ Atten(total) ⊏ … ⊏ Atten(Q 0) ⊏ Present. In particular `Dropped ⊑ Predicated` and `Predicated ⋢ Dropped`, which dissolve the v0.1 antichain. Proved in Agda since 2026-11-17 as `fate-isTotalOrder : IsTotalOrder _≡_ _≤F_` (owner ruling: prove, not narrow); the fidelity order is a chain as well. The PWG ledger grades the two directional facts (`A2-directions`) and the chain (`A2-chain`) separately (owner ruling 2026-11-16). Completeness of the chain is not claimed here and is proved in no prover. +| Agda `TB.OrderLaws.{fate-isTotalOrder,fateLte-trans,fateLte-antisym,fateLte-total,dLte-isTotalOrder}`, `TB.Order.{fateLte-refl,fateDroppedLtePredicated,fatePredicatedNotLteDropped}`; Rocq and core Lean `fate_isTotalOrder`, `fateLte_{refl,trans,antisym,total}` and the two directional facts; Idris2 (reference) `Trope.Soundness.{fateDroppedLtePredicated,fatePredicatedNotLteDropped}`, `Trope.Order.fateLteTrans`; Mathlib Lean `FateA.{le_total,le_refl}` (`BRIDGE-PENDING`). | Veridicality Derivation | Exactly three deceptive duals, one per coordinate kind (`Falsified`, `Misbound`, `Conflated`), each the unique deceptive inhabitant of its coordinate. @@ -182,24 +182,24 @@ leg, so they can neither raise nor lower a grade. | re-proved · `PROVEN` · `AGDA-VERIFIED` · unavailable · `OPEN` · `NOT-INVENTORIED` · re-proved · `PROVEN-WITH-AXIOMS` · `BRIDGE-PENDING` | L4 (monotonicity): fate coordinate -| `3` -| 0 of 2 -| re-proved · `PROVEN` · `AGDA-VERIFIED` · unavailable · `OPEN` · `NOT-INVENTORIED` · re-proved · `PROVEN-WITH-AXIOMS` · `BRIDGE-PENDING` +| `2ii` +| 2 of 2 +| re-proved · `PROVEN` · `AGDA-VERIFIED` · re-proved · `PROVEN` · `RECONCILED` · re-proved · `PROVEN` · `RECONCILED` | L4 (monotonicity): fidelity dimension -| `3` -| 0 of 2 -| re-proved · `PROVEN` · `AGDA-VERIFIED` · unavailable · `OPEN` · `NOT-INVENTORIED` · unavailable · `OPEN` · `NOT-INVENTORIED` +| `2ii` +| 2 of 2 +| re-proved · `PROVEN` · `AGDA-VERIFIED` · re-proved · `PROVEN` · `RECONCILED` · re-proved · `PROVEN` · `RECONCILED` | L4 (monotonicity): bond and merge coordinates -| `ungraded` -| 0 of 2 -| unavailable · `OPEN` · `AGDA-PENDING` · unavailable · `OPEN` · `NOT-INVENTORIED` · unavailable · `OPEN` · `NOT-INVENTORIED` +| `2ii` +| 2 of 2 +| re-proved · `PROVEN` · `AGDA-VERIFIED` · re-proved · `PROVEN` · `RECONCILED` · re-proved · `PROVEN` · `RECONCILED` | L4 (monotonicity): grade-level lifting for gradeCompose -| `ungraded` -| 0 of 2 -| unavailable · `OPEN` · `AGDA-PENDING` · unavailable · `OPEN` · `NOT-INVENTORIED` · unavailable · `OPEN` · `NOT-INVENTORIED` +| `2ii` +| 2 of 2 +| re-proved · `PROVEN` · `AGDA-VERIFIED` · re-proved · `PROVEN` · `RECONCILED` · re-proved · `PROVEN` · `RECONCILED` | L5 (deception infectiousness) | `3` @@ -212,19 +212,19 @@ leg, so they can neither raise nor lower a grade. | re-proved · `PROVEN` · `AGDA-VERIFIED` · unavailable · `OPEN` · `NOT-INVENTORIED` · re-proved · `PROVEN-WITH-AXIOMS` · `BRIDGE-PENDING` | Retention order is a decidable preorder -| `ungraded` -| 0 of 2 -| re-proved · `OPEN` · `AGDA-PENDING` · unavailable · `OPEN` · `NOT-INVENTORIED` · unavailable · `OPEN` · `NOT-INVENTORIED` +| `2ii` +| 2 of 2 +| re-proved · `PROVEN` · `AGDA-VERIFIED` · re-proved · `PROVEN` · `RECONCILED` · re-proved · `PROVEN` · `RECONCILED` | A2 directional facts: Dropped below Predicated, not conversely -| `3` -| 0 of 2 -| re-proved · `PROVEN` · `AGDA-VERIFIED` · unavailable · `OPEN` · `NOT-INVENTORIED` · unavailable · `OPEN` · `NOT-INVENTORIED` +| `2ii` +| 2 of 2 +| re-proved · `PROVEN` · `AGDA-VERIFIED` · re-proved · `PROVEN` · `RECONCILED` · re-proved · `PROVEN` · `RECONCILED` | Fate is a chain (A2) -| `ungraded` -| 0 of 2 -| unavailable · `OPEN` · `AGDA-PENDING` · unavailable · `OPEN` · `NOT-INVENTORIED` · re-proved · `OPEN` · `BRIDGE-PENDING` +| `2ii` +| 2 of 2 +| re-proved · `PROVEN` · `AGDA-VERIFIED` · re-proved · `PROVEN` · `RECONCILED` · re-proved · `PROVEN` · `RECONCILED` | Veridicality Derivation | `3` @@ -313,32 +313,79 @@ leg, so they can neither raise nor lower a grade. |=== // PWG-TABLE:END -*Census* (PROOF-POLICY §8.4 rule 7, never a percentage): of 28 theory obligations in this repository, `PWG-3` 18, `PWG-2i` 0, `PWG-2ii` 0, `PWG-1` 0, `ungraded` 10. No obligation here carries `+foundation-diverse` (§8.3). - -Read the census as the policy intends: eighteen obligations have a kernel-checked -Agda witness with a complete §8.2 receipt at the current commit, and *none* has a -counting recheck leg. `PWG-3` is not a discharge (§8.4 rule 1) — every one of the -eighteen still owes both its §2 legs. The ten `ungraded` rows split five ways, -and the distinction is the useful part. *Two* are Lean-only with no Agda source at -all: the O1 atom factorisation and the tropical (B′) sighting. *One*, `A2-chain`, -has no Agda source and only a partial Lean statement (totality and reflexivity; -Idris2 adds transitivity off the ladder; antisymmetry is cited nowhere). *Four* are -Idris2-only, where an engineering restatement is not a leg (§8.1): HC-4 coherence, -exact grade soundness, T-Sub soundness and `L4-bond-merge`. *One*, `L4-lifting`, is -mechanised in no prover at all. *Two* have a -real but incomplete Agda leg, so the Agda token is `OPEN`: the retention order -proves reflexivity but neither transitivity nor decidability, and tier-2 membership -proves six of the non-cancellativity witnesses (`TB.Tier`, fate and bond) plus the -positive `Q-cancelʳ`, but not the exhaustive characterisation — there is no Agda -counterpart of `grade_leftCancel_iff`, and no Agda witness on the merge coordinate. -§8.1 makes all five causes `ungraded` alike; only the Idris2-only group is about -engineering provers. A missing Agda source and a partial one are different debts, and the -ledger records which one each row carries rather than flattening both to -"Lean-only". - -Nothing can reach `PWG-2i`, `PWG-2ii` or `PWG-1` from where this tree stands: no -Rocq development exists in this repository at all, so the ladder has a missing -rung that is independent of any Agda work. +*Census* (PROOF-POLICY §8.4 rule 7, never a percentage): of 28 theory obligations in this repository, `PWG-3` 15, `PWG-2i` 0, `PWG-2ii` 7, `PWG-1` 0, `ungraded` 6. No obligation here carries `+foundation-diverse` (§8.3). + +Read the census as the policy intends. *Seven* obligations are at `PWG-2ii`: +the four parts of L4, both parts of A2, and the retention order. Each has a +kernel-checked Agda witness and two counting recheck legs, a Rocq leg and a +core-Lean leg (`verification/proofs/rocq/RatifiedOrder.v`, +`verification/proofs/lean4/ratified-order/RatifiedOrder.lean`, both +`RECONCILED`; see *Recheck legs of the order laws and L4*). None of them is +`PWG-1`: their receipts are from CI run 44006871652 on `d5234b1`, not from the +ledger's source commit, and the derivation (§8.2, §8.5.2) does not carry a grade +across commits. *Fifteen* obligations are at `PWG-3`: a kernel-checked Agda +witness with a complete §8.2 receipt and no counting recheck leg. `PWG-3` is not a +discharge (§8.4 rule 1); each of the fifteen still owes both its §2 legs. + +The six `ungraded` rows split three ways. *Two* are Lean-only with no Agda source +at all: the O1 atom factorisation and the tropical (B′) sighting. *Three* are +Idris2-only, where an engineering restatement is not a leg (§8.1): HC-4 +coherence, exact grade soundness and T-Sub soundness. *One* has a real but +incomplete Agda leg, so its Agda token is `OPEN`: tier-2 membership proves six of +the non-cancellativity witnesses (`TB.Tier`, fate and bond) plus the positive +`Q-cancelʳ`, but not the exhaustive characterisation. There is no Agda +counterpart of `grade_leftCancel_iff`, and no Agda witness on the merge +coordinate. §8.1 makes all three causes `ungraded` alike; only the Idris2-only +group is about engineering provers. A missing Agda source and a partial one are +different debts, and the ledger records which one each row carries rather than +flattening both to "Lean-only". + +Until 2026-11-17 nothing here could reach `PWG-2i` or above, because no Rocq +development existed. The recheck legs above are the first, and they cover only +the seven rows named. The other fifteen `PWG-3` rows have no Rocq or counting +Lean leg yet. + +[[recheck-legs]] +=== Recheck legs of the order laws and L4 (§2, §2.2) + +*Owner rulings.* On 2026-11-17 the owner ruled that L4 and A2 are proved as +their titles state, and that theory "goes in Agda, rechecked in Rocq and Lean", +with no Mathlib. The 2026-11-09 ruling below ("Lean is a generator, not a leg") +was given about the Mathlib development, for the Mathlib reason. The Lean leg here +is a separate file with no import at all. It is recorded `RECONCILED` and it +counts. *That reading is put to the owner for confirmation.* If the owner keeps +every Lean row off the ladder, the Lean legs of the seven rows become +`BRIDGE-PENDING`, and those rows derive `PWG-2i` instead of `PWG-2ii`. + +[cols="1,3"] +|=== +| Item | Record + +| Source (Agda) +| `TB.Order`, `TB.OrderLaws`, `TB.Monotone` (`verification/proofs/agda/theorem-b/`), and `TB.Bridge` for the definitions. + +| Rocq leg +| `verification/proofs/rocq/RatifiedOrder.v`, route `re-proved`. Coq 8.18.0, no `Require` (prelude only). Gate: `bash scripts/check-recheck-legs.sh rocq`. Receipt `rocq-ratified-order-d5234b1`, CI run 44006871652: `Print Assumptions` closed under the global context for 49 of 49 declarations. + +| Lean leg +| `verification/proofs/lean4/ratified-order/RatifiedOrder.lean`, route `re-proved`. Lean 4.16.0 core: no import, no Mathlib, no `simp`, `omega` or `decide`. Gate: `bash scripts/check-recheck-legs.sh lean`. Receipt `lean-ratified-order-d5234b1`, CI run 44006871652: no axiom for 49 of 49 declared theorems, nor for any definition they use. + +| Why re-proved, not transported +| The Agda→Dedukti→Rocq/Lean transport of §2 is not wired in this repository, and no released Lambdapi Lean exporter exists (PROOF-POLICY §2, item 2). + +| Statement correspondence +a| Compared by reading, item by item, and checked mechanically for the definitions: + +* *Definitions.* Each leg restates `Δ`, `Fate`, `Bond`, `Merge`, `Grade`, `_⊕d_`, `_▷f_`, `_▷b_`, `_▷m_`, `_▷_`, `lteb`, `dLte`, `fateLte`, `bondLte`, `mergeLte` and `gradeLte` with the same constructors and the same clauses. `TB.Bridge` states the values of `fateLte`, `_▷f_`, `bondLte`, `_▷b_`, `mergeLte` and `_▷m_` on a fixed sample, as six numeral lists. Each leg proves the *same six literals* about its own restatement by computation (`bridge_*`). Bond (16 pairs) and Merge (9 pairs) are covered exhaustively; Fate is covered on 9 points (81 pairs), including Δ addition. A planted one-clause drift (`withheld ▷b intact` set to `intact`) leaves every theorem provable and is caught only by `bridge_bcomp`, in both legs. That is a CI control. +* *Theorems.* Each leg states every theorem above with the same hypotheses and conclusion as the Agda. `⊑` is `gle g h := gradeLte g h = true` (Agda: `gradeLte g h ≡ true`). `IsTotalOrder _≡_ _≤F_` is stated as its four laws (`fate_isTotalOrder`). `⊑-dec : Dec (g ⊑ h)` is `gle_dec` (Rocq `{gle g h} + {~ gle g h}`, Lean `Decidable (gle g h)`), and in Lean also the theorem `gle_decides`. +* *Encoding only.* Agda `ℕ`/`Bool`/`_∧_`/`_≡_`/`_⊎_` are `nat`/`bool`/`andb`/`eq`/`or` (Rocq) and `Nat`/`Bool`/`&&`/`=`/`Or` (Lean). Conjunctions are parenthesised right-nested, because Agda's `_∧_` is right-associative while Rocq's `&&` and Lean's `&&` are left-associative. Infix operators become named functions, and hyphens become underscores. + +| Residual assumptions +| None in any leg: the Agda is `--safe` with no postulate in its cone (receipt `agda-d5234b1`), and each recheck leg reports no axiom. + +| Planted controls (CI) +| `bash scripts/check-recheck-legs.sh controls`: a Rocq `Admitted`, a Lean `sorry`, a Lean user axiom, an empty Lean audit domain, and the definition drift in each leg. Each must be caught, and in run 44006871652 all 6 were. +|=== === Import cone (§1.1) @@ -376,8 +423,11 @@ Owner ruling 2026-11-09: **Lean is a generator, not a leg.** The Lean developmen keeps Mathlib and keeps its purpose — finding and stress-testing theorems — and its results are then restated in core Agda, which is what becomes gradeable. The Mathlib cone therefore never enters the trusted base, and no Lean row here is or -will be a §2 recheck leg. The ledger records every Lean leg as -`route: re-proved, state: BRIDGE-PENDING`, which does not count (§2.2, §8.2). The +will be a §2 recheck leg. The ledger records every Lean leg of the Mathlib +development as `route: re-proved, state: BRIDGE-PENDING`, which does not count +(§2.2, §8.2). (The core-Lean legs added on 2026-11-17 for the seven order and L4 +rows import nothing, Mathlib included, and are recorded `RECONCILED`. Whether this +ruling also covers them is put to the owner: see <>.) The two Lean-only obligations — the O1 atom factorisation and the tropical (B′) sighting — stay `ungraded` until an Agda statement of them exists at all; tier-2 membership has its Agda witnesses already and stays `ungraded` only until the diff --git a/scripts/check-recheck-legs.sh b/scripts/check-recheck-legs.sh new file mode 100755 index 0000000..bf1f14e --- /dev/null +++ b/scripts/check-recheck-legs.sh @@ -0,0 +1,178 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: MPL-2.0 +# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) +# +# check-recheck-legs.sh rocq|lean|controls +# +# The gate for the PROOF-POLICY §2 recheck legs of the ratified-carrier order +# laws and L4 (verification/proofs/rocq/RatifiedOrder.v and +# verification/proofs/lean4/ratified-order/RatifiedOrder.lean). The same +# script runs locally and in CI (.github/workflows/proofs.yml), so a green +# local run and a green CI run mean the same thing. +# +# rocq coqc must be the pinned version; the file must compile; and +# `Print Assumptions` must report "Closed under the global +# context" for EVERY Theorem and Lemma the file declares. +# lean lean must be the pinned version; the file must check with no +# error and no warning (a `sorry` only warns); and EVERY theorem +# the source declares must depend on no axiom at all +# (Lean.collectAxioms, the function behind #print axioms). +# controls plants a defect in a scratch copy of each leg and requires the +# gate above to FAIL on it: an Admitted proof, a sorry, a user +# axiom, and a one-clause drift in a restated definition (caught +# by the bridge theorems). A gate that has never been seen to +# fail is not a gate. +# +# Fails closed: a missing or wrong-version prover is a FAIL, never a skip, and +# an axiom audit that inspects zero declarations is a FAIL, not a vacuous pass +# (the defect found in hyperpolymath/mathesis THY-1's Lean leg, 2026-11-16). +# +# Exit: 0 = pass; 1 = fail; 2 = misuse. + +set -euo pipefail + +MODE="${1:-}" +cd "$(dirname "${BASH_SOURCE[0]}")/.." +ROCQ_FILE="verification/proofs/rocq/RatifiedOrder.v" +LEAN_FILE="verification/proofs/lean4/ratified-order/RatifiedOrder.lean" +ROCQ_VERSION="${ROCQ_VERSION:-8.18.0}" +LEAN_VERSION="${LEAN_VERSION:-4.16.0}" + +fail() { echo "FAIL: $*" >&2; exit 1; } + +need_rocq() { + command -v coqc >/dev/null 2>&1 || fail "coqc not on PATH (a missing prover fails this gate; it never skips)" + coqc --version | grep -qF "version ${ROCQ_VERSION}" || + fail "coqc is not version ${ROCQ_VERSION}: $(coqc --version | head -1)" +} + +need_lean() { + command -v lean >/dev/null 2>&1 || fail "lean not on PATH (a missing prover fails this gate; it never skips)" + lean --version | grep -qF "version ${LEAN_VERSION}" || + fail "lean is not version ${LEAN_VERSION}: $(lean --version | head -1)" +} + +# rocq_audit FILE -> prints the receipt line; returns 1 on any defect. +rocq_audit() { + local src="$1" dir base names expect got out rc + dir="$(mktemp -d)"; base="AuditRatifiedOrder" + names="$(sed -n -E "s/^[[:space:]]*(Theorem|Lemma)[[:space:]]+([A-Za-z_][A-Za-z0-9_']*).*/\2/p" "$src")" + expect="$(grep -c . <<<"$names" || true)" + if [ "$expect" -eq 0 ]; then echo "rocq audit: no Theorem or Lemma declared (empty domain)"; rm -rf "$dir"; return 1; fi + { cat "$src"; echo; while IFS= read -r n; do echo "Print Assumptions $n."; done <<<"$names"; } >"$dir/$base.v" + set +e; out="$(cd "$dir" && coqc "$base.v" 2>&1)"; rc=$?; set -e + rm -rf "$dir" + got="$(grep -c '^Closed under the global context' <<<"$out" || true)" + if [ "$rc" -ne 0 ] || [ "$got" -ne "$expect" ]; then + echo "rocq audit: $got of $expect declaration(s) closed under the global context (coqc exit $rc)" + grep -v '^Closed under the global context' <<<"$out" | head -20 + return 1 + fi + echo "Print Assumptions: closed under the global context for $expect of $expect declaration(s)" +} + +# lean_check FILE -> prints the receipt line; returns 1 on any defect. +lean_check() { + local src="$1" dir out rc declared audited + set +e; out="$(lean "$src" 2>&1)"; rc=$?; set -e + if [ "$rc" -ne 0 ] || grep -qE '(^|: )(error|warning)' <<<"$out"; then + echo "lean: the file does not check cleanly (exit $rc)"; grep -E 'error|warning' <<<"$out" | head -20; return 1 + fi + dir="$(mktemp -d)" + { echo "import Lean"; cat "$src"; cat <<'LEAN' + +open Lean Elab Command in +#eval show CommandElabM Unit from do + let env ← getEnv + let mut n := 0 + for (name, ci) in env.constants.map₂.toList do + -- Only what the source declares: theorems, and defs that carry a + -- declaration range (the lemmas Lean generates have none). + let isThm := match ci with | .thmInfo _ => true | _ => false + let isDef := match ci with | .defnInfo _ => true | _ => false + unless isThm || isDef do continue + if (← liftCoreM (findDeclarationRanges? name)).isNone then continue + if isThm then n := n + 1 + let axs ← liftCoreM (Lean.collectAxioms name) + unless axs.isEmpty do + logInfo m!"GATE-AXIOMS {name}: {axs.toList}" + logInfo m!"GATE-AUDIT-DONE {n}" +LEAN + } >"$dir/Audit.lean" + set +e; out="$(lean "$dir/Audit.lean" 2>&1)"; rc=$?; set -e + rm -rf "$dir" + declared="$(grep -cE '^[[:space:]]*theorem[[:space:]]' "$src" || true)" + audited="$(sed -n 's/.*GATE-AUDIT-DONE \([0-9]*\).*/\1/p' <<<"$out")" + if [ "$rc" -ne 0 ] || [ -z "$audited" ] || grep -q 'GATE-AXIOMS' <<<"$out"; then + echo "lean audit: a declaration depends on an axiom, or the audit did not run (exit $rc)" + grep -E 'GATE-|error' <<<"$out" | head -20; return 1 + fi + if [ "$audited" -eq 0 ] || [ "$audited" -ne "$declared" ]; then + echo "lean audit: audited $audited theorem(s), the source declares $declared (an empty or partial domain fails)"; return 1 + fi + echo "axioms: none for $audited of $declared declared theorem(s), and none for any def they use" +} + +case "$MODE" in + rocq) + need_rocq + echo "=== Rocq recheck leg: $ROCQ_FILE ($(coqc --version | head -1)) ===" + dir="$(mktemp -d)"; cp "$ROCQ_FILE" "$dir/" + ( cd "$dir" && coqc "$(basename "$ROCQ_FILE")" ) || { rm -rf "$dir"; fail "coqc rejects $ROCQ_FILE"; } + rm -rf "$dir" + rocq_audit "$ROCQ_FILE" || fail "Rocq axiom audit" + echo "sha256 $(sha256sum "$ROCQ_FILE" | cut -d' ' -f1) $ROCQ_FILE" + echo "PASS: Rocq recheck leg" + ;; + lean) + need_lean + echo "=== Lean recheck leg: $LEAN_FILE ($(lean --version | head -1)) ===" + lean_check "$LEAN_FILE" || fail "Lean check or axiom audit" + echo "sha256 $(sha256sum "$LEAN_FILE" | cut -d' ' -f1) $LEAN_FILE" + echo "PASS: Lean recheck leg" + ;; + controls) + need_rocq; need_lean + t="$(mktemp -d)"; trap 'rm -rf "$t"' EXIT + bad=0 + expect_fail() { # $1 label, $2 command... + local label="$1"; shift + if "$@" >"$t/log" 2>&1; then echo "CONTROL NOT CAUGHT: $label"; cat "$t/log"; bad=1 + else echo "caught: $label -- $(grep -m1 -E . "$t/log")"; fi + } + # Rocq: an Admitted proof compiles; the audit must still refuse it. + sed '0,/^Proof\. intros \[\]; reflexivity\. Qed\./s//Proof. Admitted./' "$ROCQ_FILE" >"$t/A.v" + grep -q 'Admitted\.' "$t/A.v" || fail "control setup: no Admitted planted" + expect_fail "Rocq Admitted proof" rocq_audit "$t/A.v" + # Rocq: a one-clause drift in a restated definition. withheld ▷b intact + # = intact keeps every restated theorem TRUE (▷b stays monotone), so only + # the bridge can see it; the failure must be at bridge_bcomp. + sed 's/^ | withheld, intact => withheld$/ | withheld, intact => intact/' "$ROCQ_FILE" >"$t/D.v" + cmp -s "$ROCQ_FILE" "$t/D.v" && fail "control setup: no Rocq drift planted" + bl="$(grep -n '^Theorem bridge_bcomp' "$t/D.v" | cut -d: -f1)" + el="$( (cd "$t" && coqc D.v 2>&1 || true) | sed -n 's/^File .*, line \([0-9]*\),.*/\1/p' | head -1)" + if [ -n "$el" ] && [ "$el" -ge "$bl" ] && [ "$el" -le "$((bl + 1))" ]; then + echo "caught: Rocq definition drift (bcomp), caught by the bridge -- first error at line $el (bridge_bcomp)" + else echo "CONTROL NOT CAUGHT (or not by the bridge): Rocq definition drift, first error line '${el}'"; bad=1; fi + # Lean: a sorry only warns; the gate must refuse it. + { cat "$LEAN_FILE"; printf '\ntheorem planted_sorry : 1 = 2 := sorry\n'; } >"$t/S.lean" + expect_fail "Lean sorry" lean_check "$t/S.lean" + # Lean: a user axiom compiles without warning; the audit must refuse it. + { cat "$LEAN_FILE"; printf '\naxiom planted_ax : False\ntheorem planted_use : 1 = 2 := planted_ax.elim\n'; } >"$t/X.lean" + expect_fail "Lean user axiom" lean_check "$t/X.lean" + # Lean: the same drift; the only error must be at bridge_bcomp. + sed 's/^ | withheld, intact => withheld$/ | withheld, intact => intact/' "$LEAN_FILE" >"$t/D.lean" + cmp -s "$LEAN_FILE" "$t/D.lean" && fail "control setup: no Lean drift planted" + bl="$(grep -n '^theorem bridge_bcomp' "$t/D.lean" | cut -d: -f1)" + errs="$(lean "$t/D.lean" 2>&1 | grep -E ': error' || true)" + if [ -n "$errs" ] && ! grep -vq "D.lean:$bl:" <<<"$errs"; then + echo "caught: Lean definition drift (bcomp), caught by the bridge -- only error at line $bl (bridge_bcomp)" + else echo "CONTROL NOT CAUGHT (or not by the bridge): Lean definition drift"; echo "$errs"; bad=1; fi + # Lean: an audit over an empty domain must fail, not pass vacuously. + printf 'def onlyADef : Nat := 1\n' >"$t/E.lean" + expect_fail "Lean empty audit domain" lean_check "$t/E.lean" + [ "$bad" -eq 0 ] || fail "a planted defect was not caught" + echo "PASS: every planted defect was caught (6 controls)" + ;; + *) echo "usage: $(basename "$0") rocq|lean|controls" >&2; exit 2 ;; +esac diff --git a/verification/proofs/agda/theorem-b/All.agda b/verification/proofs/agda/theorem-b/All.agda index de0e4fa..83510db 100644 --- a/verification/proofs/agda/theorem-b/All.agda +++ b/verification/proofs/agda/theorem-b/All.agda @@ -8,6 +8,9 @@ module All where open import TB.Grade open import TB.Order +open import TB.OrderLaws +open import TB.Monotone +open import TB.Bridge open import TB.Tier open import TB.Syntax open import TB.Substitution diff --git a/verification/proofs/agda/theorem-b/Smoke.agda b/verification/proofs/agda/theorem-b/Smoke.agda index edde93c..0a27476 100644 --- a/verification/proofs/agda/theorem-b/Smoke.agda +++ b/verification/proofs/agda/theorem-b/Smoke.agda @@ -25,6 +25,18 @@ open import TB.Order using ; dplusMonoR ; dplusMonoL -- fidelity monotonicity ; fateL4MonoR ; fateL4MonoL ) -- L4, both arguments +-- A2-chain + retention-order: Fate is a chain (a total order), and ⊑ is a +-- decidable preorder on grades. +open import TB.OrderLaws using + ( fateLte-trans ; fateLte-antisym ; fateLte-total ; fate-isTotalOrder -- A2: chain + ; dLte-isTotalOrder -- fidelity chain + ; ⊑-trans ; ⊑-dec ; ⊑-isPreorder ) -- decidable preorder + +-- L4 in full: bond and merge coordinates, and the grade-level lifting. +open import TB.Monotone using + ( bondL4MonoR ; bondL4MonoL ; mergeL4MonoR ; mergeL4MonoL -- L4-bond-merge + ; gradeL4MonoR ; gradeL4MonoL ; ▷-mono ) -- L4-lifting + -- F4 — the three-tier boundary, dynamically (closure, NOT homomorphism). open import TB.Tier using ( Tier ; tierOf ; _⊓ᵗ_ diff --git a/verification/proofs/agda/theorem-b/TB/Bridge.agda b/verification/proofs/agda/theorem-b/TB/Bridge.agda new file mode 100644 index 0000000..750ede2 --- /dev/null +++ b/verification/proofs/agda/theorem-b/TB/Bridge.agda @@ -0,0 +1,126 @@ +{-# OPTIONS --safe --without-K --cubical-compatible --exact-split #-} +-- SPDX-FileCopyrightText: © 2026 Jonathan D.A. Jewell (hyperpolymath) +-- SPDX-License-Identifier: MPL-2.0 +-- +-- Theorem B — the definition bridge for the Rocq and Lean recheck legs of the +-- ratified-carrier order laws and L4 (PROOF-POLICY §2.2). +-- +-- A re-proved leg restates the Agda definitions by hand, and a restated +-- definition can drift from its source while every theorem about it still +-- proves. This module pins the values of the six definitions the legs restate +-- (fateLte, _▷f_, bondLte, _▷b_, mergeLte, _▷m_) on a fixed sample, as lists +-- of numerals. verification/proofs/rocq/RatifiedOrder.v and +-- verification/proofs/lean4/ratified-order/RatifiedOrder.lean state the SAME +-- six literals about their own restatements and prove them by computation. +-- If any one restatement disagrees with the Agda at any sample point, that +-- prover's kernel rejects its bridge theorem. +-- +-- Coverage: Bond (4 × 4) and Merge (3 × 3) are covered exhaustively. Fate is +-- covered on nine points, top to bottom: present, atten (Q 0), atten (Q 2), +-- atten (Q 5), atten total, atten unknown, predicated, dropped, falsified +-- (81 pairs); the Atten pairs exercise Δ addition (Q 2 ⊕d Q 5 = Q 7). +-- The fateLte table is lower-triangular in that order: the chain, visibly. +-- +-- Codes: Fate present 0, atten (Q n) 10 + n, atten total 1, atten unknown 2, +-- predicated 3, dropped 4, falsified 5; Bond intact 0, withheld 1, severed 2, +-- misbound 3; Merge single 0, fused 1, conflated 2; a Boolean is 1 or 0. + +module TB.Bridge where + +open import Data.Bool.Base using (Bool; true; false) +open import Data.List.Base using (List; []; _∷_; map; concatMap) +open import Data.Nat.Base using (ℕ; _+_) +open import Relation.Binary.PropositionalEquality using (_≡_; refl) + +open import TB.Grade +open import TB.Order + +b2n : Bool → ℕ +b2n true = 1 +b2n false = 0 + +fcode : Fate → ℕ +fcode present = 0 +fcode (atten (Q n)) = 10 + n +fcode (atten total) = 1 +fcode (atten unknown) = 2 +fcode predicated = 3 +fcode dropped = 4 +fcode falsified = 5 + +bcode : Bond → ℕ +bcode intact = 0 +bcode withheld = 1 +bcode severed = 2 +bcode misbound = 3 + +mcode : Merge → ℕ +mcode single = 0 +mcode fused = 1 +mcode conflated = 2 + +sampleF : List Fate +sampleF = present ∷ atten (Q 0) ∷ atten (Q 2) ∷ atten (Q 5) ∷ atten total + ∷ atten unknown ∷ predicated ∷ dropped ∷ falsified ∷ [] + +sampleB : List Bond +sampleB = intact ∷ withheld ∷ severed ∷ misbound ∷ [] + +sampleM : List Merge +sampleM = single ∷ fused ∷ conflated ∷ [] + +-- Every ordered pair of the sample, row by row: tbl f [x₁ … xₙ] = +-- f x₁ x₁ … f x₁ xₙ, f x₂ x₁ … +tbl : {A : Set} → (A → A → ℕ) → List A → List ℕ +tbl f xs = concatMap (λ x → map (f x) xs) xs + +fateLteTable-literal : List ℕ +fateLteTable-literal = + 1 ∷ 0 ∷ 0 ∷ 0 ∷ 0 ∷ 0 ∷ 0 ∷ 0 ∷ 0 ∷ 1 ∷ 1 ∷ 0 ∷ 0 ∷ 0 ∷ 0 ∷ 0 ∷ 0 ∷ + 0 ∷ 1 ∷ 1 ∷ 1 ∷ 0 ∷ 0 ∷ 0 ∷ 0 ∷ 0 ∷ 0 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 0 ∷ 0 ∷ 0 ∷ + 0 ∷ 0 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 0 ∷ 0 ∷ 0 ∷ 0 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ + 0 ∷ 0 ∷ 0 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 0 ∷ 0 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ + 1 ∷ 1 ∷ 1 ∷ 0 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ [] + +fcompTable-literal : List ℕ +fcompTable-literal = + 0 ∷ 10 ∷ 12 ∷ 15 ∷ 1 ∷ 2 ∷ 3 ∷ 4 ∷ 5 ∷ 10 ∷ 10 ∷ 12 ∷ 15 ∷ 1 ∷ 2 ∷ + 3 ∷ 4 ∷ 5 ∷ 12 ∷ 12 ∷ 14 ∷ 17 ∷ 1 ∷ 2 ∷ 3 ∷ 4 ∷ 5 ∷ 15 ∷ 15 ∷ 17 ∷ + 20 ∷ 1 ∷ 2 ∷ 3 ∷ 4 ∷ 5 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 2 ∷ 3 ∷ 4 ∷ 5 ∷ 2 ∷ + 2 ∷ 2 ∷ 2 ∷ 2 ∷ 2 ∷ 3 ∷ 4 ∷ 5 ∷ 3 ∷ 3 ∷ 3 ∷ 3 ∷ 3 ∷ 3 ∷ 3 ∷ 4 ∷ 5 ∷ + 4 ∷ 4 ∷ 4 ∷ 4 ∷ 4 ∷ 4 ∷ 4 ∷ 4 ∷ 5 ∷ 5 ∷ 5 ∷ 5 ∷ 5 ∷ 5 ∷ 5 ∷ 5 ∷ 5 ∷ + 5 ∷ [] + +bondLteTable-literal : List ℕ +bondLteTable-literal = + 1 ∷ 0 ∷ 0 ∷ 0 ∷ 1 ∷ 1 ∷ 0 ∷ 0 ∷ 1 ∷ 1 ∷ 1 ∷ 0 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ [] + +bcompTable-literal : List ℕ +bcompTable-literal = + 0 ∷ 1 ∷ 2 ∷ 3 ∷ 1 ∷ 1 ∷ 2 ∷ 3 ∷ 2 ∷ 2 ∷ 2 ∷ 3 ∷ 3 ∷ 3 ∷ 3 ∷ 3 ∷ [] + +mergeLteTable-literal : List ℕ +mergeLteTable-literal = + 1 ∷ 0 ∷ 0 ∷ 1 ∷ 1 ∷ 0 ∷ 1 ∷ 1 ∷ 1 ∷ [] + +mcompTable-literal : List ℕ +mcompTable-literal = + 0 ∷ 1 ∷ 2 ∷ 1 ∷ 1 ∷ 2 ∷ 2 ∷ 2 ∷ 2 ∷ [] + +bridge-fateLte : tbl (λ x y → b2n (fateLte x y)) sampleF ≡ fateLteTable-literal +bridge-fateLte = refl + +bridge-fcomp : tbl (λ x y → fcode (x ▷f y)) sampleF ≡ fcompTable-literal +bridge-fcomp = refl + +bridge-bondLte : tbl (λ x y → b2n (bondLte x y)) sampleB ≡ bondLteTable-literal +bridge-bondLte = refl + +bridge-bcomp : tbl (λ x y → bcode (x ▷b y)) sampleB ≡ bcompTable-literal +bridge-bcomp = refl + +bridge-mergeLte : tbl (λ x y → b2n (mergeLte x y)) sampleM ≡ mergeLteTable-literal +bridge-mergeLte = refl + +bridge-mcomp : tbl (λ x y → mcode (x ▷m y)) sampleM ≡ mcompTable-literal +bridge-mcomp = refl diff --git a/verification/proofs/agda/theorem-b/TB/Monotone.agda b/verification/proofs/agda/theorem-b/TB/Monotone.agda new file mode 100644 index 0000000..15b228d --- /dev/null +++ b/verification/proofs/agda/theorem-b/TB/Monotone.agda @@ -0,0 +1,109 @@ +{-# OPTIONS --safe --without-K --cubical-compatible --exact-split #-} +-- SPDX-FileCopyrightText: © 2026 Jonathan D.A. Jewell (hyperpolymath) +-- SPDX-License-Identifier: MPL-2.0 +-- +-- Theorem B — L4 (monotonicity) IN FULL on the RATIFIED carrier +-- (R-2026-07-07 (A1)/(A2), ADR 0004): ▷ is monotone in each argument with +-- respect to ⊑ on every coordinate, and the grade composition ▷ is too. +-- +-- L4-fate TB.Order.fateL4Mono{R,L} (already in TB.Order) +-- L4-fidelity TB.Order.dplusMono{R,L} (already in TB.Order) +-- L4-bond-merge bondL4Mono{R,L}, mergeL4Mono{R,L} (this module) +-- L4-lifting gradeL4Mono{R,L}, ▷-mono (this module) +-- +-- The left-argument forms follow from the right-argument forms by the +-- coordinate's commutativity (L6: ▷b-comm, ▷m-comm, grade-comm), so each +-- coordinate needs one case analysis, not two. ▷-mono, monotonicity in both +-- arguments at once, is the form the T-Fix-Decl argument (spec §7) applies at +-- a composition site; it composes the two one-sided lemmas through ⊑-trans. + +module TB.Monotone where + +open import Data.Bool.Base using (true) +open import Data.Product.Base using (_×_; _,_) +open import Relation.Binary.PropositionalEquality using (_≡_; refl; subst₂) + +open import TB.Grade +open import TB.Order +open import TB.OrderLaws using (∧⁶-elim; ∧⁶-intro; ⊑-trans) + +-------------------------------------------------------------------------------- +-- L4-bond-merge. Bond: Misbound ⊏ Severed ⊏ Withheld ⊏ Intact. +-------------------------------------------------------------------------------- + +bondL4MonoR : ∀ h x y → bondLte x y ≡ true → bondLte (h ▷b x) (h ▷b y) ≡ true +bondL4MonoR intact x y p = p +bondL4MonoR misbound x y _ = refl +bondL4MonoR withheld misbound y _ = refl +bondL4MonoR withheld intact intact _ = refl +bondL4MonoR withheld intact withheld () +bondL4MonoR withheld intact severed () +bondL4MonoR withheld intact misbound () +bondL4MonoR withheld withheld intact _ = refl +bondL4MonoR withheld withheld withheld _ = refl +bondL4MonoR withheld withheld severed () +bondL4MonoR withheld withheld misbound () +bondL4MonoR withheld severed intact _ = refl +bondL4MonoR withheld severed withheld _ = refl +bondL4MonoR withheld severed severed _ = refl +bondL4MonoR withheld severed misbound () +bondL4MonoR severed misbound y _ = refl +bondL4MonoR severed intact intact _ = refl +bondL4MonoR severed intact withheld () +bondL4MonoR severed intact severed () +bondL4MonoR severed intact misbound () +bondL4MonoR severed withheld intact _ = refl +bondL4MonoR severed withheld withheld _ = refl +bondL4MonoR severed withheld severed () +bondL4MonoR severed withheld misbound () +bondL4MonoR severed severed intact _ = refl +bondL4MonoR severed severed withheld _ = refl +bondL4MonoR severed severed severed _ = refl +bondL4MonoR severed severed misbound () + +bondL4MonoL : ∀ x y h → bondLte x y ≡ true → bondLte (x ▷b h) (y ▷b h) ≡ true +bondL4MonoL x y h p = + subst₂ (λ u v → bondLte u v ≡ true) (▷b-comm h x) (▷b-comm h y) (bondL4MonoR h x y p) + +-- Merge: Conflated ⊏ Fused ⊏ Single. + +mergeL4MonoR : ∀ h x y → mergeLte x y ≡ true → mergeLte (h ▷m x) (h ▷m y) ≡ true +mergeL4MonoR single x y p = p +mergeL4MonoR conflated x y _ = refl +mergeL4MonoR fused conflated y _ = refl +mergeL4MonoR fused single single _ = refl +mergeL4MonoR fused single fused () +mergeL4MonoR fused single conflated () +mergeL4MonoR fused fused single _ = refl +mergeL4MonoR fused fused fused _ = refl +mergeL4MonoR fused fused conflated () + +mergeL4MonoL : ∀ x y h → mergeLte x y ≡ true → mergeLte (x ▷m h) (y ▷m h) ≡ true +mergeL4MonoL x y h p = + subst₂ (λ u v → mergeLte u v ≡ true) (▷m-comm h x) (▷m-comm h y) (mergeL4MonoR h x y p) + +-------------------------------------------------------------------------------- +-- L4-lifting. The grade composition ▷ (gradeCompose) is ⊑-monotone: the six +-- coordinate lemmas, applied componentwise. +-------------------------------------------------------------------------------- + +gradeL4MonoR : ∀ k g h → g ⊑ h → (k ▷ g) ⊑ (k ▷ h) +gradeL4MonoR (mkGrade q b c r bo m) (mkGrade q₁ b₁ c₁ r₁ bo₁ m₁) (mkGrade q₂ b₂ c₂ r₂ bo₂ m₂) p + with ∧⁶-elim _ _ _ _ _ _ p +... | pq , pb , pc , pr , pbo , pm = + ∧⁶-intro _ _ _ _ _ _ + (fateL4MonoR q q₁ q₂ pq) + (fateL4MonoR b b₁ b₂ pb) + (fateL4MonoR c c₁ c₂ pc) + (fateL4MonoR r r₁ r₂ pr) + (bondL4MonoR bo bo₁ bo₂ pbo) + (mergeL4MonoR m m₁ m₂ pm) + +gradeL4MonoL : ∀ g h k → g ⊑ h → (g ▷ k) ⊑ (h ▷ k) +gradeL4MonoL g h k p = + subst₂ _⊑_ (grade-comm k g) (grade-comm k h) (gradeL4MonoR k g h p) + +-- Both arguments at once: g₁ ⊑ g₂ and h₁ ⊑ h₂ give g₁ ▷ h₁ ⊑ g₂ ▷ h₂. +▷-mono : ∀ g₁ g₂ h₁ h₂ → g₁ ⊑ g₂ → h₁ ⊑ h₂ → (g₁ ▷ h₁) ⊑ (g₂ ▷ h₂) +▷-mono g₁ g₂ h₁ h₂ p q = + ⊑-trans (g₁ ▷ h₁) (g₂ ▷ h₁) (g₂ ▷ h₂) (gradeL4MonoL g₁ g₂ h₁ p) (gradeL4MonoR g₂ h₁ h₂ q) diff --git a/verification/proofs/agda/theorem-b/TB/OrderLaws.agda b/verification/proofs/agda/theorem-b/TB/OrderLaws.agda new file mode 100644 index 0000000..97bd430 --- /dev/null +++ b/verification/proofs/agda/theorem-b/TB/OrderLaws.agda @@ -0,0 +1,346 @@ +{-# OPTIONS --safe --without-K --cubical-compatible --exact-split #-} +-- SPDX-FileCopyrightText: © 2026 Jonathan D.A. Jewell (hyperpolymath) +-- SPDX-License-Identifier: MPL-2.0 +-- +-- Theorem B — the order laws of the retention order ⊑ (TB.Order) on the +-- RATIFIED carrier (R-2026-07-07 (A2), ADR 0004). +-- +-- A2-chain Fate is a CHAIN: fateLte is reflexive, transitive, +-- antisymmetric and total — a total order in the sense of +-- the standard library (fate-isTotalOrder). The fidelity +-- order dLte, which fateLte uses on the Atten segment, is a +-- chain as well (dLte-isTotalOrder). +-- retention-order ⊑ on grades is a decidable preorder: reflexive (TB.Order +-- ⊑-refl), transitive (⊑-trans), decidable (⊑-dec). +-- +-- TB.Order proves reflexivity only; transitivity, antisymmetry and totality +-- were stated in no ladder prover before this module (pwg.json A2-chain, +-- retention-order). Everything here is by structural case analysis on the +-- Boolean orders exactly as TB.Order defines them; no definition is changed. + +module TB.OrderLaws where + +open import Data.Bool.Base using (Bool; true; false; _∧_) +open import Data.Bool.Properties using () renaming (_≟_ to _≟ᵇ_) +open import Data.Nat.Base using (ℕ; zero; suc) +open import Data.Product.Base using (_×_; _,_) +open import Data.Sum.Base using (_⊎_; inj₁; inj₂) +open import Relation.Binary.Structures using (IsPreorder; IsPartialOrder; IsTotalOrder) +open import Relation.Binary.PropositionalEquality + using (_≡_; refl; cong; subst; isEquivalence) +open import Relation.Nullary.Decidable using (Dec) + +open import TB.Grade +open import TB.Order + +-------------------------------------------------------------------------------- +-- ℕ: the structural Boolean ≤ (lteb) is a total order. +-------------------------------------------------------------------------------- + +lteb-trans : ∀ a b c → lteb a b ≡ true → lteb b c ≡ true → lteb a c ≡ true +lteb-trans zero b c _ _ = refl +lteb-trans (suc a) zero c () _ +lteb-trans (suc a) (suc b) zero _ () +lteb-trans (suc a) (suc b) (suc c) p q = lteb-trans a b c p q + +lteb-antisym : ∀ a b → lteb a b ≡ true → lteb b a ≡ true → a ≡ b +lteb-antisym zero zero _ _ = refl +lteb-antisym zero (suc b) _ () +lteb-antisym (suc a) zero () _ +lteb-antisym (suc a) (suc b) p q = cong suc (lteb-antisym a b p q) + +lteb-total : ∀ a b → lteb a b ≡ true ⊎ lteb b a ≡ true +lteb-total zero b = inj₁ refl +lteb-total (suc a) zero = inj₂ refl +lteb-total (suc a) (suc b) = lteb-total a b + +-------------------------------------------------------------------------------- +-- Δ: the fidelity order (unknown ⊏ total ⊏ … ⊏ Q 1 ⊏ Q 0) is a total order. +-------------------------------------------------------------------------------- + +dLte-trans : ∀ a b c → dLte a b ≡ true → dLte b c ≡ true → dLte a c ≡ true +dLte-trans unknown b c _ _ = refl +dLte-trans (Q x) (Q y) (Q z) p q = lteb-trans z y x q p +dLte-trans (Q x) (Q y) total _ () +dLte-trans (Q x) (Q y) unknown _ () +dLte-trans (Q x) total c () _ +dLte-trans (Q x) unknown c () _ +dLte-trans total (Q y) (Q z) _ _ = refl +dLte-trans total (Q y) total _ _ = refl +dLte-trans total (Q y) unknown _ () +dLte-trans total total (Q z) _ _ = refl +dLte-trans total total total _ _ = refl +dLte-trans total total unknown _ () +dLte-trans total unknown c () _ + +dLte-antisym : ∀ a b → dLte a b ≡ true → dLte b a ≡ true → a ≡ b +dLte-antisym unknown unknown _ _ = refl +dLte-antisym unknown (Q y) _ () +dLte-antisym unknown total _ () +dLte-antisym (Q x) (Q y) p q = cong Q (lteb-antisym x y q p) +dLte-antisym (Q x) total () _ +dLte-antisym (Q x) unknown () _ +dLte-antisym total (Q y) _ () +dLte-antisym total total _ _ = refl +dLte-antisym total unknown () _ + +dLte-total : ∀ a b → dLte a b ≡ true ⊎ dLte b a ≡ true +dLte-total unknown b = inj₁ refl +dLte-total (Q x) (Q y) = lteb-total y x +dLte-total (Q x) total = inj₂ refl +dLte-total (Q x) unknown = inj₂ refl +dLte-total total (Q y) = inj₁ refl +dLte-total total total = inj₁ refl +dLte-total total unknown = inj₂ refl + +-------------------------------------------------------------------------------- +-- A2-chain. Fate: Falsified ⊏ Dropped ⊏ Predicated ⊏ Atten(unknown) ⊏ +-- Atten(total) ⊏ … ⊏ Atten(Q 0) ⊏ Present is a total order. +-------------------------------------------------------------------------------- + +fateLte-trans : ∀ x y z → fateLte x y ≡ true → fateLte y z ≡ true → fateLte x z ≡ true +fateLte-trans falsified y z _ _ = refl +-- x = dropped: only z = falsified is open, and it forces y = falsified. +fateLte-trans dropped y present _ _ = refl +fateLte-trans dropped y (atten _) _ _ = refl +fateLte-trans dropped y predicated _ _ = refl +fateLte-trans dropped y dropped _ _ = refl +fateLte-trans dropped present falsified _ () +fateLte-trans dropped (atten _) falsified _ () +fateLte-trans dropped predicated falsified _ () +fateLte-trans dropped dropped falsified _ () +fateLte-trans dropped falsified falsified () _ +-- x = predicated: z ∈ {dropped, falsified} is refuted by y. +fateLte-trans predicated y present _ _ = refl +fateLte-trans predicated y (atten _) _ _ = refl +fateLte-trans predicated y predicated _ _ = refl +fateLte-trans predicated present dropped _ () +fateLte-trans predicated (atten _) dropped _ () +fateLte-trans predicated predicated dropped _ () +fateLte-trans predicated dropped dropped () _ +fateLte-trans predicated falsified dropped () _ +fateLte-trans predicated present falsified _ () +fateLte-trans predicated (atten _) falsified _ () +fateLte-trans predicated predicated falsified _ () +fateLte-trans predicated dropped falsified () _ +fateLte-trans predicated falsified falsified () _ +-- x = atten a: the Atten segment is the fidelity chain. +fateLte-trans (atten a) y present _ _ = refl +fateLte-trans (atten a) present (atten c) _ () +fateLte-trans (atten a) (atten b) (atten c) p q = dLte-trans a b c p q +fateLte-trans (atten a) predicated (atten c) () _ +fateLte-trans (atten a) dropped (atten c) () _ +fateLte-trans (atten a) falsified (atten c) () _ +fateLte-trans (atten a) present predicated _ () +fateLte-trans (atten a) (atten b) predicated _ () +fateLte-trans (atten a) predicated predicated () _ +fateLte-trans (atten a) dropped predicated () _ +fateLte-trans (atten a) falsified predicated () _ +fateLte-trans (atten a) present dropped _ () +fateLte-trans (atten a) (atten b) dropped _ () +fateLte-trans (atten a) predicated dropped () _ +fateLte-trans (atten a) dropped dropped () _ +fateLte-trans (atten a) falsified dropped () _ +fateLte-trans (atten a) present falsified _ () +fateLte-trans (atten a) (atten b) falsified _ () +fateLte-trans (atten a) predicated falsified () _ +fateLte-trans (atten a) dropped falsified () _ +fateLte-trans (atten a) falsified falsified () _ +-- x = present: present is the top, so y = present and z = present. +fateLte-trans present y present _ _ = refl +fateLte-trans present present (atten _) _ () +fateLte-trans present present predicated _ () +fateLte-trans present present dropped _ () +fateLte-trans present present falsified _ () +fateLte-trans present (atten _) (atten _) () _ +fateLte-trans present (atten _) predicated () _ +fateLte-trans present (atten _) dropped () _ +fateLte-trans present (atten _) falsified () _ +fateLte-trans present predicated (atten _) () _ +fateLte-trans present predicated predicated () _ +fateLte-trans present predicated dropped () _ +fateLte-trans present predicated falsified () _ +fateLte-trans present dropped (atten _) () _ +fateLte-trans present dropped predicated () _ +fateLte-trans present dropped dropped () _ +fateLte-trans present dropped falsified () _ +fateLte-trans present falsified (atten _) () _ +fateLte-trans present falsified predicated () _ +fateLte-trans present falsified dropped () _ +fateLte-trans present falsified falsified () _ + +fateLte-antisym : ∀ x y → fateLte x y ≡ true → fateLte y x ≡ true → x ≡ y +fateLte-antisym present present _ _ = refl +fateLte-antisym present (atten _) () _ +fateLte-antisym present predicated () _ +fateLte-antisym present dropped () _ +fateLte-antisym present falsified () _ +fateLte-antisym (atten a) present _ () +fateLte-antisym (atten a) (atten b) p q = cong atten (dLte-antisym a b p q) +fateLte-antisym (atten a) predicated () _ +fateLte-antisym (atten a) dropped () _ +fateLte-antisym (atten a) falsified () _ +fateLte-antisym predicated present _ () +fateLte-antisym predicated (atten _) _ () +fateLte-antisym predicated predicated _ _ = refl +fateLte-antisym predicated dropped () _ +fateLte-antisym predicated falsified () _ +fateLte-antisym dropped present _ () +fateLte-antisym dropped (atten _) _ () +fateLte-antisym dropped predicated _ () +fateLte-antisym dropped dropped _ _ = refl +fateLte-antisym dropped falsified () _ +fateLte-antisym falsified present _ () +fateLte-antisym falsified (atten _) _ () +fateLte-antisym falsified predicated _ () +fateLte-antisym falsified dropped _ () +fateLte-antisym falsified falsified _ _ = refl + +fateLte-total : ∀ x y → fateLte x y ≡ true ⊎ fateLte y x ≡ true +fateLte-total falsified y = inj₁ refl +fateLte-total present present = inj₁ refl +fateLte-total present (atten _) = inj₂ refl +fateLte-total present predicated = inj₂ refl +fateLte-total present dropped = inj₂ refl +fateLte-total present falsified = inj₂ refl +fateLte-total (atten a) present = inj₁ refl +fateLte-total (atten a) (atten b) = dLte-total a b +fateLte-total (atten a) predicated = inj₂ refl +fateLte-total (atten a) dropped = inj₂ refl +fateLte-total (atten a) falsified = inj₂ refl +fateLte-total predicated present = inj₁ refl +fateLte-total predicated (atten _) = inj₁ refl +fateLte-total predicated predicated = inj₁ refl +fateLte-total predicated dropped = inj₂ refl +fateLte-total predicated falsified = inj₂ refl +fateLte-total dropped present = inj₁ refl +fateLte-total dropped (atten _) = inj₁ refl +fateLte-total dropped predicated = inj₁ refl +fateLte-total dropped dropped = inj₁ refl +fateLte-total dropped falsified = inj₂ refl + +-- The relations as Set-valued orders, for the standard-library structures. +infix 4 _≤Δ_ _≤F_ +_≤Δ_ : Δ → Δ → Set +a ≤Δ b = dLte a b ≡ true + +_≤F_ : Fate → Fate → Set +x ≤F y = fateLte x y ≡ true + +dLte-isTotalOrder : IsTotalOrder _≡_ _≤Δ_ +dLte-isTotalOrder = record + { isPartialOrder = record + { isPreorder = record + { isEquivalence = isEquivalence + ; reflexive = λ {a} {b} eq → subst (λ b′ → dLte a b′ ≡ true) eq (dLte-refl a) + ; trans = λ {a} {b} {c} → dLte-trans a b c + } + ; antisym = λ {a} {b} → dLte-antisym a b + } + ; total = dLte-total + } + +-- A2-chain, as one statement: Fate is a chain (a total order). +fate-isTotalOrder : IsTotalOrder _≡_ _≤F_ +fate-isTotalOrder = record + { isPartialOrder = record + { isPreorder = record + { isEquivalence = isEquivalence + ; reflexive = λ {x} {y} eq → subst (λ y′ → fateLte x y′ ≡ true) eq (fateLte-refl x) + ; trans = λ {x} {y} {z} → fateLte-trans x y z + } + ; antisym = λ {x} {y} → fateLte-antisym x y + } + ; total = fateLte-total + } + +-------------------------------------------------------------------------------- +-- Bond and merge: chains too (Misbound ⊏ Severed ⊏ Withheld ⊏ Intact; +-- Conflated ⊏ Fused ⊏ Single). Transitivity is what ⊑-trans needs. +-------------------------------------------------------------------------------- + +bondLte-trans : ∀ x y z → bondLte x y ≡ true → bondLte y z ≡ true → bondLte x z ≡ true +bondLte-trans misbound y z _ _ = refl +bondLte-trans severed y intact _ _ = refl +bondLte-trans severed y withheld _ _ = refl +bondLte-trans severed y severed _ _ = refl +bondLte-trans severed intact misbound _ () +bondLte-trans severed withheld misbound _ () +bondLte-trans severed severed misbound _ () +bondLte-trans severed misbound misbound () _ +bondLte-trans withheld y intact _ _ = refl +bondLte-trans withheld y withheld _ _ = refl +bondLte-trans withheld intact severed _ () +bondLte-trans withheld withheld severed _ () +bondLte-trans withheld severed severed () _ +bondLte-trans withheld misbound severed () _ +bondLte-trans withheld intact misbound _ () +bondLte-trans withheld withheld misbound _ () +bondLte-trans withheld severed misbound () _ +bondLte-trans withheld misbound misbound () _ +bondLte-trans intact y intact _ _ = refl +bondLte-trans intact intact withheld _ () +bondLte-trans intact intact severed _ () +bondLte-trans intact intact misbound _ () +bondLte-trans intact withheld z () _ +bondLte-trans intact severed z () _ +bondLte-trans intact misbound z () _ + +mergeLte-trans : ∀ x y z → mergeLte x y ≡ true → mergeLte y z ≡ true → mergeLte x z ≡ true +mergeLte-trans conflated y z _ _ = refl +mergeLte-trans fused y single _ _ = refl +mergeLte-trans fused y fused _ _ = refl +mergeLte-trans fused single conflated _ () +mergeLte-trans fused fused conflated _ () +mergeLte-trans fused conflated conflated () _ +mergeLte-trans single y single _ _ = refl +mergeLte-trans single single fused _ () +mergeLte-trans single single conflated _ () +mergeLte-trans single fused z () _ +mergeLte-trans single conflated z () _ + +-------------------------------------------------------------------------------- +-- retention-order. ⊑ is the componentwise product of the six coordinate +-- orders; a Boolean conjunction of six tests, taken apart and put back. +-------------------------------------------------------------------------------- + +∧⁶-elim : ∀ a b c d e f → (a ∧ b ∧ c ∧ d ∧ e ∧ f) ≡ true → + a ≡ true × b ≡ true × c ≡ true × d ≡ true × e ≡ true × f ≡ true +∧⁶-elim true true true true true f p = refl , refl , refl , refl , refl , p +∧⁶-elim true true true true false f () +∧⁶-elim true true true false e f () +∧⁶-elim true true false d e f () +∧⁶-elim true false c d e f () +∧⁶-elim false b c d e f () + +∧⁶-intro : ∀ a b c d e f → a ≡ true → b ≡ true → c ≡ true → d ≡ true → + e ≡ true → f ≡ true → (a ∧ b ∧ c ∧ d ∧ e ∧ f) ≡ true +∧⁶-intro true true true true true f _ _ _ _ _ pf = pf +∧⁶-intro true true true true false f _ _ _ _ () _ +∧⁶-intro true true true false e f _ _ _ () _ _ +∧⁶-intro true true false d e f _ _ () _ _ _ +∧⁶-intro true false c d e f _ () _ _ _ _ +∧⁶-intro false b c d e f () _ _ _ _ _ + +⊑-trans : ∀ g h k → g ⊑ h → h ⊑ k → g ⊑ k +⊑-trans (mkGrade q₁ b₁ c₁ r₁ bo₁ m₁) (mkGrade q₂ b₂ c₂ r₂ bo₂ m₂) (mkGrade q₃ b₃ c₃ r₃ bo₃ m₃) p p′ + with ∧⁶-elim _ _ _ _ _ _ p | ∧⁶-elim _ _ _ _ _ _ p′ +... | pq , pb , pc , pr , pbo , pm | pq′ , pb′ , pc′ , pr′ , pbo′ , pm′ = + ∧⁶-intro _ _ _ _ _ _ + (fateLte-trans q₁ q₂ q₃ pq pq′) + (fateLte-trans b₁ b₂ b₃ pb pb′) + (fateLte-trans c₁ c₂ c₃ pc pc′) + (fateLte-trans r₁ r₂ r₃ pr pr′) + (bondLte-trans bo₁ bo₂ bo₃ pbo pbo′) + (mergeLte-trans m₁ m₂ m₃ pm pm′) + +-- ⊑ is decided by its own Boolean: gradeLte g h is computed, then compared. +⊑-dec : ∀ g h → Dec (g ⊑ h) +⊑-dec g h = gradeLte g h ≟ᵇ true + +⊑-isPreorder : IsPreorder _≡_ _⊑_ +⊑-isPreorder = record + { isEquivalence = isEquivalence + ; reflexive = λ {g} {h} eq → subst (λ h′ → g ⊑ h′) eq (⊑-refl g) + ; trans = λ {g} {h} {k} → ⊑-trans g h k + } diff --git a/verification/proofs/lean4/ratified-order/RatifiedOrder.lean b/verification/proofs/lean4/ratified-order/RatifiedOrder.lean new file mode 100644 index 0000000..731edd3 --- /dev/null +++ b/verification/proofs/lean4/ratified-order/RatifiedOrder.lean @@ -0,0 +1,567 @@ +/- +SPDX-FileCopyrightText: © 2026 Jonathan D.A. Jewell (hyperpolymath) +SPDX-License-Identifier: MPL-2.0 + +Lean recheck leg, route re-proved, for the ratified-carrier order laws and +L4 (monotonicity) in full. Source of truth: the Agda modules +verification/proofs/agda/theorem-b/TB/{Grade,Order,OrderLaws,Monotone}.agda. + +Only Lean core is used: no `import`, no Mathlib (PROOF-POLICY §2). Unlike the +grade-boundary and grade-factorisation packages, which import Mathlib and stay +BRIDGE-PENDING, this file is meant to count as a recheck leg. + +Every Agda definition used is restated with the same constructors and clauses, +and every theorem with the same hypotheses and conclusion; each is proved +again by hand. No `simp`, `omega`, `decide` or `ac_rfl`: proofs are `cases`, +`rfl`, `rw`, `nomatch` and term application, so that no theorem depends on an axiom +(`#print axioms` at the foot of this file; CI audits every theorem). + +Encoding differences, all of them notation: +- Agda's ℕ, Bool, _∧_ and _≡_ are Nat, Bool, `&&` and `=`. Lean's `&&` is + left-associative and Agda's `_∧_` right-associative, so every conjunction + below is parenthesised right-nested, as in the Agda. +- Agda's `_⊎_` is `Or`: both disjuncts are propositions here. +- Agda's infix operators are named functions: `_⊕d_` is `dplus`, `_▷f_` + `fcomp`, `_▷b_` `bcomp`, `_▷m_` `mcomp`, `_▷_` `gcomp`, `_⊑_` `gle`. + Hyphens become underscores. +- `IsTotalOrder` is unfolded into its four laws (reflexive, transitive, + antisymmetric, total), which is what the standard-library record carries. +-/ + +namespace TropeRatified + +/-! ## The carrier (TB.Grade) -/ + +inductive Delta where + | Q (n : Nat) + | total + | unknown + +open Delta + +def dplus : Delta → Delta → Delta + | unknown, _ => unknown + | total, unknown => unknown + | total, total => total + | total, Q _ => total + | Q _, unknown => unknown + | Q _, total => total + | Q a, Q b => Q (a + b) + +inductive Fate where + | present + | atten (d : Delta) + | predicated + | dropped + | falsified + +open Fate + +def fcomp : Fate → Fate → Fate + | falsified, _ => falsified + | dropped, falsified => falsified + | dropped, present => dropped + | dropped, atten _ => dropped + | dropped, predicated => dropped + | dropped, dropped => dropped + | present, f => f + | atten _, falsified => falsified + | atten _, dropped => dropped + | atten d, present => atten d + | atten d, atten e => atten (dplus d e) + | atten _, predicated => predicated + | predicated, falsified => falsified + | predicated, dropped => dropped + | predicated, present => predicated + | predicated, atten _ => predicated + | predicated, predicated => predicated + +inductive Bond where + | intact + | withheld + | severed + | misbound + +open Bond + +def bcomp : Bond → Bond → Bond + | intact, b => b + | withheld, intact => withheld + | withheld, withheld => withheld + | withheld, severed => severed + | withheld, misbound => misbound + | severed, intact => severed + | severed, withheld => severed + | severed, severed => severed + | severed, misbound => misbound + | misbound, _ => misbound + +inductive Merge where + | single + | fused + | conflated + +open Merge + +def mcomp : Merge → Merge → Merge + | single, m => m + | fused, single => fused + | fused, fused => fused + | fused, conflated => conflated + | conflated, _ => conflated + +structure Grade where + mkGrade :: + fQuality : Fate + fBearer : Fate + fContext : Fate + fRecord : Fate + gBond : Bond + gMerge : Merge + +def gcomp (g h : Grade) : Grade := + ⟨fcomp g.fQuality h.fQuality, fcomp g.fBearer h.fBearer, + fcomp g.fContext h.fContext, fcomp g.fRecord h.fRecord, + bcomp g.gBond h.gBond, mcomp g.gMerge h.gMerge⟩ + +/-! ## The retention order (TB.Order) -/ + +def lteb : Nat → Nat → Bool + | 0, _ => true + | _ + 1, 0 => false + | m + 1, n + 1 => lteb m n + +def dLte : Delta → Delta → Bool + | unknown, _ => true + | Q a, Q b => lteb b a + | Q _, total => false + | Q _, unknown => false + | total, Q _ => true + | total, total => true + | total, unknown => false + +def fateLte : Fate → Fate → Bool + | falsified, _ => true + | present, present => true + | present, atten _ => false + | present, predicated => false + | present, dropped => false + | present, falsified => false + | atten _, present => true + | atten a, atten b => dLte a b + | atten _, predicated => false + | atten _, dropped => false + | atten _, falsified => false + | predicated, present => true + | predicated, atten _ => true + | predicated, predicated => true + | predicated, dropped => false + | predicated, falsified => false + | dropped, present => true + | dropped, atten _ => true + | dropped, predicated => true + | dropped, dropped => true + | dropped, falsified => false + +def bondLte : Bond → Bond → Bool + | intact, intact => true + | intact, withheld => false + | intact, severed => false + | intact, misbound => false + | withheld, intact => true + | withheld, withheld => true + | withheld, severed => false + | withheld, misbound => false + | severed, intact => true + | severed, withheld => true + | severed, severed => true + | severed, misbound => false + | misbound, _ => true + +def mergeLte : Merge → Merge → Bool + | single, single => true + | single, fused => false + | single, conflated => false + | fused, single => true + | fused, fused => true + | fused, conflated => false + | conflated, _ => true + +def gradeLte (g h : Grade) : Bool := + fateLte g.fQuality h.fQuality && (fateLte g.fBearer h.fBearer && + (fateLte g.fContext h.fContext && (fateLte g.fRecord h.fRecord && + (bondLte g.gBond h.gBond && mergeLte g.gMerge h.gMerge)))) + +def gle (g h : Grade) : Prop := gradeLte g h = true + +/-! ## Reflexivity (TB.Order) -/ + +theorem lteb_refl : ∀ n, lteb n n = true + | 0 => rfl + | n + 1 => lteb_refl n + +theorem dLte_refl : ∀ d, dLte d d = true + | Q n => lteb_refl n + | total => rfl + | unknown => rfl + +theorem fateLte_refl : ∀ f, fateLte f f = true + | present => rfl + | atten d => dLte_refl d + | predicated => rfl + | dropped => rfl + | falsified => rfl + +theorem bondLte_refl : ∀ b, bondLte b b = true := by + intro b; cases b <;> rfl + +theorem mergeLte_refl : ∀ m, mergeLte m m = true := by + intro m; cases m <;> rfl + +/-! ## Six-way conjunctions, taken apart and put back -/ + +theorem and6_elim : ∀ a b c d e f : Bool, + (a && (b && (c && (d && (e && f))))) = true → + a = true ∧ b = true ∧ c = true ∧ d = true ∧ e = true ∧ f = true + | true, true, true, true, true, _, p => ⟨rfl, rfl, rfl, rfl, rfl, p⟩ + | true, true, true, true, false, _, p => nomatch p + | true, true, true, false, _, _, p => nomatch p + | true, true, false, _, _, _, p => nomatch p + | true, false, _, _, _, _, p => nomatch p + | false, _, _, _, _, _, p => nomatch p + +theorem and6_intro : ∀ a b c d e f : Bool, + a = true → b = true → c = true → d = true → e = true → f = true → + (a && (b && (c && (d && (e && f))))) = true + | _, _, _, _, _, _, rfl, rfl, rfl, rfl, rfl, rfl => rfl + +theorem gle_refl (g : Grade) : gle g g := + and6_intro _ _ _ _ _ _ (fateLte_refl _) (fateLte_refl _) (fateLte_refl _) + (fateLte_refl _) (bondLte_refl _) (mergeLte_refl _) + +/-! ## A2-directions (TB.Order) -/ + +theorem fateDroppedLtePredicated : fateLte dropped predicated = true := rfl + +theorem fatePredicatedNotLteDropped : fateLte predicated dropped = false := rfl + +/-! ## Order laws (TB.OrderLaws): lteb, dLte and fateLte are chains -/ + +theorem lteb_trans : ∀ a b c, lteb a b = true → lteb b c = true → lteb a c = true + | 0, _, _, _, _ => rfl + | _ + 1, 0, _, p, _ => nomatch p + | _ + 1, _ + 1, 0, _, q => nomatch q + | a + 1, b + 1, c + 1, p, q => lteb_trans a b c p q + +theorem lteb_antisym : ∀ a b, lteb a b = true → lteb b a = true → a = b + | 0, 0, _, _ => rfl + | 0, _ + 1, _, q => nomatch q + | _ + 1, 0, p, _ => nomatch p + | a + 1, b + 1, p, q => congrArg (· + 1) (lteb_antisym a b p q) + +theorem lteb_total : ∀ a b, lteb a b = true ∨ lteb b a = true + | 0, _ => Or.inl rfl + | _ + 1, 0 => Or.inr rfl + | a + 1, b + 1 => lteb_total a b + +theorem dLte_trans : ∀ a b c, dLte a b = true → dLte b c = true → dLte a c = true := by + intro a b c p q + cases a <;> cases b <;> cases c <;> + first | rfl | (cases p; done) | (cases q; done) + | exact lteb_trans _ _ _ q p + +theorem dLte_antisym : ∀ a b, dLte a b = true → dLte b a = true → a = b := by + intro a b p q + cases a <;> cases b <;> + first | rfl | (cases p; done) | (cases q; done) + | exact congrArg Delta.Q (lteb_antisym _ _ q p) + +theorem dLte_total : ∀ a b, dLte a b = true ∨ dLte b a = true := by + intro a b + cases a <;> cases b <;> + first | exact Or.inl rfl | exact Or.inr rfl | exact lteb_total _ _ + +theorem fateLte_trans : ∀ x y z, + fateLte x y = true → fateLte y z = true → fateLte x z = true := by + intro x y z p q + cases x <;> cases y <;> cases z <;> + first | rfl | (cases p; done) | (cases q; done) + | exact dLte_trans _ _ _ p q + +theorem fateLte_antisym : ∀ x y, + fateLte x y = true → fateLte y x = true → x = y := by + intro x y p q + cases x <;> cases y <;> + first | rfl | (cases p; done) | (cases q; done) + | exact congrArg Fate.atten (dLte_antisym _ _ p q) + +theorem fateLte_total : ∀ x y, fateLte x y = true ∨ fateLte y x = true := by + intro x y + cases x <;> cases y <;> + first | exact Or.inl rfl | exact Or.inr rfl | exact dLte_total _ _ + +/-- A2-chain as one statement: the four laws of a total order. -/ +theorem fate_isTotalOrder : + (∀ x, fateLte x x = true) ∧ + (∀ x y z, fateLte x y = true → fateLte y z = true → fateLte x z = true) ∧ + (∀ x y, fateLte x y = true → fateLte y x = true → x = y) ∧ + (∀ x y, fateLte x y = true ∨ fateLte y x = true) := + ⟨fateLte_refl, fateLte_trans, fateLte_antisym, fateLte_total⟩ + +theorem dLte_isTotalOrder : + (∀ a, dLte a a = true) ∧ + (∀ a b c, dLte a b = true → dLte b c = true → dLte a c = true) ∧ + (∀ a b, dLte a b = true → dLte b a = true → a = b) ∧ + (∀ a b, dLte a b = true ∨ dLte b a = true) := + ⟨dLte_refl, dLte_trans, dLte_antisym, dLte_total⟩ + +theorem bondLte_trans : ∀ x y z, + bondLte x y = true → bondLte y z = true → bondLte x z = true := by + intro x y z p q + cases x <;> cases y <;> cases z <;> + first | rfl | (cases p; done) | (cases q; done) + +theorem mergeLte_trans : ∀ x y z, + mergeLte x y = true → mergeLte y z = true → mergeLte x z = true := by + intro x y z p q + cases x <;> cases y <;> cases z <;> + first | rfl | (cases p; done) | (cases q; done) + +/-! ## retention-order (TB.OrderLaws): ⊑ is a decidable preorder -/ + +theorem gle_trans : ∀ g h k, gle g h → gle h k → gle g k := by + intro g h k p q + have ⟨pq, pb, pc, pr, pbo, pm⟩ := and6_elim _ _ _ _ _ _ p + have ⟨qq, qb, qc, qr, qbo, qm⟩ := and6_elim _ _ _ _ _ _ q + exact and6_intro _ _ _ _ _ _ + (fateLte_trans _ _ _ pq qq) (fateLte_trans _ _ _ pb qb) + (fateLte_trans _ _ _ pc qc) (fateLte_trans _ _ _ pr qr) + (bondLte_trans _ _ _ pbo qbo) (mergeLte_trans _ _ _ pm qm) + +/-- ⊑ is decided by its own Boolean (Agda `⊑-dec`). -/ +def gle_dec (g h : Grade) : Decidable (gle g h) := + match hb : gradeLte g h with + | true => isTrue hb + | false => isFalse (fun p => nomatch hb.symm.trans p) + +/-- The decision procedure is sound and complete for ⊑, as a theorem the +axiom audit inspects. -/ +theorem gle_decides (g h : Grade) : gle g h ∨ ¬ gle g h := + match hb : gradeLte g h with + | true => Or.inl hb + | false => Or.inr (fun p => nomatch hb.symm.trans p) + +/-! ## L4-fidelity (TB.Order): dplus is monotone in each argument -/ + +theorem lteb_suc_right : ∀ a b, lteb a b = true → lteb a (b + 1) = true + | 0, _, _ => rfl + | _ + 1, 0, p => nomatch p + | a + 1, b + 1, p => lteb_suc_right a b p + +theorem lteb_self_plus : ∀ m n, lteb m (m + n) = true + | 0, n => by rw [Nat.zero_add]; rfl + | m + 1, n => by rw [Nat.succ_add]; exact lteb_self_plus m n + +theorem lteb_plus_left : ∀ m n, lteb n (m + n) = true + | 0, n => by rw [Nat.zero_add]; exact lteb_refl n + | m + 1, n => by rw [Nat.succ_add]; exact lteb_suc_right n (m + n) (lteb_plus_left m n) + +theorem lteb_plus_monoL : ∀ c a b, lteb a b = true → lteb (c + a) (c + b) = true + | 0, a, b, p => by rw [Nat.zero_add, Nat.zero_add]; exact p + | c + 1, a, b, p => by rw [Nat.succ_add, Nat.succ_add]; exact lteb_plus_monoL c a b p + +theorem lteb_plus_monoR : ∀ a b c, lteb a b = true → lteb (a + c) (b + c) = true + | 0, b, c, _ => by rw [Nat.zero_add]; exact lteb_plus_left b c + | _ + 1, 0, _, p => nomatch p + | a + 1, b + 1, c, p => by + rw [Nat.succ_add, Nat.succ_add]; exact lteb_plus_monoR a b c p + +theorem dplusMonoR : ∀ c a b, dLte a b = true → dLte (dplus c a) (dplus c b) = true := by + intro c a b p + cases c <;> cases a <;> cases b <;> + first | rfl | (cases p; done) | exact lteb_plus_monoL _ _ _ p + +theorem dplusMonoL : ∀ a b c, dLte a b = true → dLte (dplus a c) (dplus b c) = true := by + intro a b c p + cases a <;> cases b <;> cases c <;> + first | rfl | (cases p; done) | exact lteb_plus_monoR _ _ _ p + +theorem dplusRetLteR : ∀ d a, dLte (dplus d a) d = true := by + intro d a + cases d <;> cases a <;> first | rfl | exact lteb_self_plus _ _ + +theorem dplusRetLteL : ∀ a e, dLte (dplus a e) e = true := by + intro a e + cases a <;> cases e <;> first | rfl | exact lteb_plus_left _ _ + +/-! ## L4-fate (TB.Order) -/ + +theorem fateL4MonoR : ∀ h x y, + fateLte x y = true → fateLte (fcomp h x) (fcomp h y) = true := by + intro h x y p + cases h <;> cases x <;> cases y <;> + first | rfl | exact p | (cases p; done) | exact dLte_refl _ + | exact dplusRetLteR _ _ | exact dplusMonoR _ _ _ p + +theorem fateL4MonoL : ∀ x y h, + fateLte x y = true → fateLte (fcomp x h) (fcomp y h) = true := by + intro x y h p + cases x <;> cases y <;> cases h <;> + first | rfl | exact p | (cases p; done) | exact dLte_refl _ + | exact dplusRetLteL _ _ | exact dplusMonoL _ _ _ p + +/-! ## L4-bond-merge (TB.Monotone) -/ + +theorem bondL4MonoR : ∀ h x y, + bondLte x y = true → bondLte (bcomp h x) (bcomp h y) = true := by + intro h x y p + cases h <;> cases x <;> cases y <;> first | rfl | (cases p; done) + +theorem bondL4MonoL : ∀ x y h, + bondLte x y = true → bondLte (bcomp x h) (bcomp y h) = true := by + intro x y h p + cases x <;> cases y <;> cases h <;> first | rfl | (cases p; done) + +theorem mergeL4MonoR : ∀ h x y, + mergeLte x y = true → mergeLte (mcomp h x) (mcomp h y) = true := by + intro h x y p + cases h <;> cases x <;> cases y <;> first | rfl | (cases p; done) + +theorem mergeL4MonoL : ∀ x y h, + mergeLte x y = true → mergeLte (mcomp x h) (mcomp y h) = true := by + intro x y h p + cases x <;> cases y <;> cases h <;> first | rfl | (cases p; done) + +/-! ## L4-lifting (TB.Monotone): gcomp is ⊑-monotone -/ + +theorem gradeL4MonoR : ∀ k g h, gle g h → gle (gcomp k g) (gcomp k h) := by + intro k g h p + have ⟨pq, pb, pc, pr, pbo, pm⟩ := and6_elim _ _ _ _ _ _ p + exact and6_intro _ _ _ _ _ _ + (fateL4MonoR _ _ _ pq) (fateL4MonoR _ _ _ pb) + (fateL4MonoR _ _ _ pc) (fateL4MonoR _ _ _ pr) + (bondL4MonoR _ _ _ pbo) (mergeL4MonoR _ _ _ pm) + +theorem gradeL4MonoL : ∀ g h k, gle g h → gle (gcomp g k) (gcomp h k) := by + intro g h k p + have ⟨pq, pb, pc, pr, pbo, pm⟩ := and6_elim _ _ _ _ _ _ p + exact and6_intro _ _ _ _ _ _ + (fateL4MonoL _ _ _ pq) (fateL4MonoL _ _ _ pb) + (fateL4MonoL _ _ _ pc) (fateL4MonoL _ _ _ pr) + (bondL4MonoL _ _ _ pbo) (mergeL4MonoL _ _ _ pm) + +/-- Both arguments at once (Agda `▷-mono`). -/ +theorem gcomp_mono : ∀ g₁ g₂ h₁ h₂, + gle g₁ g₂ → gle h₁ h₂ → gle (gcomp g₁ h₁) (gcomp g₂ h₂) := + fun g₁ g₂ h₁ h₂ p q => + gle_trans _ _ _ (gradeL4MonoL g₁ g₂ h₁ p) (gradeL4MonoR g₂ h₁ h₂ q) + +/-! ## Definition bridge (TB.Bridge) + +The same six literals as the Agda and the Rocq: if this file's restatement of +any of the six definitions disagrees with the Agda at a sample point, the +matching bridge theorem fails. Bond and Merge are covered exhaustively; Fate +on nine points, top to bottom. Codes as in TB/Bridge.agda. -/ + +def b2n : Bool → Nat + | true => 1 + | false => 0 + +def fcode : Fate → Nat + | present => 0 + | atten (Q n) => 10 + n + | atten total => 1 + | atten unknown => 2 + | predicated => 3 + | dropped => 4 + | falsified => 5 + +def bcode : Bond → Nat + | intact => 0 + | withheld => 1 + | severed => 2 + | misbound => 3 + +def mcode : Merge → Nat + | single => 0 + | fused => 1 + | conflated => 2 + +def sampleF : List Fate := + [present, atten (Q 0), atten (Q 2), atten (Q 5), atten total, + atten unknown, predicated, dropped, falsified] + +def sampleB : List Bond := [intact, withheld, severed, misbound] + +def sampleM : List Merge := [single, fused, conflated] + +def lmap {α β : Type} (f : α → β) : List α → List β + | [] => [] + | x :: t => f x :: lmap f t + +def lappend {α : Type} : List α → List α → List α + | [], ys => ys + | x :: t, ys => x :: lappend t ys + +def lconcatMap {α β : Type} (f : α → List β) : List α → List β + | [] => [] + | x :: t => lappend (f x) (lconcatMap f t) + +def tbl {α : Type} (f : α → α → Nat) (xs : List α) : List Nat := + lconcatMap (fun x => lmap (f x) xs) xs + +def fateLteTable_literal : List Nat := + [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, + 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, + 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1] + +def fcompTable_literal : List Nat := + [0, 10, 12, 15, 1, 2, 3, 4, 5, 10, 10, 12, 15, 1, 2, 3, 4, 5, 12, 12, + 14, 17, 1, 2, 3, 4, 5, 15, 15, 17, 20, 1, 2, 3, 4, 5, 1, 1, 1, 1, 1, + 2, 3, 4, 5, 2, 2, 2, 2, 2, 2, 3, 4, 5, 3, 3, 3, 3, 3, 3, 3, 4, 5, 4, + 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5] + +def bondLteTable_literal : List Nat := + [1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1] + +def bcompTable_literal : List Nat := + [0, 1, 2, 3, 1, 1, 2, 3, 2, 2, 2, 3, 3, 3, 3, 3] + +def mergeLteTable_literal : List Nat := + [1, 0, 0, 1, 1, 0, 1, 1, 1] + +def mcompTable_literal : List Nat := + [0, 1, 2, 1, 1, 2, 2, 2, 2] + +theorem bridge_fateLte : tbl (fun x y => b2n (fateLte x y)) sampleF = fateLteTable_literal := rfl + +theorem bridge_fcomp : tbl (fun x y => fcode (fcomp x y)) sampleF = fcompTable_literal := rfl + +theorem bridge_bondLte : tbl (fun x y => b2n (bondLte x y)) sampleB = bondLteTable_literal := rfl + +theorem bridge_bcomp : tbl (fun x y => bcode (bcomp x y)) sampleB = bcompTable_literal := rfl + +theorem bridge_mergeLte : tbl (fun x y => b2n (mergeLte x y)) sampleM = mergeLteTable_literal := rfl + +theorem bridge_mcomp : tbl (fun x y => mcode (mcomp x y)) sampleM = mcompTable_literal := rfl + +end TropeRatified + +/-! ## Axiom report (the CI audit re-derives this for every theorem) -/ + +#print axioms TropeRatified.fate_isTotalOrder +#print axioms TropeRatified.gle_trans +#print axioms TropeRatified.gle_decides +#print axioms TropeRatified.fateL4MonoR +#print axioms TropeRatified.fateL4MonoL +#print axioms TropeRatified.dplusMonoR +#print axioms TropeRatified.dplusMonoL +#print axioms TropeRatified.bondL4MonoR +#print axioms TropeRatified.bondL4MonoL +#print axioms TropeRatified.mergeL4MonoR +#print axioms TropeRatified.mergeL4MonoL +#print axioms TropeRatified.gradeL4MonoR +#print axioms TropeRatified.gradeL4MonoL +#print axioms TropeRatified.gcomp_mono +#print axioms TropeRatified.bridge_fcomp diff --git a/verification/proofs/lean4/ratified-order/lean-toolchain b/verification/proofs/lean4/ratified-order/lean-toolchain new file mode 100644 index 0000000..2586f88 --- /dev/null +++ b/verification/proofs/lean4/ratified-order/lean-toolchain @@ -0,0 +1 @@ +leanprover/lean4:v4.16.0 diff --git a/verification/proofs/rocq/RatifiedOrder.v b/verification/proofs/rocq/RatifiedOrder.v new file mode 100644 index 0000000..9ba2744 --- /dev/null +++ b/verification/proofs/rocq/RatifiedOrder.v @@ -0,0 +1,592 @@ +(* SPDX-FileCopyrightText: © 2026 Jonathan D.A. Jewell (hyperpolymath) + SPDX-License-Identifier: MPL-2.0 + + Rocq recheck leg, route re-proved, for the ratified-carrier order laws and + L4 (monotonicity) in full. Source of truth: the Agda modules + verification/proofs/agda/theorem-b/TB/{Grade,Order,OrderLaws,Monotone}.agda. + + This file restates every Agda definition it uses with the same + constructors and clauses, and states every theorem with the same + hypotheses and conclusion; then proves each again by hand. It imports + nothing: no standard-library module, no axiom. docs/status/PROOF-STATUS.adoc + records the statement correspondence (PROOF-POLICY 2.2). + + Encoding differences, all of them notation: + - Agda's ℕ is nat; Agda's Bool, true, false, _∧_ are bool, true, false, + andb. Agda's _∧_ is infixr, so every conjunction below is written + right-nested with explicit parentheses. + - Agda's _≡_ is eq; Agda's _⊎_ is sumbool-free `or`, since both disjuncts + are propositions here. + - Agda's infix operators are named functions: _⊕d_ is dplus, _▷f_ fcomp, + _▷b_ bcomp, _▷m_ mcomp, _▷_ gcomp, _⊑_ gle. Hyphens become underscores. + - IsTotalOrder is unfolded into its four laws (refl, trans, antisym, + total), which is what the standard-library record carries. *) + +(* ------------------------------------------------------------------ *) +(* The carrier (TB.Grade). *) +(* ------------------------------------------------------------------ *) + +Inductive Delta : Set := Q (n : nat) | total | unknown. + +Definition dplus (a b : Delta) : Delta := + match a, b with + | unknown, _ => unknown + | total, unknown => unknown + | total, total => total + | total, Q _ => total + | Q _, unknown => unknown + | Q _, total => total + | Q x, Q y => Q (x + y) + end. + +Inductive Fate : Set := present | atten (d : Delta) | predicated | dropped | falsified. + +Definition fcomp (f g : Fate) : Fate := + match f, g with + | falsified, _ => falsified + | dropped, falsified => falsified + | dropped, present => dropped + | dropped, atten _ => dropped + | dropped, predicated => dropped + | dropped, dropped => dropped + | present, h => h + | atten _, falsified => falsified + | atten _, dropped => dropped + | atten d, present => atten d + | atten d, atten e => atten (dplus d e) + | atten _, predicated => predicated + | predicated, falsified => falsified + | predicated, dropped => dropped + | predicated, present => predicated + | predicated, atten _ => predicated + | predicated, predicated => predicated + end. + +Inductive Bond : Set := intact | withheld | severed | misbound. + +Definition bcomp (a b : Bond) : Bond := + match a, b with + | intact, c => c + | withheld, intact => withheld + | withheld, withheld => withheld + | withheld, severed => severed + | withheld, misbound => misbound + | severed, intact => severed + | severed, withheld => severed + | severed, severed => severed + | severed, misbound => misbound + | misbound, _ => misbound + end. + +Inductive Merge : Set := single | fused | conflated. + +Definition mcomp (a b : Merge) : Merge := + match a, b with + | single, m => m + | fused, single => fused + | fused, fused => fused + | fused, conflated => conflated + | conflated, _ => conflated + end. + +Record Grade : Set := mkGrade + { fQuality : Fate; fBearer : Fate; fContext : Fate; fRecord : Fate; + gBond : Bond; gMerge : Merge }. + +Definition gcomp (g h : Grade) : Grade := + mkGrade (fcomp (fQuality g) (fQuality h)) (fcomp (fBearer g) (fBearer h)) + (fcomp (fContext g) (fContext h)) (fcomp (fRecord g) (fRecord h)) + (bcomp (gBond g) (gBond h)) (mcomp (gMerge g) (gMerge h)). + +(* ------------------------------------------------------------------ *) +(* The retention order (TB.Order). *) +(* ------------------------------------------------------------------ *) + +Fixpoint lteb (m n : nat) : bool := + match m, n with + | O, _ => true + | S _, O => false + | S a, S b => lteb a b + end. + +Definition dLte (a b : Delta) : bool := + match a, b with + | unknown, _ => true + | Q x, Q y => lteb y x + | Q _, total => false + | Q _, unknown => false + | total, Q _ => true + | total, total => true + | total, unknown => false + end. + +Definition fateLte (f g : Fate) : bool := + match f, g with + | falsified, _ => true + | present, present => true + | present, atten _ => false + | present, predicated => false + | present, dropped => false + | present, falsified => false + | atten _, present => true + | atten a, atten b => dLte a b + | atten _, predicated => false + | atten _, dropped => false + | atten _, falsified => false + | predicated, present => true + | predicated, atten _ => true + | predicated, predicated => true + | predicated, dropped => false + | predicated, falsified => false + | dropped, present => true + | dropped, atten _ => true + | dropped, predicated => true + | dropped, dropped => true + | dropped, falsified => false + end. + +Definition bondLte (a b : Bond) : bool := + match a, b with + | intact, intact => true + | intact, withheld => false + | intact, severed => false + | intact, misbound => false + | withheld, intact => true + | withheld, withheld => true + | withheld, severed => false + | withheld, misbound => false + | severed, intact => true + | severed, withheld => true + | severed, severed => true + | severed, misbound => false + | misbound, _ => true + end. + +Definition mergeLte (a b : Merge) : bool := + match a, b with + | single, single => true + | single, fused => false + | single, conflated => false + | fused, single => true + | fused, fused => true + | fused, conflated => false + | conflated, _ => true + end. + +Definition gradeLte (g h : Grade) : bool := + andb (fateLte (fQuality g) (fQuality h)) + (andb (fateLte (fBearer g) (fBearer h)) + (andb (fateLte (fContext g) (fContext h)) + (andb (fateLte (fRecord g) (fRecord h)) + (andb (bondLte (gBond g) (gBond h)) + (mergeLte (gMerge g) (gMerge h)))))). + +Definition gle (g h : Grade) : Prop := gradeLte g h = true. + +(* ------------------------------------------------------------------ *) +(* Reflexivity (TB.Order). *) +(* ------------------------------------------------------------------ *) + +Lemma lteb_refl : forall n, lteb n n = true. +Proof. induction n as [|n IH]; simpl; [reflexivity | exact IH]. Qed. + +Lemma dLte_refl : forall d, dLte d d = true. +Proof. intros [n| |]; simpl; [apply lteb_refl | reflexivity | reflexivity]. Qed. + +Lemma fateLte_refl : forall f, fateLte f f = true. +Proof. intros [|d| | |]; simpl; try reflexivity; apply dLte_refl. Qed. + +Lemma bondLte_refl : forall b, bondLte b b = true. +Proof. intros []; reflexivity. Qed. + +Lemma mergeLte_refl : forall m, mergeLte m m = true. +Proof. intros []; reflexivity. Qed. + +Lemma gle_refl : forall g, gle g g. +Proof. + intros [q b c r bo m]; unfold gle, gradeLte; simpl. + rewrite fateLte_refl, fateLte_refl, fateLte_refl, fateLte_refl, + bondLte_refl, mergeLte_refl; reflexivity. +Qed. + +(* ------------------------------------------------------------------ *) +(* A2-directions (TB.Order). *) +(* ------------------------------------------------------------------ *) + +Theorem fateDroppedLtePredicated : fateLte dropped predicated = true. +Proof. reflexivity. Qed. + +Theorem fatePredicatedNotLteDropped : fateLte predicated dropped = false. +Proof. reflexivity. Qed. + +(* ------------------------------------------------------------------ *) +(* Order laws (TB.OrderLaws): lteb, dLte and fateLte are chains. *) +(* ------------------------------------------------------------------ *) + +Lemma lteb_trans : forall a b c, lteb a b = true -> lteb b c = true -> lteb a c = true. +Proof. + induction a as [|a IH]; intros [|b] [|c] p q; simpl in *; + try reflexivity; try discriminate. + exact (IH b c p q). +Qed. + +Lemma lteb_antisym : forall a b, lteb a b = true -> lteb b a = true -> a = b. +Proof. + induction a as [|a IH]; intros [|b] p q; simpl in *; + try reflexivity; try discriminate. + rewrite (IH b p q); reflexivity. +Qed. + +Lemma lteb_total : forall a b, lteb a b = true \/ lteb b a = true. +Proof. + induction a as [|a IH]; intros [|b]; simpl; + try (left; reflexivity); try (right; reflexivity). + exact (IH b). +Qed. + +Lemma dLte_trans : forall a b c, dLte a b = true -> dLte b c = true -> dLte a c = true. +Proof. + intros [x| |] [y| |] [z| |] p q; simpl in *; + try reflexivity; try discriminate. + exact (lteb_trans z y x q p). +Qed. + +Lemma dLte_antisym : forall a b, dLte a b = true -> dLte b a = true -> a = b. +Proof. + intros [x| |] [y| |] p q; simpl in *; + try reflexivity; try discriminate. + rewrite (lteb_antisym x y q p); reflexivity. +Qed. + +Lemma dLte_total : forall a b, dLte a b = true \/ dLte b a = true. +Proof. + intros [x| |] [y| |]; simpl; + try (left; reflexivity); try (right; reflexivity). + exact (lteb_total y x). +Qed. + +Theorem fateLte_trans : forall x y z, + fateLte x y = true -> fateLte y z = true -> fateLte x z = true. +Proof. + intros [|a| | |] [|b| | |] [|c| | |] p q; simpl in *; + try reflexivity; try discriminate. + exact (dLte_trans a b c p q). +Qed. + +Theorem fateLte_antisym : forall x y, + fateLte x y = true -> fateLte y x = true -> x = y. +Proof. + intros [|a| | |] [|b| | |] p q; simpl in *; + try reflexivity; try discriminate. + rewrite (dLte_antisym a b p q); reflexivity. +Qed. + +Theorem fateLte_total : forall x y, fateLte x y = true \/ fateLte y x = true. +Proof. + intros [|a| | |] [|b| | |]; simpl; + try (left; reflexivity); try (right; reflexivity). + exact (dLte_total a b). +Qed. + +(* A2-chain as one statement: the four laws of a total order. *) +Theorem fate_isTotalOrder : + (forall x, fateLte x x = true) /\ + (forall x y z, fateLte x y = true -> fateLte y z = true -> fateLte x z = true) /\ + (forall x y, fateLte x y = true -> fateLte y x = true -> x = y) /\ + (forall x y, fateLte x y = true \/ fateLte y x = true). +Proof. + exact (conj fateLte_refl (conj fateLte_trans (conj fateLte_antisym fateLte_total))). +Qed. + +Theorem dLte_isTotalOrder : + (forall a, dLte a a = true) /\ + (forall a b c, dLte a b = true -> dLte b c = true -> dLte a c = true) /\ + (forall a b, dLte a b = true -> dLte b a = true -> a = b) /\ + (forall a b, dLte a b = true \/ dLte b a = true). +Proof. + exact (conj dLte_refl (conj dLte_trans (conj dLte_antisym dLte_total))). +Qed. + +Lemma bondLte_trans : forall x y z, + bondLte x y = true -> bondLte y z = true -> bondLte x z = true. +Proof. intros [] [] [] p q; simpl in *; try reflexivity; try discriminate. Qed. + +Lemma mergeLte_trans : forall x y z, + mergeLte x y = true -> mergeLte y z = true -> mergeLte x z = true. +Proof. intros [] [] [] p q; simpl in *; try reflexivity; try discriminate. Qed. + +(* ------------------------------------------------------------------ *) +(* retention-order (TB.OrderLaws): ⊑ is a decidable preorder. *) +(* ------------------------------------------------------------------ *) + +Lemma andb_true6 : forall a b c d e f, + andb a (andb b (andb c (andb d (andb e f)))) = true -> + a = true /\ b = true /\ c = true /\ d = true /\ e = true /\ f = true. +Proof. + intros [] [] [] [] [] [] p; simpl in p; try discriminate; + repeat split; reflexivity. +Qed. + +Lemma andb_intro6 : forall a b c d e f, + a = true -> b = true -> c = true -> d = true -> e = true -> f = true -> + andb a (andb b (andb c (andb d (andb e f)))) = true. +Proof. + intros a b c d e f pa pb pc pd pe pf. + rewrite pa, pb, pc, pd, pe, pf; reflexivity. +Qed. + +Theorem gle_trans : forall g h k, gle g h -> gle h k -> gle g k. +Proof. + intros [q1 b1 c1 r1 bo1 m1] [q2 b2 c2 r2 bo2 m2] [q3 b3 c3 r3 bo3 m3] p p'; + unfold gle, gradeLte in *; simpl in *. + destruct (andb_true6 _ _ _ _ _ _ p) as [pq [pb [pc [pr [pbo pm]]]]]. + destruct (andb_true6 _ _ _ _ _ _ p') as [pq' [pb' [pc' [pr' [pbo' pm']]]]]. + apply andb_intro6. + - exact (fateLte_trans _ _ _ pq pq'). + - exact (fateLte_trans _ _ _ pb pb'). + - exact (fateLte_trans _ _ _ pc pc'). + - exact (fateLte_trans _ _ _ pr pr'). + - exact (bondLte_trans _ _ _ pbo pbo'). + - exact (mergeLte_trans _ _ _ pm pm'). +Qed. + +Theorem gle_dec : forall g h, {gle g h} + {~ gle g h}. +Proof. + intros g h; unfold gle; destruct (gradeLte g h). + - left; reflexivity. + - right; discriminate. +Defined. + +(* ------------------------------------------------------------------ *) +(* L4-fidelity (TB.Order): dplus is monotone in each argument. *) +(* ------------------------------------------------------------------ *) + +Lemma lteb_suc_right : forall a b, lteb a b = true -> lteb a (S b) = true. +Proof. + induction a as [|a IH]; intros [|b] p; simpl in *; + try reflexivity; try discriminate. + exact (IH b p). +Qed. + +Lemma lteb_self_plus : forall m n, lteb m (m + n) = true. +Proof. induction m as [|m IH]; intros n; simpl; [reflexivity | apply IH]. Qed. + +Lemma lteb_plus_left : forall m n, lteb n (m + n) = true. +Proof. + induction m as [|m IH]; intros n; simpl. + - apply lteb_refl. + - apply lteb_suc_right, IH. +Qed. + +Lemma lteb_plus_monoL : forall c a b, lteb a b = true -> lteb (c + a) (c + b) = true. +Proof. induction c as [|c IH]; intros a b p; simpl; [exact p | exact (IH a b p)]. Qed. + +Lemma lteb_plus_monoR : forall a b c, lteb a b = true -> lteb (a + c) (b + c) = true. +Proof. + induction a as [|a IH]; intros [|b] c p; simpl in *; try discriminate. + - apply lteb_refl. + - exact (lteb_plus_left (S b) c). + - exact (IH b c p). +Qed. + +Theorem dplusMonoR : forall c a b, dLte a b = true -> dLte (dplus c a) (dplus c b) = true. +Proof. + intros [m| |] [x| |] [y| |] p; simpl in *; try reflexivity; try discriminate. + exact (lteb_plus_monoL m y x p). +Qed. + +Theorem dplusMonoL : forall a b c, dLte a b = true -> dLte (dplus a c) (dplus b c) = true. +Proof. + intros [x| |] [y| |] [n| |] p; simpl in *; try reflexivity; try discriminate. + exact (lteb_plus_monoR y x n p). +Qed. + +Lemma dplusRetLteR : forall d a, dLte (dplus d a) d = true. +Proof. + intros [m| |] [n| |]; simpl; try reflexivity. + apply lteb_self_plus. +Qed. + +Lemma dplusRetLteL : forall a e, dLte (dplus a e) e = true. +Proof. + intros [m| |] [n| |]; simpl; try reflexivity. + apply lteb_plus_left. +Qed. + +(* ------------------------------------------------------------------ *) +(* L4-fate (TB.Order). *) +(* ------------------------------------------------------------------ *) + +Theorem fateL4MonoR : forall h x y, + fateLte x y = true -> fateLte (fcomp h x) (fcomp h y) = true. +Proof. + intros [|d| | |] [|a| | |] [|b| | |] p; simpl in *; + first [ reflexivity | discriminate | exact p | apply dLte_refl + | apply dplusRetLteR | exact (dplusMonoR d a b p) ]. +Qed. + +Theorem fateL4MonoL : forall x y h, + fateLte x y = true -> fateLte (fcomp x h) (fcomp y h) = true. +Proof. + intros [|a| | |] [|b| | |] [|e| | |] p; simpl in *; + first [ reflexivity | discriminate | exact p | apply dLte_refl + | apply dplusRetLteL | exact (dplusMonoL a b e p) ]. +Qed. + +(* ------------------------------------------------------------------ *) +(* L4-bond-merge (TB.Monotone). *) +(* ------------------------------------------------------------------ *) + +Theorem bondL4MonoR : forall h x y, + bondLte x y = true -> bondLte (bcomp h x) (bcomp h y) = true. +Proof. intros [] [] [] p; simpl in *; try reflexivity; try discriminate. Qed. + +Theorem bondL4MonoL : forall x y h, + bondLte x y = true -> bondLte (bcomp x h) (bcomp y h) = true. +Proof. intros [] [] [] p; simpl in *; try reflexivity; try discriminate. Qed. + +Theorem mergeL4MonoR : forall h x y, + mergeLte x y = true -> mergeLte (mcomp h x) (mcomp h y) = true. +Proof. intros [] [] [] p; simpl in *; try reflexivity; try discriminate. Qed. + +Theorem mergeL4MonoL : forall x y h, + mergeLte x y = true -> mergeLte (mcomp x h) (mcomp y h) = true. +Proof. intros [] [] [] p; simpl in *; try reflexivity; try discriminate. Qed. + +(* ------------------------------------------------------------------ *) +(* L4-lifting (TB.Monotone): gcomp is ⊑-monotone. *) +(* ------------------------------------------------------------------ *) + +Theorem gradeL4MonoR : forall k g h, gle g h -> gle (gcomp k g) (gcomp k h). +Proof. + intros [q b c r bo m] [q1 b1 c1 r1 bo1 m1] [q2 b2 c2 r2 bo2 m2] p; + unfold gle, gradeLte, gcomp in *; simpl in *. + destruct (andb_true6 _ _ _ _ _ _ p) as [pq [pb [pc [pr [pbo pm]]]]]. + apply andb_intro6. + - exact (fateL4MonoR q _ _ pq). + - exact (fateL4MonoR b _ _ pb). + - exact (fateL4MonoR c _ _ pc). + - exact (fateL4MonoR r _ _ pr). + - exact (bondL4MonoR bo _ _ pbo). + - exact (mergeL4MonoR m _ _ pm). +Qed. + +Theorem gradeL4MonoL : forall g h k, gle g h -> gle (gcomp g k) (gcomp h k). +Proof. + intros [q1 b1 c1 r1 bo1 m1] [q2 b2 c2 r2 bo2 m2] [q b c r bo m] p; + unfold gle, gradeLte, gcomp in *; simpl in *. + destruct (andb_true6 _ _ _ _ _ _ p) as [pq [pb [pc [pr [pbo pm]]]]]. + apply andb_intro6. + - exact (fateL4MonoL _ _ q pq). + - exact (fateL4MonoL _ _ b pb). + - exact (fateL4MonoL _ _ c pc). + - exact (fateL4MonoL _ _ r pr). + - exact (bondL4MonoL _ _ bo pbo). + - exact (mergeL4MonoL _ _ m pm). +Qed. + +Theorem gcomp_mono : forall g1 g2 h1 h2, + gle g1 g2 -> gle h1 h2 -> gle (gcomp g1 h1) (gcomp g2 h2). +Proof. + intros g1 g2 h1 h2 p q. + exact (gle_trans _ _ _ (gradeL4MonoL g1 g2 h1 p) (gradeL4MonoR g2 h1 h2 q)). +Qed. + +(* ------------------------------------------------------------------ *) +(* Definition bridge (TB.Bridge). The same six literals as the Agda *) +(* and the Lean: if this file's restatement of any of the six *) +(* definitions disagrees with the Agda at a sample point, the matching *) +(* bridge theorem fails. Bond and Merge are covered exhaustively; Fate *) +(* on nine points, top to bottom. Codes as in TB/Bridge.agda. *) +(* ------------------------------------------------------------------ *) + +Local Open Scope list_scope. + +Definition b2n (b : bool) : nat := match b with true => 1 | false => 0 end. + +Definition fcode (f : Fate) : nat := + match f with + | present => 0 + | atten (Q n) => 10 + n + | atten total => 1 + | atten unknown => 2 + | predicated => 3 + | dropped => 4 + | falsified => 5 + end. + +Definition bcode (b : Bond) : nat := + match b with intact => 0 | withheld => 1 | severed => 2 | misbound => 3 end. + +Definition mcode (m : Merge) : nat := + match m with single => 0 | fused => 1 | conflated => 2 end. + +Definition sampleF : list Fate := + present :: atten (Q 0) :: atten (Q 2) :: atten (Q 5) :: atten total + :: atten unknown :: predicated :: dropped :: falsified :: nil. + +Definition sampleB : list Bond := intact :: withheld :: severed :: misbound :: nil. + +Definition sampleM : list Merge := single :: fused :: conflated :: nil. + +Fixpoint lmap {A B : Type} (f : A -> B) (xs : list A) : list B := + match xs with nil => nil | x :: t => f x :: lmap f t end. + +Fixpoint lappend {A : Type} (xs ys : list A) : list A := + match xs with nil => ys | x :: t => x :: lappend t ys end. + +Fixpoint lconcatMap {A B : Type} (f : A -> list B) (xs : list A) : list B := + match xs with nil => nil | x :: t => lappend (f x) (lconcatMap f t) end. + +Definition tbl {A : Type} (f : A -> A -> nat) (xs : list A) : list nat := + lconcatMap (fun x => lmap (f x) xs) xs. + +Definition fateLteTable_literal : list nat := + 1 :: 0 :: 0 :: 0 :: 0 :: 0 :: 0 :: 0 :: 0 :: 1 :: 1 :: 0 :: 0 :: + 0 :: 0 :: 0 :: 0 :: 0 :: 1 :: 1 :: 1 :: 0 :: 0 :: 0 :: 0 :: 0 :: + 0 :: 1 :: 1 :: 1 :: 1 :: 0 :: 0 :: 0 :: 0 :: 0 :: 1 :: 1 :: 1 :: + 1 :: 1 :: 0 :: 0 :: 0 :: 0 :: 1 :: 1 :: 1 :: 1 :: 1 :: 1 :: 0 :: + 0 :: 0 :: 1 :: 1 :: 1 :: 1 :: 1 :: 1 :: 1 :: 0 :: 0 :: 1 :: 1 :: + 1 :: 1 :: 1 :: 1 :: 1 :: 1 :: 0 :: 1 :: 1 :: 1 :: 1 :: 1 :: 1 :: + 1 :: 1 :: 1 :: nil. + +Definition fcompTable_literal : list nat := + 0 :: 10 :: 12 :: 15 :: 1 :: 2 :: 3 :: 4 :: 5 :: 10 :: 10 :: 12 :: + 15 :: 1 :: 2 :: 3 :: 4 :: 5 :: 12 :: 12 :: 14 :: 17 :: 1 :: 2 :: + 3 :: 4 :: 5 :: 15 :: 15 :: 17 :: 20 :: 1 :: 2 :: 3 :: 4 :: 5 :: + 1 :: 1 :: 1 :: 1 :: 1 :: 2 :: 3 :: 4 :: 5 :: 2 :: 2 :: 2 :: 2 :: + 2 :: 2 :: 3 :: 4 :: 5 :: 3 :: 3 :: 3 :: 3 :: 3 :: 3 :: 3 :: 4 :: + 5 :: 4 :: 4 :: 4 :: 4 :: 4 :: 4 :: 4 :: 4 :: 5 :: 5 :: 5 :: 5 :: + 5 :: 5 :: 5 :: 5 :: 5 :: 5 :: nil. + +Definition bondLteTable_literal : list nat := + 1 :: 0 :: 0 :: 0 :: 1 :: 1 :: 0 :: 0 :: 1 :: 1 :: 1 :: 0 :: 1 :: + 1 :: 1 :: 1 :: nil. + +Definition bcompTable_literal : list nat := + 0 :: 1 :: 2 :: 3 :: 1 :: 1 :: 2 :: 3 :: 2 :: 2 :: 2 :: 3 :: 3 :: + 3 :: 3 :: 3 :: nil. + +Definition mergeLteTable_literal : list nat := + 1 :: 0 :: 0 :: 1 :: 1 :: 0 :: 1 :: 1 :: 1 :: nil. + +Definition mcompTable_literal : list nat := + 0 :: 1 :: 2 :: 1 :: 1 :: 2 :: 2 :: 2 :: 2 :: nil. + +Theorem bridge_fateLte : tbl (fun x y => b2n (fateLte x y)) sampleF = fateLteTable_literal. +Proof. reflexivity. Qed. + +Theorem bridge_fcomp : tbl (fun x y => fcode (fcomp x y)) sampleF = fcompTable_literal. +Proof. reflexivity. Qed. + +Theorem bridge_bondLte : tbl (fun x y => b2n (bondLte x y)) sampleB = bondLteTable_literal. +Proof. reflexivity. Qed. + +Theorem bridge_bcomp : tbl (fun x y => bcode (bcomp x y)) sampleB = bcompTable_literal. +Proof. reflexivity. Qed. + +Theorem bridge_mergeLte : tbl (fun x y => b2n (mergeLte x y)) sampleM = mergeLteTable_literal. +Proof. reflexivity. Qed. + +Theorem bridge_mcomp : tbl (fun x y => mcode (mcomp x y)) sampleM = mcompTable_literal. +Proof. reflexivity. Qed. diff --git a/verification/pwg.json b/verification/pwg.json index 96ced48..03f5b46 100644 --- a/verification/pwg.json +++ b/verification/pwg.json @@ -1 +1 @@ -{"commit":"c0eb4f1a1a50aabfab23b94fd74b53cef267f653","note":"Evidence ledger. The pwg field of each theorem is DERIVED from the legs and receipts below by scripts/pwg-derive.sh, never written by hand; scripts/pwg-check.sh re-derives and fails on drift (PROOF-POLICY 8.4 rule 2). Idris2 appears as a reference, not a leg: 8.1 excludes engineering provers from the ladder.","policy":{"commit":"9bdf864cc7f2c8e24b4df84bf00d04158eee3ad5","path":"3-practice/PROOF-POLICY.adoc","repo":"metadatastician/standards","section":"8"},"receipts":{"agda-c0eb4f1":{"axioms":[],"checker":"agda","checker_version":"2.7.0.1","commit":"c0eb4f1a1a50aabfab23b94fd74b53cef267f653","evidence":"https://github.com/hyperpolymath/trope-checker/actions/runs/42623339243","import_cone":"root modules All.agda and Smoke.agda; all seven TB.* modules reachable from All.agda; postulate count 0 (--safe refuses postulate; independently scanned with hyperpolymath/mathesis scripts/census/proof-holes.sh over verification/proofs/agda at this commit, which emitted no record of any class)","inputs_digest":"git-tree verification/proofs/agda = 8d3370e7da58023b9bfa0802e710860105ace73a","invocation":"agda --safe --without-K --cubical-compatible All.agda ; agda --safe --without-K --cubical-compatible Smoke.agda","observed":"PASS: All.agda + Smoke.agda typecheck (--safe --without-K --cubical-compatible; --safe => postulate-free by construction)","repo":"hyperpolymath/trope-checker","result":"pass","state":"current","stdlib_pin":"agda-stdlib v2.0 sha256:14eecb83d62495f701e1eb03ffba59a2f767491f728a8ab8c8bb9243331399d8"},"lean-boundary-c0eb4f1":{"axioms":["propext","Quot.sound","Classical.choice"],"checker":"lean","checker_version":"4.16.0 (lake, leanchecker)","commit":"c0eb4f1a1a50aabfab23b94fd74b53cef267f653","evidence":"https://github.com/hyperpolymath/trope-checker/actions/runs/42623339243","import_cone":"every module of grade-boundary sits in the import Mathlib cone via GradeBoundary.lean:3","inputs_digest":"git-tree verification/proofs/lean4 = 5f32026d26810845d94d42b5a1281da3c2a06146","invocation":"lake build --wfail ; leanchecker ; axiom audit against the allowlist {propext, Classical.choice, Quot.sound}","observed":"job 'Lean grade-boundary: lake build + sorry-free environment' success; 'Trope.GradeR.atom_factorization' depends on axioms: [propext]; 'Trope.nine_families' depends on axioms: [propext, Classical.choice, Quot.sound]","repo":"hyperpolymath/trope-checker","result":"pass","state":"current","stdlib_pin":"mathlib4 rev v4.16.0 (lakefile.toml) -- see the Mathlib note: PROOF-POLICY 2 forbids this dependency for a recheck leg"},"lean-factorisation-c0eb4f1":{"axioms":["propext","Quot.sound","Classical.choice"],"checker":"lean","checker_version":"4.16.0 (lake, leanchecker)","commit":"c0eb4f1a1a50aabfab23b94fd74b53cef267f653","evidence":"https://github.com/hyperpolymath/trope-checker/actions/runs/42623339243","import_cone":"grade-factorisation requires gradeBoundary, so the import Mathlib cone covers it","inputs_digest":"git-tree verification/proofs/lean4 = 5f32026d26810845d94d42b5a1281da3c2a06146","invocation":"lake build --wfail ; leanchecker ; axiom audit against the allowlist {propext, Classical.choice, Quot.sound}","observed":"job 'Lean grade-factorisation: lake build + sorry-free environment' success","repo":"hyperpolymath/trope-checker","result":"pass","state":"current","stdlib_pin":"mathlib4 rev v4.16.0, transitively via the gradeBoundary path dependency"}},"repo":"hyperpolymath/trope-checker","schema_version":"1.0.0","theorems":[{"foundation_diverse_witness":null,"id":"L1","kind":"theory","legs":{"agda":{"declarations":["TB.Grade.gmonoid-assoc"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["FateA.comp_assoc"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"","reference":{"idris2":{"declarations":["Trope.Laws.gradeAssoc","Trope.Coords.fateAssoc","Trope.Coords.bondAssoc","Trope.Coords.mergeAssoc","Trope.Fidelity.dplusAssoc"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"L1 (associativity)"},{"foundation_diverse_witness":null,"id":"L2","kind":"theory","legs":{"agda":{"declarations":["TB.Grade.gmonoid-unitL","TB.Grade.gmonoid-unitR"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"","reference":{"idris2":{"declarations":["Trope.Grade.gradeUnitL","Trope.Grade.gradeUnitR","Trope.Coords.fateUnitL","Trope.Fidelity.dplusZeroR"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"L2 (unit)"},{"foundation_diverse_witness":null,"id":"L3","kind":"theory","legs":{"agda":{"declarations":["TB.Grade.falsified-absorbL","TB.Grade.falsified-absorbR","TB.Grade.misbound-absorbL","TB.Grade.conflated-absorbL","TB.Grade.unknown-absorbL","TB.Grade.total-absorb-Q","TB.Tier.deceptive-absorbs-▷"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["FateA.falsified_two_sided_zero","GradeR.gBotR_two_sided_zero"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Agda states both sides only for Falsified. For Misbound, Conflated and Unknown the left form is stated; the right follows in one step from the coordinate's commutativity but is not itself a lemma.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"L3 (bottom absorption)"},{"foundation_diverse_witness":null,"id":"L4-fate","kind":"theory","legs":{"agda":{"declarations":["TB.Order.fateL4MonoR","TB.Order.fateL4MonoL"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["FateA.comp_mono_right","FateA.comp_mono_left"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"One of four parts of L4 (owner ruling 2026-11-16: split rather than grade the whole on partial coverage). The others are L4-fidelity, L4-bond-merge and L4-lifting; L4 in full is their conjunction and holds only when all four do.","reference":{"idris2":{"declarations":["Trope.Soundness.fateL4MonoR","Trope.Soundness.fateL4MonoL"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"L4 (monotonicity): fate coordinate"},{"foundation_diverse_witness":null,"id":"L4-fidelity","kind":"theory","legs":{"agda":{"declarations":["TB.Order.dplusMonoR","TB.Order.dplusMonoL"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"One of four parts of L4. The Lean tree carries no fidelity order on the ratified carrier, so there is no Lean leg.","reference":{},"title":"L4 (monotonicity): fidelity dimension"},{"foundation_diverse_witness":null,"id":"L4-bond-merge","kind":"theory","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"One of four parts of L4. Idris2 restatement only, which 8.1 excludes from the ladder; no gradeable theory leg.","reference":{"idris2":{"declarations":["Trope.Order.bondComposeMono","Trope.Order.mergeComposeMono"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"L4 (monotonicity): bond and merge coordinates"},{"foundation_diverse_witness":null,"id":"L4-lifting","kind":"theory","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"One of four parts of L4: the lifting from coordinate-level monotonicity to gradeCompose that spec section 7 (Knaster-Tarski) invokes. Mechanised in no prover, Idris2 included.","reference":{},"title":"L4 (monotonicity): grade-level lifting for gradeCompose"},{"foundation_diverse_witness":null,"id":"L5","kind":"theory","legs":{"agda":{"declarations":["TB.Tier.deceptive-absorbs-▷","TB.Reduction.attenuate-stays-deceptive","TB.Reduction.project-stays-deceptive"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"L5 (deception infectiousness)"},{"foundation_diverse_witness":null,"id":"L6","kind":"theory","legs":{"agda":{"declarations":["TB.Grade.grade-comm"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["GradeR.instCommMonoid","FateA.comp_comm"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"L6 ratification is still subject to the open owner ruling tracked on trope-checker issue 106.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"L6 (commutativity)"},{"foundation_diverse_witness":null,"id":"retention-order","kind":"theory","legs":{"agda":{"declarations":["TB.Order.⊑-refl"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Agda proves reflexivity only. Transitivity and decidability exist in the Idris2 reference, which 8.1 excludes from the ladder, so the preorder claim has no complete theory leg. The Agda leg is OPEN, not PROVEN, for this obligation.","reference":{"idris2":{"declarations":["Trope.Laws.decGradeLte","Trope.Soundness.gradeLteTrans","Trope.Coords.fateLteRefl","Trope.Coords.bondLteRefl","Trope.Coords.mergeLteRefl","Trope.Fidelity.dLteRefl"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"Retention order is a decidable preorder"},{"foundation_diverse_witness":null,"id":"A2-directions","kind":"theory","legs":{"agda":{"declarations":["TB.Order.fateDroppedLtePredicated","TB.Order.fatePredicatedNotLteDropped"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"One of two parts of A2 (owner ruling 2026-11-16: split). The two directional facts only; that Fate is a chain is A2-chain.","reference":{"idris2":{"declarations":["Trope.Soundness.fateDroppedLtePredicated","Trope.Soundness.fatePredicatedNotLteDropped"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"A2 directional facts: Dropped below Predicated, not conversely"},{"foundation_diverse_witness":null,"id":"A2-chain","kind":"theory","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":["FateA.le_total","FateA.le_refl"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"A chain is a total order: reflexive, transitive, antisymmetric and total. Lean states totality and reflexivity (FateA.le_total, FateA.le_refl); Idris2 proves transitivity (Trope.Order.fateLteTrans), which PROOF-POLICY 8.1 keeps off the ladder; antisymmetry has no cited proof in any prover. No ladder leg states the whole claim, so every leg is OPEN. The directional facts are A2-directions.","reference":{"idris2":{"declarations":["Trope.Order.fateLteTrans"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Fate is a chain (A2)"},{"foundation_diverse_witness":null,"id":"veridicality-derivation","kind":"theory","legs":{"agda":{"declarations":["TB.Honest.fateDeceptiveUnique","TB.Honest.bondDeceptiveUnique","TB.Honest.mergeDeceptiveUnique"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"The 'exactly three' half rests on the three uniqueness lemmas plus the construction of Grade; Trope.Veridicality.deceptiveDuals is a tuple value and states no proposition, so it is not cited as evidence here.","reference":{"idris2":{"declarations":["Trope.Veridicality.fateDeceptiveUnique","Trope.Veridicality.bondDeceptiveUnique","Trope.Veridicality.mergeDeceptiveUnique"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"Veridicality Derivation"},{"foundation_diverse_witness":null,"id":"honest-generation","kind":"theory","legs":{"agda":{"declarations":["TB.Honest.genFate","TB.Honest.genBond","TB.Honest.genMerge","TB.Honest.honest-closed-▷"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"","reference":{"idris2":{"declarations":["Trope.Generation.genFate","Trope.Generation.genBond","Trope.Generation.genMerge"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"Honest Generation"},{"foundation_diverse_witness":null,"id":"hc4-coherence","kind":"theory","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Idris2 only. No Agda source, so ungraded under 8.1 however sound the Idris2 proof is.","reference":{"idris2":{"declarations":["Trope.Veridicality.epsilonHonest","Trope.Grade.epsilonCoherent"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"The unit is non-deceptive and HC-4-coherent"},{"foundation_diverse_witness":null,"id":"C1","kind":"theory","legs":{"agda":{"declarations":["TB.Grade.grade-conical"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["GradeR.conical","FateA.conical"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"C1 (conicality)"},{"foundation_diverse_witness":null,"id":"C2","kind":"theory","legs":{"agda":{"declarations":["TB.Tier.Q-cancelʳ","TB.Tier.core-closed-▷"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["GradeR.gradeR_leftCancel_iff","GradeR.gradeR_not_leftCancel","GradeR.gDroppedR_not_cancel","FateA.atten_cancel_on_normalForms"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"The normal-form half is proved on the fate coordinate only (FateA.atten_cancel_on_normalForms); there is no grade-level normal-form cancellation theorem. Amendment (A3) is not modelled in the Agda, whose carrier is the unnormalised one.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"C2 (the cancellation boundary)"},{"foundation_diverse_witness":null,"id":"tier2-membership","kind":"theory","legs":{"agda":{"declarations":["TB.Tier.unknown-not-cancel","TB.Tier.total-honest-not-cancel","TB.Tier.falsified-not-cancel","TB.Tier.dropped-honest-not-cancel","TB.Tier.predicated-honest-not-cancel","TB.Tier.severed-honest-not-cancel","TB.Tier.Q-cancelʳ"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":["Bond.withheld_honest_not_cancel","Merge.fused_honest_not_cancel","Fate.atten_not_cancel","Grade.grade_leftCancel_iff","GradeR.gradeR_leftCancel_iff","FateA.leftCancelWitness"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Agda states six of the non-cancellativity witnesses (fate and bond) plus the positive right-cancellation Q-cancelʳ, so the Agda leg is NOT unavailable. It is OPEN because the exhaustive characterisation is not stated in Agda: there is no Agda counterpart of grade_leftCancel_iff, and no Agda witness on the merge coordinate. Lean carries the exhaustive iff. Grade.grade_leftCancel_iff is over the historical pre-ratification carrier; the ratified restatement is GradeR.gradeR_leftCancel_iff. Ungraded because the Agda token is OPEN (§8.1), not for want of an Agda source.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Tier-2 membership, exhaustive"},{"foundation_diverse_witness":null,"id":"C3","kind":"theory","legs":{"agda":{"declarations":["TB.Tier.fate-tier-meet-hom-fails"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["FateA.dropped_still_not_cancel","Trope.Grade.fidelity_total_honest_not_cancel"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"The ratified witness is dropped |>f atten unknown against the tier meet. The pre-ratification witness dropped |>f falsified = dropped was reversed by amendment (A1) and is retained as history only.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"C3 (partition; tier closure is not a homomorphism)"},{"foundation_diverse_witness":null,"id":"O1-carrier","kind":"theory","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":["Trope.GradeR.atom_factorization","Trope.nine_families","Trope.family_realized","Trope.families_disjoint","Trope.fateFamily_none_iff"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Lean only, so ungraded under 8.1. Mechanised: the factorisation into six slot projections, and separately the nine-label classification over the coordinate value types. NOT mechanised: the link between them. No theorem maps a grade's slot projections to AtomFamily, and the emb*_one lemmas that would begin that bridge are stated but used by nothing, so 'drawn from the nine families' and 'exhaustive' are argued in a docstring rather than stated.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"O1-carrier (atom factorisation)"},{"foundation_diverse_witness":null,"id":"tropical-Bprime","kind":"theory","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":["piR_hom","piR_one","piRHom","piR_nontrivial","piR_surjective","piR_sighted","phiR_sighted","phiId_not_hom","sighted_forces_squash","squash_top","squash_ne_unknown","squash_add"],"receipts":["lean-factorisation-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Lean only, so ungraded under 8.1. sighted_forces_squash concludes f (atten Delta.unknown) /= Delta.unknown: a sighted homomorphism must send atten Unknown AWAY from the deceptive top, not onto it.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Tropical factorisation, (B-prime) sighted"},{"foundation_diverse_witness":null,"id":"theorem-b-t1","kind":"theory","legs":{"agda":{"declarations":["TB.Syntax","TB.Grade","TB.Tier"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Theorem B Target 1 - intrinsic graded calculus"},{"foundation_diverse_witness":null,"id":"theorem-b-t2","kind":"theory","legs":{"agda":{"declarations":["TB.Substitution.cut-preserves-grade","TB.Substitution.cut-grade-comm"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"The v0.1 sharpness refutation (cut-orientation-matters, cut-symmetric-fails) was retired by amendment (A1) and is replaced by cut-grade-comm: the cut is reorderable.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Theorem B Target 2 - grade-exact substitution"},{"foundation_diverse_witness":null,"id":"theorem-b-t3","kind":"theory","legs":{"agda":{"declarations":["TB.Reduction.β-app","TB.Reduction.β-let","TB.Reduction.let-redex-grade","TB.Reduction.let-tier-preserved","TB.Reduction.seq-stays-core"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Narrow and intrinsic. The step relation has exactly two constructors, each requiring the substituted argument at grade epsilon, with no congruence rule and no step for any effect former. Preservation holds by construction because the relation is indexed at the same type and grade on both sides, not by induction. There is no progress theorem. The fix case is open (CO-1).","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Theorem B Target 3 - subject reduction, beta/let core"},{"foundation_diverse_witness":null,"id":"theorem-b-t4","kind":"theory","legs":{"agda":{"declarations":["TB.Honest"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Theorem B Target 4 - Honest Generation and Veridicality"},{"foundation_diverse_witness":null,"id":"grade-soundness-exact","kind":"theory","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Idris2 only, so ungraded under 8.1.","reference":{"idris2":{"declarations":["Trope.Soundness.soundFromExact"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"Grade soundness, exact lowering"},{"foundation_diverse_witness":null,"id":"tsub-soundness","kind":"theory","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Idris2 only, so ungraded under 8.1.","reference":{"idris2":{"declarations":["Trope.Soundness.subSound"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"T-Sub soundness"},{"foundation_diverse_witness":null,"id":"verdict-soundness","kind":"engineering","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Classified engineering: the statement is about the shipped checker's verdict function over its own types, so 8.1 puts it off the ladder entirely and it carries section 5 tokens only. Note that verdictSound is typed over Grade while the shipped checker's floor is a different type decided by a different predicate, and no lemma connects them.","reference":{"idris2":{"declarations":["Trope.Soundness.verdictSound"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"Verdict soundness (corollary)"},{"foundation_diverse_witness":null,"id":"grade-soundness-core","kind":"theory","legs":{"agda":{"declarations":["TB.Reduction","TB.Substitution.cut-preserves-grade"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Inherits Target 3's fragment: the beta/let core only, with the fix case open (CO-1).","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Grade soundness, beta/let core"}]} +{"commit":"c0eb4f1a1a50aabfab23b94fd74b53cef267f653","note":"Evidence ledger. The pwg field of each theorem is DERIVED from the legs and receipts below by scripts/pwg-derive.sh, never written by hand; scripts/pwg-check.sh re-derives and fails on drift (PROOF-POLICY 8.4 rule 2). Idris2 appears as a reference, not a leg: 8.1 excludes engineering provers from the ladder.","policy":{"commit":"9bdf864cc7f2c8e24b4df84bf00d04158eee3ad5","path":"3-practice/PROOF-POLICY.adoc","repo":"metadatastician/standards","section":"8"},"receipts":{"agda-c0eb4f1":{"axioms":[],"checker":"agda","checker_version":"2.7.0.1","commit":"c0eb4f1a1a50aabfab23b94fd74b53cef267f653","evidence":"https://github.com/hyperpolymath/trope-checker/actions/runs/42623339243","import_cone":"root modules All.agda and Smoke.agda; all seven TB.* modules reachable from All.agda; postulate count 0 (--safe refuses postulate; independently scanned with hyperpolymath/mathesis scripts/census/proof-holes.sh over verification/proofs/agda at this commit, which emitted no record of any class)","inputs_digest":"git-tree verification/proofs/agda = 8d3370e7da58023b9bfa0802e710860105ace73a","invocation":"agda --safe --without-K --cubical-compatible All.agda ; agda --safe --without-K --cubical-compatible Smoke.agda","observed":"PASS: All.agda + Smoke.agda typecheck (--safe --without-K --cubical-compatible; --safe => postulate-free by construction)","repo":"hyperpolymath/trope-checker","result":"pass","state":"current","stdlib_pin":"agda-stdlib v2.0 sha256:14eecb83d62495f701e1eb03ffba59a2f767491f728a8ab8c8bb9243331399d8"},"agda-d5234b1":{"axioms":[],"checker":"agda","checker_version":"2.7.0.1","commit":"d5234b15e56829a81ceec44e6cf14713357096ef","evidence":"https://github.com/hyperpolymath/trope-checker/actions/runs/44006871652/job/133784244586","import_cone":"root modules All.agda and Smoke.agda; 145 modules in the cone (agda --dependency-graph), 12 first-party: All, Smoke and the ten TB.* modules, TB.OrderLaws, TB.Monotone and TB.Bridge among them; postulate count 0 (--safe refuses postulate; independently scanned with hyperpolymath/mathesis scripts/scan-postulates.sh over the 12 first-party files, which reported 12 files, 0 postulate(s))","inputs_digest":"git-tree verification/proofs/agda = 3b19a6787cd678e93ea0c6be49a6e60634ff6978","invocation":"agda --safe --without-K --cubical-compatible All.agda ; agda --safe --without-K --cubical-compatible Smoke.agda","observed":"PASS: All.agda + Smoke.agda typecheck (--safe --without-K --cubical-compatible; --safe => postulate-free by construction)","repo":"hyperpolymath/trope-checker","result":"pass","state":"current","stdlib_pin":"agda-stdlib v2.0 sha256:14eecb83d62495f701e1eb03ffba59a2f767491f728a8ab8c8bb9243331399d8"},"lean-boundary-c0eb4f1":{"axioms":["propext","Quot.sound","Classical.choice"],"checker":"lean","checker_version":"4.16.0 (lake, leanchecker)","commit":"c0eb4f1a1a50aabfab23b94fd74b53cef267f653","evidence":"https://github.com/hyperpolymath/trope-checker/actions/runs/42623339243","import_cone":"every module of grade-boundary sits in the import Mathlib cone via GradeBoundary.lean:3","inputs_digest":"git-tree verification/proofs/lean4 = 5f32026d26810845d94d42b5a1281da3c2a06146","invocation":"lake build --wfail ; leanchecker ; axiom audit against the allowlist {propext, Classical.choice, Quot.sound}","observed":"job 'Lean grade-boundary: lake build + sorry-free environment' success; 'Trope.GradeR.atom_factorization' depends on axioms: [propext]; 'Trope.nine_families' depends on axioms: [propext, Classical.choice, Quot.sound]","repo":"hyperpolymath/trope-checker","result":"pass","state":"current","stdlib_pin":"mathlib4 rev v4.16.0 (lakefile.toml) -- see the Mathlib note: PROOF-POLICY 2 forbids this dependency for a recheck leg"},"lean-factorisation-c0eb4f1":{"axioms":["propext","Quot.sound","Classical.choice"],"checker":"lean","checker_version":"4.16.0 (lake, leanchecker)","commit":"c0eb4f1a1a50aabfab23b94fd74b53cef267f653","evidence":"https://github.com/hyperpolymath/trope-checker/actions/runs/42623339243","import_cone":"grade-factorisation requires gradeBoundary, so the import Mathlib cone covers it","inputs_digest":"git-tree verification/proofs/lean4 = 5f32026d26810845d94d42b5a1281da3c2a06146","invocation":"lake build --wfail ; leanchecker ; axiom audit against the allowlist {propext, Classical.choice, Quot.sound}","observed":"job 'Lean grade-factorisation: lake build + sorry-free environment' success","repo":"hyperpolymath/trope-checker","result":"pass","state":"current","stdlib_pin":"mathlib4 rev v4.16.0, transitively via the gradeBoundary path dependency"},"lean-ratified-order-d5234b1":{"axioms":[],"checker":"lean","checker_version":"4.16.0 (commit 128a1e6b0a82; GitHub release archive, sha256 cdd31f1064783fff163be53e285722102f16767e65e6fb7f7cb1c232514e0c3a)","commit":"d5234b15e56829a81ceec44e6cf14713357096ef","evidence":"https://github.com/hyperpolymath/trope-checker/actions/runs/44006871652/job/133784244634","import_cone":"verification/proofs/lean4/ratified-order/RatifiedOrder.lean alone: no import (Lean core only, no Mathlib)","inputs_digest":"git-tree verification/proofs/lean4/ratified-order = 2d69c2f34f4c98834f21ed6413f85b375b024e7b; RatifiedOrder.lean sha256 74c33f1310227243155da52d4afee603f58cff7b8df9942accf6b8dd80f554c5","invocation":"bash scripts/check-recheck-legs.sh lean (lean RatifiedOrder.lean with no error or warning, then Lean.collectAxioms on every declared theorem and def); bash scripts/check-recheck-legs.sh controls","observed":"axioms: none for 49 of 49 declared theorem(s), and none for any def they use; PASS: Lean recheck leg; controls: every planted defect was caught (6 controls)","repo":"hyperpolymath/trope-checker","result":"pass","state":"current","stdlib_pin":"Lean core only (no lakefile, no Mathlib)"},"rocq-ratified-order-d5234b1":{"axioms":[],"checker":"coqc","checker_version":"8.18.0 (Ubuntu 24.04 coq package; scripts/check-recheck-legs.sh refuses any other version)","commit":"d5234b15e56829a81ceec44e6cf14713357096ef","evidence":"https://github.com/hyperpolymath/trope-checker/actions/runs/44006871652/job/133784244634","import_cone":"verification/proofs/rocq/RatifiedOrder.v alone: it requires no library module (Coq prelude only)","inputs_digest":"git-tree verification/proofs/rocq = 2f808c303b5707bf40a54a7eb5c64cd4b774c511; RatifiedOrder.v sha256 89085ae49cb52894fbb16175cc86f2dc3da29333ef8699becf850c0b5ec1583e","invocation":"bash scripts/check-recheck-legs.sh rocq (coqc RatifiedOrder.v, then Print Assumptions on every Theorem and Lemma); bash scripts/check-recheck-legs.sh controls","observed":"Print Assumptions: closed under the global context for 49 of 49 declaration(s); PASS: Rocq recheck leg; controls: every planted defect was caught (6 controls)","repo":"hyperpolymath/trope-checker","result":"pass","state":"current","stdlib_pin":"none: no Require"}},"repo":"hyperpolymath/trope-checker","schema_version":"1.0.0","theorems":[{"foundation_diverse_witness":null,"id":"L1","kind":"theory","legs":{"agda":{"declarations":["TB.Grade.gmonoid-assoc"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["FateA.comp_assoc"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"","reference":{"idris2":{"declarations":["Trope.Laws.gradeAssoc","Trope.Coords.fateAssoc","Trope.Coords.bondAssoc","Trope.Coords.mergeAssoc","Trope.Fidelity.dplusAssoc"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"L1 (associativity)"},{"foundation_diverse_witness":null,"id":"L2","kind":"theory","legs":{"agda":{"declarations":["TB.Grade.gmonoid-unitL","TB.Grade.gmonoid-unitR"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"","reference":{"idris2":{"declarations":["Trope.Grade.gradeUnitL","Trope.Grade.gradeUnitR","Trope.Coords.fateUnitL","Trope.Fidelity.dplusZeroR"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"L2 (unit)"},{"foundation_diverse_witness":null,"id":"L3","kind":"theory","legs":{"agda":{"declarations":["TB.Grade.falsified-absorbL","TB.Grade.falsified-absorbR","TB.Grade.misbound-absorbL","TB.Grade.conflated-absorbL","TB.Grade.unknown-absorbL","TB.Grade.total-absorb-Q","TB.Tier.deceptive-absorbs-▷"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["FateA.falsified_two_sided_zero","GradeR.gBotR_two_sided_zero"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Agda states both sides only for Falsified. For Misbound, Conflated and Unknown the left form is stated; the right follows in one step from the coordinate's commutativity but is not itself a lemma.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"L3 (bottom absorption)"},{"foundation_diverse_witness":null,"id":"L4-fate","kind":"theory","legs":{"agda":{"declarations":["TB.Order.fateL4MonoR","TB.Order.fateL4MonoL"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["TropeRatified.fateL4MonoR","TropeRatified.fateL4MonoL"],"receipts":["lean-ratified-order-d5234b1"],"route":"re-proved","state":"RECONCILED","token":"PROVEN"},"rocq":{"declarations":["fateL4MonoR","fateL4MonoL"],"receipts":["rocq-ratified-order-d5234b1"],"route":"re-proved","state":"RECONCILED","token":"PROVEN"}},"notes":"One of four parts of L4 (owner ruling 2026-11-16: split rather than grade the whole on partial coverage). The others are L4-fidelity, L4-bond-merge and L4-lifting; L4 in full is their conjunction, and since 2026-11-17 all four hold. The Rocq and Lean legs are the Mathlib-free recheck of verification/proofs/rocq and verification/proofs/lean4/ratified-order; the Mathlib package lemmas FateA.comp_mono_right/left remain, BRIDGE-PENDING, and are not this leg. Both recheck legs restate the carrier clause for clause; TB.Bridge pins the restated definitions to the Agda on a fixed sample (exhaustive for Bond and Merge), and each leg proves the same six tables, so a definition that drifts fails its own kernel (PROOF-STATUS, statement correspondence).","reference":{"idris2":{"declarations":["Trope.Soundness.fateL4MonoR","Trope.Soundness.fateL4MonoL"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"L4 (monotonicity): fate coordinate"},{"foundation_diverse_witness":null,"id":"L4-fidelity","kind":"theory","legs":{"agda":{"declarations":["TB.Order.dplusMonoR","TB.Order.dplusMonoL"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["TropeRatified.dplusMonoR","TropeRatified.dplusMonoL"],"receipts":["lean-ratified-order-d5234b1"],"route":"re-proved","state":"RECONCILED","token":"PROVEN"},"rocq":{"declarations":["dplusMonoR","dplusMonoL"],"receipts":["rocq-ratified-order-d5234b1"],"route":"re-proved","state":"RECONCILED","token":"PROVEN"}},"notes":"One of four parts of L4. Both recheck legs restate the carrier clause for clause; TB.Bridge pins the restated definitions to the Agda on a fixed sample (exhaustive for Bond and Merge), and each leg proves the same six tables, so a definition that drifts fails its own kernel (PROOF-STATUS, statement correspondence).","reference":{},"title":"L4 (monotonicity): fidelity dimension"},{"foundation_diverse_witness":null,"id":"L4-bond-merge","kind":"theory","legs":{"agda":{"declarations":["TB.Monotone.bondL4MonoR","TB.Monotone.bondL4MonoL","TB.Monotone.mergeL4MonoR","TB.Monotone.mergeL4MonoL"],"receipts":["agda-d5234b1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["TropeRatified.bondL4MonoR","TropeRatified.bondL4MonoL","TropeRatified.mergeL4MonoR","TropeRatified.mergeL4MonoL"],"receipts":["lean-ratified-order-d5234b1"],"route":"re-proved","state":"RECONCILED","token":"PROVEN"},"rocq":{"declarations":["bondL4MonoR","bondL4MonoL","mergeL4MonoR","mergeL4MonoL"],"receipts":["rocq-ratified-order-d5234b1"],"route":"re-proved","state":"RECONCILED","token":"PROVEN"}},"notes":"One of four parts of L4. Proved in Agda 2026-11-17 (TB.Monotone; the left forms follow from the right forms by bond and merge commutativity). The Idris2 restatement remains a reference only (8.1). Both recheck legs restate the carrier clause for clause; TB.Bridge pins the restated definitions to the Agda on a fixed sample (exhaustive for Bond and Merge), and each leg proves the same six tables, so a definition that drifts fails its own kernel (PROOF-STATUS, statement correspondence).","reference":{"idris2":{"declarations":["Trope.Order.bondComposeMono","Trope.Order.mergeComposeMono"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"L4 (monotonicity): bond and merge coordinates"},{"foundation_diverse_witness":null,"id":"L4-lifting","kind":"theory","legs":{"agda":{"declarations":["TB.Monotone.gradeL4MonoR","TB.Monotone.gradeL4MonoL","TB.Monotone.▷-mono"],"receipts":["agda-d5234b1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["TropeRatified.gradeL4MonoR","TropeRatified.gradeL4MonoL","TropeRatified.gcomp_mono"],"receipts":["lean-ratified-order-d5234b1"],"route":"re-proved","state":"RECONCILED","token":"PROVEN"},"rocq":{"declarations":["gradeL4MonoR","gradeL4MonoL","gcomp_mono"],"receipts":["rocq-ratified-order-d5234b1"],"route":"re-proved","state":"RECONCILED","token":"PROVEN"}},"notes":"One of four parts of L4: the lifting from coordinate-level monotonicity to gradeCompose that spec section 7 (Knaster-Tarski) invokes. Proved in Agda 2026-11-17 (TB.Monotone): each argument separately, and both at once (▷-mono, through ⊑-trans). Spec section 7 also needs each coordinate to be a COMPLETE chain; completeness is not part of this obligation and is proved in no prover. Both recheck legs restate the carrier clause for clause; TB.Bridge pins the restated definitions to the Agda on a fixed sample (exhaustive for Bond and Merge), and each leg proves the same six tables, so a definition that drifts fails its own kernel (PROOF-STATUS, statement correspondence).","reference":{},"title":"L4 (monotonicity): grade-level lifting for gradeCompose"},{"foundation_diverse_witness":null,"id":"L5","kind":"theory","legs":{"agda":{"declarations":["TB.Tier.deceptive-absorbs-▷","TB.Reduction.attenuate-stays-deceptive","TB.Reduction.project-stays-deceptive"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"L5 (deception infectiousness)"},{"foundation_diverse_witness":null,"id":"L6","kind":"theory","legs":{"agda":{"declarations":["TB.Grade.grade-comm"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["GradeR.instCommMonoid","FateA.comp_comm"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"L6 ratification is still subject to the open owner ruling tracked on trope-checker issue 106.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"L6 (commutativity)"},{"foundation_diverse_witness":null,"id":"retention-order","kind":"theory","legs":{"agda":{"declarations":["TB.Order.⊑-refl","TB.OrderLaws.⊑-trans","TB.OrderLaws.⊑-dec","TB.OrderLaws.⊑-isPreorder"],"receipts":["agda-d5234b1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["TropeRatified.gle_refl","TropeRatified.gle_trans","TropeRatified.gle_dec","TropeRatified.gle_decides"],"receipts":["lean-ratified-order-d5234b1"],"route":"re-proved","state":"RECONCILED","token":"PROVEN"},"rocq":{"declarations":["gle_refl","gle_trans","gle_dec"],"receipts":["rocq-ratified-order-d5234b1"],"route":"re-proved","state":"RECONCILED","token":"PROVEN"}},"notes":"Proved in Agda 2026-11-17: reflexivity (TB.Order), transitivity and decidability (TB.OrderLaws), packaged as ⊑-isPreorder. Before that the Agda proved reflexivity only and the leg was OPEN. Both recheck legs restate the carrier clause for clause; TB.Bridge pins the restated definitions to the Agda on a fixed sample (exhaustive for Bond and Merge), and each leg proves the same six tables, so a definition that drifts fails its own kernel (PROOF-STATUS, statement correspondence).","reference":{"idris2":{"declarations":["Trope.Laws.decGradeLte","Trope.Soundness.gradeLteTrans","Trope.Coords.fateLteRefl","Trope.Coords.bondLteRefl","Trope.Coords.mergeLteRefl","Trope.Fidelity.dLteRefl"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"Retention order is a decidable preorder"},{"foundation_diverse_witness":null,"id":"A2-directions","kind":"theory","legs":{"agda":{"declarations":["TB.Order.fateDroppedLtePredicated","TB.Order.fatePredicatedNotLteDropped"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["TropeRatified.fateDroppedLtePredicated","TropeRatified.fatePredicatedNotLteDropped"],"receipts":["lean-ratified-order-d5234b1"],"route":"re-proved","state":"RECONCILED","token":"PROVEN"},"rocq":{"declarations":["fateDroppedLtePredicated","fatePredicatedNotLteDropped"],"receipts":["rocq-ratified-order-d5234b1"],"route":"re-proved","state":"RECONCILED","token":"PROVEN"}},"notes":"One of two parts of A2 (owner ruling 2026-11-16: split). The two directional facts only; that Fate is a chain is A2-chain. Both recheck legs restate the carrier clause for clause; TB.Bridge pins the restated definitions to the Agda on a fixed sample (exhaustive for Bond and Merge), and each leg proves the same six tables, so a definition that drifts fails its own kernel (PROOF-STATUS, statement correspondence).","reference":{"idris2":{"declarations":["Trope.Soundness.fateDroppedLtePredicated","Trope.Soundness.fatePredicatedNotLteDropped"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"A2 directional facts: Dropped below Predicated, not conversely"},{"foundation_diverse_witness":null,"id":"A2-chain","kind":"theory","legs":{"agda":{"declarations":["TB.OrderLaws.fate-isTotalOrder","TB.OrderLaws.fateLte-trans","TB.OrderLaws.fateLte-antisym","TB.OrderLaws.fateLte-total","TB.Order.fateLte-refl"],"receipts":["agda-d5234b1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["TropeRatified.fate_isTotalOrder","TropeRatified.fateLte_trans","TropeRatified.fateLte_antisym","TropeRatified.fateLte_total","TropeRatified.fateLte_refl"],"receipts":["lean-ratified-order-d5234b1"],"route":"re-proved","state":"RECONCILED","token":"PROVEN"},"rocq":{"declarations":["fate_isTotalOrder","fateLte_trans","fateLte_antisym","fateLte_total","fateLte_refl"],"receipts":["rocq-ratified-order-d5234b1"],"route":"re-proved","state":"RECONCILED","token":"PROVEN"}},"notes":"A chain is a total order: reflexive, transitive, antisymmetric and total. Proved in Agda 2026-11-17 as fate-isTotalOrder : IsTotalOrder _≡_ _≤F_ (standard library), with the fidelity order a chain as well (dLte-isTotalOrder). The Mathlib package lemmas FateA.le_total and FateA.le_refl remain, BRIDGE-PENDING, and are not this leg. Completeness of the chain is not part of this obligation and is proved in no prover. The directional facts are A2-directions. Both recheck legs restate the carrier clause for clause; TB.Bridge pins the restated definitions to the Agda on a fixed sample (exhaustive for Bond and Merge), and each leg proves the same six tables, so a definition that drifts fails its own kernel (PROOF-STATUS, statement correspondence).","reference":{"idris2":{"declarations":["Trope.Order.fateLteTrans"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Fate is a chain (A2)"},{"foundation_diverse_witness":null,"id":"veridicality-derivation","kind":"theory","legs":{"agda":{"declarations":["TB.Honest.fateDeceptiveUnique","TB.Honest.bondDeceptiveUnique","TB.Honest.mergeDeceptiveUnique"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"The 'exactly three' half rests on the three uniqueness lemmas plus the construction of Grade; Trope.Veridicality.deceptiveDuals is a tuple value and states no proposition, so it is not cited as evidence here.","reference":{"idris2":{"declarations":["Trope.Veridicality.fateDeceptiveUnique","Trope.Veridicality.bondDeceptiveUnique","Trope.Veridicality.mergeDeceptiveUnique"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"Veridicality Derivation"},{"foundation_diverse_witness":null,"id":"honest-generation","kind":"theory","legs":{"agda":{"declarations":["TB.Honest.genFate","TB.Honest.genBond","TB.Honest.genMerge","TB.Honest.honest-closed-▷"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"","reference":{"idris2":{"declarations":["Trope.Generation.genFate","Trope.Generation.genBond","Trope.Generation.genMerge"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"Honest Generation"},{"foundation_diverse_witness":null,"id":"hc4-coherence","kind":"theory","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Idris2 only. No Agda source, so ungraded under 8.1 however sound the Idris2 proof is.","reference":{"idris2":{"declarations":["Trope.Veridicality.epsilonHonest","Trope.Grade.epsilonCoherent"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"The unit is non-deceptive and HC-4-coherent"},{"foundation_diverse_witness":null,"id":"C1","kind":"theory","legs":{"agda":{"declarations":["TB.Grade.grade-conical"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["GradeR.conical","FateA.conical"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"C1 (conicality)"},{"foundation_diverse_witness":null,"id":"C2","kind":"theory","legs":{"agda":{"declarations":["TB.Tier.Q-cancelʳ","TB.Tier.core-closed-▷"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["GradeR.gradeR_leftCancel_iff","GradeR.gradeR_not_leftCancel","GradeR.gDroppedR_not_cancel","FateA.atten_cancel_on_normalForms"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"The normal-form half is proved on the fate coordinate only (FateA.atten_cancel_on_normalForms); there is no grade-level normal-form cancellation theorem. Amendment (A3) is not modelled in the Agda, whose carrier is the unnormalised one.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"C2 (the cancellation boundary)"},{"foundation_diverse_witness":null,"id":"tier2-membership","kind":"theory","legs":{"agda":{"declarations":["TB.Tier.unknown-not-cancel","TB.Tier.total-honest-not-cancel","TB.Tier.falsified-not-cancel","TB.Tier.dropped-honest-not-cancel","TB.Tier.predicated-honest-not-cancel","TB.Tier.severed-honest-not-cancel","TB.Tier.Q-cancelʳ"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":["Bond.withheld_honest_not_cancel","Merge.fused_honest_not_cancel","Fate.atten_not_cancel","Grade.grade_leftCancel_iff","GradeR.gradeR_leftCancel_iff","FateA.leftCancelWitness"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Agda states six of the non-cancellativity witnesses (fate and bond) plus the positive right-cancellation Q-cancelʳ, so the Agda leg is NOT unavailable. It is OPEN because the exhaustive characterisation is not stated in Agda: there is no Agda counterpart of grade_leftCancel_iff, and no Agda witness on the merge coordinate. Lean carries the exhaustive iff. Grade.grade_leftCancel_iff is over the historical pre-ratification carrier; the ratified restatement is GradeR.gradeR_leftCancel_iff. Ungraded because the Agda token is OPEN (§8.1), not for want of an Agda source.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Tier-2 membership, exhaustive"},{"foundation_diverse_witness":null,"id":"C3","kind":"theory","legs":{"agda":{"declarations":["TB.Tier.fate-tier-meet-hom-fails"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":["FateA.dropped_still_not_cancel","Trope.Grade.fidelity_total_honest_not_cancel"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"The ratified witness is dropped |>f atten unknown against the tier meet. The pre-ratification witness dropped |>f falsified = dropped was reversed by amendment (A1) and is retained as history only.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"C3 (partition; tier closure is not a homomorphism)"},{"foundation_diverse_witness":null,"id":"O1-carrier","kind":"theory","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":["Trope.GradeR.atom_factorization","Trope.nine_families","Trope.family_realized","Trope.families_disjoint","Trope.fateFamily_none_iff"],"receipts":["lean-boundary-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Lean only, so ungraded under 8.1. Mechanised: the factorisation into six slot projections, and separately the nine-label classification over the coordinate value types. NOT mechanised: the link between them. No theorem maps a grade's slot projections to AtomFamily, and the emb*_one lemmas that would begin that bridge are stated but used by nothing, so 'drawn from the nine families' and 'exhaustive' are argued in a docstring rather than stated.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"O1-carrier (atom factorisation)"},{"foundation_diverse_witness":null,"id":"tropical-Bprime","kind":"theory","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":["piR_hom","piR_one","piRHom","piR_nontrivial","piR_surjective","piR_sighted","phiR_sighted","phiId_not_hom","sighted_forces_squash","squash_top","squash_ne_unknown","squash_add"],"receipts":["lean-factorisation-c0eb4f1"],"route":"re-proved","state":"BRIDGE-PENDING","token":"PROVEN-WITH-AXIOMS"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Lean only, so ungraded under 8.1. sighted_forces_squash concludes f (atten Delta.unknown) /= Delta.unknown: a sighted homomorphism must send atten Unknown AWAY from the deceptive top, not onto it.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Tropical factorisation, (B-prime) sighted"},{"foundation_diverse_witness":null,"id":"theorem-b-t1","kind":"theory","legs":{"agda":{"declarations":["TB.Syntax","TB.Grade","TB.Tier"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Theorem B Target 1 - intrinsic graded calculus"},{"foundation_diverse_witness":null,"id":"theorem-b-t2","kind":"theory","legs":{"agda":{"declarations":["TB.Substitution.cut-preserves-grade","TB.Substitution.cut-grade-comm"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"The v0.1 sharpness refutation (cut-orientation-matters, cut-symmetric-fails) was retired by amendment (A1) and is replaced by cut-grade-comm: the cut is reorderable.","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Theorem B Target 2 - grade-exact substitution"},{"foundation_diverse_witness":null,"id":"theorem-b-t3","kind":"theory","legs":{"agda":{"declarations":["TB.Reduction.β-app","TB.Reduction.β-let","TB.Reduction.let-redex-grade","TB.Reduction.let-tier-preserved","TB.Reduction.seq-stays-core"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Narrow and intrinsic. The step relation has exactly two constructors, each requiring the substituted argument at grade epsilon, with no congruence rule and no step for any effect former. Preservation holds by construction because the relation is indexed at the same type and grade on both sides, not by induction. There is no progress theorem. The fix case is open (CO-1).","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Theorem B Target 3 - subject reduction, beta/let core"},{"foundation_diverse_witness":null,"id":"theorem-b-t4","kind":"theory","legs":{"agda":{"declarations":["TB.Honest"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Theorem B Target 4 - Honest Generation and Veridicality"},{"foundation_diverse_witness":null,"id":"grade-soundness-exact","kind":"theory","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Idris2 only, so ungraded under 8.1.","reference":{"idris2":{"declarations":["Trope.Soundness.soundFromExact"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"Grade soundness, exact lowering"},{"foundation_diverse_witness":null,"id":"tsub-soundness","kind":"theory","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Idris2 only, so ungraded under 8.1.","reference":{"idris2":{"declarations":["Trope.Soundness.subSound"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"T-Sub soundness"},{"foundation_diverse_witness":null,"id":"verdict-soundness","kind":"engineering","legs":{"agda":{"declarations":[],"receipts":[],"route":"unavailable","state":"AGDA-PENDING","token":"OPEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Classified engineering: the statement is about the shipped checker's verdict function over its own types, so 8.1 puts it off the ladder entirely and it carries section 5 tokens only. Note that verdictSound is typed over Grade while the shipped checker's floor is a different type decided by a different predicate, and no lemma connects them.","reference":{"idris2":{"declarations":["Trope.Soundness.verdictSound"],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"PROVEN"}},"title":"Verdict soundness (corollary)"},{"foundation_diverse_witness":null,"id":"grade-soundness-core","kind":"theory","legs":{"agda":{"declarations":["TB.Reduction","TB.Substitution.cut-preserves-grade"],"receipts":["agda-c0eb4f1"],"route":"re-proved","state":"AGDA-VERIFIED","token":"PROVEN"},"lean":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"},"rocq":{"declarations":[],"receipts":[],"route":"unavailable","state":"NOT-INVENTORIED","token":"OPEN"}},"notes":"Inherits Target 3's fragment: the beta/let core only, with the fix case open (CO-1).","reference":{"idris2":{"declarations":[],"state":"not-a-leg (PROOF-POLICY 8.1 excludes engineering provers from the PWG ladder)","token":"OPEN"}},"title":"Grade soundness, beta/let core"}]}