2018-02-02 14:33:54 +00:00
|
|
|
|
-- There is no category of categories in our interpretation
|
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
|
2018-02-05 15:35:33 +00:00
|
|
|
|
open import Cat.Category.Functor
|
|
|
|
|
open import Cat.Category.Product
|
2018-03-05 12:52:41 +00:00
|
|
|
|
open import Cat.Category.Exponential hiding (_×_ ; product)
|
2018-02-23 16:33:09 +00:00
|
|
|
|
open import Cat.Category.NaturalTransformation
|
2018-01-08 21:29:29 +00:00
|
|
|
|
|
2018-01-31 13:39:54 +00:00
|
|
|
|
open import Cat.Equality
|
|
|
|
|
open Equality.Data.Product
|
2018-01-20 23:21:25 +00:00
|
|
|
|
|
2018-03-08 10:03:56 +00:00
|
|
|
|
open Functor using (fmap ; omap)
|
2018-02-22 14:31:54 +00:00
|
|
|
|
open Category using (Object ; 𝟙)
|
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-31 13:39:54 +00:00
|
|
|
|
module _ {𝔸 𝔹 ℂ 𝔻 : Category ℓ ℓ'} {F : Functor 𝔸 𝔹} {G : Functor 𝔹 ℂ} {H : Functor ℂ 𝔻} where
|
2018-02-24 11:55:08 +00:00
|
|
|
|
assc : F[ H ∘ F[ G ∘ F ] ] ≡ F[ F[ H ∘ G ] ∘ F ]
|
2018-03-05 16:10:41 +00:00
|
|
|
|
assc = Functor≡ refl
|
2018-01-08 21:29:29 +00:00
|
|
|
|
|
2018-01-25 11:44:47 +00:00
|
|
|
|
module _ {ℂ 𝔻 : Category ℓ ℓ'} {F : Functor ℂ 𝔻} where
|
2018-02-24 11:55:08 +00:00
|
|
|
|
ident-r : F[ F ∘ identity ] ≡ F
|
2018-03-05 16:10:41 +00:00
|
|
|
|
ident-r = Functor≡ refl
|
2018-02-23 11:15:16 +00:00
|
|
|
|
|
2018-02-24 11:55:08 +00:00
|
|
|
|
ident-l : F[ identity ∘ F ] ≡ F
|
2018-03-05 16:10:41 +00:00
|
|
|
|
ident-l = Functor≡ refl
|
2018-01-08 21:29:29 +00:00
|
|
|
|
|
2018-02-23 09:34:37 +00:00
|
|
|
|
RawCat : RawCategory (lsuc (ℓ ⊔ ℓ')) (ℓ ⊔ ℓ')
|
|
|
|
|
RawCat =
|
|
|
|
|
record
|
|
|
|
|
{ Object = Category ℓ ℓ'
|
|
|
|
|
; Arrow = Functor
|
|
|
|
|
; 𝟙 = identity
|
2018-02-24 11:55:08 +00:00
|
|
|
|
; _∘_ = F[_∘_]
|
2018-02-23 09:34:37 +00:00
|
|
|
|
}
|
|
|
|
|
private
|
2018-02-23 11:15:16 +00:00
|
|
|
|
open RawCategory RawCat
|
2018-02-23 11:43:49 +00:00
|
|
|
|
isAssociative : IsAssociative
|
|
|
|
|
isAssociative {f = F} {G} {H} = assc {F = F} {G = G} {H = H}
|
2018-03-08 00:09:40 +00:00
|
|
|
|
ident : IsIdentity identity
|
|
|
|
|
ident = ident-r , ident-l
|
2018-02-23 09:34:37 +00:00
|
|
|
|
-- NB! `ArrowsAreSets RawCat` is *not* provable. The type of functors,
|
|
|
|
|
-- however, form a groupoid! Therefore there is no (1-)category of
|
|
|
|
|
-- categories. There does, however, exist a 2-category of 1-categories.
|
|
|
|
|
|
|
|
|
|
-- Because of the note above there is not category of categories.
|
|
|
|
|
Cat : (unprovable : IsCategory RawCat) → Category (lsuc (ℓ ⊔ ℓ')) (ℓ ⊔ ℓ')
|
|
|
|
|
Category.raw (Cat _) = RawCat
|
|
|
|
|
Category.isCategory (Cat unprovable) = unprovable
|
|
|
|
|
-- Category.raw Cat _ = RawCat
|
|
|
|
|
-- Category.isCategory Cat unprovable = unprovable
|
|
|
|
|
|
|
|
|
|
-- The following to some extend depends on the category of categories being a
|
|
|
|
|
-- category. In some places it may not actually be needed, however.
|
2018-03-05 10:13:37 +00:00
|
|
|
|
module CatProduct {ℓ ℓ' : Level} (ℂ 𝔻 : Category ℓ ℓ') where
|
2018-03-05 10:01:36 +00:00
|
|
|
|
private
|
|
|
|
|
:Object: = Object ℂ × Object 𝔻
|
|
|
|
|
:Arrow: : :Object: → :Object: → Set ℓ'
|
|
|
|
|
:Arrow: (c , d) (c' , d') = ℂ [ c , c' ] × 𝔻 [ d , d' ]
|
|
|
|
|
:𝟙: : {o : :Object:} → :Arrow: o o
|
|
|
|
|
:𝟙: = 𝟙 ℂ , 𝟙 𝔻
|
|
|
|
|
_:⊕:_ :
|
|
|
|
|
{a b c : :Object:} →
|
|
|
|
|
:Arrow: b c →
|
|
|
|
|
:Arrow: a b →
|
|
|
|
|
:Arrow: a c
|
|
|
|
|
_:⊕:_ = λ { (bc∈C , bc∈D) (ab∈C , ab∈D) → ℂ [ bc∈C ∘ ab∈C ] , 𝔻 [ bc∈D ∘ ab∈D ]}
|
|
|
|
|
|
|
|
|
|
:rawProduct: : RawCategory ℓ ℓ'
|
|
|
|
|
RawCategory.Object :rawProduct: = :Object:
|
|
|
|
|
RawCategory.Arrow :rawProduct: = :Arrow:
|
|
|
|
|
RawCategory.𝟙 :rawProduct: = :𝟙:
|
|
|
|
|
RawCategory._∘_ :rawProduct: = _:⊕:_
|
|
|
|
|
open RawCategory :rawProduct:
|
|
|
|
|
|
|
|
|
|
module ℂ = Category ℂ
|
|
|
|
|
module 𝔻 = Category 𝔻
|
|
|
|
|
open import Cubical.Sigma
|
|
|
|
|
arrowsAreSets : ArrowsAreSets -- {A B : RawCategory.Object :rawProduct:} → isSet (Arrow A B)
|
|
|
|
|
arrowsAreSets = setSig {sA = ℂ.arrowsAreSets} {sB = λ x → 𝔻.arrowsAreSets}
|
|
|
|
|
isIdentity : IsIdentity :𝟙:
|
|
|
|
|
isIdentity
|
|
|
|
|
= Σ≡ (fst ℂ.isIdentity) (fst 𝔻.isIdentity)
|
|
|
|
|
, Σ≡ (snd ℂ.isIdentity) (snd 𝔻.isIdentity)
|
|
|
|
|
postulate univalent : Univalence.Univalent :rawProduct: isIdentity
|
|
|
|
|
instance
|
|
|
|
|
:isCategory: : IsCategory :rawProduct:
|
|
|
|
|
IsCategory.isAssociative :isCategory: = Σ≡ ℂ.isAssociative 𝔻.isAssociative
|
|
|
|
|
IsCategory.isIdentity :isCategory: = isIdentity
|
|
|
|
|
IsCategory.arrowsAreSets :isCategory: = arrowsAreSets
|
|
|
|
|
IsCategory.univalent :isCategory: = univalent
|
|
|
|
|
|
|
|
|
|
obj : Category ℓ ℓ'
|
|
|
|
|
Category.raw obj = :rawProduct:
|
|
|
|
|
|
|
|
|
|
proj₁ : Functor obj ℂ
|
|
|
|
|
proj₁ = record
|
2018-03-08 10:03:56 +00:00
|
|
|
|
{ raw = record { omap = fst ; fmap = fst }
|
2018-03-05 10:01:36 +00:00
|
|
|
|
; isFunctor = record { isIdentity = refl ; isDistributive = refl }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
proj₂ : Functor obj 𝔻
|
|
|
|
|
proj₂ = record
|
2018-03-08 10:03:56 +00:00
|
|
|
|
{ raw = record { omap = snd ; fmap = snd }
|
2018-03-05 10:01:36 +00:00
|
|
|
|
; isFunctor = record { isIdentity = refl ; isDistributive = refl }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
module _ {X : Category ℓ ℓ'} (x₁ : Functor X ℂ) (x₂ : Functor X 𝔻) where
|
2018-01-24 15:38:28 +00:00
|
|
|
|
private
|
2018-03-05 10:01:36 +00:00
|
|
|
|
x : Functor X obj
|
|
|
|
|
x = record
|
|
|
|
|
{ raw = record
|
2018-03-08 10:03:56 +00:00
|
|
|
|
{ omap = λ x → x₁.omap x , x₂.omap x
|
|
|
|
|
; fmap = λ x → x₁.fmap x , x₂.fmap x
|
2018-02-23 11:29:10 +00:00
|
|
|
|
}
|
2018-03-05 10:01:36 +00:00
|
|
|
|
; isFunctor = record
|
|
|
|
|
{ isIdentity = Σ≡ x₁.isIdentity x₂.isIdentity
|
|
|
|
|
; isDistributive = Σ≡ x₁.isDistributive x₂.isDistributive
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
where
|
|
|
|
|
open module x₁ = Functor x₁
|
|
|
|
|
open module x₂ = Functor x₂
|
2018-02-23 11:29:10 +00:00
|
|
|
|
|
2018-03-05 10:01:36 +00:00
|
|
|
|
isUniqL : F[ proj₁ ∘ x ] ≡ x₁
|
2018-03-05 16:10:41 +00:00
|
|
|
|
isUniqL = Functor≡ refl
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
2018-03-05 10:01:36 +00:00
|
|
|
|
isUniqR : F[ proj₂ ∘ x ] ≡ x₂
|
2018-03-05 16:10:41 +00:00
|
|
|
|
isUniqR = Functor≡ refl
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
2018-03-05 10:01:36 +00:00
|
|
|
|
isUniq : F[ proj₁ ∘ x ] ≡ x₁ × F[ proj₂ ∘ x ] ≡ x₂
|
|
|
|
|
isUniq = isUniqL , isUniqR
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
2018-03-05 10:01:36 +00:00
|
|
|
|
isProduct : ∃![ x ] (F[ proj₁ ∘ x ] ≡ x₁ × F[ proj₂ ∘ x ] ≡ x₂)
|
|
|
|
|
isProduct = x , isUniq
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
2018-03-05 10:01:36 +00:00
|
|
|
|
module _ {ℓ ℓ' : Level} (unprovable : IsCategory (RawCat ℓ ℓ')) where
|
|
|
|
|
private
|
|
|
|
|
Catℓ = Cat ℓ ℓ' unprovable
|
2018-03-05 10:13:37 +00:00
|
|
|
|
|
2018-03-05 10:01:36 +00:00
|
|
|
|
module _ (ℂ 𝔻 : Category ℓ ℓ') where
|
|
|
|
|
private
|
2018-03-05 10:13:37 +00:00
|
|
|
|
module P = CatProduct ℂ 𝔻
|
2018-03-05 09:35:33 +00:00
|
|
|
|
|
2018-03-08 09:22:21 +00:00
|
|
|
|
rawProduct : RawProduct Catℓ ℂ 𝔻
|
2018-03-08 09:45:15 +00:00
|
|
|
|
RawProduct.object rawProduct = P.obj
|
|
|
|
|
RawProduct.proj₁ rawProduct = P.proj₁
|
|
|
|
|
RawProduct.proj₂ rawProduct = P.proj₂
|
2018-03-08 09:20:29 +00:00
|
|
|
|
|
2018-03-08 09:28:05 +00:00
|
|
|
|
isProduct : IsProduct Catℓ _ _ rawProduct
|
2018-03-08 09:20:29 +00:00
|
|
|
|
IsProduct.isProduct isProduct = P.isProduct
|
2018-01-24 15:38:28 +00:00
|
|
|
|
|
2018-03-08 09:22:21 +00:00
|
|
|
|
product : Product Catℓ ℂ 𝔻
|
2018-03-08 09:20:29 +00:00
|
|
|
|
Product.raw product = rawProduct
|
|
|
|
|
Product.isProduct product = isProduct
|
2018-01-21 13:31:37 +00:00
|
|
|
|
|
2018-01-24 15:38:28 +00:00
|
|
|
|
instance
|
2018-03-05 10:01:36 +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-03-05 12:52:41 +00:00
|
|
|
|
module CatExponential {ℓ : Level} (ℂ 𝔻 : Category ℓ ℓ) where
|
|
|
|
|
open Data.Product
|
|
|
|
|
open import Cat.Categories.Fun
|
|
|
|
|
|
|
|
|
|
Categoryℓ = Category ℓ ℓ
|
|
|
|
|
open Fun ℂ 𝔻 renaming (identity to idN)
|
2018-01-24 15:38:28 +00:00
|
|
|
|
private
|
2018-03-08 10:03:56 +00:00
|
|
|
|
:omap: : Functor ℂ 𝔻 × Object ℂ → Object 𝔻
|
|
|
|
|
:omap: (F , A) = omap F A
|
2018-01-25 11:01:37 +00:00
|
|
|
|
|
2018-03-05 12:52:41 +00:00
|
|
|
|
prodObj : Categoryℓ
|
|
|
|
|
prodObj = Fun
|
|
|
|
|
|
|
|
|
|
module _ {dom cod : Functor ℂ 𝔻 × Object ℂ} where
|
|
|
|
|
private
|
|
|
|
|
F : Functor ℂ 𝔻
|
|
|
|
|
F = proj₁ dom
|
|
|
|
|
A : Object ℂ
|
|
|
|
|
A = proj₂ dom
|
|
|
|
|
|
|
|
|
|
G : Functor ℂ 𝔻
|
|
|
|
|
G = proj₁ cod
|
|
|
|
|
B : Object ℂ
|
|
|
|
|
B = proj₂ cod
|
|
|
|
|
|
2018-03-08 10:03:56 +00:00
|
|
|
|
:fmap: : (pobj : NaturalTransformation F G × ℂ [ A , B ])
|
|
|
|
|
→ 𝔻 [ omap F A , omap G B ]
|
|
|
|
|
:fmap: ((θ , θNat) , f) = result
|
2018-03-05 12:52:41 +00:00
|
|
|
|
where
|
2018-03-08 10:03:56 +00:00
|
|
|
|
θA : 𝔻 [ omap F A , omap G A ]
|
2018-03-05 12:52:41 +00:00
|
|
|
|
θA = θ A
|
2018-03-08 10:03:56 +00:00
|
|
|
|
θB : 𝔻 [ omap F B , omap G B ]
|
2018-03-05 12:52:41 +00:00
|
|
|
|
θB = θ B
|
2018-03-08 10:03:56 +00:00
|
|
|
|
F→f : 𝔻 [ omap F A , omap F B ]
|
|
|
|
|
F→f = fmap F f
|
|
|
|
|
G→f : 𝔻 [ omap G A , omap G B ]
|
|
|
|
|
G→f = fmap G f
|
|
|
|
|
l : 𝔻 [ omap F A , omap G B ]
|
2018-03-05 12:52:41 +00:00
|
|
|
|
l = 𝔻 [ θB ∘ F→f ]
|
2018-03-08 10:03:56 +00:00
|
|
|
|
r : 𝔻 [ omap F A , omap G B ]
|
2018-03-05 12:52:41 +00:00
|
|
|
|
r = 𝔻 [ G→f ∘ θA ]
|
|
|
|
|
-- There are two choices at this point,
|
|
|
|
|
-- but I suppose the whole point is that
|
|
|
|
|
-- by `θNat f` we have `l ≡ r`
|
2018-03-08 10:03:56 +00:00
|
|
|
|
-- lem : 𝔻 [ θ B ∘ F .fmap f ] ≡ 𝔻 [ G .fmap f ∘ θ A ]
|
2018-03-05 12:52:41 +00:00
|
|
|
|
-- lem = θNat f
|
2018-03-08 10:03:56 +00:00
|
|
|
|
result : 𝔻 [ omap F A , omap G B ]
|
2018-03-05 12:52:41 +00:00
|
|
|
|
result = l
|
|
|
|
|
|
|
|
|
|
open CatProduct renaming (obj to _×p_) using ()
|
|
|
|
|
|
|
|
|
|
module _ {c : Functor ℂ 𝔻 × Object ℂ} where
|
|
|
|
|
private
|
|
|
|
|
F : Functor ℂ 𝔻
|
|
|
|
|
F = proj₁ c
|
|
|
|
|
C : Object ℂ
|
|
|
|
|
C = proj₂ c
|
|
|
|
|
|
|
|
|
|
-- NaturalTransformation F G × ℂ .Arrow A B
|
2018-03-08 10:03:56 +00:00
|
|
|
|
-- :ident: : :fmap: {c} {c} (identityNat F , ℂ .𝟙) ≡ 𝔻 .𝟙
|
2018-03-05 12:52:41 +00:00
|
|
|
|
-- :ident: = trans (proj₂ 𝔻.isIdentity) (F .isIdentity)
|
|
|
|
|
-- where
|
|
|
|
|
-- open module 𝔻 = IsCategory (𝔻 .isCategory)
|
|
|
|
|
-- Unfortunately the equational version has some ambigous arguments.
|
|
|
|
|
|
2018-03-08 10:03:56 +00:00
|
|
|
|
:ident: : :fmap: {c} {c} (NT.identity F , 𝟙 ℂ {A = proj₂ c}) ≡ 𝟙 𝔻
|
2018-03-05 12:52:41 +00:00
|
|
|
|
:ident: = begin
|
2018-03-08 10:03:56 +00:00
|
|
|
|
:fmap: {c} {c} (𝟙 (prodObj ×p ℂ) {c}) ≡⟨⟩
|
|
|
|
|
:fmap: {c} {c} (idN F , 𝟙 ℂ) ≡⟨⟩
|
|
|
|
|
𝔻 [ identityTrans F C ∘ fmap F (𝟙 ℂ)] ≡⟨⟩
|
|
|
|
|
𝔻 [ 𝟙 𝔻 ∘ fmap F (𝟙 ℂ)] ≡⟨ proj₂ 𝔻.isIdentity ⟩
|
|
|
|
|
fmap F (𝟙 ℂ) ≡⟨ F.isIdentity ⟩
|
2018-03-05 12:52:41 +00:00
|
|
|
|
𝟙 𝔻 ∎
|
|
|
|
|
where
|
|
|
|
|
open module 𝔻 = Category 𝔻
|
|
|
|
|
open module F = Functor F
|
|
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
_P⊕_ = Category._∘_ (prodObj ×p ℂ) {F×A} {G×B} {H×C}
|
|
|
|
|
module _
|
|
|
|
|
-- NaturalTransformation F G × ℂ .Arrow A B
|
|
|
|
|
{θ×f : NaturalTransformation F G × ℂ [ A , B ]}
|
|
|
|
|
{η×g : NaturalTransformation G H × ℂ [ B , C ]} where
|
2018-01-24 15:38:28 +00:00
|
|
|
|
private
|
2018-03-05 12:52:41 +00:00
|
|
|
|
θ : Transformation F G
|
|
|
|
|
θ = proj₁ (proj₁ θ×f)
|
|
|
|
|
θNat : Natural F G θ
|
|
|
|
|
θNat = proj₂ (proj₁ θ×f)
|
|
|
|
|
f : ℂ [ A , B ]
|
|
|
|
|
f = proj₂ θ×f
|
|
|
|
|
η : Transformation G H
|
|
|
|
|
η = proj₁ (proj₁ η×g)
|
|
|
|
|
ηNat : Natural G H η
|
|
|
|
|
ηNat = proj₂ (proj₁ η×g)
|
|
|
|
|
g : ℂ [ B , C ]
|
|
|
|
|
g = proj₂ η×g
|
|
|
|
|
|
|
|
|
|
ηθNT : NaturalTransformation F H
|
|
|
|
|
ηθNT = Category._∘_ Fun {F} {G} {H} (η , ηNat) (θ , θNat)
|
|
|
|
|
|
|
|
|
|
ηθ = proj₁ ηθNT
|
|
|
|
|
ηθNat = proj₂ ηθNT
|
|
|
|
|
|
|
|
|
|
:isDistributive: :
|
2018-03-08 10:03:56 +00:00
|
|
|
|
𝔻 [ 𝔻 [ η C ∘ θ C ] ∘ fmap F ( ℂ [ g ∘ f ] ) ]
|
|
|
|
|
≡ 𝔻 [ 𝔻 [ η C ∘ fmap G g ] ∘ 𝔻 [ θ B ∘ fmap F f ] ]
|
2018-03-05 12:52:41 +00:00
|
|
|
|
:isDistributive: = begin
|
2018-03-08 10:03:56 +00:00
|
|
|
|
𝔻 [ (ηθ C) ∘ fmap F (ℂ [ g ∘ f ]) ]
|
2018-03-05 12:52:41 +00:00
|
|
|
|
≡⟨ ηθNat (ℂ [ g ∘ f ]) ⟩
|
2018-03-08 10:03:56 +00:00
|
|
|
|
𝔻 [ fmap H (ℂ [ g ∘ f ]) ∘ (ηθ A) ]
|
2018-03-05 12:52:41 +00:00
|
|
|
|
≡⟨ cong (λ φ → 𝔻 [ φ ∘ ηθ A ]) (H.isDistributive) ⟩
|
2018-03-08 10:03:56 +00:00
|
|
|
|
𝔻 [ 𝔻 [ fmap H g ∘ fmap H f ] ∘ (ηθ A) ]
|
2018-03-05 12:52:41 +00:00
|
|
|
|
≡⟨ sym isAssociative ⟩
|
2018-03-08 10:03:56 +00:00
|
|
|
|
𝔻 [ fmap H g ∘ 𝔻 [ fmap H f ∘ ηθ A ] ]
|
|
|
|
|
≡⟨ cong (λ φ → 𝔻 [ fmap H g ∘ φ ]) isAssociative ⟩
|
|
|
|
|
𝔻 [ fmap H g ∘ 𝔻 [ 𝔻 [ fmap H f ∘ η A ] ∘ θ A ] ]
|
|
|
|
|
≡⟨ cong (λ φ → 𝔻 [ fmap H g ∘ φ ]) (cong (λ φ → 𝔻 [ φ ∘ θ A ]) (sym (ηNat f))) ⟩
|
|
|
|
|
𝔻 [ fmap H g ∘ 𝔻 [ 𝔻 [ η B ∘ fmap G f ] ∘ θ A ] ]
|
|
|
|
|
≡⟨ cong (λ φ → 𝔻 [ fmap H g ∘ φ ]) (sym isAssociative) ⟩
|
|
|
|
|
𝔻 [ fmap H g ∘ 𝔻 [ η B ∘ 𝔻 [ fmap G f ∘ θ A ] ] ]
|
2018-03-05 12:52:41 +00:00
|
|
|
|
≡⟨ isAssociative ⟩
|
2018-03-08 10:03:56 +00:00
|
|
|
|
𝔻 [ 𝔻 [ fmap H g ∘ η B ] ∘ 𝔻 [ fmap G f ∘ θ A ] ]
|
|
|
|
|
≡⟨ cong (λ φ → 𝔻 [ φ ∘ 𝔻 [ fmap G f ∘ θ A ] ]) (sym (ηNat g)) ⟩
|
|
|
|
|
𝔻 [ 𝔻 [ η C ∘ fmap G g ] ∘ 𝔻 [ fmap G f ∘ θ A ] ]
|
|
|
|
|
≡⟨ cong (λ φ → 𝔻 [ 𝔻 [ η C ∘ fmap G g ] ∘ φ ]) (sym (θNat f)) ⟩
|
|
|
|
|
𝔻 [ 𝔻 [ η C ∘ fmap G g ] ∘ 𝔻 [ θ B ∘ fmap F f ] ] ∎
|
2018-03-05 12:52:41 +00:00
|
|
|
|
where
|
|
|
|
|
open Category 𝔻
|
|
|
|
|
module H = Functor H
|
|
|
|
|
|
|
|
|
|
eval : Functor (CatProduct.obj prodObj ℂ) 𝔻
|
|
|
|
|
-- :eval: : Functor (prodObj ×p ℂ) 𝔻
|
|
|
|
|
eval = record
|
|
|
|
|
{ raw = record
|
2018-03-08 10:03:56 +00:00
|
|
|
|
{ omap = :omap:
|
|
|
|
|
; fmap = λ {dom} {cod} → :fmap: {dom} {cod}
|
2018-03-05 12:52:41 +00:00
|
|
|
|
}
|
|
|
|
|
; isFunctor = record
|
|
|
|
|
{ isIdentity = λ {o} → :ident: {o}
|
|
|
|
|
; isDistributive = λ {f u n k y} → :isDistributive: {f} {u} {n} {k} {y}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-02-23 09:44:23 +00:00
|
|
|
|
|
2018-03-05 12:52:41 +00:00
|
|
|
|
module _ (𝔸 : Category ℓ ℓ) (F : Functor (𝔸 ×p ℂ) 𝔻) where
|
|
|
|
|
-- open HasProducts (hasProducts {ℓ} {ℓ} unprovable) renaming (_|×|_ to parallelProduct)
|
|
|
|
|
|
|
|
|
|
postulate
|
|
|
|
|
parallelProduct
|
|
|
|
|
: Functor 𝔸 prodObj → Functor ℂ ℂ
|
|
|
|
|
→ Functor (𝔸 ×p ℂ) (prodObj ×p ℂ)
|
|
|
|
|
transpose : Functor 𝔸 prodObj
|
|
|
|
|
eq : F[ eval ∘ (parallelProduct transpose (identity {C = ℂ})) ] ≡ F
|
|
|
|
|
-- eq : F[ :eval: ∘ {!!} ] ≡ F
|
|
|
|
|
-- eq : Catℓ [ :eval: ∘ (HasProducts._|×|_ hasProducts transpose (𝟙 Catℓ {o = ℂ})) ] ≡ F
|
|
|
|
|
-- eq' : (Catℓ [ :eval: ∘
|
|
|
|
|
-- (record { product = product } HasProducts.|×| transpose)
|
|
|
|
|
-- (𝟙 Catℓ)
|
|
|
|
|
-- ])
|
|
|
|
|
-- ≡ F
|
|
|
|
|
|
|
|
|
|
-- For some reason after `e8215b2c051062c6301abc9b3f6ec67106259758`
|
|
|
|
|
-- `catTranspose` makes Agda hang. catTranspose : ∃![ F~ ] (Catℓ [
|
|
|
|
|
-- :eval: ∘ (parallelProduct F~ (𝟙 Catℓ {o = ℂ}))] ≡ F) catTranspose =
|
|
|
|
|
-- transpose , eq
|
|
|
|
|
|
|
|
|
|
module _ (ℓ : Level) (unprovable : IsCategory (RawCat ℓ ℓ)) where
|
|
|
|
|
private
|
|
|
|
|
Catℓ : Category (lsuc (ℓ ⊔ ℓ)) (ℓ ⊔ ℓ)
|
|
|
|
|
Catℓ = Cat ℓ ℓ unprovable
|
|
|
|
|
module _ (ℂ 𝔻 : Category ℓ ℓ) where
|
|
|
|
|
open CatExponential ℂ 𝔻 using (prodObj ; eval)
|
|
|
|
|
-- Putting in the type annotation causes Agda to loop indefinitely.
|
|
|
|
|
-- eval' : Functor (CatProduct.obj prodObj ℂ) 𝔻
|
|
|
|
|
-- Likewise, using it below also results in this.
|
|
|
|
|
eval' : _
|
|
|
|
|
eval' = eval
|
|
|
|
|
-- private
|
|
|
|
|
-- -- module _ (ℂ 𝔻 : Category ℓ ℓ) where
|
|
|
|
|
-- postulate :isExponential: : IsExponential Catℓ ℂ 𝔻 prodObj :eval:
|
|
|
|
|
-- -- :isExponential: : IsExponential Catℓ ℂ 𝔻 :obj: :eval:
|
|
|
|
|
-- -- :isExponential: = {!catTranspose!}
|
|
|
|
|
-- -- where
|
|
|
|
|
-- -- open HasProducts (hasProducts {ℓ} {ℓ} unprovable) using (_|×|_)
|
|
|
|
|
-- -- :isExponential: = λ 𝔸 F → transpose 𝔸 F , eq' 𝔸 F
|
|
|
|
|
|
|
|
|
|
-- -- :exponent: : Exponential (Cat ℓ ℓ) A B
|
|
|
|
|
exponent : Exponential Catℓ ℂ 𝔻
|
|
|
|
|
exponent = record
|
|
|
|
|
{ obj = prodObj
|
|
|
|
|
; eval = {!evalll'!}
|
|
|
|
|
; isExponential = {!:isExponential:!}
|
|
|
|
|
}
|
|
|
|
|
where
|
|
|
|
|
open HasProducts (hasProducts unprovable) renaming (_×_ to _×p_)
|
|
|
|
|
open import Cat.Categories.Fun
|
|
|
|
|
open Fun
|
|
|
|
|
-- _×p_ = CatProduct.obj -- prodObj ℂ
|
|
|
|
|
-- eval' : Functor CatP.obj 𝔻
|
2018-02-23 09:44:23 +00:00
|
|
|
|
|
|
|
|
|
hasExponentials : HasExponentials Catℓ
|
2018-03-05 12:52:41 +00:00
|
|
|
|
hasExponentials = record { exponent = exponent }
|