@@ -4,16 +4,22 @@ open import Categories.Category using (Category)
44
55module Categories.Functor.Slice {o ℓ e} (C : Category o ℓ e) where
66
7- open import Function using () renaming (id to id→)
7+ open import Function.Base using (_$_ ) renaming (id to id→)
88
9+ open import Categories.Category.BinaryProducts
10+ open import Categories.Category.Cartesian
11+ open import Categories.Category.CartesianClosed C
912open import Categories.Diagram.Pullback C using (Pullback; unglue; Pullback-resp-≈)
1013open import Categories.Functor using (Functor)
1114open import Categories.Functor.Properties using ([_]-resp-∘)
1215open import Categories.Morphism.Reasoning C
16+ open import Categories.Object.Exponential C
1317open import Categories.Object.Product C
18+ open import Categories.Object.Terminal C
1419
1520import Categories.Category.Slice as S
1621import Categories.Category.Construction.Pullbacks as Pbs
22+ import Categories.Object.Product.Construction as ×C
1723
1824open Category C
1925open HomReasoning
@@ -96,3 +102,58 @@ module _ {A : Obj} where
96102 ; F-resp-≈ = λ f≈g → ⟨⟩-cong₂ refl (∘-resp-≈ˡ f≈g)
97103 }
98104
105+ -- This can and probably should be restricted
106+ -- e.g. we only need exponential objects with A as domain
107+ -- I don't think we need all products but I don't have a clear idea of what products we do need
108+ module _ (ccc : CartesianClosed) (pullback : ∀ {X} {Y} {Z} (h : X ⇒ Z) (i : Y ⇒ Z) → Pullback h i) where
109+
110+ open CartesianClosed ccc
111+ open Cartesian cartesian
112+ open Terminal terminal
113+ open BinaryProducts products
114+
115+ -- Needs better name!
116+ Coforgetful : Functor (Slice A) C
117+ Coforgetful = record
118+ { F₀ = p.P
119+ ; F₁ = λ f → p.universal _ (F₁-lemma f)
120+ ; identity = λ {X} → sym $ p.unique X (sym (!-unique _)) $ begin
121+ p.p₂ X ∘ id ≈⟨ identityʳ ⟩
122+ p.p₂ X ≈˘⟨ η-exp′ ⟩
123+ λg (eval′ ∘ first (p.p₂ X)) ≈˘⟨ λ-cong (pullˡ identityˡ) ⟩
124+ λg (id ∘ eval′ ∘ first (p.p₂ X)) ∎
125+ ; homomorphism = λ {S} {T} {U} {f} {g} → sym $ p.unique U (sym (!-unique _)) $ begin
126+ p.p₂ U ∘ p.universal U (F₁-lemma g) ∘ p.universal T (F₁-lemma f) ≈⟨ pullˡ (p.p₂∘universal≈h₂ U) ⟩
127+ λg (h g ∘ eval′ ∘ first (p.p₂ T)) ∘ p.universal T (F₁-lemma f) ≈˘⟨ pullˡ (subst ○ λ-cong assoc) ⟩
128+ λg (h g ∘ eval′) ∘ p.p₂ T ∘ p.universal T (F₁-lemma f) ≈⟨ refl⟩∘⟨ p.p₂∘universal≈h₂ T ⟩
129+ λg (h g ∘ eval′) ∘ λg (h f ∘ eval′ ∘ first (p.p₂ S)) ≈⟨ subst ⟩
130+ λg ((h g ∘ eval′) ∘ first (λg (h f ∘ eval′ ∘ first (p.p₂ S)))) ≈⟨ λ-cong (pullʳ β′) ⟩
131+ λg (h g ∘ (h f ∘ eval′ ∘ first (p.p₂ S))) ≈⟨ λ-cong sym-assoc ⟩
132+ λg ((h g ∘ h f) ∘ eval′ ∘ first (p.p₂ S)) ∎
133+ ; F-resp-≈ = λ f≈g → p.universal-resp-≈ _ refl (λ-cong (∘-resp-≈ˡ f≈g))
134+ }
135+ where
136+ p : (X : SliceObj A) → Pullback {X = ⊤} {Z = A ^ A} {Y = Y X ^ A} (λg π₂) (λg (arr X ∘ eval′))
137+ p X = pullback (λg π₂) (λg (arr X ∘ eval′))
138+ module p X = Pullback (p X)
139+
140+ abstract
141+ F₁-lemma : ∀ {S} {T} (f : Slice⇒ S T) → λg π₂ ∘ ! ≈ λg (arr T ∘ eval′) ∘ λg (h f ∘ eval′ ∘ first (p.p₂ S))
142+ F₁-lemma {S} {T} f = λ-unique₂′ $ begin
143+ eval′ ∘ first (λg π₂ ∘ !) ≈˘⟨ refl⟩∘⟨ first∘first ⟩
144+ eval′ ∘ first (λg π₂) ∘ first ! ≈⟨ pullˡ β′ ⟩
145+ π₂ ∘ first ! ≈⟨ π₂∘⁂ ○ identityˡ ⟩
146+ π₂ ≈⟨ λ-inj lemma ⟩
147+ arr S ∘ eval′ ∘ first (p.p₂ S) ≈˘⟨ pullˡ (△ f) ⟩
148+ arr T ∘ h f ∘ eval′ ∘ first (p.p₂ S) ≈˘⟨ pullʳ β′ ⟩
149+ (arr T ∘ eval′) ∘ first (λg (h f ∘ eval′ ∘ first (p.p₂ S))) ≈˘⟨ pullˡ β′ ⟩
150+ eval′ ∘ first (λg (arr T ∘ eval′)) ∘ first (λg (h f ∘ eval′ ∘ first (p.p₂ S))) ≈⟨ refl⟩∘⟨ first∘first ⟩
151+ eval′ ∘ first (λg (arr T ∘ eval′) ∘ λg (h f ∘ eval′ ∘ first (p.p₂ S))) ∎
152+ where
153+ lemma : λg π₂ ≈ λg (arr S ∘ eval′ ∘ first (p.p₂ S))
154+ lemma = begin
155+ λg π₂ ≈˘⟨ λ-cong (π₂∘⁂ ○ identityˡ) ⟩
156+ λg (π₂ ∘ first (p.p₁ S)) ≈˘⟨ subst ⟩
157+ λg π₂ ∘ p.p₁ S ≈⟨ p.commute S ⟩
158+ λg (arr S ∘ eval′) ∘ p.p₂ S ≈⟨ subst ○ λ-cong assoc ⟩
159+ λg (arr S ∘ eval′ ∘ first (p.p₂ S)) ∎
0 commit comments