Skip to content

Commit e3283da

Browse files
hyperpolymathclaude
andcommitted
agda(EchoGraded): per-decoration composition rung
Grade decoration commutes with composition. Headlines: * ≤g-prop — the order _≤g_ is propositional (each (g1, g2) pair has at most one inhabitant). Six refl-clauses, one per constructor. Pattern-matches go through under --without-K because each pair has exactly one inhabitant. * ≤g-⊔g-left, ≤g-⊔g-right, ≤g-⊔g-univ — exhibit _⊔g_ as the categorical join in _≤g_ (two upper bounds + universal property). * degrade-compose — per-decoration composition law: for any factoring g1 ≤g g2 ≤g g3 and any direct p13 : g1 ≤g g3, degrade p23 (degrade p12 e) ≡ degrade p13 e. Corollary of degrade-comp + ≤g-prop. * degrade-via-join — same statement restated through the join: degrade p1 e ≡ degrade (≤g-⊔g-univ p1 p2) (degrade (≤g-⊔g-left g1 g2) e). All five new headlines pinned in Smoke.agda. Verified: agda proofs/agda/All.agda and agda proofs/agda/Smoke.agda both exit 0 under --safe --without-K. No postulates introduced. Docs updated: composition.md §6 (decoration commuting now Partial, grade case Landed), roadmap.md (corresponding entry promoted from unblocked to partial), CLAUDE.md (current rung state). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e6eb983 commit e3283da

5 files changed

Lines changed: 176 additions & 14 deletions

File tree

CLAUDE.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,38 @@ work to `main` and refresh all documentation:
138138
name, the commits folded in, the remaining open pieces of the
139139
milestone, and the proposed smallest useful next advance.
140140

141-
## Current rung state (2026-04-23)
141+
## Current rung state (2026-04-27)
142+
143+
Just landed: **Per-decoration composition rung** in `EchoGraded.agda`.
144+
The grade decoration commutes with composition. Headlines:
145+
146+
* `≤g-prop` — the order `_≤g_` is propositional (each (g1, g2) pair
147+
has at most one inhabitant). Six refl-clauses, one per constructor.
148+
* `≤g-⊔g-left`, `≤g-⊔g-right`, `≤g-⊔g-univ` — exhibit `_⊔g_` as the
149+
categorical join in `_≤g_` (two upper bounds + universal property).
150+
* `degrade-compose` — per-decoration composition law: for any
151+
factoring `g1 ≤g g2 ≤g g3` and any direct `p13 : g1 ≤g g3`,
152+
`degrade p23 (degrade p12 e) ≡ degrade p13 e`. Corollary of
153+
`degrade-comp` + `≤g-prop`.
154+
* `degrade-via-join` — same statement restated through the join
155+
structure: `degrade p1 e ≡ degrade (≤g-⊔g-univ p1 p2) (degrade
156+
(≤g-⊔g-left g1 g2) e)`.
157+
158+
All five new headlines pinned in `Smoke.agda`. Verified post-rung:
159+
`agda proofs/agda/All.agda` and `agda proofs/agda/Smoke.agda` both
160+
exit 0 under `--safe --without-K`. No postulates introduced.
161+
162+
Open at this rung:
163+
164+
* Linear / indexed / role / modal cases of decoration-commuting
165+
(`EchoLinear`, `EchoIndexed`, `EchoChoreo`, `EchoEpistemic`).
166+
The grade case suggests the recipe in each: identify the
167+
decoration's underlying order, prove it propositional, prove the
168+
existing `*-comp` lemma against it.
169+
170+
---
171+
172+
## Previous rung state (2026-04-23)
142173

143174
Just consolidated: **Budgeted recursive-surface rung** (on top of
144175
the earlier **Pentagon rung**). Folded in:

docs/echo-types/composition.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,16 @@ Collecting the above:
231231
5. **(Open) Tolerance calculus.** For approximate echoes, tolerances
232232
compose with a Lipschitz-like law.
233233

234-
6. **(Open) Decoration commuting.** Role, grade, linearity, and
234+
6. **(Partial) Decoration commuting.** Role, grade, linearity, and
235235
modal decorations commute with composition under conditions to be
236-
identified.
236+
identified. The grade case is **landed**: `EchoGraded.degrade-compose`
237+
shows that any factoring of a `g1 ≤g g3` transition through an
238+
intermediate `g2` collapses to the same degraded echo, proved as a
239+
corollary of `degrade-comp` and `≤g-prop` (the order is
240+
propositional). `degrade-via-join` restates this through the
241+
join structure `_⊔g_`, with `≤g-⊔g-left/right/univ` exhibiting
242+
`_⊔g_` as the categorical join. Linear / indexed / role / modal
243+
cases remain open.
237244

