Skip to content

Commit c064670

Browse files
F1 PASSED: gc-coassoc closed (earn-back gate, R-2026-05-18 follow-up) (#86)
## Summary Gate **F1** of the earn-back plan — the MAKE-OR-BREAK retraction from [R-2026-05-18](../blob/main/docs/retractions.adoc) — now passes. The 2026-05-18 spike `EchoGradedComonadF1.agda` had two of three graded-comonad laws closed (`gc-counit-l`, `gc-counit-r`) and named the remaining obstruction precisely: an isolated proof-engineering type-mismatch at the inductive step of `gc-coassoc`, requiring an explicit δ-naturality lemma over the outer `R` layer rather than the ad-hoc `coe-cong-R ∘ sym` push. This PR discharges that obligation: ```agda δ-suc : ∀ m n {A} (x : D (m + n) A) (b : Bool) → δ (suc m) n {A} (x , b) ≡ (δ m n x , b) δ-suc m n {A} x b = coe-cong-R (D-+ m n A) x b ``` This factor + the existing `subst-D-suc` let `gc-coassoc` close as a six-step `≡-Reasoning` chain. Stdlib's `+-assoc (suc m) n p` reduces *definitionally* to `cong suc (+-assoc m n p)`, so the two ℕ-equation proofs at the chain ends are syntactically identical and **ℕ-UIP is not needed for `gc-coassoc` itself** (`gc-counit-l` still uses ℕ-UIP, which is K-free via Hedberg / decidable equality). ## Mechanised content of F1 * Grade monoid `(ℕ, +, 0)`; `D 0 A = A`; `D (suc r) A = R (D r A)` where `R X = X × Bool` — a non-collapsing residue layer. * `mapD r f` functorial (`mapD-id`, `mapD-∘`). * `ε : D 0 A → A` — counit at the unit grade. * `δ : D (m + n) A → D m (D n A)` — **NESTED** comultiplication. * `gc-counit-r` (definitional), `gc-counit-l` (induction on grade), `gc-coassoc` (this PR). * `D2-nontrivial` — separating witness that `D r` is not `⊤` / a prop. * Echo is the grade-unit object: `D 0 (Echo f y) ≡ Echo f y`. `--safe --without-K`, **zero postulates**, zero escape pragmas, no funext. Wired into `All.agda` and pinned in `Smoke.agda`. ## Scope (please re-read with care) F1 earns back the **existence** of a graded comonad with Echo as the grade-unit object — that's the claim R-2026-05-18 retracted at its strongest reading. It does **NOT** retroactively make `EchoGraded` itself a graded comonad: `EchoGraded` remains a thin-poset reindexing modality on a three-element lattice, with no nested family, no monoid multiplication, no `D r r' ⇒ D r ∘ D r'`. The paper's title and central thesis (Echo as a reindexing modality) stand unchanged; F1 enters the codebase as an *additional* mechanised contribution beside `EchoGraded`. ## What this unblocks Gate **F3** — a genuinely independent second model of the comonad at a different grade monoid (e.g. tropical or multiplicative semiring), without a `× ⊤` carrier or a `⊑-prop`-equivalent field — is now in scope. F3 is **not** started by this PR. ## Doc changes (gated, scoped) * `docs/echo-types/earn-back-plan.adoc` — ledger row A1 + Status entry (F1 PASSED 2026-05-20), with the scope qualifier pinned. * `docs/retractions.adoc` — follow-up **F-2026-05-20a** appended (append-only revision policy preserved); no edits to other doc bodies. * `paper.adoc`, `types-abstract.adoc`, `conservativity.adoc` — **intentionally untouched** in this PR. Their bodies are about `EchoGraded`'s thin-poset structure, which F1 does not change. Whether to add a bounded new-contribution paragraph mentioning the F1 side-construction is **owner-gated**. ## Test plan * [x] `agda proofs/agda/All.agda` exit 0 under `--safe --without-K` * [x] `agda proofs/agda/Smoke.agda` exit 0 under `--safe --without-K` * [x] `grep -nE '^\s*postulate\b|BUILTIN REWRITE|NON_TERMINATING|TERMINATING' proofs/agda/EchoGradedComonadF1.agda` returns no matches in code * [x] `--safe --without-K` OPTIONS line preserved on the F1 module * [ ] (owner) confirm the scope language in `retractions.adoc` F-2026-05-20a matches intent * [ ] (owner) decide whether `paper.adoc` / `types-abstract.adoc` / `conservativity.adoc` should gain a bounded contribution paragraph in a separate PR ## Non-overlap with parallel sessions Touches: `EchoGradedComonadF1.agda` (existing 2026-05-18 spike, finishing it), `All.agda` (one-line F1 import), `Smoke.agda` (F1 pin block), `earn-back-plan.adoc`, `retractions.adoc`. Stays clear of: * `proofs/agda/Ordinal/**` — the Brouwer-arithmetic / `_<ᵇ⁻_` / rank-mono session's territory. * Any module the recent estate PRs (#80 EchoSearch, #81 EchoExampleProvenance, #83 EchoExampleParser) added — restored their imports cleanly during the rebase onto fresh `origin/main`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 67189c7 commit c064670

5 files changed

Lines changed: 167 additions & 26 deletions

File tree

docs/echo-types/earn-back-plan.adoc

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,13 @@ single index; it moves no claim.
189189

190190
| A1
191191
| *F1* — `gc-coassoc` (graded-comonad coassociativity),
192-
`proofs/agda/EchoGradedComonadF1.agda`. Needs an explicit
193-
δ-naturality-over-`R` lemma. Spike not wired into `All`/`Smoke`.
194-
| Open, *not postulated*. Feasibility decided *positive* (see Status).
192+
`proofs/agda/EchoGradedComonadF1.agda`.
193+
| *PASSED 2026-05-20* — `gc-coassoc` closed via the predicted
194+
`δ`-naturality-over-`R` (`δ-suc`) + `subst-D-suc` factoring; stdlib
195+
`+-assoc (suc m) n p` reduces to `cong suc (+-assoc m n p)`, so
196+
ℕ-UIP was *not* needed for coassoc. `--safe --without-K`, zero
197+
postulates, wired into `All`/`Smoke`. Retraction follow-up
198+
F-2026-05-20a. Unblocks A3 / F3.
195199

196200
| A2
197201
| *F2* — real second model of the bare Echo functor via
@@ -262,8 +266,8 @@ single index; it moves no claim.
262266
spikes wired into `All`/`Smoke`, scoped claims moved (follow-up
263267
F-2026-05-18a). Each earned back a qualified/real claim
264268
independently of F1.
265-
. *F1 coassoc* (A1) — one obligation, feasibility decided; closes the
266-
make-or-break and unlocks *F3* (A3). Now the next action.
269+
. *F1 coassoc* (A1) — *DONE 2026-05-20*: passed via the predicted
270+
`δ`-naturality-over-`R` factoring; unblocks *F3* (A3).
267271
. *Doc-integrity* (D) — reconcile alongside step 1; removes a drift
268272
vector at near-zero cost.
269273
. *Buchholz* (B) — separate long-tail; keep the `ExtendedOrder`
@@ -312,3 +316,28 @@ single index; it moves no claim.
312316
*Strictly scoped:* F2 is the Echo functor only — the graded-comonad,
313317
model-independence, and conservativity claims remain retracted; F1
314318
(coassoc) and F3 remain open.
319+
320+
* *2026-05-20 — Gate F1 PASSED.* `gc-coassoc` closed via the
321+
predicted `δ`-naturality-over-`R` (`δ-suc`) + `subst-D-suc`
322+
factoring; stdlib `+-assoc (suc m) n p` reduces definitionally to
323+
`cong suc (+-assoc m n p)` (recursion on left), so the two
324+
ℕ-equation proofs on the chain ends are syntactically identical
325+
and ℕ-UIP was *not* needed for coassoc itself. `EchoGradedComonadF1.agda`
326+
now ships all three graded-comonad laws + the separating witness
327+
`D2-nontrivial`; `--safe --without-K`, zero postulates, no funext;
328+
wired into `All.agda` and pinned in `Smoke.agda`. Full + smoke
329+
build green. Retraction follow-up F-2026-05-20a.
330+
+
331+
*Strictly scoped (re-read with care):* F1 earns back the
332+
*existence* of a graded comonad with Echo as the grade-unit object
333+
(`D 0 (Echo f y)` is the bare echo, the nested comultiplication is
334+
real, all three laws hold, the carrier is non-trivial). It does
335+
*not* retroactively make `EchoGraded` a graded comonad — `EchoGraded`
336+
remains a thin-poset reindexing modality per R-2026-05-18, on a
337+
different structure (`Grade = 3-element lattice`, no nested family,
338+
no monoid multiplication, no `D r r' ⇒ D r ∘ D r'`). The paper's
339+
title and central thesis (Echo as a reindexing modality) stand
340+
unchanged; the F1 result is an *additional* mechanised contribution
341+
sitting beside `EchoGraded`, not a reinstatement of it. F3
342+
(independent second comonad model at a different grade monoid) is
343+
now unblocked.

docs/retractions.adoc

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,74 @@ note), `docs/echo-types/conservativity.adoc` (scope), and
192192
to the *conditional/scoped* earned claim, never beyond it;
193193
`docs/echo-types/earn-back-plan.adoc` ledger rows A2/A4 and Status.
194194

