@@ -4,7 +4,7 @@ module Echo where
44
55open import Level using (Level; _⊔_)
66open import Function.Base using (_∘_; id)
7- open import Data.Product.Base using (Σ; _,_; _×_)
7+ open import Data.Product.Base using (Σ; _,_; _×_; proj₁; proj₂ )
88open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; trans; cong)
99
1010-- Echo_f(y) := Σ (x : A) , (f x ≡ y)
@@ -131,3 +131,41 @@ cancel-iso-from f g s s-right {y = y} (x , q) =
131131-- formalisation is deferred until we commit to either (a) an
132132-- equivalence record that packages the triangle identity as a field,
133133-- or (b) stdlib's `Function.Bundles.Inverse`.
134+
135+ -- Pentagon coherence for three-fold composition. Given
136+ -- f : A → B, g : B → C, h : C → D, the echo of (h ∘ g ∘ f)
137+ -- admits two natural factorings via `Echo-comp-iso-to`:
138+ --
139+ -- outer-first : split at outer boundary (h) then at inner (g)
140+ -- Echo (h ∘ (g ∘ f)) y
141+ -- → Σ C (λ c → Echo (g ∘ f) c × (h c ≡ y)) [iso on (g∘f, h)]
142+ -- → Σ C (λ c → Σ B (λ b → Echo f b × (g b ≡ c)) × (h c ≡ y))
143+ --
144+ -- inner-first : split at the inner boundary ((h∘g) as outer, f as inner)
145+ -- Echo ((h ∘ g) ∘ f) y
146+ -- → Σ B (λ b → Echo f b × ((h ∘ g) b ≡ y)) [iso on (f, h∘g)]
147+ --
148+ -- Both factorings project to the same `f x` at the B-component and
149+ -- the same `x , refl` at the Echo-f witness. This is the minimal
150+ -- pentagon-style coherence: the two natural applications of
151+ -- Echo-comp-iso agree on the A-origin of the composite echo.
152+
153+ Echo-comp-iso-pent-B :
154+ ∀ {a b c d} {A : Set a} {B : Set b} {C : Set c} {D : Set d}
155+ (f : A → B) (g : B → C) (h : C → D) {y : D}
156+ (e : Echo (h ∘ g ∘ f) y) →
157+ proj₁ (Echo-comp-iso-to f g
158+ (proj₁ (proj₂ (Echo-comp-iso-to (g ∘ f) h e))))
159+ ≡ proj₁ (Echo-comp-iso-to f (h ∘ g) e)
160+ Echo-comp-iso-pent-B f g h (x , p) = refl
161+
162+ -- Stronger statement: same `(x , refl) : Echo f (f x)` on the
163+ -- Echo-f component too.
164+ Echo-comp-iso-pent-echo :
165+ ∀ {a b c d} {A : Set a} {B : Set b} {C : Set c} {D : Set d}
166+ (f : A → B) (g : B → C) (h : C → D) {y : D}
167+ (e : Echo (h ∘ g ∘ f) y) →
168+ proj₁ (proj₂ (Echo-comp-iso-to f g
169+ (proj₁ (proj₂ (Echo-comp-iso-to (g ∘ f) h e)))))
170+ ≡ proj₁ (proj₂ (Echo-comp-iso-to f (h ∘ g) e))
171+ Echo-comp-iso-pent-echo f g h (x , p) = refl
0 commit comments