@@ -3,10 +3,9 @@ module Categories.CoYoneda where
33
44-- CoYoneda Lemma. See Yoneda for more documentation
55
6- open import Level
6+ open import Level using (Level; _⊔_; lift; lower)
77open import Function.Base using (_$_)
88open import Function.Bundles using (Inverse; Func; _⟨$⟩_)
9- -- open import Function.Equality using (Π; _⟨$⟩_; cong)
109open import Relation.Binary.Bundles using (module Setoid )
1110import Relation.Binary.Reasoning.Setoid as SetoidR
1211open import Data.Product using (_,_; Σ)
@@ -15,7 +14,7 @@ open import Categories.Category using (Category; _[_,_])
1514open import Categories.Category.Product using (πʳ; πˡ; _※_)
1615open import Categories.Category.Construction.Presheaves using (CoPresheaves)
1716open import Categories.Category.Construction.Functors using (eval)
18- open import Categories.Category.Construction.Functors
17+ open import Categories.Category.Construction.Functors using (Functors)
1918open import Categories.Category.Instance.Setoids using (Setoids)
2019open import Categories.Functor using (Functor; _∘F_) renaming (id to idF)
2120open import Categories.Functor.Hom using (module Hom ; Hom[_][_,-]; Hom[_][-,-])
@@ -28,6 +27,8 @@ import Categories.Morphism as Mor
2827import Categories.Morphism.Reasoning as MR
2928import Categories.NaturalTransformation.Hom as NT-Hom
3029
30+ open Func
31+
3132private
3233 variable
3334 o ℓ e : Level
@@ -36,7 +37,7 @@ module Yoneda (C : Category o ℓ e) where
3637 open Category C hiding (op) -- uses lots
3738 open HomReasoning using (_○_; ⟺; refl⟩∘⟨_)
3839 open MR C using (id-comm)
39- open NaturalTransformation
40+ open NaturalTransformation using (η; commute; sym-commute)
4041 open NT-Hom C using (Hom[C,A]⇒Hom[C,B])
4142 private
4243 module CE = Category.Equiv C using (refl)
@@ -76,18 +77,18 @@ module Yoneda (C : Category o ℓ e) where
7677 ( λ {b} {nat} eq →
7778 let module SR = SetoidR (F.₀ a) in
7879 let open SR in begin
79- Func. to (η nat a) id ≈⟨ eq {a} {id} {id} CE.refl ⟩
80- Func. to (F.₁ id) b ≈⟨ F.identity (Setoid.refl (F.₀ a) {b}) ⟩
80+ to (η nat a) id ≈⟨ eq {a} {id} {id} CE.refl ⟩
81+ to (F.₁ id) b ≈⟨ F.identity (Setoid.refl (F.₀ a) {b}) ⟩
8182 b ∎)
8283 , λ {nat} {y} eq {b} {f} {g} f≈g →
8384 let open Setoid (F.₀ b) in
8485 let module SR = SetoidR (F.₀ b) in
8586 let open SR in
8687 begin
87- Func. to (F.₁ f) y ≈⟨ Func. cong (F.₁ f) eq ⟩
88- Func. to (F.₁ f) (Func. to (η nat a) id) ≈⟨ sym-commute nat f CE.refl ⟩
89- Func. to (η nat b) (f ∘ id ∘ id) ≈⟨ Func. cong (η nat b) (refl⟩∘⟨ identity² ○ (identityʳ ○ f≈g)) ⟩
90- Func. to (η nat b) g ∎
88+ to (F.₁ f) y ≈⟨ cong (F.₁ f) eq ⟩
89+ to (F.₁ f) (to (η nat a) id) ≈⟨ sym-commute nat f CE.refl ⟩
90+ to (η nat b) (f ∘ id ∘ id) ≈⟨ cong (η nat b) (refl⟩∘⟨ identity² ○ (identityʳ ○ f≈g)) ⟩
91+ to (η nat b) g ∎
9192 }
9293 where
9394 module F = Functor F using (₀; ₁; F-resp-≈; homomorphism; identity)
@@ -113,7 +114,7 @@ module Yoneda (C : Category o ℓ e) where
113114 ; cong = λ i≈j → lift (i≈j CE.refl)
114115 }
115116 ; commute = λ where
116- {_} {G , B} (α , f) {β} {γ} β≈γ → lift $ Func. cong (η α B) (helper f β γ β≈γ)
117+ {_} {G , B} (α , f) {β} {γ} β≈γ → lift $ cong (η α B) (helper f β γ β≈γ)
117118 }
118119 ; F⇐G = ntHelper record
119120 { η = λ (F , A) → record
@@ -134,9 +135,9 @@ module Yoneda (C : Category o ℓ e) where
134135 Setoid._≈_ (Functor.F₀ Nat[Hom[C][c,-],F] (F , A)) β γ →
135136 Setoid._≈_ (Functor.F₀ F B) (η β B ⟨$⟩ id ∘ f) (Functor.F₁ F f ⟨$⟩ (η γ A ⟨$⟩ id))
136137 helper {F} {A} {B} f β γ β≈γ = S.begin
137- η β B ⟨$⟩ id ∘ f S.≈⟨ Func. cong (η β B) (MR.id-comm-sym C ○ ∘-resp-≈ʳ (⟺ identity²)) ⟩
138+ η β B ⟨$⟩ id ∘ f S.≈⟨ cong (η β B) (MR.id-comm-sym C ○ ∘-resp-≈ʳ (⟺ identity²)) ⟩
138139 η β B ⟨$⟩ f ∘ id ∘ id S.≈⟨ commute β f CE.refl ⟩
139- F.₁ f ⟨$⟩ (η β A ⟨$⟩ id) S.≈⟨ Func. cong (F.₁ f) (β≈γ CE.refl) ⟩
140+ F.₁ f ⟨$⟩ (η β A ⟨$⟩ id) S.≈⟨ cong (F.₁ f) (β≈γ CE.refl) ⟩
140141 F.₁ f ⟨$⟩ (η γ A ⟨$⟩ id) S.∎
141142 where
142143 module F = Functor F using (₀;₁)
@@ -153,9 +154,9 @@ module Yoneda (C : Category o ℓ e) where
153154 Setoid._≈_ (Functor.F₀ G Z) (Functor.F₁ G h ⟨$⟩ (η α B ⟨$⟩ (Functor.F₁ F f ⟨$⟩ X)))
154155 (η α Z ⟨$⟩ (Functor.F₁ F (i ∘ f) ⟨$⟩ Y))
155156 helper′ {F} {G} {A} {B} {Z} {h} {i} {X} {Y} α f eq eq′ = S.begin
156- G.₁ h ⟨$⟩ (η α B ⟨$⟩ (F.₁ f ⟨$⟩ X)) S.≈˘⟨ commute α h ((S′.sym (Func. cong (F.₁ f) eq))) ⟩
157- η α Z ⟨$⟩ (F.₁ h ⟨$⟩ (F.₁ f ⟨$⟩ Y)) S.≈⟨ Func. cong (η α Z) ((F.F-resp-≈ eq′ S′.refl)) ⟩
158- η α Z ⟨$⟩ (F.₁ i ⟨$⟩ (F.₁ f ⟨$⟩ Y)) S.≈˘⟨ Func. cong (η α Z) ((F.homomorphism (Setoid.refl (F.₀ A)))) ⟩
157+ G.₁ h ⟨$⟩ (η α B ⟨$⟩ (F.₁ f ⟨$⟩ X)) S.≈˘⟨ commute α h ((S′.sym (cong (F.₁ f) eq))) ⟩
158+ η α Z ⟨$⟩ (F.₁ h ⟨$⟩ (F.₁ f ⟨$⟩ Y)) S.≈⟨ cong (η α Z) ((F.F-resp-≈ eq′ S′.refl)) ⟩
159+ η α Z ⟨$⟩ (F.₁ i ⟨$⟩ (F.₁ f ⟨$⟩ Y)) S.≈˘⟨ cong (η α Z) ((F.homomorphism (Setoid.refl (F.₀ A)))) ⟩
159160 η α Z ⟨$⟩ (F.₁ (i ∘ f) ⟨$⟩ Y) S.∎
160161 where
161162 module F = Functor F using (₀; ₁; homomorphism; F-resp-≈)
0 commit comments