195+
==== Follow-up F-2026-05-20a (2026-05-20) — Gate F1 passed
196+
197+
The make-or-break gate of R-2026-05-18 — Gate F1, a *genuine*
198+
graded comonad with Echo as the grade-unit object and a nested
199+
comultiplication — *passes* under the `EchoGradedComonadF1.agda`
200+
candidate (monoid-graded iterated-residue carrier `D : ℕ → Set →
201+
Set`, grade monoid `(ℕ, +, 0)`, `R X = X × Bool` informative
202+
residue layer).
203+
204+
[cols="1,4", options="header"]
205+
|===
206+
| Gate | Earned-back claim (exact strength — nothing beyond)
207+
208+
| *F1*
209+
| `proofs/agda/EchoGradedComonadF1.agda`. There exists a graded
210+
functor `D : ℕ → Set → Set` with: `mapD` functorial
211+
(`mapD-id`/`mapD-∘`); counit `ε : D 0 A → A` at the unit grade;
212+
*nested* comultiplication `δ : D (m + n) A → D m (D n A)`; all
213+
three graded-comonad laws (`gc-counit-l`, `gc-counit-r`,
214+
`gc-coassoc`) discharged as propositional equalities; a separating
215+
witness `D2-nontrivial` that `D r` is *not* `⊤`/a proposition; and
216+
`D 0 (Echo f y)` is the bare echo (Echo is the grade-unit
217+
object). The proof uses `δ`-naturality over the outermost `R`
218+
layer (`δ-suc`) plus the `subst`-over-`R` interchange
219+
(`subst-D-suc`) to factor the coassociativity inductive step;
220+
stdlib's `+-assoc (suc m) n p` reduces definitionally to
221+
`cong suc (+-assoc m n p)`, so the two ℕ-equation proofs on the
222+
chain ends are syntactically identical and ℕ-UIP was *not*
223+
required for `gc-coassoc` (only `gc-counit-l` uses ℕ-UIP, which
224+
is itself K-free via Hedberg / decidable equality and was
225+
already present in the 2026-05-18 spike). `--safe --without-K`,
226+
zero postulates, no funext, no escape pragmas.
227+
|===
228+
229+
*What is NOT earned back by this follow-up.* The retraction's
230+
target was `EchoGraded` and its surrounding scaffold — and the
231+
retraction stands for `EchoGraded`. The F1 contribution is a
232+
*separate, additional* mechanised structure: it shows that a
233+
genuine graded comonad over Echo *exists*, but it does not
234+
retroactively re-classify `EchoGraded` as a graded comonad.
235+
`EchoGraded` remains a thin-poset reindexing modality on a
236+
three-element lattice, with no nested family, no monoid
237+
multiplication, and `⊑-prop` baked in — as R-2026-05-18 stated.
238+
The paper's title, central thesis, and most of the "honest
239+
qualifications" therefore stand verbatim; F1 enters the codebase
240+
as an *additional* mechanised contribution at the side of
241+
`EchoGraded`, not as a reinstatement of it.
242+
243+
*What this unblocks.* Gate *F3* (a genuinely independent second
244+
model of the *comonad* at a different grade monoid — e.g. a
245+
multiplicative or tropical semiring — without a `× ⊤` carrier or
246+
a `⊑-prop`-equivalent field) is now in scope; it was gated on F1.
247+
F3 is *not* started by this follow-up.
248+
249+
*Artefacts edited 2026-05-20 pursuant to this follow-up:*
250+
`proofs/agda/EchoGradedComonadF1.agda` (closed `gc-coassoc`;
251+
introduced `δ-suc`); `proofs/agda/All.agda` (wired F1 in);
252+
`proofs/agda/Smoke.agda` (pinned the F1 headlines and the
253+
`D2-nontrivial` separating witness);
254+
`docs/echo-types/earn-back-plan.adoc` (ledger row A1 + Status). No
255+
edits to `paper.adoc`, `types-abstract.adoc`, or
256+
`conservativity.adoc` in this follow-up — the body of those
257+
documents is about `EchoGraded`'s thin-poset structure, which F1
258+
does not change. Owner-gated decision: whether to add a *bounded*
259+
new contribution paragraph mentioning the F1 side-construction
260+
(without altering the title / thesis / reindexing-modality
261+
framing).
262+
195263
== Revision policy
196264

