Skip to content

Commit afa0e03

Browse files
Claude/fix dirty orphans (#10)
* Delete duplicate broken orphan modules These three modules were committed in 8b8fc03 ("further proofing bridges") but never compiled and duplicated functionality already covered by in-suite modules: * EchoCategory.agda (58 sigs, 0 data) — duplicate of EchoCategorical.agda; had self-shadowing `_→_` and `_∘_` definitions that parse-errored. * EchoCNO.agda (8 sigs) — duplicate of EchoCNOBridge.agda; used invalid `Σ (x : A) (λ _ → ...)` binder syntax and had a dangling top-level `where` clause. * EchoJanusSimple.agda (9 sigs) — duplicate of EchoJanusBridge.agda; same invalid `Σ (x : A) (...)` binder syntax. Nothing in the verified suite (All.agda) imported any of them. Deleting them removes silently-broken Agda from the tree without changing what compiles. https://claude.ai/code/session_01JRLz84fAaWvRBKyXuc4tyK * Fix DyadicEchoBridge universe error and wire in Dyadic Three defects kept this file from typechecking: 1. Lines 29-32, 42: the body `Echo (λ _ → ⊤) ⊤` conflated the unit *type* (⊤ : Set) with the unit *value* (tt : ⊤). Echo expects a function A → B and a value y : B, not a function into Set. Changed to `Echo {A = ⊤} (λ _ → tt) tt` — pinning A explicitly because the inferred source type is not constrained anywhere else. 2. ProtocolProvenance pattern-matched on a SessionEcho input whose type depends on the Session constructor. The End case has type ⊤, not Echo, so the single-clause catch-all "ProtocolProvenance echo = echo" could not typecheck. Split into five clauses, synthesising a canonical Echo in the End case via echo-intro. 3. ProvenancePreservation returned the left echo verbatim, but its type was SessionEcho at (S1 >>= S2) rather than at S1. Pattern- match on S1 and synthesise a fresh canonical echo at the concatenated head; pass the right-hand echo through when S1 = End. Also wired Dyadic + DyadicEchoBridge into All.agda so they join the verified suite and cannot silently regress again. https://claude.ai/code/session_01JRLz84fAaWvRBKyXuc4tyK * Rewrite EchoThermodynamics to minimum viable compile The previous file failed to typecheck in ~15 places: missing imports (∃, Fin, _≤_, _≃_, proj₁, proj₂, sym, _-_, if-then-else), detached top-level `where` clauses, chained `≤` that doesn't parse as written, reversible-echo-preservation using _≃_ without importing it, a self-assigning nested export module, and theorem bodies such as "echo-to-cno-thermodynamic-mapping" that branched on a proof value as if it were a Bool. Rather than salvage each aspirational theorem, this commit strips the module to the claims it can actually discharge: * Thermodynamic types (Temperature, Energy, Information, Entropy) as ℕ. * Landauer's bit-erasure energy `landauer-energy T = k * T`. * A simplified `FiberSize` (always 1) with matching `fiber-energy` and `echo-energy-cost`. * A concrete CNO model `cno-identity = id` on ProgramState. * Three zero-cost lemmas at temperature zero: - `cno-fiber-size s ≡ 1` - `fiber-energy cno-identity s 0 ≡ 0` - `echo-energy-cost f x 0 ≡ 0` Dropped but documented in-file as not-yet-discharged: CNO zero energy at non-zero T (needs real fiber enumeration), involution-based reversible-echo preservation (needs _≃_ plumbing), energy hierarchy (needs a `≤` relation and non-trivial FiberSize), CNO-detection predicates (need decidable equality on energies). Wired into All.agda. https://claude.ai/code/session_01JRLz84fAaWvRBKyXuc4tyK * Rewrite EchoStabilityTests against surviving modules The previous file cross-linked four modules. Three of them (EchoCategory, EchoCNO, EchoCNO's thermodynamic mapping) were deleted or rewritten in earlier commits on this branch, leaving roughly 75 % of the tests pointing at missing symbols. On top of that the file itself never typechecked — bad Σ-binder syntax, bogus `where` at top level, self-assigning export module. Rewrite strategy: keep only tests that lock upstream shapes via refl against modules we still ship, document the dropped sections in comments so follow-up work can repopulate them. The surviving tests are: Section 1 (Echo core) echo-intro-fst — proj₁ of echo-intro lands at the supplied x map-over-fst — map-over advances the first component by u map-over-id-check — map-over with identity is the identity Section 2 (thermodynamic core) cno-fiber-is-one — the CNO fiber proof is refl cno-zero-T-check — fiber-energy of CNO at T=0 is 0 echo-cost-zero-T-check — echo-energy-cost of any f at T=0 is 0 Dropped sections (noted in-file for future work): universal-CNO / categorical equivalence (needs EchoCategorical API parity), CNO-singleton equivalence (needs tests against EchoCNOBridge's CNOEcho/nullop-echo), thermodynamic optimality / hierarchy (needs non-trivial FiberSize and a _≤_ on energies). Wired into All.agda. https://claude.ai/code/session_01JRLz84fAaWvRBKyXuc4tyK --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent f84c03b commit afa0e03

7 files changed

Lines changed: 157 additions & 911 deletions

File tree

proofs/agda/All.agda

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ open import EchoCategorical
2222
open import EchoScope
2323
open import EchoOrdinal
2424
open import EchoJanusBridge
25+
open import Dyadic
26+
open import DyadicEchoBridge
27+
open import EchoThermodynamics
28+
open import EchoStabilityTests
2529

2630
open import Ordinal.Base
2731
open import Ordinal.Closure

proofs/agda/DyadicEchoBridge.agda

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,25 @@ SessionAsFunction {p} (Select S1 S2) q = SessionAsFunction S1 q ⊎ SessionAsFun
2626
-- Simplified echo over session types (avoiding universe issues)
2727
SessionEcho : {p} (q : Party) Session p Set
2828
SessionEcho q End =
29-
SessionEcho q (Send A S) = Echo (λ _ ⊤) ⊤
30-
SessionEcho q (Recv A S) = Echo (λ _ ⊤) ⊤
31-
SessionEcho q (Choice S1 S2) = Echo (λ _ ⊤) ⊤
32-
SessionEcho q (Select S1 S2) = Echo (λ _ ⊤) ⊤
29+
SessionEcho q (Send A S) = Echo {A = ⊤} (λ _ tt) tt
30+
SessionEcho q (Recv A S) = Echo {A = ⊤} (λ _ tt) tt
31+
SessionEcho q (Choice S1 S2) = Echo {A = ⊤} (λ _ tt) tt
32+
SessionEcho q (Select S1 S2) = Echo {A = ⊤} (λ _ tt) tt
3333

3434
-- Example: Echo over Alice's send protocol
3535
AliceSendEcho : SessionEcho Alice AliceSendsUnit
36-
AliceSendEcho = echo-intro (λ _ tt) tt
37-
38-
-- Protocol provenance: echo retains session structure
39-
ProtocolProvenance : {p} {S : Session p} {q : Party}
40-
SessionEcho q S Echo (λ _ ⊤) ⊤
41-
ProtocolProvenance echo = echo
36+
AliceSendEcho = echo-intro {A = ⊤} (λ _ tt) tt
37+
38+
-- Protocol provenance: echo retains session structure. For non-End
39+
-- sessions SessionEcho q S is already Echo {A = ⊤} (λ _ → tt) tt; for End it
40+
-- is ⊤ and we synthesize the canonical echo.
41+
ProtocolProvenance : {p} {S : Session p} {q : Party}
42+
SessionEcho q S Echo {A = ⊤} (λ _ tt) tt
43+
ProtocolProvenance {S = End} _ = echo-intro {A = ⊤} (λ _ tt) tt
44+
ProtocolProvenance {S = Send _ _} echo = echo
45+
ProtocolProvenance {S = Recv _ _} echo = echo
46+
ProtocolProvenance {S = Choice _ _} echo = echo
47+
ProtocolProvenance {S = Select _ _} echo = echo
4248

4349
-- Dyadic echo: session with echo-indexed provenance
4450
DyadicEcho : {p} Session p Set
@@ -50,12 +56,19 @@ AliceSendWithProvenance = Alice , AliceSendEcho
5056

5157
-- Bob's receive protocol with provenance
5258
BobReceiveWithProvenance : DyadicEcho BobReceivesUnit
53-
BobReceiveWithProvenance = Bob , echo-intro (λ _ tt) tt
59+
BobReceiveWithProvenance = Bob , echo-intro {A = ⊤} (λ _ tt) tt
5460

55-
-- Provenance preservation under session concatenation
61+
-- Provenance preservation under session concatenation. We synthesize
62+
-- a fresh echo at the concatenated session, since SessionEcho at a
63+
-- Send/Recv/Choice/Select head is always Echo {A = ⊤} (λ _ → tt) tt and at
64+
-- End it is ⊤.
5665
ProvenancePreservation : {p} {S1 S2 : Session p}
5766
DyadicEcho S1 DyadicEcho S2 DyadicEcho (S1 >>= S2)
58-
ProvenancePreservation (q1 , echo1) (q2 , echo2) = q1 , echo1
67+
ProvenancePreservation {S1 = End} _ (q2 , echo2) = q2 , echo2
68+
ProvenancePreservation {S1 = Send _ _} (q1 , _) _ = q1 , echo-intro {A = ⊤} (λ _ tt) tt
69+
ProvenancePreservation {S1 = Recv _ _} (q1 , _) _ = q1 , echo-intro {A = ⊤} (λ _ tt) tt
70+
ProvenancePreservation {S1 = Choice _ _} (q1 , _) _ = q1 , echo-intro {A = ⊤} (λ _ tt) tt
71+
ProvenancePreservation {S1 = Select _ _} (q1 , _) _ = q1 , echo-intro {A = ⊤} (λ _ tt) tt
5972

6073
-- Echo-safe dyadic protocols: protocols where echoes preserve safety
6174
EchoSafe : {p} Session p Set

proofs/agda/EchoCNO.agda

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)