11{-# OPTIONS --without-K --safe #-}
22
3- open import Categories.Category
3+ open import Categories.Category using (Category)
44
55module Categories.Functor.Slice {o ℓ e} (C : Category o ℓ e) where
66
7- open import Data.Product using (_,_ )
7+ open import Function using () renaming (id to id→ )
88
9- open import Categories.Adjoint
10- open import Categories.Category.CartesianClosed
11- open import Categories.Category.CartesianClosed.Locally
12- open import Categories.Functor hiding (id)
13- open import Categories.Functor.Properties
9+ open import Categories.Diagram.Pullback C using (Pullback; unglue; Pullback-resp-≈)
10+ open import Categories.Functor using (Functor)
11+ open import Categories.Functor.Properties using ([_]-resp-∘)
1412open import Categories.Morphism.Reasoning C
15- open import Categories.NaturalTransformation hiding (id)
1613open import Categories.Object.Product C
1714
1815import Categories.Category.Slice as S
19- import Categories.Diagram.Pullback as P
2016import Categories.Category.Construction.Pullbacks as Pbs
2117
2218open Category C
@@ -27,74 +23,32 @@ module _ {A : Obj} where
2723 open S.SliceObj
2824 open S.Slice⇒
2925
26+ -- A functor between categories induces one between the corresponding slices at a given object of C.
3027 Base-F : ∀ {o′ ℓ′ e′} {D : Category o′ ℓ′ e′} (F : Functor C D) → Functor (S.Slice C A) (S.Slice D (Functor.F₀ F A))
31- Base-F {D = D} F = record
32- { F₀ = λ { (S.sliceobj arr) → S.sliceobj (F₁ arr) }
33- ; F₁ = λ { (S.slicearr △) → S.slicearr ([ F ]-resp-∘ △) }
28+ Base-F F = record
29+ { F₀ = λ s → S.sliceobj (F₁ ( arr s))
30+ ; F₁ = λ s⇒ → S.slicearr ([ F ]-resp-∘ (△ s⇒))
3431 ; identity = identity
3532 ; homomorphism = homomorphism
3633 ; F-resp-≈ = F-resp-≈
3734 }
38- where module D = Category D
39- open Functor F
35+ where open Functor F
4036
4137 open S C
4238
4339 Forgetful : Functor (Slice A) C
4440 Forgetful = record
45- { F₀ = λ X → Y X
46- ; F₁ = λ f → h f
41+ { F₀ = Y
42+ ; F₁ = h
4743 ; identity = refl
4844 ; homomorphism = refl
49- ; F-resp-≈ = λ eq → eq
45+ ; F-resp-≈ = id→
5046 }
5147
52- BaseChange! : ∀ {B} (f : B ⇒ A) → Functor (Slice B) (Slice A)
53- BaseChange! f = record
54- { F₀ = λ X → sliceobj (f ∘ arr X)
55- ; F₁ = λ g → slicearr (pullʳ (△ g))
56- ; identity = refl
57- ; homomorphism = refl
58- ; F-resp-≈ = λ eq → eq
59- }
60-
61-
62- module _ (pullbacks : ∀ {X Y Z} (h : X ⇒ Z) (i : Y ⇒ Z) → P.Pullback C h i) where
48+ module _ (pullback : ∀ {X} {Y} {Z} (h : X ⇒ Z) (i : Y ⇒ Z) → Pullback h i) where
6349 private
64- open P C
65- module pullbacks {X Y Z} h i = Pullback (pullbacks {X} {Y} {Z} h i)
66- open pullbacks
67-
68- BaseChange* : ∀ {B} (f : B ⇒ A) → Functor (Slice A) (Slice B)
69- BaseChange* f = record
70- { F₀ = λ X → sliceobj (p₂ (arr X) f)
71- ; F₁ = λ {X Y} g → slicearr {h = Pullback.p₂ (unglue (pullbacks (arr Y) f)
72- (Pullback-resp-≈ (pullbacks (arr X) f) (△ g) refl))}
73- (p₂∘universal≈h₂ (arr Y) f)
74- ; identity = λ {X} → ⟺ (unique (arr X) f id-comm identityʳ)
75- ; homomorphism = λ {X Y Z} {h i} → unique-diagram (arr Z) f (p₁∘universal≈h₁ (arr Z) f ○ assoc ○ ⟺ (pullʳ (p₁∘universal≈h₁ (arr Y) f)) ○ ⟺ (pullˡ (p₁∘universal≈h₁ (arr Z) f)))
76- (p₂∘universal≈h₂ (arr Z) f ○ ⟺ (p₂∘universal≈h₂ (arr Y) f) ○ ⟺ (pullˡ (p₂∘universal≈h₂ (arr Z) f)))
77- ; F-resp-≈ = λ {X Y} eq″ → unique (arr Y) f (p₁∘universal≈h₁ (arr Y) f ○ ∘-resp-≈ˡ eq″) (p₂∘universal≈h₂ (arr Y) f)
78- }
79-
80-
81- !⊣* : ∀ {B} (f : B ⇒ A) → BaseChange! f ⊣ BaseChange* f
82- !⊣* f = record
83- { unit = ntHelper record
84- { η = λ X → slicearr (p₂∘universal≈h₂ (f ∘ arr X) f {eq = identityʳ})
85- ; commute = λ {X Y} g → unique-diagram (f ∘ arr Y) f
86- (cancelˡ (p₁∘universal≈h₁ (f ∘ arr Y) f) ○ ⟺ (cancelʳ (p₁∘universal≈h₁ (f ∘ arr X) f)) ○ pushˡ (⟺ (p₁∘universal≈h₁ (f ∘ arr Y) f)))
87- (pullˡ (p₂∘universal≈h₂ (f ∘ arr Y) f) ○ △ g ○ ⟺ (p₂∘universal≈h₂ (f ∘ arr X) f) ○ pushˡ (⟺ (p₂∘universal≈h₂ (f ∘ arr Y) f)))
88- }
89- ; counit = ntHelper record
90- { η = λ X → slicearr (pullbacks.commute (arr X) f)
91- ; commute = λ {X Y} g → p₁∘universal≈h₁ (arr Y) f
92- }
93- ; zig = λ {X} → p₁∘universal≈h₁ (f ∘ arr X) f
94- ; zag = λ {Y} → unique-diagram (arr Y) f
95- (pullˡ (p₁∘universal≈h₁ (arr Y) f) ○ pullʳ (p₁∘universal≈h₁ (f ∘ pullbacks.p₂ (arr Y) f) f))
96- (pullˡ (p₂∘universal≈h₂ (arr Y) f) ○ p₂∘universal≈h₂ (f ∘ pullbacks.p₂ (arr Y) f) f ○ ⟺ identityʳ)
97- }
50+ module pullbacks {X Y Z} h i = Pullback (pullback {X} {Y} {Z} h i)
51+ open pullbacks using (p₂; p₂∘universal≈h₂; unique; unique-diagram; p₁∘universal≈h₁)
9852
9953 pullback-functorial : ∀ {B} (f : B ⇒ A) → Functor (Slice A) C
10054 pullback-functorial f = record
@@ -109,7 +63,7 @@ module _ {A : Obj} where
10963 (p.p₂∘universal≈h₂ B ○ ∘-resp-≈ˡ eq ○ ⟺ (p.p₂∘universal≈h₂ B))
11064 }
11165 where p : ∀ X → Pullback f (arr X)
112- p X = pullbacks f (arr X)
66+ p X = pullback f (arr X)
11367 module p X = Pullback (p X)
11468
11569 p⇒ : ∀ X Y (g : Slice⇒ X Y) → p.P X ⇒ p.P Y
@@ -128,35 +82,17 @@ module _ {A : Obj} where
12882
12983 module _ (product : {X : Obj} → Product A X) where
13084
85+ private
86+ module product {X} = Product (product {X})
87+ open product
88+
13189 -- this is adapted from proposition 1.33 of Aspects of Topoi (Freyd, 1972)
13290 Free : Functor C (Slice A)
13391 Free = record
134- { F₀ = λ _ → sliceobj [ product ] π₁
92+ { F₀ = λ _ → sliceobj π₁
13593 ; F₁ = λ f → slicearr ([ product ⇒ product ]π₁∘× ○ identityˡ)
13694 ; identity = id×id product
13795 ; homomorphism = sym [ product ⇒ product ⇒ product ]id×∘id×
138- ; F-resp-≈ = λ f≈g → Product. ⟨⟩-cong₂ product refl (∘-resp-≈ˡ f≈g)
96+ ; F-resp-≈ = λ f≈g → ⟨⟩-cong₂ refl (∘-resp-≈ˡ f≈g)
13997 }
14098
141- Forgetful⊣Free : Forgetful ⊣ Free
142- Forgetful⊣Free = record
143- { unit = ntHelper record
144- { η = λ _ → slicearr (Product.project₁ product)
145- ; commute = λ {X} {Y} f → begin
146- [ product ]⟨ arr Y , id ⟩ ∘ h f ≈⟨ [ product ]⟨⟩∘ ⟩
147- [ product ]⟨ arr Y ∘ h f , id ∘ h f ⟩ ≈⟨ Product.⟨⟩-cong₂ product (△ f) identityˡ ⟩
148- [ product ]⟨ arr X , h f ⟩ ≈˘⟨ Product.⟨⟩-cong₂ product identityˡ identityʳ ⟩
149- [ product ]⟨ id ∘ arr X , h f ∘ id ⟩ ≈˘⟨ [ product ⇒ product ]×∘⟨⟩ ⟩
150- [ product ⇒ product ] id × h f ∘ [ product ]⟨ arr X , id ⟩ ∎
151- }
152- ; counit = ntHelper record
153- { η = λ _ → Product.π₂ product
154- ; commute = λ _ → Product.project₂ product
155- }
156- ; zig = Product.project₂ product
157- ; zag = begin
158- [ product ⇒ product ]id× [ product ]π₂ ∘ [ product ]⟨ [ product ]π₁ , id ⟩ ≈⟨ [ product ⇒ product ]×∘⟨⟩ ⟩
159- [ product ]⟨ id ∘ [ product ]π₁ , [ product ]π₂ ∘ id ⟩ ≈⟨ Product.⟨⟩-cong₂ product identityˡ identityʳ ⟩
160- [ product ]⟨ [ product ]π₁ , [ product ]π₂ ⟩ ≈⟨ Product.η product ⟩
161- id ∎
162- }
0 commit comments