197265
Append-only. New retractions get the next `R-YYYY-MM-DD` id. An entry

proofs/agda/All.agda

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ open import EchoRelModel -- Pillar D (scaffold)
5959
-- follow-up F-2026-05-18a.
6060
open import EchoPullbackUnivF4 -- Gate F4 PASSED (funext-qualified UP)
6161
open import EchoStepNDModelF2 -- Gate F2 PASSED (StepND second model)
62+
open import EchoGradedComonadF1 -- Gate F1 PASSED (graded comonad on iterated-residue)
6263

6364
-- Foundation P1: external-fibre triangulation. Echo agrees with the
6465
-- standard library's OWN independently-authored notions

proofs/agda/EchoGradedComonadF1.agda

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ coe-D-irr : ∀ {A} {j k : ℕ} (p q : D j A ≡ D k A) (x : D j A) →
114114
(e : j ≡ k) p ≡ q coe p x ≡ coe q x
115115
coe-D-irr p .p x e refl = refl
116116

117+
-- δ-naturality over the R layer. Peels the outermost R off both
118+
-- sides of δ. Direct corollary of `coe-cong-R` at p := D-+ m n A,
119+
-- isolated as a lemma so the coassociativity proof can rewrite the
120+
-- nested `δ` without re-deriving the coe push at every step.
121+
δ-suc : m n {A} (x : D (m + n) A) (b : Bool)
122+
δ (suc m) n {A} (x , b) ≡ (δ m n x , b)
123+
δ-suc m n {A} x b = coe-cong-R (D-+ m n A) x b
124+
117125
----------------------------------------------------------------------
118126
-- LAW 1 — counit-right. e · r = 0 + r = r definitionally, so
119127
-- δ 0 r = coe refl = id and ε is id: the law is definitional.
@@ -155,25 +163,39 @@ gc-counit-l (suc r) {A} (d , b) = begin
155163
-- D ((m+n)+p) A --subst +-assoc--> D (m+(n+p)) A --δ m (n+p)-->
156164
-- D m (D (n+p) A) --mapD m (δ n p)--> D m (D n (D p A))
157165

