Skip to content

Commit 4238ded

Browse files
Claude/echo types theory docs (#15)
* Add Echo Types theory documentation pack Five structured markdown documents under docs/echo-types/ that develop Echo Types as a reusable theory of residual information after non-injective computation. Parallel-work product: produces no code in the Agda suite and does not depend on the current Buchholz well-foundedness block (--without-K shared-binder pattern-matching limitation on claude/buchholz-order-def). Files and rough scope: overview.md (126 lines) Working definition. Current Agda anchor (Echo f y as a fiber). Loss / residue pairing. Extensional shadow vs intensional core as the load-bearing distinction for the rest of the pack. taxonomy.md (215 lines) Seven axes: extensional/intensional, exact/approximate, local/global, canonical/presentation-dependent, compositional/non-compositional, static/dynamic, proof-relevant/proof-irrelevant. Cross-classification table placing existing Agda modules on each axis. Open candidate axes (reversibility, topological, category-of-loss). examples.md (223 lines) Ten worked cases using a single template (source map / what is lost / what remains / echo / ext vs int / reference): 1. Sign loss under squaring (Agda-backed) 2. Boolean component forgetting (Agda-backed) 3. Quotient by equivalence (Agda-backed) 4. Cantor normal form canonicalisation (Agda-backed) 5. Database GROUP BY (informal) 6. Lossy numerical truncation (informal, approximate) 7. Ordinal collapse (Agda-backed via EchoOrdinal) 8. Cryptographic hash (informal; forces the computational- access axis that current taxonomy does not cover) 9. Parser error recovery (informal; presentation-dependent) 10. Abstract interpretation (informal) Cross-cutting observations connecting examples to axes. composition.md (216 lines) Central question: how does Echo(g ∘ f) relate to Echo(f) and Echo(g)? Settles accumulation as the base case (backed by the existing map-over / map-over-comp evidence; formal iso is a named next milestone). Shadow-level weakening vs intensional accumulation. Six open questions (2-category shape, negative / co-echoes, approximate-composition tolerance calculus, pentagon coherence, decoration-commuting, recovery interaction). Ranked list of what to formalise next. roadmap.md (188 lines) Splits work by dependency on two named bottlenecks: B1. --without-K shared-binder block on Buchholz _<ᵇ_. B2. Tool-scope limits on maa-framework / januskey / absolute-zero. Four panels (theory / formalisation / example / application) mark every item as [unblocked], [gated on B1], or [gated on B2]. Suggests an honest 4-5 day immediate ordering and a 3-4 week parallel-work pack that does not touch any blocked path. Deliberate non-goals: * No overwriting of existing docs. Existing adjacency notes, buchholz-plan.adoc, assessment.adoc, and the CNO / Janus bridge docs are untouched. * No new Agda modules in this commit. Every Agda-facing item in roadmap.md is a named next milestone on a separate branch. * No release-tag gating. v0.2 and future tags remain decided on actual landed content. Verification: no code touched; no compile step required for this commit. Repo continues to compile green on main (All.agda + Smoke exit 0; the audit in the current session had already verified this). https://claude.ai/code/session_01JRLz84fAaWvRBKyXuc4tyK * Add axis 8 (information-theoretic vs computational access) Promotes the computational-access candidate from the "worth considering" section in taxonomy.md to a full numbered axis, with the same structural template used for axes 1-7 (definition, distinguishing test, forcing example, Agda anchor, candidate refinements, composition conjecture). The axis is motivated by the cryptographic-hash example (examples.md §8) which cannot be distinguished from a constructive square-root by any of axes 1-7: both have the same extensional shadow, intensional core, exactness, locality, canonicity, compositionality, static-ness, and proof-relevance. The only real distinction is whether a witness can be extracted in feasible resources — which axes 1-7 do not name. Four candidate refinements of `Echo` are listed for future formalisation, roughly in increasing weight: 1. Cost-indexed echo: pair Echo f y with a witness-extraction bound. 2. Graded access modality: Echo^c f y at grade c meaning "reachable within c steps"; natural host is EchoGraded.agda. 3. Decidability-respecting echo: Echo⁺ f y = Dec (Echo f y); separates mathematically-inhabited from feasibly-decidable. 4. Witness-search abstract machine: model the extractor as a term in a bounded-step machine. The four probably live on a small lattice of access-tracking theories rather than being subsumed by a single definition. Downstream updates in this commit: * examples.md §8 points to taxonomy.md axis 8 instead of treating the axis as a todo. * The cross-classification table in taxonomy.md adds an `Access` column; every current module is uniformly `Info` (information- theoretic only) with `EchoLinear` and `EchoGraded` marked `Info (proxy)` since their usage/grade semantics approximate cost-tracking without committing to an algorithmic interpretation. * The "Open: new axes" section in taxonomy.md has a history note explaining the promotion. * roadmap.md marks axis 8 [landed] and its immediate-ordering item now reads "pick one axis-8 refinement and formalise it". No code is changed. Theory-only update. https://claude.ai/code/session_01JRLz84fAaWvRBKyXuc4tyK --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9864b0a commit 4238ded

5 files changed

Lines changed: 1076 additions & 0 deletions

File tree

docs/echo-types/composition.md

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
# Echo Types — Composition
2+
3+
**Status:** working note mixing established results and open
4+
conjectures. Every result backed by the current Agda development is
5+
marked *Agda-backed*; every conjectural claim is labelled explicitly.
6+
7+
---
8+
9+
## The central question
10+
11+
Given `f : A → B` and `g : B → C`, how does `Echo(g ∘ f) : C → Set`
12+
relate to `Echo(f) : B → Set` and `Echo(g) : C → Set`?
13+
14+
Three candidate answers to rule between:
15+
16+
1. **Accumulation.** The echoes stack: `Echo(g ∘ f) y` factors as
17+
`(Echo(f) b × Echo(g) y)` integrated over intermediates `b`.
18+
2. **Weakening.** The echo of `g ∘ f` is *strictly less informative*
19+
than `Echo(f)` alone — composition can only lose more.
20+
3. **Cancellation.** When `g` has a section, `Echo(g ∘ f)` is
21+
isomorphic to `Echo(f)`.
22+
23+
The current Agda evidence strongly favours **accumulation** as the
24+
base case and **cancellation** as a corollary. Weakening is true at
25+
the shadow level but not generally at the intensional core.
26+
27+
---
28+
29+
## Accumulation — Agda-backed (base case)
30+
31+
*Lemma.* For `f : A → B` and `g : B → C`, the type
32+
`Echo(g ∘ f) y` is canonically isomorphic to
33+
`Σ B (λ b → Echo(f) b × (g b ≡ y))`.
34+
35+
*Proof sketch.* Σ-associativity plus propositional-equality
36+
rearrangement. In Agda terms, given
37+
```
38+
Echo f b = Σ A (λ x → f x ≡ b)
39+
Echo g y = Σ B (λ b → g b ≡ y)
40+
Echo (g ∘ f) y = Σ A (λ x → g (f x) ≡ y)
41+
```
42+
the iso is witnessed by
43+
```
44+
to : Σ A (λ x → g (f x) ≡ y) → Σ B (λ b → Σ A (λ x → f x ≡ b) × (g b ≡ y))
45+
to (x , p) = (f x , (x , refl) , p)
46+
from : Σ B (λ b → Σ A (λ x → f x ≡ b) × (g b ≡ y)) → Σ A (λ x → g (f x) ≡ y)
47+
from (b , (x , refl) , p) = (x , p)
48+
```
49+
and both round-trips are `refl`. Formalisation is routine and not
50+
yet in the repo; it is the cleanest candidate for the next
51+
composition lemma to land.
52+
53+
*Agda adjacency.* `Echo.map-over-comp` proves functoriality of the
54+
derived action on echoes; this is the morphism side of the same
55+
composition law. The *object-side* isomorphism above is not yet
56+
proved but is a straightforward next milestone.
57+
58+
---
59+
60+
## Cancellation — expected corollary
61+
62+
*Conjecture.* If `g : B → C` has a section `s : C → B` with
63+
`g ∘ s ≡ id`, then `Echo(g ∘ f) y ≃ Echo(f) (s y)` for every `y`.
64+
65+
*Rationale.* Composing with an injection loses no information, so
66+
the intermediate factor in the accumulation law collapses to a
67+
single witnessed point.
68+
69+
*Status.* Not proved. Depends on the accumulation isomorphism plus
70+
a section lemma that the current repo has pieces of (see
71+
`no-section-weaken` in `EchoLinear` for the negative direction).
72+
73+
---
74+
75+
## Weakening — true at the shadow, false at the core
76+
77+
*Observation (Agda-backed).* At the extensional shadow,
78+
`Shadow(g ∘ f) ⊆ Shadow(g)`, because `image(g ∘ f) ⊆ image(g)`. So
79+
at the shadow level, composition weakens: you cannot learn more
80+
after an additional forgetful step.
81+
82+
*Counter at the core.* At the intensional core, `Echo(g ∘ f) y` can
83+
carry *more* witness structure than `Echo(g) y` alone — specifically,
84+
it records which `b ∈ Echo(g) y` came via `f`. This is the content
85+
of the accumulation iso above: the composed echo is the sum-total,
86+
not just the outer fiber.
87+
88+
*Summary.* Weakening is a shadow-level phenomenon. At the core,
89+
composition *accumulates* witnesses rather than losing them.
90+
91+
---
92+
93+
## Open questions
94+
95+
### Q1. 2-categorical structure
96+
97+
*Question.* Is there a 2-category whose objects are types, whose
98+
1-morphisms are maps, and whose 2-morphisms are echo-preserving
99+
transformations? `EchoCategorical.agda` hints at this but does not
100+
commit to a full 2-categorical axiomatisation.
101+
102+
*Why it matters.* If yes, the composition laws are the coherence
103+
laws of the 2-category. If no, the composition laws are ad-hoc and
104+
probably a sign the residue structure is subtler than we modelled.
105+
106+
### Q2. Negative echoes
107+
108+
*Question.* Is there a systematic dual to `Echo(f)` — call it
109+
`CoEcho(f)` — that records *what has been lost* rather than what
110+
remains? For a linear map this would correspond to the kernel; for
111+
a general map, to a typed analogue of the fibre-wise "information
112+
loss".
113+
114+
*Candidate.* `CoEcho(f)(y) = (something like) "equivalence class of
115+
preimages of y modulo identity"`. The tropical / metric echo
116+
(`EchoTropical.agda`) may be the first instance.
117+
118+
*Status.* Speculative. Worth developing alongside approximate
119+
echoes.
120+
121+
### Q3. Composition of approximate echoes
122+
123+
*Question.* Under the approximate-echo definition (taxonomy,
124+
axis 2), does composition give a clean tolerance calculus?
125+
126+
*Conjecture.* For metric-tolerance echoes,
127+
`ε₁-echo(f) ⊙ ε₂-echo(g) ⊑ (ε₁ + L_g · ε₂)-echo(g ∘ f)` where `L_g`
128+
is a Lipschitz constant of `g`. This is a crude first guess — the
129+
right form may involve sup-norms, dilation-operators, or
130+
coarser bounds.
131+
132+
*Status.* Entirely speculative. Requires a formal definition of
133+
approximate echo first.
134+
135+
### Q4. Associativity
136+
137+
*Question.* Does the accumulation isomorphism above satisfy the
138+
pentagon coherence for three-fold composition? I.e., for
139+
`f : A → B`, `g : B → C`, `h : C → D`, does the two ways of
140+
associating `Echo((h ∘ g) ∘ f) = Echo(h ∘ (g ∘ f))` yield equivalent
141+
iso's?
142+
143+
*Expectation.* Yes, but the proof requires the iso to land as a
144+
`map-over` morphism whose `commute` field is itself proved by
145+
pentagon-style transitivity. `Echo.map-over-comp` already bottles
146+
the relevant shape. Proving pentagon on top is routine but not
147+
written down.
148+
149+
### Q5. Interaction with role-indexing, gradings, linearity
150+
151+
*Question.* The existing repo modules `EchoIndexed`, `EchoGraded`,
152+
`EchoLinear` each decorate the basic echo with extra structure
153+
(role index, grade label, mode tag). Does composition commute with
154+
these decorations, or do some decorations require refined
155+
composition laws?
156+
157+
*Evidence.* `EchoGraded.degrade-comp` is the first hint of a
158+
graded-composition law. Linear echoes via `EchoLinear.weaken` behave
159+
by weakening along mode transitions. No systematic cross-check
160+
between these decorations has been attempted.
161+
162+
### Q6. Composition in the presence of recovery / echo-erasure
163+
164+
*Question.* When a downstream stage "uses" the echo — extracts the
165+
preimage `x` and re-applies `f` to reconstruct `y` — the echo is
166+
temporarily made definite. Does the composition law respect this
167+
extraction?
168+
169+
*Formalisation hint.* Probably expressible as a 2-cell in the
170+
hypothetical 2-category of Q1. Not attempted.
171+
172+
---
173+
174+
## Composition laws — a compact statement
175+
176+
Collecting the above:
177+
178+
1. **(Agda-backed) Base accumulation iso.**
179+
`Echo(g ∘ f) y ≃ Σ B (λ b → Echo(f) b × (g b ≡ y))`.
180+
181+
2. **(Agda-backed) Functorial action.** `map-over` respects
182+
composition: `map-over (g' , c₁) ∘ map-over (f' , c₂) ≡ map-over
183+
((g' ∘ f') , coherence)`. Proved in `Echo.map-over-comp`.
184+
185+
3. **(Expected) Cancellation.** `Echo(g ∘ f) y ≃ Echo(f) (s y)` when
186+
`g` has a section `s`.
187+
188+
4. **(Open) Pentagon.** Three-fold composition associates.
189+
190+
5. **(Open) Tolerance calculus.** For approximate echoes, tolerances
191+
compose with a Lipschitz-like law.
192+
193+
6. **(Open) Decoration commuting.** Role, grade, linearity, and
194+
modal decorations commute with composition under conditions to be
195+
identified.
196+
197+
---
198+
199+
## What to formalise next
200+
201+
Ranked by unblock-value:
202+
203+
1. **Base accumulation iso.** Single Agda proof, no new modules
204+
needed. Would add `Echo-comp-iso` to `Echo.agda`.
205+
2. **Cancellation corollary.** One paragraph on top of (1).
206+
3. **Pentagon coherence.** Moderate proof, probably one more lemma.
207+
4. **Approximate-echo skeleton.** New module
208+
`EchoApprox.agda` defining ε-echoes and restating (1) in the
209+
approximate setting. This is where axis 2 of the taxonomy gets
210+
teeth.
211+
5. **Decoration commuting.** Per-decoration lemmas in the existing
212+
`EchoGraded`, `EchoLinear`, `EchoIndexed` modules.
213+
214+
None of these depend on the blocked Buchholz-WF / shared-binder
215+
work. All are Sonnet-class proofs; (4) is Opus 4.7 design and
216+
Sonnet execution.

0 commit comments

Comments
 (0)