Skip to content

Commit 0538283

Browse files
committed
agda: make CNO echo bridge relation-first
1 parent e80c5fb commit 0538283

4 files changed

Lines changed: 49 additions & 11 deletions

File tree

absolute-zero/README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ Agda bridge note:
211211

212212
* `proofs/agda/EchoBridgeScaffold.agda` is now present as a compile-safe adapter layer to connect CNO identity witnesses to the echo/fiber shape used in `echo-types`.
213213
* `proofs/agda/EchoBridgeCNO.agda` now provides a concrete `Program`/`eval` model instantiation into that scaffold.
214-
* This concrete bridge currently uses a function-extensionality parameter to convert `state-eq` into propositional equality for `Echo`.
214+
* The concrete bridge now exposes relation-based echoes over `state-eq` directly; function extensionality is only used for optional propositional `Echo` corollaries.
215215

216216
**Coq Proof Status** (2026-02-05): 81 Qed / 19 Admitted / 6 Defined / 63 Axioms across 10 files. 4 files fully complete (CNO.v, CNOCategory.v, StatMech.v, StatMech_helpers.v).
217217

absolute-zero/proofs/agda/EchoBridgeCNO.agda

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- Concrete Echo/CNO instantiation against CNO.Program and CNO.eval.
22
--
3-
-- Note: CNO identity is phrased as state-eq, so we parameterize by
4-
-- function extensionality to recover propositional equality of states.
3+
-- Primary bridge: use CNO.state-eq directly as the relation in EchoRel.
4+
-- Secondary bridge: recover propositional equality with extensionality.
55

66
module EchoBridgeCNO where
77

@@ -11,7 +11,28 @@ open import Relation.Binary.PropositionalEquality using (_≡_; refl)
1111
open import Axiom.Extensionality.Propositional using (Extensionality)
1212

1313
import CNO
14-
open import EchoBridgeScaffold using (CNOModel; Echo; echo-from-cno)
14+
open import EchoBridgeScaffold using
15+
( CNOModel
16+
; Echo
17+
; EchoRel
18+
; echo-from-cno
19+
; echo-from-rel
20+
)
21+
22+
echo-from-cno-program-rel :
23+
(p : CNO.Program)
24+
CNO.IsCNO p
25+
(s : CNO.ProgramState)
26+
EchoRel (CNO.eval p) CNO.state-eq s
27+
echo-from-cno-program-rel p cno s =
28+
echo-from-rel (CNO.eval p) CNO.state-eq s s
29+
(CNO.IsCNO.cno-identity cno s)
30+
31+
absolute-zero-echo-rel :
32+
(s : CNO.ProgramState)
33+
EchoRel (CNO.eval CNO.absolute-zero) CNO.state-eq s
34+
absolute-zero-echo-rel s =
35+
echo-from-cno-program-rel CNO.absolute-zero CNO.absolute-zero-is-cno s
1536

1637
state-eq→≡ :
1738
Extensionality zero zero
@@ -30,18 +51,18 @@ program-state-model ext = record
3051
state-eq→≡ ext (CNO.IsCNO.cno-identity cno s)
3152
}
3253

33-
echo-from-cno-program :
54+
echo-from-cno-program-≡ :
3455
(ext : Extensionality zero zero)
3556
(p : CNO.Program)
3657
CNO.IsCNO p
3758
(s : CNO.ProgramState)
3859
Echo (CNO.eval p) s
39-
echo-from-cno-program ext p cno s =
60+
echo-from-cno-program-≡ ext p cno s =
4061
echo-from-cno (program-state-model ext) p cno s
4162

42-
absolute-zero-echo :
63+
absolute-zero-echo-≡ :
4364
(ext : Extensionality zero zero)
4465
(s : CNO.ProgramState)
4566
Echo (CNO.eval CNO.absolute-zero) s
46-
absolute-zero-echo ext s =
47-
echo-from-cno-program ext CNO.absolute-zero CNO.absolute-zero-is-cno s
67+
absolute-zero-echo-≡ ext s =
68+
echo-from-cno-program-≡ ext CNO.absolute-zero CNO.absolute-zero-is-cno s

absolute-zero/proofs/agda/EchoBridgeScaffold.agda

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,21 @@ open import Agda.Builtin.Unit using (⊤; tt)
1616
Echo : {a b} {A : Set a} {B : Set b} (A B) B Set (a ⊔ b)
1717
Echo {A = A} f y = Σ A (λ x f x ≡ y)
1818

19+
-- Relation-indexed fiber shape, useful when identity is stated up to
20+
-- a semantic relation instead of propositional equality.
21+
EchoRel :
22+
{a b r} {A : Set a} {B : Set b}
23+
(A B) (B B Set r) B Set (a ⊔ r)
24+
EchoRel {A = A} f _≈_ y = Σ A (λ x _≈_ (f x) y)
25+
26+
echo-from-rel :
27+
{a b r} {A : Set a} {B : Set b}
28+
(f : A B) (_≈_ : B B Set r)
29+
(x : A) (y : B)
30+
_≈_ (f x) y
31+
EchoRel f _≈_ y
32+
echo-from-rel _ _ x _ rel = x , rel
33+
1934
-- Minimal interface needed to connect a CNO model to echoes.
2035
record CNOModel {ℓs ℓo : Level} (State : Set ℓs) : Set (lsuc (ℓs ⊔ ℓo)) where
2136
field

absolute-zero/proofs/agda/README.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,10 @@ This module imports `CNO.agda` and instantiates `CNOModel` concretely with:
2626
* `IsCNO = IsCNO`
2727

2828
Because `CNO.cno-identity` is phrased as `state-eq` (with function-valued memory),
29-
the bridge takes a function-extensionality parameter to derive propositional
30-
state equality for `Echo`.
29+
the bridge provides two layers:
30+
31+
* primary: relation-based echoes via `EchoRel ... CNO.state-eq` (no extensionality needed);
32+
* secondary: propositional `Echo` corollaries via a function-extensionality parameter.
3133

3234
== Integration plan
3335

0 commit comments

Comments
 (0)