158-
-- LAW 3 — coassociativity. OPEN OBLIGATION (F1 not yet passed).
159-
--
160-
-- Spike finding (2026-05-18): the base case (`zero`) and the
161-
-- structural skeleton close; the inductive step has an isolated
162-
-- type-mismatch in the chain that re-expresses
163-
-- mapD (suc m) (δ n p) (δ (suc m) (n+p) (subst (cong suc +-assoc)))
164-
-- back through `coe-cong-R`/`sym` — `m != m + (n + p)` at the
165-
-- penultimate rewrite. This is a PROOF-ENGINEERING bug, NOT a
166-
-- foundational obstruction: Agda demanded NO K, NO funext, NO
167-
-- postulate anywhere; ℕ-UIP (K-free) is the only non-structural
168-
-- tool, exactly as predicted. The remaining work is to factor the
169-
-- inductive step through an explicit `δ`-naturality lemma
170-
-- δ (suc m) q (x , b) ≡ (δ m q x , b) [over the R layer]
171-
-- and a `mapD`/`subst` interchange, rather than the ad-hoc
172-
-- `coe-cong-R ∘ sym` push used above. Tracked as Gate F1 in
173-
-- docs/echo-types/earn-back-plan.adoc §"Status". NOT postulated,
174-
-- NOT softened: stated here as the precise open obligation.
166+
-- LAW 3 — coassociativity. Closed 2026-05-20.
175167
--
176-
-- gc-coassoc : ∀ m n p {A} (x : D ((m + n) + p) A) →
177-
-- δ m n (δ (m + n) p x)
178-
-- ≡ mapD m (δ n p)
179-
-- (δ m (n + p) (subst (λ k → D k A) (+-assoc m n p) x))
168+
-- The inductive step factors cleanly through `δ-suc` (δ-naturality
169+
-- over the outer R layer) and `subst-D-suc` (subst commutes with the
170+
-- outer R layer). Stdlib's `+-assoc (suc m) n p` is *definitionally*
171+
-- `cong suc (+-assoc m n p)` (recursion on left arg), so the
172+
-- ℕ-equation proofs on the two sides are syntactically identical and
173+
-- ℕ-UIP is *not* needed — only ℕ-equation transport along the
174+
-- structural lemmas. No K, no funext, no postulate.
175+
176+
gc-coassoc : m n p {A} (x : D ((m + n) + p) A)
177+
δ m n (δ (m + n) p x)
178+
≡ mapD m (δ n p)
179+
(δ m (n + p) (subst (λ k D k A) (+-assoc m n p) x))
180+
gc-coassoc zero n p x = refl
181+
gc-coassoc (suc m) n p {A} (x , b) = begin
182+
δ (suc m) n (δ (suc m + n) p (x , b))
183+
≡⟨ cong (δ (suc m) n) (δ-suc (m + n) p x b) ⟩
184+
δ (suc m) n (δ (m + n) p x , b)
185+
≡⟨ δ-suc m n (δ (m + n) p x) b ⟩
186+
(δ m n (δ (m + n) p x) , b)
187+
≡⟨ cong (_, b) (gc-coassoc m n p x) ⟩
188+
(mapD m (δ n p) (δ m (n + p) (subst (λ k D k A) (+-assoc m n p) x)) , b)
189+
≡⟨ sym (cong (mapD (suc m) (δ n p))
190+
(δ-suc m (n + p)
191+
(subst (λ k D k A) (+-assoc m n p) x) b)) ⟩
192+
mapD (suc m) (δ n p)
193+
(δ (suc m) (n + p)
194+
(subst (λ k D k A) (+-assoc m n p) x , b))
195+
≡⟨ cong (λ z mapD (suc m) (δ n p) (δ (suc m) (n + p) z))
196+
(sym (subst-D-suc (+-assoc m n p) x b)) ⟩
197+
mapD (suc m) (δ n p)
198+
(δ (suc m) (n + p)
199+
(subst (λ k D k A) (+-assoc (suc m) n p) (x , b)))
200+
201+
where open ≡-Reasoning

