2018-01-17 22:00:27 +00:00
|
|
|
|
{-# OPTIONS --cubical --allow-unsolved-metas #-}
|
2018-01-08 21:29:29 +00:00
|
|
|
|
|
2018-01-17 22:00:27 +00:00
|
|
|
|
module Cat.Categories.Cat where
|
2018-01-08 21:29:29 +00:00
|
|
|
|
|
|
|
|
|
open import Agda.Primitive
|
|
|
|
|
open import Cubical
|
|
|
|
|
open import Function
|
|
|
|
|
open import Data.Product renaming (proj₁ to fst ; proj₂ to snd)
|
|
|
|
|
|
2018-01-17 22:00:27 +00:00
|
|
|
|
open import Cat.Category
|
|
|
|
|
open import Cat.Functor
|
2018-01-08 21:29:29 +00:00
|
|
|
|
|
2018-01-21 14:03:00 +00:00
|
|
|
|
-- Tip from Andrea:
|
2018-01-20 23:21:25 +00:00
|
|
|
|
-- Use co-patterns - they help with showing more understandable types in goals.
|
|
|
|
|
lift-eq : ∀ {ℓ} {A B : Set ℓ} {a a' : A} {b b' : B} → a ≡ a' → b ≡ b' → (a , b) ≡ (a' , b')
|
|
|
|
|
fst (lift-eq a b i) = a i
|
|
|
|
|
snd (lift-eq a b i) = b i
|
|
|
|
|
|
2018-01-21 14:03:00 +00:00
|
|
|
|
eqpair : ∀ {ℓa ℓb} {A : Set ℓa} {B : Set ℓb} {a a' : A} {b b' : B}
|
|
|
|
|
→ a ≡ a' → b ≡ b' → (a , b) ≡ (a' , b')
|
|
|
|
|
eqpair eqa eqb i = eqa i , eqb i
|
2018-01-20 23:21:25 +00:00
|
|
|
|
|
|
|
|
|
open Functor
|
2018-01-30 15:23:36 +00:00
|
|
|
|
open IsFunctor
|
2018-01-30 18:19:16 +00:00
|
|
|
|
open Category hiding (_∘_)
|
2018-01-25 11:01:37 +00:00
|
|
|
|
|
2018-01-08 21:29:29 +00:00
|
|
|
|
-- The category of categories
|
2018-01-24 15:38:28 +00:00
|
|
|
|
module _ (ℓ ℓ' : Level) where
|
2018-01-08 21:29:29 +00:00
|
|
|
|
private
|
2018-01-21 00:11:08 +00:00
|
|
|
|
module _ {A B C D : Category ℓ ℓ'} {f : Functor A B} {g : Functor B C} {h : Functor C D} where
|
2018-01-25 11:44:47 +00:00
|
|
|
|
private
|
|
|
|
|
eq* : func* (h ∘f (g ∘f f)) ≡ func* ((h ∘f g) ∘f f)
|
|
|
|
|
eq* = refl
|
|
|
|
|
eq→ : PathP
|
|
|
|
|
(λ i → {x y : A .Object} → A .Arrow x y → D .Arrow (eq* i x) (eq* i y))
|
|
|
|
|
(func→ (h ∘f (g ∘f f))) (func→ ((h ∘f g) ∘f f))
|
|
|
|
|
eq→ = refl
|
|
|
|
|
postulate eqI : PathP
|
|
|
|
|
(λ i → ∀ {c : A .Object} → eq→ i (A .𝟙 {c}) ≡ D .𝟙 {eq* i c})
|
2018-01-30 15:23:36 +00:00
|
|
|
|
((h ∘f (g ∘f f)) .isFunctor .ident)
|
|
|
|
|
(((h ∘f g) ∘f f) .isFunctor .ident)
|
2018-01-25 11:44:47 +00:00
|
|
|
|
postulate eqD : PathP (λ i → { c c' c'' : A .Object} {a : A .Arrow c c'} {a' : A .Arrow c' c''}
|
2018-01-30 18:19:16 +00:00
|
|
|
|
→ eq→ i (A [ a' ∘ a ]) ≡ D [ eq→ i a' ∘ eq→ i a ])
|
2018-01-30 15:23:36 +00:00
|
|
|
|
((h ∘f (g ∘f f)) .isFunctor .distrib) (((h ∘f g) ∘f f) .isFunctor .distrib)
|
2018-01-21 18:23:24 +00:00
|
|
|
|
|
|
|
|
|
assc : h ∘f (g ∘f f) ≡ (h ∘f g) ∘f f
|
2018-01-25 11:11:50 +00:00
|
|
|
|
assc = Functor≡ eq* eq→ eqI eqD
|
2018-01-08 21:29:29 +00:00
|
|
|
|
|
2018-01-25 11:44:47 +00:00
|
|
|
|
module _ {ℂ 𝔻 : Category ℓ ℓ'} {F : Functor ℂ 𝔻} where
|
|
|
|
|
module _ where
|
|
|
|
|
private
|
|
|
|
|
eq* : (func* F) ∘ (func* (identity {C = ℂ})) ≡ func* F
|
|
|
|
|
eq* = refl
|
|
|
|
|
-- lemmm : func→ {C = A} {D = B} (f ∘f identity) ≡ func→ f
|
|
|
|
|
eq→ : PathP
|
|
|
|
|
(λ i →
|
|
|
|
|
{x y : Object ℂ} → Arrow ℂ x y → Arrow 𝔻 (func* F x) (func* F y))
|
|
|
|
|
(func→ (F ∘f identity)) (func→ F)
|
|
|
|
|
eq→ = refl
|
|
|
|
|
postulate
|
|
|
|
|
eqI-r : PathP (λ i → {c : ℂ .Object}
|
|
|
|
|
→ PathP (λ _ → Arrow 𝔻 (func* F c) (func* F c)) (func→ F (ℂ .𝟙)) (𝔻 .𝟙))
|
2018-01-30 15:23:36 +00:00
|
|
|
|
((F ∘f identity) .isFunctor .ident) (F .isFunctor .ident)
|
2018-01-25 11:44:47 +00:00
|
|
|
|
eqD-r : PathP
|
|
|
|
|
(λ i →
|
|
|
|
|
{A B C : ℂ .Object} {f : ℂ .Arrow A B} {g : ℂ .Arrow B C} →
|
2018-01-30 18:19:16 +00:00
|
|
|
|
eq→ i (ℂ [ g ∘ f ]) ≡ 𝔻 [ eq→ i g ∘ eq→ i f ])
|
2018-01-30 15:23:36 +00:00
|
|
|
|
((F ∘f identity) .isFunctor .distrib) (F .isFunctor .distrib)
|
2018-01-25 11:44:47 +00:00
|
|
|
|
ident-r : F ∘f identity ≡ F
|
|
|
|
|
ident-r = Functor≡ eq* eq→ eqI-r eqD-r
|
|
|
|
|
module _ where
|
|
|
|
|
private
|
|
|
|
|
postulate
|
|
|
|
|
eq* : (identity ∘f F) .func* ≡ F .func*
|
|
|
|
|
eq→ : PathP
|
|
|
|
|
(λ i → {x y : Object ℂ} → ℂ .Arrow x y → 𝔻 .Arrow (eq* i x) (eq* i y))
|
|
|
|
|
((identity ∘f F) .func→) (F .func→)
|
|
|
|
|
eqI : PathP (λ i → ∀ {A : ℂ .Object} → eq→ i (ℂ .𝟙 {A}) ≡ 𝔻 .𝟙 {eq* i A})
|
2018-01-30 15:23:36 +00:00
|
|
|
|
((identity ∘f F) .isFunctor .ident) (F .isFunctor .ident)
|
2018-01-25 11:44:47 +00:00
|
|
|
|
eqD : PathP (λ i → {A B C : ℂ .Object} {f : ℂ .Arrow A B} {g : ℂ .Arrow B C}
|
2018-01-30 18:19:16 +00:00
|
|
|
|
→ eq→ i (ℂ [ g ∘ f ]) ≡ 𝔻 [ eq→ i g ∘ eq→ i f ])
|
2018-01-30 15:23:36 +00:00
|
|
|
|
((identity ∘f F) .isFunctor .distrib) (F .isFunctor .distrib)
|
2018-01-25 11:44:47 +00:00
|
|
|
|
ident-l : identity ∘f F ≡ F
|
|
|
|
|
ident-l = Functor≡ eq* eq→ eqI eqD
|
2018-01-08 21:29:29 +00:00
|
|
|
|
|
2018-01-21 14:23:40 +00:00
|
|
|
|
Cat : Category (lsuc (ℓ ⊔ ℓ')) (ℓ ⊔ ℓ')
|
|
|
|
|
Cat =
|
2018-01-08 21:29:29 +00:00
|
|
|
|
record
|
2018-01-21 00:11:08 +00:00
|
|
|
|
{ Object = Category ℓ ℓ'
|
2018-01-08 21:29:29 +00:00
|
|
|
|
; Arrow = Functor
|
|
|
|
|
; 𝟙 = identity
|
2018-01-30 18:19:16 +00:00
|
|
|
|
; _∘_ = _∘f_
|
2018-01-20 23:21:25 +00:00
|
|
|
|
-- What gives here? Why can I not name the variables directly?
|
2018-01-21 18:23:24 +00:00
|
|
|
|
; isCategory = record
|
|
|
|
|
{ assoc = λ {_ _ _ _ f g h} → assc {f = f} {g = g} {h = h}
|
|
|
|
|
; ident = ident-r , ident-l
|
|
|
|
|
}
|
2018-01-08 21:29:29 +00:00
|
|
|
|
}
|
2018-01-20 23:21:25 +00:00
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
module _ {ℓ ℓ' : Level} where
|
|
|
|
|
Catt = Cat ℓ ℓ'
|
|
|
|
|
|
2018-01-25 11:44:47 +00:00
|
|
|
|
module _ (ℂ 𝔻 : Category ℓ ℓ') where
|
2018-01-24 15:38:28 +00:00
|
|
|
|
private
|
2018-01-25 11:44:47 +00:00
|
|
|
|
:Object: = ℂ .Object × 𝔻 .Object
|
2018-01-24 15:38:28 +00:00
|
|
|
|
:Arrow: : :Object: → :Object: → Set ℓ'
|
2018-01-25 11:44:47 +00:00
|
|
|
|
:Arrow: (c , d) (c' , d') = Arrow ℂ c c' × Arrow 𝔻 d d'
|
2018-01-24 15:38:28 +00:00
|
|
|
|
:𝟙: : {o : :Object:} → :Arrow: o o
|
2018-01-25 11:44:47 +00:00
|
|
|
|
:𝟙: = ℂ .𝟙 , 𝔻 .𝟙
|
2018-01-24 15:38:28 +00:00
|
|
|
|
_:⊕:_ :
|
|
|
|
|
{a b c : :Object:} →
|
|
|
|
|
:Arrow: b c →
|
|
|
|
|
:Arrow: a b →
|
|
|
|
|
:Arrow: a c
|
2018-01-30 18:19:16 +00:00
|
|
|
|
_:⊕:_ = λ { (bc∈C , bc∈D) (ab∈C , ab∈D) → ℂ [ bc∈C ∘ ab∈C ] , 𝔻 [ bc∈D ∘ ab∈D ]}
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
|
|
|
|
instance
|
|
|
|
|
:isCategory: : IsCategory :Object: :Arrow: :𝟙: _:⊕:_
|
|
|
|
|
:isCategory: = record
|
|
|
|
|
{ assoc = eqpair C.assoc D.assoc
|
|
|
|
|
; ident
|
|
|
|
|
= eqpair (fst C.ident) (fst D.ident)
|
|
|
|
|
, eqpair (snd C.ident) (snd D.ident)
|
|
|
|
|
}
|
|
|
|
|
where
|
2018-01-25 11:44:47 +00:00
|
|
|
|
open module C = IsCategory (ℂ .isCategory)
|
|
|
|
|
open module D = IsCategory (𝔻 .isCategory)
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
|
|
|
|
:product: : Category ℓ ℓ'
|
|
|
|
|
:product: = record
|
|
|
|
|
{ Object = :Object:
|
|
|
|
|
; Arrow = :Arrow:
|
|
|
|
|
; 𝟙 = :𝟙:
|
2018-01-30 18:19:16 +00:00
|
|
|
|
; _∘_ = _:⊕:_
|
2018-01-21 13:31:37 +00:00
|
|
|
|
}
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
2018-01-25 11:44:47 +00:00
|
|
|
|
proj₁ : Arrow Catt :product: ℂ
|
2018-01-30 15:23:36 +00:00
|
|
|
|
proj₁ = record { func* = fst ; func→ = fst ; isFunctor = record { ident = refl ; distrib = refl } }
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
2018-01-25 11:44:47 +00:00
|
|
|
|
proj₂ : Arrow Catt :product: 𝔻
|
2018-01-30 15:23:36 +00:00
|
|
|
|
proj₂ = record { func* = snd ; func→ = snd ; isFunctor = record { ident = refl ; distrib = refl } }
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
2018-01-25 11:44:47 +00:00
|
|
|
|
module _ {X : Object Catt} (x₁ : Arrow Catt X ℂ) (x₂ : Arrow Catt X 𝔻) where
|
2018-01-24 15:38:28 +00:00
|
|
|
|
open Functor
|
|
|
|
|
|
|
|
|
|
-- ident' : {c : Object X} → ((func→ x₁) {dom = c} (𝟙 X) , (func→ x₂) {dom = c} (𝟙 X)) ≡ 𝟙 (catProduct C D)
|
|
|
|
|
-- ident' {c = c} = lift-eq (ident x₁) (ident x₂)
|
|
|
|
|
|
|
|
|
|
x : Functor X :product:
|
|
|
|
|
x = record
|
|
|
|
|
{ func* = λ x → (func* x₁) x , (func* x₂) x
|
|
|
|
|
; func→ = λ x → func→ x₁ x , func→ x₂ x
|
2018-01-30 15:23:36 +00:00
|
|
|
|
; isFunctor = record
|
|
|
|
|
{ ident = lift-eq x₁.ident x₂.ident
|
|
|
|
|
; distrib = lift-eq x₁.distrib x₂.distrib
|
|
|
|
|
}
|
2018-01-24 15:38:28 +00:00
|
|
|
|
}
|
2018-01-30 15:23:36 +00:00
|
|
|
|
where
|
|
|
|
|
open module x₁ = IsFunctor (x₁ .isFunctor)
|
|
|
|
|
open module x₂ = IsFunctor (x₂ .isFunctor)
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
|
|
|
|
-- Need to "lift equality of functors"
|
|
|
|
|
-- If I want to do this like I do it for pairs it's gonna be a pain.
|
2018-01-30 18:19:16 +00:00
|
|
|
|
postulate isUniqL : Catt [ proj₁ ∘ x ] ≡ x₁
|
2018-01-25 11:44:47 +00:00
|
|
|
|
-- isUniqL = Functor≡ refl refl {!!} {!!}
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
2018-01-30 18:19:16 +00:00
|
|
|
|
postulate isUniqR : Catt [ proj₂ ∘ x ] ≡ x₂
|
2018-01-25 11:44:47 +00:00
|
|
|
|
-- isUniqR = Functor≡ refl refl {!!} {!!}
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
2018-01-30 18:19:16 +00:00
|
|
|
|
isUniq : Catt [ proj₁ ∘ x ] ≡ x₁ × Catt [ proj₂ ∘ x ] ≡ x₂
|
2018-01-24 15:38:28 +00:00
|
|
|
|
isUniq = isUniqL , isUniqR
|
|
|
|
|
|
2018-01-30 18:19:16 +00:00
|
|
|
|
uniq : ∃![ x ] (Catt [ proj₁ ∘ x ] ≡ x₁ × Catt [ proj₂ ∘ x ] ≡ x₂)
|
2018-01-24 15:38:28 +00:00
|
|
|
|
uniq = x , isUniq
|
|
|
|
|
|
2018-01-25 11:44:47 +00:00
|
|
|
|
instance
|
|
|
|
|
isProduct : IsProduct (Cat ℓ ℓ') proj₁ proj₂
|
|
|
|
|
isProduct = uniq
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
2018-01-25 11:44:47 +00:00
|
|
|
|
product : Product {ℂ = (Cat ℓ ℓ')} ℂ 𝔻
|
2018-01-24 15:38:28 +00:00
|
|
|
|
product = record
|
|
|
|
|
{ obj = :product:
|
|
|
|
|
; proj₁ = proj₁
|
|
|
|
|
; proj₂ = proj₂
|
2018-01-21 13:31:37 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
module _ {ℓ ℓ' : Level} where
|
|
|
|
|
instance
|
2018-01-25 11:01:37 +00:00
|
|
|
|
hasProducts : HasProducts (Cat ℓ ℓ')
|
|
|
|
|
hasProducts = record { product = product }
|
2018-01-20 23:21:25 +00:00
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
-- Basically proves that `Cat ℓ ℓ` is cartesian closed.
|
2018-01-25 11:01:37 +00:00
|
|
|
|
module _ (ℓ : Level) where
|
2018-01-24 15:38:28 +00:00
|
|
|
|
private
|
2018-01-25 11:01:37 +00:00
|
|
|
|
open Data.Product
|
2018-01-24 15:38:28 +00:00
|
|
|
|
open import Cat.Categories.Fun
|
2018-01-25 11:01:37 +00:00
|
|
|
|
|
|
|
|
|
Catℓ : Category (lsuc (ℓ ⊔ ℓ)) (ℓ ⊔ ℓ)
|
|
|
|
|
Catℓ = Cat ℓ ℓ
|
2018-01-24 15:38:28 +00:00
|
|
|
|
module _ (ℂ 𝔻 : Category ℓ ℓ) where
|
|
|
|
|
private
|
|
|
|
|
:obj: : Cat ℓ ℓ .Object
|
|
|
|
|
:obj: = Fun {ℂ = ℂ} {𝔻 = 𝔻}
|
2018-01-20 23:21:25 +00:00
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
:func*: : Functor ℂ 𝔻 × ℂ .Object → 𝔻 .Object
|
|
|
|
|
:func*: (F , A) = F .func* A
|
2018-01-20 23:21:25 +00:00
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
module _ {dom cod : Functor ℂ 𝔻 × ℂ .Object} where
|
|
|
|
|
private
|
|
|
|
|
F : Functor ℂ 𝔻
|
|
|
|
|
F = proj₁ dom
|
|
|
|
|
A : ℂ .Object
|
|
|
|
|
A = proj₂ dom
|
2018-01-20 23:21:25 +00:00
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
G : Functor ℂ 𝔻
|
|
|
|
|
G = proj₁ cod
|
|
|
|
|
B : ℂ .Object
|
|
|
|
|
B = proj₂ cod
|
2018-01-20 23:21:25 +00:00
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
:func→: : (pobj : NaturalTransformation F G × ℂ .Arrow A B)
|
|
|
|
|
→ 𝔻 .Arrow (F .func* A) (G .func* B)
|
|
|
|
|
:func→: ((θ , θNat) , f) = result
|
|
|
|
|
where
|
|
|
|
|
θA : 𝔻 .Arrow (F .func* A) (G .func* A)
|
|
|
|
|
θA = θ A
|
|
|
|
|
θB : 𝔻 .Arrow (F .func* B) (G .func* B)
|
|
|
|
|
θB = θ B
|
|
|
|
|
F→f : 𝔻 .Arrow (F .func* A) (F .func* B)
|
|
|
|
|
F→f = F .func→ f
|
|
|
|
|
G→f : 𝔻 .Arrow (G .func* A) (G .func* B)
|
|
|
|
|
G→f = G .func→ f
|
|
|
|
|
l : 𝔻 .Arrow (F .func* A) (G .func* B)
|
2018-01-30 18:19:16 +00:00
|
|
|
|
l = 𝔻 [ θB ∘ F→f ]
|
2018-01-24 15:38:28 +00:00
|
|
|
|
r : 𝔻 .Arrow (F .func* A) (G .func* B)
|
2018-01-30 18:19:16 +00:00
|
|
|
|
r = 𝔻 [ G→f ∘ θA ]
|
2018-01-24 15:38:28 +00:00
|
|
|
|
-- There are two choices at this point,
|
|
|
|
|
-- but I suppose the whole point is that
|
|
|
|
|
-- by `θNat f` we have `l ≡ r`
|
2018-01-30 18:19:16 +00:00
|
|
|
|
-- lem : 𝔻 [ θ B ∘ F .func→ f ] ≡ 𝔻 [ G .func→ f ∘ θ A ]
|
2018-01-24 15:38:28 +00:00
|
|
|
|
-- lem = θNat f
|
|
|
|
|
result : 𝔻 .Arrow (F .func* A) (G .func* B)
|
|
|
|
|
result = l
|
2018-01-20 23:21:25 +00:00
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
_×p_ = product
|
2018-01-20 23:21:25 +00:00
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
module _ {c : Functor ℂ 𝔻 × ℂ .Object} where
|
|
|
|
|
private
|
|
|
|
|
F : Functor ℂ 𝔻
|
|
|
|
|
F = proj₁ c
|
|
|
|
|
C : ℂ .Object
|
|
|
|
|
C = proj₂ c
|
2018-01-20 23:21:25 +00:00
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
-- NaturalTransformation F G × ℂ .Arrow A B
|
2018-01-25 11:01:37 +00:00
|
|
|
|
-- :ident: : :func→: {c} {c} (identityNat F , ℂ .𝟙) ≡ 𝔻 .𝟙
|
|
|
|
|
-- :ident: = trans (proj₂ 𝔻.ident) (F .ident)
|
2018-01-24 15:38:28 +00:00
|
|
|
|
-- where
|
|
|
|
|
-- open module 𝔻 = IsCategory (𝔻 .isCategory)
|
2018-01-25 11:01:37 +00:00
|
|
|
|
-- Unfortunately the equational version has some ambigous arguments.
|
|
|
|
|
:ident: : :func→: {c} {c} (identityNat F , ℂ .𝟙 {o = proj₂ c}) ≡ 𝔻 .𝟙
|
|
|
|
|
:ident: = begin
|
|
|
|
|
:func→: {c} {c} ((:obj: ×p ℂ) .Product.obj .𝟙 {c}) ≡⟨⟩
|
|
|
|
|
:func→: {c} {c} (identityNat F , ℂ .𝟙) ≡⟨⟩
|
2018-01-30 18:19:16 +00:00
|
|
|
|
𝔻 [ identityTrans F C ∘ F .func→ (ℂ .𝟙)] ≡⟨⟩
|
|
|
|
|
𝔻 [ 𝔻 .𝟙 ∘ F .func→ (ℂ .𝟙)] ≡⟨ proj₂ 𝔻.ident ⟩
|
2018-01-30 15:23:36 +00:00
|
|
|
|
F .func→ (ℂ .𝟙) ≡⟨ F.ident ⟩
|
2018-01-30 18:19:16 +00:00
|
|
|
|
𝔻 .𝟙 ∎
|
2018-01-25 11:01:37 +00:00
|
|
|
|
where
|
|
|
|
|
open module 𝔻 = IsCategory (𝔻 .isCategory)
|
2018-01-30 15:23:36 +00:00
|
|
|
|
open module F = IsFunctor (F .isFunctor)
|
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
module _ {F×A G×B H×C : Functor ℂ 𝔻 × ℂ .Object} where
|
|
|
|
|
F = F×A .proj₁
|
|
|
|
|
A = F×A .proj₂
|
|
|
|
|
G = G×B .proj₁
|
|
|
|
|
B = G×B .proj₂
|
|
|
|
|
H = H×C .proj₁
|
|
|
|
|
C = H×C .proj₂
|
|
|
|
|
-- Not entirely clear what this is at this point:
|
2018-01-30 18:19:16 +00:00
|
|
|
|
_P⊕_ = (:obj: ×p ℂ) .Product.obj .Category._∘_ {F×A} {G×B} {H×C}
|
2018-01-24 15:38:28 +00:00
|
|
|
|
module _
|
|
|
|
|
-- NaturalTransformation F G × ℂ .Arrow A B
|
2018-01-25 11:01:37 +00:00
|
|
|
|
{θ×f : NaturalTransformation F G × ℂ .Arrow A B}
|
|
|
|
|
{η×g : NaturalTransformation G H × ℂ .Arrow B C} where
|
|
|
|
|
private
|
|
|
|
|
θ : Transformation F G
|
|
|
|
|
θ = proj₁ (proj₁ θ×f)
|
|
|
|
|
θNat : Natural F G θ
|
|
|
|
|
θNat = proj₂ (proj₁ θ×f)
|
|
|
|
|
f : ℂ .Arrow A B
|
|
|
|
|
f = proj₂ θ×f
|
|
|
|
|
η : Transformation G H
|
|
|
|
|
η = proj₁ (proj₁ η×g)
|
|
|
|
|
ηNat : Natural G H η
|
|
|
|
|
ηNat = proj₂ (proj₁ η×g)
|
|
|
|
|
g : ℂ .Arrow B C
|
|
|
|
|
g = proj₂ η×g
|
|
|
|
|
|
|
|
|
|
ηθNT : NaturalTransformation F H
|
2018-01-30 18:19:16 +00:00
|
|
|
|
ηθNT = Fun .Category._∘_ {F} {G} {H} (η , ηNat) (θ , θNat)
|
2018-01-25 11:01:37 +00:00
|
|
|
|
|
|
|
|
|
ηθ = proj₁ ηθNT
|
|
|
|
|
ηθNat = proj₂ ηθNT
|
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
:distrib: :
|
2018-01-30 18:19:16 +00:00
|
|
|
|
𝔻 [ 𝔻 [ η C ∘ θ C ] ∘ F .func→ ( ℂ [ g ∘ f ] ) ]
|
|
|
|
|
≡ 𝔻 [ 𝔻 [ η C ∘ G .func→ g ] ∘ 𝔻 [ θ B ∘ F .func→ f ] ]
|
2018-01-24 15:38:28 +00:00
|
|
|
|
:distrib: = begin
|
2018-01-30 18:19:16 +00:00
|
|
|
|
𝔻 [ (ηθ C) ∘ F .func→ (ℂ [ g ∘ f ]) ]
|
|
|
|
|
≡⟨ ηθNat (ℂ [ g ∘ f ]) ⟩
|
|
|
|
|
𝔻 [ H .func→ (ℂ [ g ∘ f ]) ∘ (ηθ A) ]
|
|
|
|
|
≡⟨ cong (λ φ → 𝔻 [ φ ∘ ηθ A ]) (H.distrib) ⟩
|
|
|
|
|
𝔻 [ 𝔻 [ H .func→ g ∘ H .func→ f ] ∘ (ηθ A) ]
|
|
|
|
|
≡⟨ sym assoc ⟩
|
|
|
|
|
𝔻 [ H .func→ g ∘ 𝔻 [ H .func→ f ∘ ηθ A ] ]
|
|
|
|
|
≡⟨ cong (λ φ → 𝔻 [ H .func→ g ∘ φ ]) assoc ⟩
|
|
|
|
|
𝔻 [ H .func→ g ∘ 𝔻 [ 𝔻 [ H .func→ f ∘ η A ] ∘ θ A ] ]
|
|
|
|
|
≡⟨ cong (λ φ → 𝔻 [ H .func→ g ∘ φ ]) (cong (λ φ → 𝔻 [ φ ∘ θ A ]) (sym (ηNat f))) ⟩
|
|
|
|
|
𝔻 [ H .func→ g ∘ 𝔻 [ 𝔻 [ η B ∘ G .func→ f ] ∘ θ A ] ]
|
|
|
|
|
≡⟨ cong (λ φ → 𝔻 [ H .func→ g ∘ φ ]) (sym assoc) ⟩
|
|
|
|
|
𝔻 [ H .func→ g ∘ 𝔻 [ η B ∘ 𝔻 [ G .func→ f ∘ θ A ] ] ] ≡⟨ assoc ⟩
|
|
|
|
|
𝔻 [ 𝔻 [ H .func→ g ∘ η B ] ∘ 𝔻 [ G .func→ f ∘ θ A ] ]
|
|
|
|
|
≡⟨ cong (λ φ → 𝔻 [ φ ∘ 𝔻 [ G .func→ f ∘ θ A ] ]) (sym (ηNat g)) ⟩
|
|
|
|
|
𝔻 [ 𝔻 [ η C ∘ G .func→ g ] ∘ 𝔻 [ G .func→ f ∘ θ A ] ]
|
|
|
|
|
≡⟨ cong (λ φ → 𝔻 [ 𝔻 [ η C ∘ G .func→ g ] ∘ φ ]) (sym (θNat f)) ⟩
|
|
|
|
|
𝔻 [ 𝔻 [ η C ∘ G .func→ g ] ∘ 𝔻 [ θ B ∘ F .func→ f ] ] ∎
|
2018-01-24 15:38:28 +00:00
|
|
|
|
where
|
2018-01-25 11:01:37 +00:00
|
|
|
|
open IsCategory (𝔻 .isCategory)
|
2018-01-30 15:23:36 +00:00
|
|
|
|
open module H = IsFunctor (H .isFunctor)
|
2018-01-25 11:01:37 +00:00
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
:eval: : Functor ((:obj: ×p ℂ) .Product.obj) 𝔻
|
|
|
|
|
:eval: = record
|
|
|
|
|
{ func* = :func*:
|
|
|
|
|
; func→ = λ {dom} {cod} → :func→: {dom} {cod}
|
2018-01-30 15:23:36 +00:00
|
|
|
|
; isFunctor = record
|
|
|
|
|
{ ident = λ {o} → :ident: {o}
|
|
|
|
|
; distrib = λ {f u n k y} → :distrib: {f} {u} {n} {k} {y}
|
|
|
|
|
}
|
2018-01-24 15:38:28 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module _ (𝔸 : Category ℓ ℓ) (F : Functor ((𝔸 ×p ℂ) .Product.obj) 𝔻) where
|
2018-01-25 11:01:37 +00:00
|
|
|
|
open HasProducts (hasProducts {ℓ} {ℓ}) using (parallelProduct)
|
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
postulate
|
|
|
|
|
transpose : Functor 𝔸 :obj:
|
2018-01-30 18:19:16 +00:00
|
|
|
|
eq : Catℓ [ :eval: ∘ (parallelProduct transpose (Catℓ .𝟙 {o = ℂ})) ] ≡ F
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
2018-01-30 18:19:16 +00:00
|
|
|
|
catTranspose : ∃![ F~ ] (Catℓ [ :eval: ∘ (parallelProduct F~ (Catℓ .𝟙 {o = ℂ}))] ≡ F )
|
2018-01-24 15:38:28 +00:00
|
|
|
|
catTranspose = transpose , eq
|
|
|
|
|
|
|
|
|
|
:isExponential: : IsExponential Catℓ ℂ 𝔻 :obj: :eval:
|
|
|
|
|
:isExponential: = catTranspose
|
|
|
|
|
|
|
|
|
|
-- :exponent: : Exponential (Cat ℓ ℓ) A B
|
|
|
|
|
:exponent: : Exponential Catℓ ℂ 𝔻
|
|
|
|
|
:exponent: = record
|
|
|
|
|
{ obj = :obj:
|
|
|
|
|
; eval = :eval:
|
|
|
|
|
; isExponential = :isExponential:
|
|
|
|
|
}
|
2018-01-20 23:21:25 +00:00
|
|
|
|
|
2018-01-25 11:01:37 +00:00
|
|
|
|
hasExponentials : HasExponentials (Cat ℓ ℓ)
|
|
|
|
|
hasExponentials = record { exponent = :exponent: }
|