Skip to content

Commit 282c204

Browse files
feat(proofs/agda): upstream Echo/CNO bridge files from maa-framework vendored copy (#65)
## Summary Upstreams 3 Agda files that exist only in maa-framework's vendored copy of absolute-zero, but self-identify as absolute-zero artefacts. - `proofs/agda/EchoBridgeScaffold.agda` — compile-safe interface (`Echo` Σ-shape, `CNOModel`), intentionally independent of `CNO.agda`. - `proofs/agda/EchoBridgeCNO.agda` — concrete instantiation from `CNO.Program` / `CNO.eval` into the scaffold. - `proofs/agda/README.adoc` — describes the directory. ## Why now Discovered during proof-debt classification triage for maa-framework (filed at hyperpolymath/maa-framework#82, with disposition analysis in hyperpolymath/maa-framework#84). The maa-framework re-vendor (hyperpolymath/maa-framework#83) currently uses `rsync --filter='P ...'` to *preserve* these files across each sync — once they're upstream, that filter becomes redundant. The README.adoc literally titles itself "Agda Proofs (absolute-zero)" and the scaffold header says "Echo/CNO Agda bridge scaffold", so the canonical home is here. ## Trusted-base impact The 3-file set has **zero postulates and zero axioms**. `EchoBridgeCNO.agda` imports `Axiom.Extensionality.Propositional` to obtain the `Extensionality` *type*, which is then accepted as an explicit *module parameter* by downstream functions — not postulated. Documented in `docs/proof-debt.md` under a new "False positives" section to satisfy `check-trusted-base.sh`'s path-enumeration clause. ## Test plan - [ ] `cd proofs/agda && agda EchoBridgeScaffold.agda` typechecks. - [ ] `cd proofs/agda && agda EchoBridgeCNO.agda` typechecks (may need `CNO.agda` build prerequisites). - [ ] `bash scripts/check-trusted-base.sh .` passes (path-enumeration covers the false positive). - [ ] CI green. ## Companion - hyperpolymath/maa-framework#82 — proof-debt schema PR (parallel). - hyperpolymath/maa-framework#83 — re-vendor PR (parallel; this PR removes its need for `rsync --filter='P ...'`). - hyperpolymath/maa-framework#84 — fork-vs-vendor disposition issue (open, owner-decision). - hyperpolymath/standards#203 — trusted-base reduction policy. - hyperpolymath/standards#211 — `check-trusted-base.sh`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 50f32dd commit 282c204

4 files changed

Lines changed: 183 additions & 0 deletions

File tree

docs/proof-debt.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,21 @@ the bottom.
334334
4. The `check-trusted-base` CI job (standards#211) ensures markers
335335
are never un-annotated AND un-enumerated simultaneously.
336336
337+
## False positives (no markers; script over-matches)
338+
339+
### `proofs/agda/EchoBridgeCNO.agda` — `Axiom.Extensionality` import
340+
341+
`check-trusted-base.sh`'s grep matches the line
342+
`open import Axiom.Extensionality.Propositional using (Extensionality)`
343+
at L11 as if it were an axiom declaration. It is not — it imports the
344+
`Extensionality` type, which is then accepted as an *explicit module
345+
parameter* by every downstream function that needs it
346+
(`program-state-model`, `program-rel-bridge`, etc.). The file
347+
introduces zero postulates and zero axioms; extensionality is
348+
propagated from the caller as a hypothesis.
349+
350+
Listed here to satisfy the script's path-enumeration clause.
351+
337352
## Companion documents
338353
339354
- [standards#195](https://github.com/hyperpolymath/standards/pull/195) — estate proof-debt audit.

proofs/agda/EchoBridgeCNO.agda

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
-- Concrete Echo/CNO instantiation against CNO.Program and CNO.eval.
2+
--
3+
-- Primary bridge: use CNO.state-eq directly as the relation in EchoRel.
4+
-- Secondary bridge: recover propositional equality with extensionality.
5+
6+
module EchoBridgeCNO where
7+
8+
open import Level using (zero)
9+
open import Data.Product using (_,_)
10+
open import Relation.Binary.PropositionalEquality using (_≡_; refl)
11+
open import Axiom.Extensionality.Propositional using (Extensionality)
12+
13+
import 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
36+
37+
state-eq→≡ :
38+
Extensionality zero zero
39+
{s₁ s₂ : CNO.ProgramState}
40+
CNO.state-eq s₁ s₂ s₁ ≡ s₂
41+
state-eq→≡ ext {CNO.mk-state m₁ r₁ i₁ pc₁} {CNO.mk-state m₂ r₂ i₂ pc₂}
42+
(m-eq , r-eq , io-eq , pc-eq)
43+
rewrite ext m-eq | r-eq | io-eq | pc-eq = refl
44+
45+
program-state-model : Extensionality zero zero CNOModel CNO.ProgramState
46+
program-state-model ext = record
47+
{ Op = CNO.Program
48+
; run = CNO.eval
49+
; IsCNO = CNO.IsCNO
50+
; cno-identity = λ cno s
51+
state-eq→≡ ext (CNO.IsCNO.cno-identity cno s)
52+
}
53+
54+
echo-from-cno-program-≡ :
55+
(ext : Extensionality zero zero)
56+
(p : CNO.Program)
57+
CNO.IsCNO p
58+
(s : CNO.ProgramState)
59+
Echo (CNO.eval p) s
60+
echo-from-cno-program-≡ ext p cno s =
61+
echo-from-cno (program-state-model ext) p cno s
62+
63+
absolute-zero-echo-≡ :
64+
(ext : Extensionality zero zero)
65+
(s : CNO.ProgramState)
66+
Echo (CNO.eval CNO.absolute-zero) s
67+
absolute-zero-echo-≡ ext s =
68+
echo-from-cno-program-≡ ext CNO.absolute-zero CNO.absolute-zero-is-cno s
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{-# OPTIONS --safe --without-K #-}
2+
3+
-- Echo/CNO Agda bridge scaffold.
4+
--
5+
-- This module is intentionally independent from `CNO.agda` so it can
6+
-- stay typecheckable while that file is still being completed.
7+
8+
module EchoBridgeScaffold where
9+
10+
open import Agda.Primitive using (Level; lsuc; _⊔_)
11+
open import Agda.Builtin.Equality using (_≡_; refl)
12+
open import Agda.Builtin.Sigma using (Σ; _,_)
13+
open import Agda.Builtin.Unit using (⊤; tt)
14+
15+
-- Canonical echo/fiber shape used by echo-types.
16+
Echo : {a b} {A : Set a} {B : Set b} (A B) B Set (a ⊔ b)
17+
Echo {A = A} f y = Σ A (λ x f x ≡ y)
18+
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+
34+
-- Minimal interface needed to connect a CNO model to echoes.
35+
record CNOModel {ℓs ℓo : Level} (State : Set ℓs) : Set (lsuc (ℓs ⊔ ℓo)) where
36+
field
37+
Op : Set ℓo
38+
run : Op State State
39+
IsCNO : Op Set (ℓs ⊔ ℓo)
40+
cno-identity : {op} IsCNO op (s : State) run op s ≡ s
41+
42+
open CNOModel public
43+
44+
-- Any CNO witness yields an echo at any visible state.
45+
echo-from-cno :
46+
{ℓs ℓo} {State : Set ℓs}
47+
(M : CNOModel {ℓs} {ℓo} State)
48+
(op : Op M) IsCNO M op
49+
(s : State) Echo (run M op) s
50+
echo-from-cno M op cno s = s , cno-identity M cno s
51+
52+
-- A tiny closed model kept here as a local smoke witness.
53+
TrivialModel : CNOModel ⊤
54+
TrivialModel = record
55+
{ Op =
56+
; run = λ _ s s
57+
; IsCNO = λ _
58+
; cno-identity = λ _ _ refl
59+
}
60+
61+
trivial-echo : Echo (run TrivialModel tt) tt
62+
trivial-echo = echo-from-cno TrivialModel tt tt tt

proofs/agda/README.adoc

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
= Agda Proofs (absolute-zero)
2+
3+
This directory currently contains:
4+
5+
* `CNO.agda` — main Agda CNO development (compiles locally).
6+
* `EchoBridgeScaffold.agda` — compile-safe interface layer for bridging CNO identity witnesses to the echo/fiber shape used in `echo-types`.
7+
* `EchoBridgeCNO.agda` — concrete model instantiation from `CNO.Program` / `eval` into the scaffold interface.
8+
9+
== Purpose of `EchoBridgeScaffold.agda`
10+
11+
The scaffold avoids importing `CNO.agda` directly so this bridge path can
12+
remain typecheckable while `CNO.agda` is still being completed.
13+
14+
It provides:
15+
16+
* `Echo` as `Σ x , f x ≡ y`.
17+
* `CNOModel` interface with `run`, `IsCNO`, and `cno-identity`.
18+
* `echo-from-cno` conversion from a CNO witness to an echo witness.
19+
20+
== Purpose of `EchoBridgeCNO.agda`
21+
22+
This module imports `CNO.agda` and instantiates `CNOModel` concretely with:
23+
24+
* `Op = Program`
25+
* `run = eval`
26+
* `IsCNO = IsCNO`
27+
28+
Because `CNO.cno-identity` is phrased as `state-eq` (with function-valued memory),
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.
33+
34+
== Integration plan
35+
36+
1. Add reciprocal consistency checks against:
37+
* `echo-types` (`proofs/agda/EchoCNOBridge.agda`)
38+
* this repository's Coq/Lean CNO statements.

0 commit comments

Comments
 (0)