Skip to content

Commit 0cfdc66

Browse files
committed
Merge PR #20 and resolve conflicts with main
2 parents 66220ee + 961c9fa commit 0cfdc66

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; 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

proofs/agda/Smoke.agda

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ open import Echo using
1919
; Echo-comp-iso-to-from
2020
; cancel-iso-to
2121
; cancel-iso-from
22+
; Echo-comp-iso-pent-B
23+
; Echo-comp-iso-pent-echo
2224
)
2325
open import EchoCharacteristic using (collapse; echo-true; echo-false; echo-true≢echo-false)
2426
open import EchoResidue using (EchoR; collapse-to-residue; strict-weakening-collapse; no-section-collapse-to-residue)

0 commit comments

Comments
 (0)