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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
== Changelog

== 2026-11-19 — Parallel composition and the loop grade (P-1 to P-4, K-1 to K-4); every receipt superseded (40 rows ungraded for now)

* `src/ResourceAlgebra/Parallel.agda` adds the `IsParallel` layer: a
commutative monoid on `𝟙` that distributes over ⊕. Two exchange laws,
`SyncBelow` and `SyncAbove`, relate it to ⊗ and are stated apart. Work
(`_∥_` = ⊗ in a dioid with a commutative ⊗; Loss and MaxPlus) has both.
MaxPlus span (`tPar`, max) has `SyncAbove` only. HWM (`_∥h_`, the sum) has
`SyncBelow` only.
* `src/ResourceAlgebra/Star.agda` adds the `IsStar` layer (Kozen's axioms).
An algebra whose `𝟙` is greatest has the star `star a` = `𝟙` (Loss).
MaxPlus and HWM have no star. `Instances/MaxPlusTop.agda` adds a top to
MaxPlus; it is an annihilating dioid with a star, and MaxPlus embeds in it
by a strict, injective morphism.
* Three expected rejections are added (16 in all): `SpanSyncBelow`,
`HWMSyncAbove` and `MaxPlusLoopBounded`.
* The Rocq and Lean legs re-prove the eight rows by hand. Checked before
the pull request, not as receipts: Agda 2.6.3, Lean 4.35.0 (116 of 116
printed theorems axiom-free) and Coq 8.18.0 on a copy (106 of 106 closed).
* The Agda and Rocq inputs changed, so their runs at `15fa113` are
`superseded` in the ledger of `scripts/proof-receipt.sh`; the Lean run
already was. The receipt is regenerated with source commit `c31bf1a`. Of
40 theory rows, all 40 are ungraded until the first `proofs.yml` run on
main that contains this change is recorded.

== 2026-11-18 — Lean leg and M-2 bridge under lake; the Lean receipt is superseded (31 rows PWG-2i for now)

* The Lean leg builds as a Lake package (`verification/proofs/lean4/lakefile.toml`,
Expand Down
4 changes: 3 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ only from its first green run.
----
src/ResourceAlgebra/Prelude.agda ℕ lemmas (+, max, min, ≤), proved here
src/ResourceAlgebra/Core.agda the record and its layers
src/ResourceAlgebra/Instances/*.agda Loss, MaxPlus, HWM, MinMax, Questions, Evidence
src/ResourceAlgebra/Instances/*.agda Loss, MaxPlus, HWM, MinMax, Questions, Evidence, Diamond, MaxPlusTop
src/ResourceAlgebra/Ledger.agda a proof-ledger row's status, derived from its dependencies
src/ResourceAlgebra/Separation.agda checked separation witnesses
src/ResourceAlgebra/Morphism.agda strict and lax morphisms, classifications
src/ResourceAlgebra/Parallel.agda parallel composition and its two exchange laws
src/ResourceAlgebra/Star.agda the loop grade (Kleene star), and where it exists
tests/reject/*.agda expected rejections (must fail)
docs/pre-registration.adoc intent, provenance ledger, obligations
docs/status/PROOF-STATUS.adoc every claim with its status and artefact
Expand Down
253 changes: 200 additions & 53 deletions docs/status/PROOF-STATUS.adoc

Large diffs are not rendered by default.

20 changes: 17 additions & 3 deletions scripts/proof-receipt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ receipt_claims() {
printf '%s|proven|theorem|re-proved|RECONCILED|re-proved|RECONCILED||\n' "$id"
done
printf '%s\n' "M-2|open|theorem|unavailable||re-proved|LEAN-CHECKED|the statement names tropical-types' Lean instance, which Rocq cannot import|"
for id in H-1 H-3 N-1 Q-1 Q-2 Q-3 Q-4 E-1 E-2 E-3 F-1 F-2 F-3 F-4 F-5 F-6 F-7 F-8 F-9 F-10 S-1 S-2 S-3 S-4; do
for id in H-1 H-3 N-1 Q-1 Q-2 Q-3 Q-4 E-1 E-2 E-3 F-1 F-2 F-3 F-4 F-5 F-6 F-7 F-8 F-9 F-10 S-1 S-2 S-3 S-4 P-1 P-2 P-3 P-4 K-1 K-2 K-3 K-4; do
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
printf '%s|proven|theorem|re-proved|RECONCILED|re-proved|RECONCILED||\n' "$id"
done
}
Expand All @@ -112,12 +112,26 @@ receipt_runs() {
# The Lean invocation of that run, before the legs moved under lake.
local lean_direct='lean ResourceAlgebra.lean in verification/proofs/lean4, core only; then bash scripts/check-lean-bridge.sh (lean -o on TropicalSessionTypes.lean and ResourceAlgebra.lean, then lean TropicalBridge.lean with LEAN_PATH)'
cat <<ROWS
agda|$u/134484857967|$c|Agda version 2.6.4.3 (Debian trixie agda-bin=2.6.4.3-1+b2, container debian:trixie-slim, not pinned by digest)|$(receipt_invocation agda)|6d3250447bd3271db46ebac1e48005a6988baf87b6b923ecd3914fbe1b74ae9d|PASS: core proofs, unit tests and all 13 expected rejections|current||||0c1f64c3c7f0a26cbc92595168858485a9883f6196d287497dcc805faf5c58eb
rocq|$u/134484858135|$c|Rocq 9.3.0, then rocqchk|$(receipt_invocation rocq)|b52b1348c6cace05db2ac026d1137a1a3027b14ec84e9fb599259c3693c8b1b7|RESULT: PASS -- gated modules compile; the Assumptions step then passed, which fails unless all 75 printed theorems are closed under the global context and rocqchk accepts the compiled file|current|||||rocq/rocq-prover:9.3.0@sha256:97a68f230e785726c3bab4ba17e1d416fdd630de4af4548eb49b08712f29af93
agda|$u/134484857967|$c|Agda version 2.6.4.3 (Debian trixie agda-bin=2.6.4.3-1+b2, container debian:trixie-slim, not pinned by digest)|$(receipt_invocation agda)|6d3250447bd3271db46ebac1e48005a6988baf87b6b923ecd3914fbe1b74ae9d|PASS: core proofs, unit tests and all 13 expected rejections|superseded|its inputs changed when parallel composition and the loop grade were added (rows P-1 to P-4 and K-1 to K-4): the cone gained src/ResourceAlgebra/Parallel.agda, Star.agda and Instances/MaxPlusTop.agda, and three expected rejections were added. To be replaced by the first run on main that contains them|||0c1f64c3c7f0a26cbc92595168858485a9883f6196d287497dcc805faf5c58eb
rocq|$u/134484858135|$c|Rocq 9.3.0, then rocqchk|$(receipt_invocation rocq)|b52b1348c6cace05db2ac026d1137a1a3027b14ec84e9fb599259c3693c8b1b7|RESULT: PASS -- gated modules compile; the Assumptions step then passed, which fails unless all 75 printed theorems are closed under the global context and rocqchk accepts the compiled file|superseded|its input changed when parallel composition and the loop grade were added (rows P-1 to P-4 and K-1 to K-4): verification/proofs/coq/ResourceAlgebra.v gained their Rocq leg. To be replaced by the first run on main that contains them||||rocq/rocq-prover:9.3.0@sha256:97a68f230e785726c3bab4ba17e1d416fdd630de4af4548eb49b08712f29af93
lean|$u/134484858201|$c|Lean 4.35.0 (release archive, sha256 7289597a44543246c9227b8cae501767e095ce17f6d448b95fc4a8dc97268f6d, on the hosted runner, no image)|$lean_direct|015e62121942646e938318c4015212bb32434493c238e3cef7168858c68d9cb6|RESULT: PASS -- gated modules compile; the Axioms step then passed, which fails unless all 84 printed theorems depend on no axiom; PASS: M-2 bridge to hyperpolymath/tropical-types@f2e465c966d14d4986dfc492875cc54653d9751e; 6 of 6 printed theorems depend on no axiom|superseded|its inputs changed in hyperpolymath/resource-algebra#53: the leg and the M-2 bridge now build under lake, so the input set gained scripts/check-lean-leg.sh, two lakefiles and two Lake manifests, and scripts/check-lean-bridge.sh changed. To be replaced by the first run on main of the legs under lake||hyperpolymath/tropical-types@f2e465c966d14d4986dfc492875cc54653d9751e=c176b35aaec8d21b891671ed0e0619e68f1413ace21a8078825069a3d3095e01
ROWS
}

# The three runs at 15fa113 predate rows P-1 to P-4 and K-1 to K-4, so they
# did not check them. Each is listed under the rows it did check only: a
# row's lineage never names a run that did not check it. M-2 has a Lean
# leg only. Remove a row here when its run is replaced by a current one.
receipt_run_scope() {
local u=https://github.com/hyperpolymath/resource-algebra/actions/runs/44209774341/job
local old='C-1 C-2 C-3 C-4a C-4b L-1 M-1 H-1 H-3 N-1 Q-1 Q-2 Q-3 Q-4 E-1 E-2 E-3 F-1 F-2 F-3 F-4 F-5 F-6 F-7 F-8 F-9 F-10 S-1 S-2 S-3 S-4'
cat <<ROWS
agda|$u/134484857967|$old
rocq|$u/134484858135|$old
lean|$u/134484858201|$old M-2
ROWS
}

receipt_echoes() { :; }
receipt_header() {
cat <<'EOF'
Expand Down
3 changes: 3 additions & 0 deletions src/ResourceAlgebra/All.agda
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ import ResourceAlgebra.Ledger
import ResourceAlgebra.Instances.Diamond
import ResourceAlgebra.Separation
import ResourceAlgebra.Morphism
import ResourceAlgebra.Instances.MaxPlusTop
import ResourceAlgebra.Parallel
import ResourceAlgebra.Star
162 changes: 162 additions & 0 deletions src/ResourceAlgebra/Instances/MaxPlusTop.agda
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
{-# OPTIONS --safe --without-K --cubical-compatible --exact-split --no-sized-types --no-guardedness #-}
-- SPDX-License-Identifier: MPL-2.0
-- SPDX-FileCopyrightText: 2026 Jonathan D.A. Jewell
--
-- MaxPlus with a top: (ℕ ∪ {−∞, +∞}, max, +).
--
-- _⊕t_ = alternatives = max (worst case); unit bot (−∞, no path)
-- _⊗t_ = sequence = + (accumulate); unit val 0
-- top = +∞, the cost of a run with no finite bound
--
-- MaxPlus has no grade for a loop whose body costs something: the costs
-- val 1, val 2, ... have no upper bound in ℕ ∪ {−∞} (ResourceAlgebra.Star,
-- MaxPlus-no-fixpoint). The top is that bound. The impossible run still
-- annihilates: bot ⊗t top = bot.
module ResourceAlgebra.Instances.MaxPlusTop where

open import ResourceAlgebra.Prelude
open import ResourceAlgebra.Core

data Grade : Set where
bot : Grade
val : Nat → Grade
top : Grade

-- Injectivity through a projection (Prelude, suc-injective, says why).
val-proj : Grade → Nat
val-proj (val n) = n
val-proj bot = zero
val-proj top = zero

val-injective : ∀ {m n} → val m ≡ val n → m ≡ n
val-injective = cong val-proj

infixl 6 _⊕t_
_⊕t_ : Grade → Grade → Grade
bot ⊕t y = y
val m ⊕t bot = val m
val m ⊕t val n = val (max m n)
val m ⊕t top = top
top ⊕t _ = top

infixl 7 _⊗t_
_⊗t_ : Grade → Grade → Grade
bot ⊗t _ = bot
val m ⊗t bot = bot
val m ⊗t val n = val (m + n)
val m ⊗t top = top
top ⊗t bot = bot
top ⊗t val _ = top
top ⊗t top = top

----------------------------------------------------------------------
-- Alternatives: (⊕t, bot) is an idempotent commutative monoid
⊕t-assoc : ∀ a b c → (a ⊕t b) ⊕t c ≡ a ⊕t (b ⊕t c)
⊕t-assoc bot b c = refl
⊕t-assoc (val a) bot c = refl
⊕t-assoc (val a) (val b) bot = refl
⊕t-assoc (val a) (val b) (val c) = cong val (max-assoc a b c)
⊕t-assoc (val a) (val b) top = refl
⊕t-assoc (val a) top c = refl
⊕t-assoc top b c = refl

⊕t-comm : ∀ a b → a ⊕t b ≡ b ⊕t a
⊕t-comm bot bot = refl
⊕t-comm bot (val b) = refl
⊕t-comm bot top = refl
⊕t-comm (val a) bot = refl
⊕t-comm (val a) (val b) = cong val (max-comm a b)
⊕t-comm (val a) top = refl
⊕t-comm top bot = refl
⊕t-comm top (val b) = refl
⊕t-comm top top = refl

⊕t-idem : ∀ a → a ⊕t a ≡ a
⊕t-idem bot = refl
⊕t-idem (val a) = cong val (max-idem a)
⊕t-idem top = refl

----------------------------------------------------------------------
-- Sequence: (⊗t, val 0) is a commutative monoid
⊗t-assoc : ∀ a b c → (a ⊗t b) ⊗t c ≡ a ⊗t (b ⊗t c)
⊗t-assoc bot b c = refl
⊗t-assoc (val a) bot c = refl
⊗t-assoc (val a) (val b) bot = refl
⊗t-assoc (val a) (val b) (val c) = cong val (+-assoc a b c)
⊗t-assoc (val a) (val b) top = refl
⊗t-assoc (val a) top bot = refl
⊗t-assoc (val a) top (val c) = refl
⊗t-assoc (val a) top top = refl
⊗t-assoc top bot c = refl
⊗t-assoc top (val b) bot = refl
⊗t-assoc top (val b) (val c) = refl
⊗t-assoc top (val b) top = refl
⊗t-assoc top top bot = refl
⊗t-assoc top top (val c) = refl
⊗t-assoc top top top = refl

⊗t-unitˡ : ∀ a → val 0 ⊗t a ≡ a
⊗t-unitˡ bot = refl
⊗t-unitˡ (val a) = refl
⊗t-unitˡ top = refl

⊗t-unitʳ : ∀ a → a ⊗t val 0 ≡ a
⊗t-unitʳ bot = refl
⊗t-unitʳ (val a) = cong val (+-identityʳ a)
⊗t-unitʳ top = refl

⊗t-comm : ∀ a b → a ⊗t b ≡ b ⊗t a
⊗t-comm bot bot = refl
⊗t-comm bot (val b) = refl
⊗t-comm bot top = refl
⊗t-comm (val a) bot = refl
⊗t-comm (val a) (val b) = cong val (+-comm a b)
⊗t-comm (val a) top = refl
⊗t-comm top bot = refl
⊗t-comm top (val b) = refl
⊗t-comm top top = refl

----------------------------------------------------------------------
-- The instance, and its layers
MaxPlusTop : ResourceAlgebra
MaxPlusTop = record
{ Grade = Grade
; _⊕_ = _⊕t_
; _⊗_ = _⊗t_
; 𝟘 = bot
; 𝟙 = val 0
; alt = record { assoc = ⊕t-assoc ; comm = ⊕t-comm ; idem = ⊕t-idem ; unitˡ = λ _ → refl }
; seq = record { assoc = ⊗t-assoc ; unitˡ = ⊗t-unitˡ ; unitʳ = ⊗t-unitʳ }
}

MaxPlusTop-dioid : IsDioid MaxPlusTop
MaxPlusTop-dioid = record { distribˡ = distribˡ ; distribʳ = distribʳ }
where
distribˡ : ∀ a b c → a ⊗t (b ⊕t c) ≡ (a ⊗t b) ⊕t (a ⊗t c)
distribˡ bot b c = refl
distribˡ (val a) bot c = refl
distribˡ (val a) (val b) bot = refl
distribˡ (val a) (val b) (val c) = cong val (+-distribˡ-max a b c)
distribˡ (val a) (val b) top = refl
distribˡ (val a) top c = refl
distribˡ top bot c = refl
distribˡ top (val b) bot = refl
distribˡ top (val b) (val c) = refl
distribˡ top (val b) top = refl
distribˡ top top c = refl

distribʳ : ∀ a b c → (a ⊕t b) ⊗t c ≡ (a ⊗t c) ⊕t (b ⊗t c)
distribʳ a b c =
trans (⊗t-comm (a ⊕t b) c)
(trans (distribˡ c a b) (cong₂ _⊕t_ (⊗t-comm c a) (⊗t-comm c b)))

MaxPlusTop-ordered : IsOrdered MaxPlusTop
MaxPlusTop-ordered = IsDioid.ordered MaxPlusTop-dioid

MaxPlusTop-annihilating : IsAnnihilating MaxPlusTop
MaxPlusTop-annihilating = record { annihilˡ = λ _ → refl ; annihilʳ = annihilʳ }
where
annihilʳ : ∀ a → a ⊗t bot ≡ bot
annihilʳ bot = refl
annihilʳ (val _) = refl
annihilʳ top = refl
Loading
Loading