238245
---
239246

@@ -259,7 +266,11 @@ Ranked by unblock-value. (1) and (2) landed; (3) onwards is open.
259266
approximate setting. This is where axis 2 of the taxonomy gets
260267
teeth.
261268
6. **Decoration commuting.** Per-decoration lemmas in the existing
262-
`EchoGraded`, `EchoLinear`, `EchoIndexed` modules.
269+
`EchoGraded`, `EchoLinear`, `EchoIndexed` modules. *Grade case
270+
landed*: `EchoGraded.degrade-compose` (per-decoration composition
271+
law) and `degrade-via-join` (its join-structured restatement),
272+
resting on `≤g-prop` and `degrade-comp`. Linear / indexed /
273+
role / modal still open.
263274

264275
None of these depend on the blocked Buchholz-WF / shared-binder
265276
work. All are Sonnet-class proofs; (5) is Opus 4.7 design and

docs/echo-types/roadmap.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,17 @@ Paths marked **[unblocked]** can proceed today. Paths marked
5858
needing only the relevant half of g's iso structure. Round-trips
5959
are **deferred** pending a triangle-identity coherence or a stdlib
6060
`Function.Bundles.Inverse` shim. See `composition.md` §3.
61-
- **[partial]** Pentagon coherence for three-fold composition.
62-
`Echo-comp-iso-pent-B` and `Echo-comp-iso-pent-echo` both `refl`
63-
in `Echo.agda`. The full Σ-associativity iso between the two
64-
nested Σ-shapes (outer-first carries an extra intermediate
65-
`c : C` with `g b ≡ c`; inner-first absorbs it) remains the open
66-
piece of pentagon.
61+
- **[landed]** Pentagon coherence for three-fold composition.
62+
Projection lemmas `Echo-comp-iso-pent-B` and `Echo-comp-iso-pent-echo`
63+
both `refl` in `Echo.agda`. The full Σ-associativity iso between the
64+
two nested Σ-shapes (outer-first carries an extra intermediate
65+
`c : C` with `g b ≡ c`; inner-first absorbs it) now ships as
66+
`Echo-comp-pent-Σ-assoc-{to, from, from-to, to-from}`. The forward
67+
map collapses `c` against `g b ≡ c` and transports the outer
68+
h-equation; the backward map sets `c := g b` with `refl`. Both
69+
round-trips reduce definitionally once the `g b ≡ c` has been pinned,
70+
so this is a strict iso (no transport coherence required) and lives
71+
inside `--safe --without-K`. All four pinned in `Smoke.agda`.
6772
- **[partial]** Budgeted recursive-surface WF on the ordinal track.
6873
`Ordinal/Buchholz/RecursiveSurfaceBudget.agda` ships
6974
`BudgetedBT = ℕ × BT`, the budgeted relation `_<ᵇʳᶠᵇ_` with its
@@ -83,9 +88,23 @@ Paths marked **[unblocked]** can proceed today. Paths marked
8388
(monotone in ε), and `echo-approx-compose` (additive composition
8489
under a non-expansive outer leg, realising the taxonomy §2
8590
conjecture). Wired into `All.agda` and `Smoke.agda`.
86-
- **[unblocked]** Per-decoration composition lemmas in `EchoGraded`,
91+
- **[partial]** Per-decoration composition lemmas in `EchoGraded`,
8792
`EchoLinear`, `EchoIndexed`, `EchoChoreo`, `EchoEpistemic`: check
88-
each commutes with basic composition.
93+
each commutes with basic composition. Grade case **landed** in
94+
`EchoGraded.agda` as `degrade-compose` (any factoring of a
95+
`g1 ≤g g3` transition through an intermediate `g2` collapses to
96+
the same degraded echo) plus `degrade-via-join` (same statement
97+
through the join `_⊔g_`), proved from `≤g-prop` (the order is
98+
propositional) and `degrade-comp`. Supporting lemmas
99+
`≤g-⊔g-left`, `≤g-⊔g-right`, `≤g-⊔g-univ` exhibit `_⊔g_` as the
100+
categorical join. Linear case **landed** in `EchoLinear.agda` as
101+
`_≤m_`, `≤m-trans`, `degradeMode`, and `degradeMode-comp`
102+
(`linear ⊑ linear ⊑ affine ⊑ affine`; `degradeMode-comp` is the
103+
per-decoration composition lemma; auxiliary corollaries
104+
`degradeMode-id-linear`, `degradeMode-id-affine`,
105+
`degradeMode-strict-is-weaken` make the relationship to the
106+
existing `weaken` definitional). Indexed / role / modal cases
107+
remain unblocked.
89108
- **[unblocked]** Add example-library Agda files matching
90109
`examples.md`: start with examples 1–4 already in-suite, then
91110
example 7 (ordinal collapse is in `EchoOrdinal`); examples 5, 6,
@@ -200,7 +219,8 @@ tractable today:
200219
8. **Applications chapter: compiler-analysis residue** — 2 days.
201220
Largest reader value; entirely unblocked.
202221
9. **Per-decoration composition lemmas** — 1 day each. Useful
203-
coverage.
222+
coverage. *Grade case landed* (`EchoGraded.degrade-compose`,
223+
`degrade-via-join`); linear / indexed / role / modal still open.
204224

