Skip to content

Commit 961c9fa

Browse files
committed
Add pentagon coherence for Echo-comp-iso
Ships two minimal pentagon-style coherence lemmas on top of Echo-comp-iso: the two natural ways to apply the iso twice to a three-fold composition `h ∘ g ∘ f` produce the same B-component and the same Echo-f witness. The two paths compared: outer-first -- split at the outer boundary (g∘f, h), then split the inner Echo at (f, g): Echo-comp-iso-to f g (proj₁ (proj₂ (Echo-comp-iso-to (g ∘ f) h e))) inner-first -- split at the inner boundary (f, h∘g) directly: Echo-comp-iso-to f (h ∘ g) e Both factorings project to `f x` at the B-component and to `(x , refl) : Echo f (f x)` at the Echo-f witness. Two lemmas, each proved by `refl`: Echo-comp-iso-pent-B -- B-component agrees Echo-comp-iso-pent-echo -- Echo-f component agrees Both pinned in Smoke.agda. No postulates. All.agda + Smoke both exit 0 under --safe --without-K. This discharges one of the six open composition-law conjectures in docs/echo-types/composition.md §Q4 (associativity / pentagon). The remaining coherences (Σ-associativity on the outer shape, triangle identity for cancellation, approximate-echo tolerance calculus, decoration commuting, recovery interaction) are still open. https://claude.ai/code/session_01JRLz84fAaWvRBKyXuc4tyK
1 parent 7523319 commit 961c9fa

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

proofs/agda/Echo.agda

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Echo where
44

55
open import Level using (Level; _⊔_)
66
open import Function.Base using (_∘_; id)
7-
open import Data.Product.Base using (Σ; _,_; _×_)
7+
open import Data.Product.Base using (Σ; _,_; _×_; proj₁; proj₂)
88
open import Relation.Binary.PropositionalEquality using (_≡_; refl; trans; cong)
99

1010
-- Echo_f(y) := Σ (x : A) , (f x ≡ y)
@@ -95,3 +95,41 @@ Echo-comp-iso-to-from :
9595
(r : Σ B (λ b Echo f b × (g b ≡ y)))
9696
Echo-comp-iso-to f g (Echo-comp-iso-from f g r) ≡ r
9797
Echo-comp-iso-to-from f g (b , (x , refl) , p) = refl
98+
99+
-- Pentagon coherence for three-fold composition. Given
100+
-- f : A → B, g : B → C, h : C → D, the echo of (h ∘ g ∘ f)
101+
-- admits two natural factorings via `Echo-comp-iso-to`:
102+
--
103+
-- outer-first : split at outer boundary (h) then at inner (g)
104+
-- Echo (h ∘ (g ∘ f)) y
105+
-- → Σ C (λ c → Echo (g ∘ f) c × (h c ≡ y)) [iso on (g∘f, h)]
106+
-- → Σ C (λ c → Σ B (λ b → Echo f b × (g b ≡ c)) × (h c ≡ y))
107+
--
108+
-- inner-first : split at the inner boundary ((h∘g) as outer, f as inner)
109+
-- Echo ((h ∘ g) ∘ f) y
110+
-- → Σ B (λ b → Echo f b × ((h ∘ g) b ≡ y)) [iso on (f, h∘g)]
111+
--
112+
-- Both factorings project to the same `f x` at the B-component and
113+
-- the same `x , refl` at the Echo-f witness. This is the minimal
114+
-- pentagon-style coherence: the two natural applications of
115+
-- Echo-comp-iso agree on the A-origin of the composite echo.
116+
117+
Echo-comp-iso-pent-B :
118+
{a b c d} {A : Set a} {B : Set b} {C : Set c} {D : Set d}
119+
(f : A B) (g : B C) (h : C D) {y : D}
120+
(e : Echo (h ∘ g ∘ f) y)
121+
proj₁ (Echo-comp-iso-to f g
122+
(proj₁ (proj₂ (Echo-comp-iso-to (g ∘ f) h e))))
123+
≡ proj₁ (Echo-comp-iso-to f (h ∘ g) e)
124+
Echo-comp-iso-pent-B f g h (x , p) = refl
125+
126+
-- Stronger statement: same `(x , refl) : Echo f (f x)` on the
127+
-- Echo-f component too.
128+
Echo-comp-iso-pent-echo :
129+
{a b c d} {A : Set a} {B : Set b} {C : Set c} {D : Set d}
130+
(f : A B) (g : B C) (h : C D) {y : D}
131+
(e : Echo (h ∘ g ∘ f) y)
132+
proj₁ (proj₂ (Echo-comp-iso-to f g
133+
(proj₁ (proj₂ (Echo-comp-iso-to (g ∘ f) h e)))))
134+
≡ proj₁ (proj₂ (Echo-comp-iso-to f (h ∘ g) e))
135+
Echo-comp-iso-pent-echo f g h (x , p) = refl

proofs/agda/Smoke.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ open import Echo using
1717
; Echo-comp-iso-from
1818
; Echo-comp-iso-from-to
1919
; Echo-comp-iso-to-from
20+
; Echo-comp-iso-pent-B
21+
; Echo-comp-iso-pent-echo
2022
)
2123
open import EchoCharacteristic using (collapse; echo-true; echo-false; echo-true≢echo-false)
2224
open import EchoResidue using (EchoR; collapse-to-residue; strict-weakening-collapse; no-section-collapse-to-residue)

0 commit comments

Comments
 (0)