proofs/agda/Smoke.agda

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,27 @@ open import EchoStepNDModelF2 using
450450
; nd-fibre-not-prop -- the fibre is not a proposition
451451
)
452452

453+
-- Pillar F, Gate F1 — the MAKE-OR-BREAK gate (docs/echo-types/
454+
-- earn-back-plan.adoc §F1). A genuine graded comonad on the
455+
-- iterated-residue carrier `D r A = r nested R-layers`, with grade
456+
-- monoid (ℕ, +, 0), Echo as the grade-unit object (D 0 (Echo f y) is
457+
-- the bare echo), NESTED comultiplication δ : D (m+n) ⇒ D m ∘ D n,
458+
-- all three graded-comonad laws proved, and a separating witness
459+
-- showing D 2 is not collapsing to ⊤. --safe --without-K, zero
460+
-- postulates, no funext. Scope: this earns back the graded-comonad
461+
-- claim FOR THIS WITNESS ONLY; `EchoGraded` itself remains a
462+
-- thin-poset reindexing modality per R-2026-05-18.
463+
open import EchoGradedComonadF1 using
464+
( D -- the graded functor
465+
; mapD ; mapD-id ; mapD-∘ -- functor laws
466+
; ε -- counit at the unit grade
467+
; δ -- NESTED comultiplication
468+
; D2-nontrivial -- D 2 is not ⊤ / a prop
469+
; gc-counit-r -- counit-right law (definitional)
470+
; gc-counit-l -- counit-left law
471+
; gc-coassoc -- coassociativity law (the F1 keystone)
472+
)
473+
453474
open import EchoTropical using
454475
( Candidate
455476
; score

0 commit comments

Comments
 (0)