Skip to content

Commit 44363cc

Browse files
committed
First shot of other adjoint functor
1 parent e5fef74 commit 44363cc

File tree

1 file changed

+62
-1
lines changed

1 file changed

+62
-1
lines changed

src/Categories/Functor/Slice.agda

Lines changed: 62 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,22 @@ open import Categories.Category using (Category)
44

55
module 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
912
open import Categories.Diagram.Pullback C using (Pullback; unglue; Pullback-resp-≈)
1013
open import Categories.Functor using (Functor)
1114
open import Categories.Functor.Properties using ([_]-resp-∘)
1215
open import Categories.Morphism.Reasoning C
16+
open import Categories.Object.Exponential C
1317
open import Categories.Object.Product C
18+
open import Categories.Object.Terminal C
1419

1520
import Categories.Category.Slice as S
1621
import Categories.Category.Construction.Pullbacks as Pbs
22+
import Categories.Object.Product.Construction as ×C
1723

1824
open Category C
1925
open 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

Comments
 (0)