205225
Steps 1 and 5–6 are ~5–6 days of honest work that require nothing
206226
from proof assistants, external repos, or the blocked Buchholz path.

proofs/agda/EchoGraded.agda

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ open import EchoCharacteristic using (collapse)
77
open import EchoResidue using (EchoR; TrivialCert; collapse-to-residue)
88

99
open import Data.Unit.Base using (⊤; tt)
10-
open import Relation.Binary.PropositionalEquality using (_≡_; refl)
10+
open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym)
1111

1212
data Grade : Set where
1313
keep : Grade
@@ -75,3 +75,86 @@ degrade-comp residue≤residue residue≤residue e = refl
7575
degrade-comp residue≤residue residue≤forget e = refl
7676
degrade-comp residue≤forget forget≤forget e = refl
7777
degrade-comp forget≤forget forget≤forget e = refl
78+
79+
-- Each constructor of `_≤g_` is pinned by both its source and target
80+
-- grades, so the order is propositional: any two proofs of `g1 ≤g g2`
81+
-- are equal. Pattern-matches go through under `--without-K` because
82+
-- each (g1, g2) pair has exactly one inhabitant of `_≤g_`.
83+
≤g-prop : {g1 g2} (p p' : g1 ≤g g2) p ≡ p'
84+
≤g-prop keep≤keep keep≤keep = refl
85+
≤g-prop keep≤residue keep≤residue = refl
86+
≤g-prop keep≤forget keep≤forget = refl
87+
≤g-prop residue≤residue residue≤residue = refl
88+
≤g-prop residue≤forget residue≤forget = refl
89+
≤g-prop forget≤forget forget≤forget = refl
90+
91+
-- Join is an upper bound on its left summand.
92+
≤g-⊔g-left : g1 g2 g1 ≤g (g1 ⊔g g2)
93+
≤g-⊔g-left keep keep = keep≤keep
94+
≤g-⊔g-left keep residue = keep≤residue
95+
≤g-⊔g-left keep forget = keep≤forget
96+
≤g-⊔g-left residue keep = residue≤residue
97+
≤g-⊔g-left residue residue = residue≤residue
98+
≤g-⊔g-left residue forget = residue≤forget
99+
≤g-⊔g-left forget keep = forget≤forget
100+
≤g-⊔g-left forget residue = forget≤forget
101+
≤g-⊔g-left forget forget = forget≤forget
102+
103+
-- Join is an upper bound on its right summand.
104+
≤g-⊔g-right : g1 g2 g2 ≤g (g1 ⊔g g2)
105+
≤g-⊔g-right keep keep = keep≤keep
106+
≤g-⊔g-right keep residue = residue≤residue
107+
≤g-⊔g-right keep forget = forget≤forget
108+
≤g-⊔g-right residue keep = keep≤residue
109+
≤g-⊔g-right residue residue = residue≤residue
110+
≤g-⊔g-right residue forget = forget≤forget
111+
≤g-⊔g-right forget keep = keep≤forget
112+
≤g-⊔g-right forget residue = residue≤forget
113+
≤g-⊔g-right forget forget = forget≤forget
114+
115+
-- Universal property of join: anything dominated by both g1 and g2
116+
-- is dominated by their join. Together with the two upper-bound
117+
-- lemmas this exhibits `_⊔g_` as the categorical join in `_≤g_`.
118+
≤g-⊔g-univ :
119+
{g1 g2 g} g1 ≤g g g2 ≤g g (g1 ⊔g g2) ≤g g
120+
≤g-⊔g-univ keep≤keep p2 = p2
121+
≤g-⊔g-univ keep≤residue p2 = p2
122+
≤g-⊔g-univ keep≤forget p2 = p2
123+
≤g-⊔g-univ residue≤residue keep≤residue = residue≤residue
124+
≤g-⊔g-univ residue≤residue residue≤residue = residue≤residue
125+
≤g-⊔g-univ residue≤forget keep≤forget = residue≤forget
126+
≤g-⊔g-univ residue≤forget residue≤forget = residue≤forget
127+
≤g-⊔g-univ residue≤forget forget≤forget = forget≤forget
128+
≤g-⊔g-univ forget≤forget keep≤forget = forget≤forget
129+
≤g-⊔g-univ forget≤forget residue≤forget = forget≤forget
130+
≤g-⊔g-univ forget≤forget forget≤forget = forget≤forget
131+
132+
-- Per-decoration composition. The grade decoration commutes with
133+
-- composition: any factoring of a transition `g1 ≤g g3` through an
134+
-- intermediate grade `g2` yields the same degraded echo, regardless of
135+
-- which intermediate is chosen, and is moreover indistinguishable from
136+
-- the direct degrade. This is the per-decoration analogue of pentagon
137+
-- coherence — different paths through the decoration order collapse.
138+
--
139+
-- The proof is a corollary of `degrade-comp` (associativity along the
140+
-- chosen factoring) and `≤g-prop` (any two paths through `_≤g_` agree),
141+
-- so the per-decoration story rests cleanly on those two ingredients.
142+
degrade-compose :
143+
{g1 g2 g3}
144+
(p12 : g1 ≤g g2) (p23 : g2 ≤g g3) (p13 : g1 ≤g g3)
145+
(e : GEcho g1)
146+
degrade p23 (degrade p12 e) ≡ degrade p13 e
147+
degrade-compose p12 p23 p13 e
148+
rewrite ≤g-prop p13 (≤g-trans p12 p23) = degrade-comp p12 p23 e
149+
150+
-- Join-action specialisation: degrading directly to a common upper
151+
-- bound `g` agrees with degrading first to the join `g1 ⊔g g2` and
152+
-- then onward via the universal arrow. This is the per-decoration
153+
-- composition law restated through the join structure.
154+
degrade-via-join :
155+
{g1 g2 g}
156+
(p1 : g1 ≤g g) (p2 : g2 ≤g g) (e : GEcho g1)
157+
degrade p1 e
158+
≡ degrade (≤g-⊔g-univ p1 p2) (degrade (≤g-⊔g-left g1 g2) e)
159+
degrade-via-join {g1} {g2} p1 p2 e =
160+
sym (degrade-compose (≤g-⊔g-left g1 g2) (≤g-⊔g-univ p1 p2) p1 e)

proofs/agda/Smoke.agda

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@ open import Echo using
1919
; Echo-comp-iso-to-from
2020
; cancel-iso-to
2121
; cancel-iso-from
22+
; cancel-iso-from-to
23+
; cancel-iso-to-from
24+
; hom-natural-id
2225
; Echo-comp-iso-pent-B
2326
; Echo-comp-iso-pent-echo
27+
; Echo-comp-pent-Σ-assoc-to
28+
; Echo-comp-pent-Σ-assoc-from
29+
; Echo-comp-pent-Σ-assoc-from-to
30+
; Echo-comp-pent-Σ-assoc-to-from
2431
)
2532
open import EchoCharacteristic using (collapse; echo-true; echo-false; echo-true≢echo-false)
2633
open import EchoResidue using (EchoR; collapse-to-residue; strict-weakening-collapse; no-section-collapse-to-residue)
@@ -59,13 +66,23 @@ open import EchoLinear using
5966
; weaken
6067
; strict-linear-example
6168
; no-section-weaken
69+
; _≤m_
70+
; ≤m-trans
71+
; degradeMode
72+
; degradeMode-comp
6273
)
6374

6475
open import EchoGraded using
6576
( Grade
6677
; degrade
6778
; degrade-comp
6879
; ⊔g-assoc
80+
; ≤g-prop
81+
; ≤g-⊔g-left
82+
; ≤g-⊔g-right
83+
; ≤g-⊔g-univ
84+
; degrade-compose
85+
; degrade-via-join
6986
)
7087

7188
open import EchoTropical using

0 commit comments

Comments
 (0)