Use alternative syntax for arrow composition
This commit is contained in:
parent
e33911ad9e
commit
255b0236f9
|
@ -22,7 +22,7 @@ eqpair eqa eqb i = eqa i , eqb i
|
||||||
|
|
||||||
open Functor
|
open Functor
|
||||||
open IsFunctor
|
open IsFunctor
|
||||||
open Category
|
open Category hiding (_∘_)
|
||||||
|
|
||||||
-- The category of categories
|
-- The category of categories
|
||||||
module _ (ℓ ℓ' : Level) where
|
module _ (ℓ ℓ' : Level) where
|
||||||
|
@ -40,7 +40,7 @@ module _ (ℓ ℓ' : Level) where
|
||||||
((h ∘f (g ∘f f)) .isFunctor .ident)
|
((h ∘f (g ∘f f)) .isFunctor .ident)
|
||||||
(((h ∘f g) ∘f f) .isFunctor .ident)
|
(((h ∘f g) ∘f f) .isFunctor .ident)
|
||||||
postulate eqD : PathP (λ i → { c c' c'' : A .Object} {a : A .Arrow c c'} {a' : A .Arrow c' c''}
|
postulate eqD : PathP (λ i → { c c' c'' : A .Object} {a : A .Arrow c c'} {a' : A .Arrow c' c''}
|
||||||
→ eq→ i (A ._⊕_ a' a) ≡ D ._⊕_ (eq→ i a') (eq→ i a))
|
→ eq→ i (A [ a' ∘ a ]) ≡ D [ eq→ i a' ∘ eq→ i a ])
|
||||||
((h ∘f (g ∘f f)) .isFunctor .distrib) (((h ∘f g) ∘f f) .isFunctor .distrib)
|
((h ∘f (g ∘f f)) .isFunctor .distrib) (((h ∘f g) ∘f f) .isFunctor .distrib)
|
||||||
|
|
||||||
assc : h ∘f (g ∘f f) ≡ (h ∘f g) ∘f f
|
assc : h ∘f (g ∘f f) ≡ (h ∘f g) ∘f f
|
||||||
|
@ -64,7 +64,7 @@ module _ (ℓ ℓ' : Level) where
|
||||||
eqD-r : PathP
|
eqD-r : PathP
|
||||||
(λ i →
|
(λ i →
|
||||||
{A B C : ℂ .Object} {f : ℂ .Arrow A B} {g : ℂ .Arrow B C} →
|
{A B C : ℂ .Object} {f : ℂ .Arrow A B} {g : ℂ .Arrow B C} →
|
||||||
eq→ i (ℂ ._⊕_ g f) ≡ 𝔻 ._⊕_ (eq→ i g) (eq→ i f))
|
eq→ i (ℂ [ g ∘ f ]) ≡ 𝔻 [ eq→ i g ∘ eq→ i f ])
|
||||||
((F ∘f identity) .isFunctor .distrib) (F .isFunctor .distrib)
|
((F ∘f identity) .isFunctor .distrib) (F .isFunctor .distrib)
|
||||||
ident-r : F ∘f identity ≡ F
|
ident-r : F ∘f identity ≡ F
|
||||||
ident-r = Functor≡ eq* eq→ eqI-r eqD-r
|
ident-r = Functor≡ eq* eq→ eqI-r eqD-r
|
||||||
|
@ -78,7 +78,7 @@ module _ (ℓ ℓ' : Level) where
|
||||||
eqI : PathP (λ i → ∀ {A : ℂ .Object} → eq→ i (ℂ .𝟙 {A}) ≡ 𝔻 .𝟙 {eq* i A})
|
eqI : PathP (λ i → ∀ {A : ℂ .Object} → eq→ i (ℂ .𝟙 {A}) ≡ 𝔻 .𝟙 {eq* i A})
|
||||||
((identity ∘f F) .isFunctor .ident) (F .isFunctor .ident)
|
((identity ∘f F) .isFunctor .ident) (F .isFunctor .ident)
|
||||||
eqD : PathP (λ i → {A B C : ℂ .Object} {f : ℂ .Arrow A B} {g : ℂ .Arrow B C}
|
eqD : PathP (λ i → {A B C : ℂ .Object} {f : ℂ .Arrow A B} {g : ℂ .Arrow B C}
|
||||||
→ eq→ i (ℂ ._⊕_ g f) ≡ 𝔻 ._⊕_ (eq→ i g) (eq→ i f))
|
→ eq→ i (ℂ [ g ∘ f ]) ≡ 𝔻 [ eq→ i g ∘ eq→ i f ])
|
||||||
((identity ∘f F) .isFunctor .distrib) (F .isFunctor .distrib)
|
((identity ∘f F) .isFunctor .distrib) (F .isFunctor .distrib)
|
||||||
ident-l : identity ∘f F ≡ F
|
ident-l : identity ∘f F ≡ F
|
||||||
ident-l = Functor≡ eq* eq→ eqI eqD
|
ident-l = Functor≡ eq* eq→ eqI eqD
|
||||||
|
@ -89,7 +89,7 @@ module _ (ℓ ℓ' : Level) where
|
||||||
{ Object = Category ℓ ℓ'
|
{ Object = Category ℓ ℓ'
|
||||||
; Arrow = Functor
|
; Arrow = Functor
|
||||||
; 𝟙 = identity
|
; 𝟙 = identity
|
||||||
; _⊕_ = _∘f_
|
; _∘_ = _∘f_
|
||||||
-- What gives here? Why can I not name the variables directly?
|
-- What gives here? Why can I not name the variables directly?
|
||||||
; isCategory = record
|
; isCategory = record
|
||||||
{ assoc = λ {_ _ _ _ f g h} → assc {f = f} {g = g} {h = h}
|
{ assoc = λ {_ _ _ _ f g h} → assc {f = f} {g = g} {h = h}
|
||||||
|
@ -112,7 +112,7 @@ module _ {ℓ ℓ' : Level} where
|
||||||
:Arrow: b c →
|
:Arrow: b c →
|
||||||
:Arrow: a b →
|
:Arrow: a b →
|
||||||
:Arrow: a c
|
:Arrow: a c
|
||||||
_:⊕:_ = λ { (bc∈C , bc∈D) (ab∈C , ab∈D) → (ℂ ._⊕_) bc∈C ab∈C , 𝔻 ._⊕_ bc∈D ab∈D}
|
_:⊕:_ = λ { (bc∈C , bc∈D) (ab∈C , ab∈D) → ℂ [ bc∈C ∘ ab∈C ] , 𝔻 [ bc∈D ∘ ab∈D ]}
|
||||||
|
|
||||||
instance
|
instance
|
||||||
:isCategory: : IsCategory :Object: :Arrow: :𝟙: _:⊕:_
|
:isCategory: : IsCategory :Object: :Arrow: :𝟙: _:⊕:_
|
||||||
|
@ -131,7 +131,7 @@ module _ {ℓ ℓ' : Level} where
|
||||||
{ Object = :Object:
|
{ Object = :Object:
|
||||||
; Arrow = :Arrow:
|
; Arrow = :Arrow:
|
||||||
; 𝟙 = :𝟙:
|
; 𝟙 = :𝟙:
|
||||||
; _⊕_ = _:⊕:_
|
; _∘_ = _:⊕:_
|
||||||
}
|
}
|
||||||
|
|
||||||
proj₁ : Arrow Catt :product: ℂ
|
proj₁ : Arrow Catt :product: ℂ
|
||||||
|
@ -161,16 +161,16 @@ module _ {ℓ ℓ' : Level} where
|
||||||
|
|
||||||
-- Need to "lift equality of functors"
|
-- Need to "lift equality of functors"
|
||||||
-- If I want to do this like I do it for pairs it's gonna be a pain.
|
-- If I want to do this like I do it for pairs it's gonna be a pain.
|
||||||
postulate isUniqL : (Catt ⊕ proj₁) x ≡ x₁
|
postulate isUniqL : Catt [ proj₁ ∘ x ] ≡ x₁
|
||||||
-- isUniqL = Functor≡ refl refl {!!} {!!}
|
-- isUniqL = Functor≡ refl refl {!!} {!!}
|
||||||
|
|
||||||
postulate isUniqR : (Catt ⊕ proj₂) x ≡ x₂
|
postulate isUniqR : Catt [ proj₂ ∘ x ] ≡ x₂
|
||||||
-- isUniqR = Functor≡ refl refl {!!} {!!}
|
-- isUniqR = Functor≡ refl refl {!!} {!!}
|
||||||
|
|
||||||
isUniq : (Catt ⊕ proj₁) x ≡ x₁ × (Catt ⊕ proj₂) x ≡ x₂
|
isUniq : Catt [ proj₁ ∘ x ] ≡ x₁ × Catt [ proj₂ ∘ x ] ≡ x₂
|
||||||
isUniq = isUniqL , isUniqR
|
isUniq = isUniqL , isUniqR
|
||||||
|
|
||||||
uniq : ∃![ x ] ((Catt ⊕ proj₁) x ≡ x₁ × (Catt ⊕ proj₂) x ≡ x₂)
|
uniq : ∃![ x ] (Catt [ proj₁ ∘ x ] ≡ x₁ × Catt [ proj₂ ∘ x ] ≡ x₂)
|
||||||
uniq = x , isUniq
|
uniq = x , isUniq
|
||||||
|
|
||||||
instance
|
instance
|
||||||
|
@ -199,9 +199,6 @@ module _ (ℓ : Level) where
|
||||||
Catℓ = Cat ℓ ℓ
|
Catℓ = Cat ℓ ℓ
|
||||||
module _ (ℂ 𝔻 : Category ℓ ℓ) where
|
module _ (ℂ 𝔻 : Category ℓ ℓ) where
|
||||||
private
|
private
|
||||||
_𝔻⊕_ = 𝔻 ._⊕_
|
|
||||||
_ℂ⊕_ = ℂ ._⊕_
|
|
||||||
|
|
||||||
:obj: : Cat ℓ ℓ .Object
|
:obj: : Cat ℓ ℓ .Object
|
||||||
:obj: = Fun {ℂ = ℂ} {𝔻 = 𝔻}
|
:obj: = Fun {ℂ = ℂ} {𝔻 = 𝔻}
|
||||||
|
|
||||||
|
@ -233,13 +230,13 @@ module _ (ℓ : Level) where
|
||||||
G→f : 𝔻 .Arrow (G .func* A) (G .func* B)
|
G→f : 𝔻 .Arrow (G .func* A) (G .func* B)
|
||||||
G→f = G .func→ f
|
G→f = G .func→ f
|
||||||
l : 𝔻 .Arrow (F .func* A) (G .func* B)
|
l : 𝔻 .Arrow (F .func* A) (G .func* B)
|
||||||
l = θB 𝔻⊕ F→f
|
l = 𝔻 [ θB ∘ F→f ]
|
||||||
r : 𝔻 .Arrow (F .func* A) (G .func* B)
|
r : 𝔻 .Arrow (F .func* A) (G .func* B)
|
||||||
r = G→f 𝔻⊕ θA
|
r = 𝔻 [ G→f ∘ θA ]
|
||||||
-- There are two choices at this point,
|
-- There are two choices at this point,
|
||||||
-- but I suppose the whole point is that
|
-- but I suppose the whole point is that
|
||||||
-- by `θNat f` we have `l ≡ r`
|
-- by `θNat f` we have `l ≡ r`
|
||||||
-- lem : θ B 𝔻⊕ F .func→ f ≡ G .func→ f 𝔻⊕ θ A
|
-- lem : 𝔻 [ θ B ∘ F .func→ f ] ≡ 𝔻 [ G .func→ f ∘ θ A ]
|
||||||
-- lem = θNat f
|
-- lem = θNat f
|
||||||
result : 𝔻 .Arrow (F .func* A) (G .func* B)
|
result : 𝔻 .Arrow (F .func* A) (G .func* B)
|
||||||
result = l
|
result = l
|
||||||
|
@ -257,17 +254,16 @@ module _ (ℓ : Level) where
|
||||||
-- :ident: : :func→: {c} {c} (identityNat F , ℂ .𝟙) ≡ 𝔻 .𝟙
|
-- :ident: : :func→: {c} {c} (identityNat F , ℂ .𝟙) ≡ 𝔻 .𝟙
|
||||||
-- :ident: = trans (proj₂ 𝔻.ident) (F .ident)
|
-- :ident: = trans (proj₂ 𝔻.ident) (F .ident)
|
||||||
-- where
|
-- where
|
||||||
-- _𝔻⊕_ = 𝔻 ._⊕_
|
|
||||||
-- open module 𝔻 = IsCategory (𝔻 .isCategory)
|
-- open module 𝔻 = IsCategory (𝔻 .isCategory)
|
||||||
-- Unfortunately the equational version has some ambigous arguments.
|
-- Unfortunately the equational version has some ambigous arguments.
|
||||||
:ident: : :func→: {c} {c} (identityNat F , ℂ .𝟙 {o = proj₂ c}) ≡ 𝔻 .𝟙
|
:ident: : :func→: {c} {c} (identityNat F , ℂ .𝟙 {o = proj₂ c}) ≡ 𝔻 .𝟙
|
||||||
:ident: = begin
|
:ident: = begin
|
||||||
:func→: {c} {c} ((:obj: ×p ℂ) .Product.obj .𝟙 {c}) ≡⟨⟩
|
:func→: {c} {c} ((:obj: ×p ℂ) .Product.obj .𝟙 {c}) ≡⟨⟩
|
||||||
:func→: {c} {c} (identityNat F , ℂ .𝟙) ≡⟨⟩
|
:func→: {c} {c} (identityNat F , ℂ .𝟙) ≡⟨⟩
|
||||||
(identityTrans F C 𝔻⊕ F .func→ (ℂ .𝟙)) ≡⟨⟩
|
𝔻 [ identityTrans F C ∘ F .func→ (ℂ .𝟙)] ≡⟨⟩
|
||||||
𝔻 .𝟙 𝔻⊕ F .func→ (ℂ .𝟙) ≡⟨ proj₂ 𝔻.ident ⟩
|
𝔻 [ 𝔻 .𝟙 ∘ F .func→ (ℂ .𝟙)] ≡⟨ proj₂ 𝔻.ident ⟩
|
||||||
F .func→ (ℂ .𝟙) ≡⟨ F.ident ⟩
|
F .func→ (ℂ .𝟙) ≡⟨ F.ident ⟩
|
||||||
𝔻 .𝟙 ∎
|
𝔻 .𝟙 ∎
|
||||||
where
|
where
|
||||||
open module 𝔻 = IsCategory (𝔻 .isCategory)
|
open module 𝔻 = IsCategory (𝔻 .isCategory)
|
||||||
open module F = IsFunctor (F .isFunctor)
|
open module F = IsFunctor (F .isFunctor)
|
||||||
|
@ -280,7 +276,7 @@ module _ (ℓ : Level) where
|
||||||
H = H×C .proj₁
|
H = H×C .proj₁
|
||||||
C = H×C .proj₂
|
C = H×C .proj₂
|
||||||
-- Not entirely clear what this is at this point:
|
-- Not entirely clear what this is at this point:
|
||||||
_P⊕_ = (:obj: ×p ℂ) .Product.obj ._⊕_ {F×A} {G×B} {H×C}
|
_P⊕_ = (:obj: ×p ℂ) .Product.obj .Category._∘_ {F×A} {G×B} {H×C}
|
||||||
module _
|
module _
|
||||||
-- NaturalTransformation F G × ℂ .Arrow A B
|
-- NaturalTransformation F G × ℂ .Arrow A B
|
||||||
{θ×f : NaturalTransformation F G × ℂ .Arrow A B}
|
{θ×f : NaturalTransformation F G × ℂ .Arrow A B}
|
||||||
|
@ -300,26 +296,33 @@ module _ (ℓ : Level) where
|
||||||
g = proj₂ η×g
|
g = proj₂ η×g
|
||||||
|
|
||||||
ηθNT : NaturalTransformation F H
|
ηθNT : NaturalTransformation F H
|
||||||
ηθNT = Fun ._⊕_ {F} {G} {H} (η , ηNat) (θ , θNat)
|
ηθNT = Fun .Category._∘_ {F} {G} {H} (η , ηNat) (θ , θNat)
|
||||||
|
|
||||||
ηθ = proj₁ ηθNT
|
ηθ = proj₁ ηθNT
|
||||||
ηθNat = proj₂ ηθNT
|
ηθNat = proj₂ ηθNT
|
||||||
|
|
||||||
:distrib: :
|
:distrib: :
|
||||||
(η C 𝔻⊕ θ C) 𝔻⊕ F .func→ (g ℂ⊕ f)
|
𝔻 [ 𝔻 [ η C ∘ θ C ] ∘ F .func→ ( ℂ [ g ∘ f ] ) ]
|
||||||
≡ (η C 𝔻⊕ G .func→ g) 𝔻⊕ (θ B 𝔻⊕ F .func→ f)
|
≡ 𝔻 [ 𝔻 [ η C ∘ G .func→ g ] ∘ 𝔻 [ θ B ∘ F .func→ f ] ]
|
||||||
:distrib: = begin
|
:distrib: = begin
|
||||||
(ηθ C) 𝔻⊕ F .func→ (g ℂ⊕ f) ≡⟨ ηθNat (g ℂ⊕ f) ⟩
|
𝔻 [ (ηθ C) ∘ F .func→ (ℂ [ g ∘ f ]) ]
|
||||||
H .func→ (g ℂ⊕ f) 𝔻⊕ (ηθ A) ≡⟨ cong (λ φ → φ 𝔻⊕ ηθ A) (H.distrib) ⟩
|
≡⟨ ηθNat (ℂ [ g ∘ f ]) ⟩
|
||||||
(H .func→ g 𝔻⊕ H .func→ f) 𝔻⊕ (ηθ A) ≡⟨ sym assoc ⟩
|
𝔻 [ H .func→ (ℂ [ g ∘ f ]) ∘ (ηθ A) ]
|
||||||
H .func→ g 𝔻⊕ (H .func→ f 𝔻⊕ (ηθ A)) ≡⟨⟩
|
≡⟨ cong (λ φ → 𝔻 [ φ ∘ ηθ A ]) (H.distrib) ⟩
|
||||||
H .func→ g 𝔻⊕ (H .func→ f 𝔻⊕ (ηθ A)) ≡⟨ cong (λ φ → H .func→ g 𝔻⊕ φ) assoc ⟩
|
𝔻 [ 𝔻 [ H .func→ g ∘ H .func→ f ] ∘ (ηθ A) ]
|
||||||
H .func→ g 𝔻⊕ ((H .func→ f 𝔻⊕ η A) 𝔻⊕ θ A) ≡⟨ cong (λ φ → H .func→ g 𝔻⊕ φ) (cong (λ φ → φ 𝔻⊕ θ A) (sym (ηNat f))) ⟩
|
≡⟨ sym assoc ⟩
|
||||||
H .func→ g 𝔻⊕ ((η B 𝔻⊕ G .func→ f) 𝔻⊕ θ A) ≡⟨ cong (λ φ → H .func→ g 𝔻⊕ φ) (sym assoc) ⟩
|
𝔻 [ H .func→ g ∘ 𝔻 [ H .func→ f ∘ ηθ A ] ]
|
||||||
H .func→ g 𝔻⊕ (η B 𝔻⊕ (G .func→ f 𝔻⊕ θ A)) ≡⟨ assoc ⟩
|
≡⟨ cong (λ φ → 𝔻 [ H .func→ g ∘ φ ]) assoc ⟩
|
||||||
(H .func→ g 𝔻⊕ η B) 𝔻⊕ (G .func→ f 𝔻⊕ θ A) ≡⟨ cong (λ φ → φ 𝔻⊕ (G .func→ f 𝔻⊕ θ A)) (sym (ηNat g)) ⟩
|
𝔻 [ H .func→ g ∘ 𝔻 [ 𝔻 [ H .func→ f ∘ η A ] ∘ θ A ] ]
|
||||||
(η C 𝔻⊕ G .func→ g) 𝔻⊕ (G .func→ f 𝔻⊕ θ A) ≡⟨ cong (λ φ → (η C 𝔻⊕ G .func→ g) 𝔻⊕ φ) (sym (θNat f)) ⟩
|
≡⟨ cong (λ φ → 𝔻 [ H .func→ g ∘ φ ]) (cong (λ φ → 𝔻 [ φ ∘ θ A ]) (sym (ηNat f))) ⟩
|
||||||
(η C 𝔻⊕ G .func→ g) 𝔻⊕ (θ B 𝔻⊕ F .func→ 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 ] ] ∎
|
||||||
where
|
where
|
||||||
open IsCategory (𝔻 .isCategory)
|
open IsCategory (𝔻 .isCategory)
|
||||||
open module H = IsFunctor (H .isFunctor)
|
open module H = IsFunctor (H .isFunctor)
|
||||||
|
@ -339,9 +342,9 @@ module _ (ℓ : Level) where
|
||||||
|
|
||||||
postulate
|
postulate
|
||||||
transpose : Functor 𝔸 :obj:
|
transpose : Functor 𝔸 :obj:
|
||||||
eq : Catℓ ._⊕_ :eval: (parallelProduct transpose (Catℓ .𝟙 {o = ℂ})) ≡ F
|
eq : Catℓ [ :eval: ∘ (parallelProduct transpose (Catℓ .𝟙 {o = ℂ})) ] ≡ F
|
||||||
|
|
||||||
catTranspose : ∃![ F~ ] (Catℓ ._⊕_ :eval: (parallelProduct F~ (Catℓ .𝟙 {o = ℂ})) ≡ F)
|
catTranspose : ∃![ F~ ] (Catℓ [ :eval: ∘ (parallelProduct F~ (Catℓ .𝟙 {o = ℂ}))] ≡ F )
|
||||||
catTranspose = transpose , eq
|
catTranspose = transpose , eq
|
||||||
|
|
||||||
:isExponential: : IsExponential Catℓ ℂ 𝔻 :obj: :eval:
|
:isExponential: : IsExponential Catℓ ℂ 𝔻 :obj: :eval:
|
||||||
|
|
|
@ -10,19 +10,19 @@ open import Cat.Category
|
||||||
open import Cat.Functor
|
open import Cat.Functor
|
||||||
|
|
||||||
module _ {ℓc ℓc' ℓd ℓd' : Level} {ℂ : Category ℓc ℓc'} {𝔻 : Category ℓd ℓd'} where
|
module _ {ℓc ℓc' ℓd ℓd' : Level} {ℂ : Category ℓc ℓc'} {𝔻 : Category ℓd ℓd'} where
|
||||||
open Category
|
open Category hiding ( _∘_ ; Arrow )
|
||||||
open Functor
|
open Functor
|
||||||
|
|
||||||
module _ (F G : Functor ℂ 𝔻) where
|
module _ (F G : Functor ℂ 𝔻) where
|
||||||
-- What do you call a non-natural tranformation?
|
-- What do you call a non-natural tranformation?
|
||||||
Transformation : Set (ℓc ⊔ ℓd')
|
Transformation : Set (ℓc ⊔ ℓd')
|
||||||
Transformation = (C : ℂ .Object) → 𝔻 .Arrow (F .func* C) (G .func* C)
|
Transformation = (C : ℂ .Object) → 𝔻 [ F .func* C , G .func* C ]
|
||||||
|
|
||||||
Natural : Transformation → Set (ℓc ⊔ (ℓc' ⊔ ℓd'))
|
Natural : Transformation → Set (ℓc ⊔ (ℓc' ⊔ ℓd'))
|
||||||
Natural θ
|
Natural θ
|
||||||
= {A B : ℂ .Object}
|
= {A B : ℂ .Object}
|
||||||
→ (f : ℂ .Arrow A B)
|
→ (f : ℂ [ A , B ])
|
||||||
→ 𝔻 ._⊕_ (θ B) (F .func→ f) ≡ 𝔻 ._⊕_ (G .func→ f) (θ A)
|
→ 𝔻 [ θ B ∘ F .func→ f ] ≡ 𝔻 [ G .func→ f ∘ θ A ]
|
||||||
|
|
||||||
NaturalTransformation : Set (ℓc ⊔ ℓc' ⊔ ℓd')
|
NaturalTransformation : Set (ℓc ⊔ ℓc' ⊔ ℓd')
|
||||||
NaturalTransformation = Σ Transformation Natural
|
NaturalTransformation = Σ Transformation Natural
|
||||||
|
@ -30,18 +30,28 @@ module _ {ℓc ℓc' ℓd ℓd' : Level} {ℂ : Category ℓc ℓc'} {𝔻 : Cat
|
||||||
-- NaturalTranformation : Set (ℓc ⊔ (ℓc' ⊔ ℓd'))
|
-- NaturalTranformation : Set (ℓc ⊔ (ℓc' ⊔ ℓd'))
|
||||||
-- NaturalTranformation = ∀ (θ : Transformation) {A B : ℂ .Object} → (f : ℂ .Arrow A B) → 𝔻 ._⊕_ (θ B) (F .func→ f) ≡ 𝔻 ._⊕_ (G .func→ f) (θ A)
|
-- NaturalTranformation = ∀ (θ : Transformation) {A B : ℂ .Object} → (f : ℂ .Arrow A B) → 𝔻 ._⊕_ (θ B) (F .func→ f) ≡ 𝔻 ._⊕_ (G .func→ f) (θ A)
|
||||||
|
|
||||||
|
module _ {F G : Functor ℂ 𝔻} where
|
||||||
|
NaturalTransformation≡ : {α β : NaturalTransformation F G}
|
||||||
|
→ (eq₁ : α .proj₁ ≡ β .proj₁)
|
||||||
|
→ (eq₂ : PathP
|
||||||
|
(λ i → {A B : ℂ .Object} (f : ℂ [ A , B ])
|
||||||
|
→ 𝔻 [ eq₁ i B ∘ F .func→ f ]
|
||||||
|
≡ 𝔻 [ G .func→ f ∘ eq₁ i A ])
|
||||||
|
(α .proj₂) (β .proj₂))
|
||||||
|
→ α ≡ β
|
||||||
|
NaturalTransformation≡ eq₁ eq₂ i = eq₁ i , eq₂ i
|
||||||
|
|
||||||
identityTrans : (F : Functor ℂ 𝔻) → Transformation F F
|
identityTrans : (F : Functor ℂ 𝔻) → Transformation F F
|
||||||
identityTrans F C = 𝔻 .𝟙
|
identityTrans F C = 𝔻 .𝟙
|
||||||
|
|
||||||
identityNatural : (F : Functor ℂ 𝔻) → Natural F F (identityTrans F)
|
identityNatural : (F : Functor ℂ 𝔻) → Natural F F (identityTrans F)
|
||||||
identityNatural F {A = A} {B = B} f = begin
|
identityNatural F {A = A} {B = B} f = begin
|
||||||
identityTrans F B 𝔻⊕ F→ f ≡⟨⟩
|
𝔻 [ identityTrans F B ∘ F→ f ] ≡⟨⟩
|
||||||
𝔻 .𝟙 𝔻⊕ F→ f ≡⟨ proj₂ 𝔻.ident ⟩
|
𝔻 [ 𝔻 .𝟙 ∘ F→ f ] ≡⟨ proj₂ 𝔻.ident ⟩
|
||||||
F→ f ≡⟨ sym (proj₁ 𝔻.ident) ⟩
|
F→ f ≡⟨ sym (proj₁ 𝔻.ident) ⟩
|
||||||
F→ f 𝔻⊕ 𝔻 .𝟙 ≡⟨⟩
|
𝔻 [ F→ f ∘ 𝔻 .𝟙 ] ≡⟨⟩
|
||||||
F→ f 𝔻⊕ identityTrans F A ∎
|
𝔻 [ F→ f ∘ identityTrans F A ] ∎
|
||||||
where
|
where
|
||||||
_𝔻⊕_ = 𝔻 ._⊕_
|
|
||||||
F→ = F .func→
|
F→ = F .func→
|
||||||
open module 𝔻 = IsCategory (𝔻 .isCategory)
|
open module 𝔻 = IsCategory (𝔻 .isCategory)
|
||||||
|
|
||||||
|
@ -50,21 +60,20 @@ module _ {ℓc ℓc' ℓd ℓd' : Level} {ℂ : Category ℓc ℓc'} {𝔻 : Cat
|
||||||
|
|
||||||
module _ {F G H : Functor ℂ 𝔻} where
|
module _ {F G H : Functor ℂ 𝔻} where
|
||||||
private
|
private
|
||||||
_𝔻⊕_ = 𝔻 ._⊕_
|
|
||||||
_∘nt_ : Transformation G H → Transformation F G → Transformation F H
|
_∘nt_ : Transformation G H → Transformation F G → Transformation F H
|
||||||
(θ ∘nt η) C = θ C 𝔻⊕ η C
|
(θ ∘nt η) C = 𝔻 [ θ C ∘ η C ]
|
||||||
|
|
||||||
NatComp _:⊕:_ : NaturalTransformation G H → NaturalTransformation F G → NaturalTransformation F H
|
NatComp _:⊕:_ : NaturalTransformation G H → NaturalTransformation F G → NaturalTransformation F H
|
||||||
proj₁ ((θ , _) :⊕: (η , _)) = θ ∘nt η
|
proj₁ ((θ , _) :⊕: (η , _)) = θ ∘nt η
|
||||||
proj₂ ((θ , θNat) :⊕: (η , ηNat)) {A} {B} f = begin
|
proj₂ ((θ , θNat) :⊕: (η , ηNat)) {A} {B} f = begin
|
||||||
((θ ∘nt η) B) 𝔻⊕ (F .func→ f) ≡⟨⟩
|
𝔻 [ (θ ∘nt η) B ∘ F .func→ f ] ≡⟨⟩
|
||||||
(θ B 𝔻⊕ η B) 𝔻⊕ (F .func→ f) ≡⟨ sym assoc ⟩
|
𝔻 [ 𝔻 [ θ B ∘ η B ] ∘ F .func→ f ] ≡⟨ sym assoc ⟩
|
||||||
θ B 𝔻⊕ (η B 𝔻⊕ (F .func→ f)) ≡⟨ cong (λ φ → θ B 𝔻⊕ φ) (ηNat f) ⟩
|
𝔻 [ θ B ∘ 𝔻 [ η B ∘ F .func→ f ] ] ≡⟨ cong (λ φ → 𝔻 [ θ B ∘ φ ]) (ηNat f) ⟩
|
||||||
θ B 𝔻⊕ ((G .func→ f) 𝔻⊕ η A) ≡⟨ assoc ⟩
|
𝔻 [ θ B ∘ 𝔻 [ G .func→ f ∘ η A ] ] ≡⟨ assoc ⟩
|
||||||
(θ B 𝔻⊕ (G .func→ f)) 𝔻⊕ η A ≡⟨ cong (λ φ → φ 𝔻⊕ η A) (θNat f) ⟩
|
𝔻 [ 𝔻 [ θ B ∘ G .func→ f ] ∘ η A ] ≡⟨ cong (λ φ → 𝔻 [ φ ∘ η A ]) (θNat f) ⟩
|
||||||
(((H .func→ f) 𝔻⊕ θ A) 𝔻⊕ η A) ≡⟨ sym assoc ⟩
|
𝔻 [ 𝔻 [ H .func→ f ∘ θ A ] ∘ η A ] ≡⟨ sym assoc ⟩
|
||||||
((H .func→ f) 𝔻⊕ (θ A 𝔻⊕ η A)) ≡⟨⟩
|
𝔻 [ H .func→ f ∘ 𝔻 [ θ A ∘ η A ] ] ≡⟨⟩
|
||||||
((H .func→ f) 𝔻⊕ ((θ ∘nt η) A)) ∎
|
𝔻 [ H .func→ f ∘ (θ ∘nt η) A ] ∎
|
||||||
where
|
where
|
||||||
open IsCategory (𝔻 .isCategory)
|
open IsCategory (𝔻 .isCategory)
|
||||||
NatComp = _:⊕:_
|
NatComp = _:⊕:_
|
||||||
|
@ -100,7 +109,7 @@ module _ {ℓc ℓc' ℓd ℓd' : Level} {ℂ : Category ℓc ℓc'} {𝔻 : Cat
|
||||||
{ Object = Functor ℂ 𝔻
|
{ Object = Functor ℂ 𝔻
|
||||||
; Arrow = NaturalTransformation
|
; Arrow = NaturalTransformation
|
||||||
; 𝟙 = λ {F} → identityNat F
|
; 𝟙 = λ {F} → identityNat F
|
||||||
; _⊕_ = λ {F G H} → _:⊕:_ {F} {G} {H}
|
; _∘_ = λ {F G H} → _:⊕:_ {F} {G} {H}
|
||||||
}
|
}
|
||||||
|
|
||||||
module _ {ℓ ℓ' : Level} (ℂ : Category ℓ ℓ') where
|
module _ {ℓ ℓ' : Level} (ℂ : Category ℓ ℓ') where
|
||||||
|
@ -112,5 +121,5 @@ module _ {ℓ ℓ' : Level} (ℂ : Category ℓ ℓ') where
|
||||||
{ Object = Presheaf ℂ
|
{ Object = Presheaf ℂ
|
||||||
; Arrow = NaturalTransformation
|
; Arrow = NaturalTransformation
|
||||||
; 𝟙 = λ {F} → identityNat F
|
; 𝟙 = λ {F} → identityNat F
|
||||||
; _⊕_ = λ {F G H} → NatComp {F = F} {G = G} {H = H}
|
; _∘_ = λ {F G H} → NatComp {F = F} {G = G} {H = H}
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,6 +159,6 @@ Rel = record
|
||||||
{ Object = Set
|
{ Object = Set
|
||||||
; Arrow = λ S R → Subset (S × R)
|
; Arrow = λ S R → Subset (S × R)
|
||||||
; 𝟙 = λ {S} → Diag S
|
; 𝟙 = λ {S} → Diag S
|
||||||
; _⊕_ = λ {A B C} S R → λ {( a , c ) → Σ[ b ∈ B ] ( (a , b) ∈ R × (b , c) ∈ S )}
|
; _∘_ = λ {A B C} S R → λ {( a , c ) → Σ[ b ∈ B ] ( (a , b) ∈ R × (b , c) ∈ S )}
|
||||||
; isCategory = record { assoc = funExt is-assoc ; ident = funExt ident-l , funExt ident-r }
|
; isCategory = record { assoc = funExt is-assoc ; ident = funExt ident-l , funExt ident-r }
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ module Cat.Categories.Sets where
|
||||||
open import Cubical
|
open import Cubical
|
||||||
open import Agda.Primitive
|
open import Agda.Primitive
|
||||||
open import Data.Product
|
open import Data.Product
|
||||||
open import Data.Product renaming (proj₁ to fst ; proj₂ to snd)
|
|
||||||
|
|
||||||
open import Cat.Category
|
open import Cat.Category
|
||||||
open import Cat.Functor
|
open import Cat.Functor
|
||||||
|
@ -15,7 +14,7 @@ module _ {ℓ : Level} where
|
||||||
{ Object = Set ℓ
|
{ Object = Set ℓ
|
||||||
; Arrow = λ T U → T → U
|
; Arrow = λ T U → T → U
|
||||||
; 𝟙 = id
|
; 𝟙 = id
|
||||||
; _⊕_ = _∘′_
|
; _∘_ = _∘′_
|
||||||
; isCategory = record { assoc = refl ; ident = funExt (λ _ → refl) , funExt (λ _ → refl) }
|
; isCategory = record { assoc = refl ; ident = funExt (λ _ → refl) , funExt (λ _ → refl) }
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
|
@ -26,16 +25,15 @@ module _ {ℓ : Level} where
|
||||||
_&&&_ : (X → A × B)
|
_&&&_ : (X → A × B)
|
||||||
_&&&_ x = f x , g x
|
_&&&_ x = f x , g x
|
||||||
module _ {X A B : Set ℓ} (f : X → A) (g : X → B) where
|
module _ {X A B : Set ℓ} (f : X → A) (g : X → B) where
|
||||||
_S⊕_ = Sets ._⊕_
|
lem : Sets [ proj₁ ∘ (f &&& g)] ≡ f × Sets [ proj₂ ∘ (f &&& g)] ≡ g
|
||||||
lem : proj₁ S⊕ (f &&& g) ≡ f × snd S⊕ (f &&& g) ≡ g
|
|
||||||
proj₁ lem = refl
|
proj₁ lem = refl
|
||||||
proj₂ lem = refl
|
proj₂ lem = refl
|
||||||
instance
|
instance
|
||||||
isProduct : {A B : Sets .Object} → IsProduct Sets {A} {B} fst snd
|
isProduct : {A B : Sets .Object} → IsProduct Sets {A} {B} proj₁ proj₂
|
||||||
isProduct f g = f &&& g , lem f g
|
isProduct f g = f &&& g , lem f g
|
||||||
|
|
||||||
product : (A B : Sets .Object) → Product {ℂ = Sets} A B
|
product : (A B : Sets .Object) → Product {ℂ = Sets} A B
|
||||||
product A B = record { obj = A × B ; proj₁ = fst ; proj₂ = snd ; isProduct = isProduct }
|
product A B = record { obj = A × B ; proj₁ = proj₁ ; proj₂ = proj₂ ; isProduct = isProduct }
|
||||||
|
|
||||||
instance
|
instance
|
||||||
SetsHasProducts : HasProducts Sets
|
SetsHasProducts : HasProducts Sets
|
||||||
|
@ -49,9 +47,9 @@ Representable {ℓ' = ℓ'} ℂ = Functor ℂ (Sets {ℓ'})
|
||||||
representable : ∀ {ℓ ℓ'} {ℂ : Category ℓ ℓ'} → Category.Object ℂ → Representable ℂ
|
representable : ∀ {ℓ ℓ'} {ℂ : Category ℓ ℓ'} → Category.Object ℂ → Representable ℂ
|
||||||
representable {ℂ = ℂ} A = record
|
representable {ℂ = ℂ} A = record
|
||||||
{ func* = λ B → ℂ .Arrow A B
|
{ func* = λ B → ℂ .Arrow A B
|
||||||
; func→ = ℂ ._⊕_
|
; func→ = ℂ ._∘_
|
||||||
; isFunctor = record
|
; isFunctor = record
|
||||||
{ ident = funExt λ _ → snd ident
|
{ ident = funExt λ _ → proj₂ ident
|
||||||
; distrib = funExt λ x → sym assoc
|
; distrib = funExt λ x → sym assoc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,9 +64,9 @@ Presheaf {ℓ' = ℓ'} ℂ = Functor (Opposite ℂ) (Sets {ℓ'})
|
||||||
presheaf : {ℓ ℓ' : Level} {ℂ : Category ℓ ℓ'} → Category.Object (Opposite ℂ) → Presheaf ℂ
|
presheaf : {ℓ ℓ' : Level} {ℂ : Category ℓ ℓ'} → Category.Object (Opposite ℂ) → Presheaf ℂ
|
||||||
presheaf {ℂ = ℂ} B = record
|
presheaf {ℂ = ℂ} B = record
|
||||||
{ func* = λ A → ℂ .Arrow A B
|
{ func* = λ A → ℂ .Arrow A B
|
||||||
; func→ = λ f g → ℂ ._⊕_ g f
|
; func→ = λ f g → ℂ ._∘_ g f
|
||||||
; isFunctor = record
|
; isFunctor = record
|
||||||
{ ident = funExt λ x → fst ident
|
{ ident = funExt λ x → proj₁ ident
|
||||||
; distrib = funExt λ x → assoc
|
; distrib = funExt λ x → assoc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ open import Data.Product renaming
|
||||||
; ∃! to ∃!≈
|
; ∃! to ∃!≈
|
||||||
)
|
)
|
||||||
open import Data.Empty
|
open import Data.Empty
|
||||||
open import Function
|
import Function
|
||||||
open import Cubical
|
open import Cubical
|
||||||
|
|
||||||
∃! : ∀ {a b} {A : Set a}
|
∃! : ∀ {a b} {A : Set a}
|
||||||
|
@ -43,9 +43,9 @@ record Category (ℓ ℓ' : Level) : Set (lsuc (ℓ' ⊔ ℓ)) where
|
||||||
Object : Set ℓ
|
Object : Set ℓ
|
||||||
Arrow : Object → Object → Set ℓ'
|
Arrow : Object → Object → Set ℓ'
|
||||||
𝟙 : {o : Object} → Arrow o o
|
𝟙 : {o : Object} → Arrow o o
|
||||||
_⊕_ : { a b c : Object } → Arrow b c → Arrow a b → Arrow a c
|
_∘_ : {A B C : Object} → Arrow B C → Arrow A B → Arrow A C
|
||||||
{{isCategory}} : IsCategory Object Arrow 𝟙 _⊕_
|
{{isCategory}} : IsCategory Object Arrow 𝟙 _∘_
|
||||||
infixl 45 _⊕_
|
infixl 10 _∘_
|
||||||
domain : { a b : Object } → Arrow a b → Object
|
domain : { a b : Object } → Arrow a b → Object
|
||||||
domain {a = a} _ = a
|
domain {a = a} _ = a
|
||||||
codomain : { a b : Object } → Arrow a b → Object
|
codomain : { a b : Object } → Arrow a b → Object
|
||||||
|
@ -57,18 +57,18 @@ _[_,_] : ∀ {ℓ ℓ'} → (ℂ : Category ℓ ℓ') → (A : ℂ .Object) →
|
||||||
_[_,_] = Arrow
|
_[_,_] = Arrow
|
||||||
|
|
||||||
_[_∘_] : ∀ {ℓ ℓ'} → (ℂ : Category ℓ ℓ') → {A B C : ℂ .Object} → (g : ℂ [ B , C ]) → (f : ℂ [ A , B ]) → ℂ [ A , C ]
|
_[_∘_] : ∀ {ℓ ℓ'} → (ℂ : Category ℓ ℓ') → {A B C : ℂ .Object} → (g : ℂ [ B , C ]) → (f : ℂ [ A , B ]) → ℂ [ A , C ]
|
||||||
_[_∘_] = _⊕_
|
_[_∘_] = _∘_
|
||||||
|
|
||||||
module _ {ℓ ℓ' : Level} {ℂ : Category ℓ ℓ'} where
|
module _ {ℓ ℓ' : Level} {ℂ : Category ℓ ℓ'} where
|
||||||
module _ { A B : ℂ .Object } where
|
module _ { A B : ℂ .Object } where
|
||||||
Isomorphism : (f : ℂ .Arrow A B) → Set ℓ'
|
Isomorphism : (f : ℂ .Arrow A B) → Set ℓ'
|
||||||
Isomorphism f = Σ[ g ∈ ℂ .Arrow B A ] ℂ ._⊕_ g f ≡ ℂ .𝟙 × ℂ ._⊕_ f g ≡ ℂ .𝟙
|
Isomorphism f = Σ[ g ∈ ℂ .Arrow B A ] ℂ [ g ∘ f ] ≡ ℂ .𝟙 × ℂ [ f ∘ g ] ≡ ℂ .𝟙
|
||||||
|
|
||||||
Epimorphism : {X : ℂ .Object } → (f : ℂ .Arrow A B) → Set ℓ'
|
Epimorphism : {X : ℂ .Object } → (f : ℂ .Arrow A B) → Set ℓ'
|
||||||
Epimorphism {X} f = ( g₀ g₁ : ℂ .Arrow B X ) → ℂ ._⊕_ g₀ f ≡ ℂ ._⊕_ g₁ f → g₀ ≡ g₁
|
Epimorphism {X} f = ( g₀ g₁ : ℂ .Arrow B X ) → ℂ [ g₀ ∘ f ] ≡ ℂ [ g₁ ∘ f ] → g₀ ≡ g₁
|
||||||
|
|
||||||
Monomorphism : {X : ℂ .Object} → (f : ℂ .Arrow A B) → Set ℓ'
|
Monomorphism : {X : ℂ .Object} → (f : ℂ .Arrow A B) → Set ℓ'
|
||||||
Monomorphism {X} f = ( g₀ g₁ : ℂ .Arrow X A ) → ℂ ._⊕_ f g₀ ≡ ℂ ._⊕_ f g₁ → g₀ ≡ g₁
|
Monomorphism {X} f = ( g₀ g₁ : ℂ .Arrow X A ) → ℂ [ f ∘ g₀ ] ≡ ℂ [ f ∘ g₁ ] → g₀ ≡ g₁
|
||||||
|
|
||||||
-- Isomorphism of objects
|
-- Isomorphism of objects
|
||||||
_≅_ : (A B : Object ℂ) → Set ℓ'
|
_≅_ : (A B : Object ℂ) → Set ℓ'
|
||||||
|
@ -78,7 +78,7 @@ module _ {ℓ ℓ' : Level} (ℂ : Category ℓ ℓ') {A B obj : Object ℂ} whe
|
||||||
IsProduct : (π₁ : Arrow ℂ obj A) (π₂ : Arrow ℂ obj B) → Set (ℓ ⊔ ℓ')
|
IsProduct : (π₁ : Arrow ℂ obj A) (π₂ : Arrow ℂ obj B) → Set (ℓ ⊔ ℓ')
|
||||||
IsProduct π₁ π₂
|
IsProduct π₁ π₂
|
||||||
= ∀ {X : ℂ .Object} (x₁ : ℂ .Arrow X A) (x₂ : ℂ .Arrow X B)
|
= ∀ {X : ℂ .Object} (x₁ : ℂ .Arrow X A) (x₂ : ℂ .Arrow X B)
|
||||||
→ ∃![ x ] (ℂ ._⊕_ π₁ x ≡ x₁ × ℂ ._⊕_ π₂ x ≡ x₂)
|
→ ∃![ x ] (ℂ [ π₁ ∘ x ] ≡ x₁ × ℂ [ π₂ ∘ x ] ≡ x₂)
|
||||||
|
|
||||||
-- Tip from Andrea; Consider this style for efficiency:
|
-- Tip from Andrea; Consider this style for efficiency:
|
||||||
-- record IsProduct {ℓ ℓ' : Level} (ℂ : Category {ℓ} {ℓ'})
|
-- record IsProduct {ℓ ℓ' : Level} (ℂ : Category {ℓ} {ℓ'})
|
||||||
|
@ -112,17 +112,17 @@ record HasProducts {ℓ ℓ' : Level} (ℂ : Category ℓ ℓ') : Set (ℓ ⊔
|
||||||
parallelProduct : {A A' B B' : ℂ .Object} → ℂ .Arrow A A' → ℂ .Arrow B B'
|
parallelProduct : {A A' B B' : ℂ .Object} → ℂ .Arrow A A' → ℂ .Arrow B B'
|
||||||
→ ℂ .Arrow (objectProduct A B) (objectProduct A' B')
|
→ ℂ .Arrow (objectProduct A B) (objectProduct A' B')
|
||||||
parallelProduct {A = A} {A' = A'} {B = B} {B' = B'} a b = arrowProduct (product A' B')
|
parallelProduct {A = A} {A' = A'} {B = B} {B' = B'} a b = arrowProduct (product A' B')
|
||||||
(ℂ ._⊕_ a ((product A B) .proj₁))
|
(ℂ [ a ∘ (product A B) .proj₁ ])
|
||||||
(ℂ ._⊕_ b ((product A B) .proj₂))
|
(ℂ [ b ∘ (product A B) .proj₂ ])
|
||||||
|
|
||||||
module _ {ℓ ℓ' : Level} (ℂ : Category ℓ ℓ') where
|
module _ {ℓ ℓ' : Level} (ℂ : Category ℓ ℓ') where
|
||||||
Opposite : Category ℓ ℓ'
|
Opposite : Category ℓ ℓ'
|
||||||
Opposite =
|
Opposite =
|
||||||
record
|
record
|
||||||
{ Object = ℂ .Object
|
{ Object = ℂ .Object
|
||||||
; Arrow = flip (ℂ .Arrow)
|
; Arrow = Function.flip (ℂ .Arrow)
|
||||||
; 𝟙 = ℂ .𝟙
|
; 𝟙 = ℂ .𝟙
|
||||||
; _⊕_ = flip (ℂ ._⊕_)
|
; _∘_ = Function.flip (ℂ ._∘_)
|
||||||
; isCategory = record { assoc = sym assoc ; ident = swap ident }
|
; isCategory = record { assoc = sym assoc ; ident = swap ident }
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
|
@ -145,7 +145,7 @@ Hom ℂ A B = Arrow ℂ A B
|
||||||
module _ {ℓ ℓ' : Level} {ℂ : Category ℓ ℓ'} where
|
module _ {ℓ ℓ' : Level} {ℂ : Category ℓ ℓ'} where
|
||||||
HomFromArrow : (A : ℂ .Object) → {B B' : ℂ .Object} → (g : ℂ .Arrow B B')
|
HomFromArrow : (A : ℂ .Object) → {B B' : ℂ .Object} → (g : ℂ .Arrow B B')
|
||||||
→ Hom ℂ A B → Hom ℂ A B'
|
→ Hom ℂ A B → Hom ℂ A B'
|
||||||
HomFromArrow _A = _⊕_ ℂ
|
HomFromArrow _A = ℂ ._∘_
|
||||||
|
|
||||||
module _ {ℓ ℓ'} (ℂ : Category ℓ ℓ') {{hasProducts : HasProducts ℂ}} where
|
module _ {ℓ ℓ'} (ℂ : Category ℓ ℓ') {{hasProducts : HasProducts ℂ}} where
|
||||||
open HasProducts hasProducts
|
open HasProducts hasProducts
|
||||||
|
@ -157,7 +157,7 @@ module _ {ℓ ℓ'} (ℂ : Category ℓ ℓ') {{hasProducts : HasProducts ℂ}}
|
||||||
module _ (B C : ℂ .Category.Object) where
|
module _ (B C : ℂ .Category.Object) where
|
||||||
IsExponential : (Cᴮ : ℂ .Object) → ℂ .Arrow (Cᴮ ×p B) C → Set (ℓ ⊔ ℓ')
|
IsExponential : (Cᴮ : ℂ .Object) → ℂ .Arrow (Cᴮ ×p B) C → Set (ℓ ⊔ ℓ')
|
||||||
IsExponential Cᴮ eval = ∀ (A : ℂ .Object) (f : ℂ .Arrow (A ×p B) C)
|
IsExponential Cᴮ eval = ∀ (A : ℂ .Object) (f : ℂ .Arrow (A ×p B) C)
|
||||||
→ ∃![ f~ ] (ℂ ._⊕_ eval (parallelProduct f~ (ℂ .𝟙)) ≡ f)
|
→ ∃![ f~ ] (ℂ [ eval ∘ parallelProduct f~ (ℂ .𝟙)] ≡ f)
|
||||||
|
|
||||||
record Exponential : Set (ℓ ⊔ ℓ') where
|
record Exponential : Set (ℓ ⊔ ℓ') where
|
||||||
field
|
field
|
||||||
|
|
|
@ -31,6 +31,6 @@ module _ {ℓ ℓ' : Level} (ℂ : Category ℓ ℓ') where
|
||||||
{ Object = Obj
|
{ Object = Obj
|
||||||
; Arrow = Path
|
; Arrow = Path
|
||||||
; 𝟙 = λ {o} → emptyPath o
|
; 𝟙 = λ {o} → emptyPath o
|
||||||
; _⊕_ = λ {a b c} → concatenate {a} {b} {c}
|
; _∘_ = λ {a b c} → concatenate {a} {b} {c}
|
||||||
; isCategory = record { assoc = p-assoc ; ident = ident-r , ident-l }
|
; isCategory = record { assoc = p-assoc ; ident = ident-r , ident-l }
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,27 +15,26 @@ module _ {ℓ ℓ' : Level} {ℂ : Category ℓ ℓ'} { A B : ℂ .Category.Obje
|
||||||
open IsCategory (isCategory)
|
open IsCategory (isCategory)
|
||||||
|
|
||||||
iso-is-epi : Isomorphism {ℂ = ℂ} f → Epimorphism {ℂ = ℂ} {X = X} f
|
iso-is-epi : Isomorphism {ℂ = ℂ} f → Epimorphism {ℂ = ℂ} {X = X} f
|
||||||
iso-is-epi (f- , left-inv , right-inv) g₀ g₁ eq =
|
iso-is-epi (f- , left-inv , right-inv) g₀ g₁ eq = begin
|
||||||
begin
|
|
||||||
g₀ ≡⟨ sym (proj₁ ident) ⟩
|
g₀ ≡⟨ sym (proj₁ ident) ⟩
|
||||||
g₀ ⊕ 𝟙 ≡⟨ cong (_⊕_ g₀) (sym right-inv) ⟩
|
g₀ ∘ 𝟙 ≡⟨ cong (_∘_ g₀) (sym right-inv) ⟩
|
||||||
g₀ ⊕ (f ⊕ f-) ≡⟨ assoc ⟩
|
g₀ ∘ (f ∘ f-) ≡⟨ assoc ⟩
|
||||||
(g₀ ⊕ f) ⊕ f- ≡⟨ cong (λ φ → φ ⊕ f-) eq ⟩
|
(g₀ ∘ f) ∘ f- ≡⟨ cong (λ φ → φ ∘ f-) eq ⟩
|
||||||
(g₁ ⊕ f) ⊕ f- ≡⟨ sym assoc ⟩
|
(g₁ ∘ f) ∘ f- ≡⟨ sym assoc ⟩
|
||||||
g₁ ⊕ (f ⊕ f-) ≡⟨ cong (_⊕_ g₁) right-inv ⟩
|
g₁ ∘ (f ∘ f-) ≡⟨ cong (_∘_ g₁) right-inv ⟩
|
||||||
g₁ ⊕ 𝟙 ≡⟨ proj₁ ident ⟩
|
g₁ ∘ 𝟙 ≡⟨ proj₁ ident ⟩
|
||||||
g₁ ∎
|
g₁ ∎
|
||||||
|
|
||||||
iso-is-mono : Isomorphism {ℂ = ℂ} f → Monomorphism {ℂ = ℂ} {X = X} f
|
iso-is-mono : Isomorphism {ℂ = ℂ} f → Monomorphism {ℂ = ℂ} {X = X} f
|
||||||
iso-is-mono (f- , (left-inv , right-inv)) g₀ g₁ eq =
|
iso-is-mono (f- , (left-inv , right-inv)) g₀ g₁ eq =
|
||||||
begin
|
begin
|
||||||
g₀ ≡⟨ sym (proj₂ ident) ⟩
|
g₀ ≡⟨ sym (proj₂ ident) ⟩
|
||||||
𝟙 ⊕ g₀ ≡⟨ cong (λ φ → φ ⊕ g₀) (sym left-inv) ⟩
|
𝟙 ∘ g₀ ≡⟨ cong (λ φ → φ ∘ g₀) (sym left-inv) ⟩
|
||||||
(f- ⊕ f) ⊕ g₀ ≡⟨ sym assoc ⟩
|
(f- ∘ f) ∘ g₀ ≡⟨ sym assoc ⟩
|
||||||
f- ⊕ (f ⊕ g₀) ≡⟨ cong (_⊕_ f-) eq ⟩
|
f- ∘ (f ∘ g₀) ≡⟨ cong (_∘_ f-) eq ⟩
|
||||||
f- ⊕ (f ⊕ g₁) ≡⟨ assoc ⟩
|
f- ∘ (f ∘ g₁) ≡⟨ assoc ⟩
|
||||||
(f- ⊕ f) ⊕ g₁ ≡⟨ cong (λ φ → φ ⊕ g₁) left-inv ⟩
|
(f- ∘ f) ∘ g₁ ≡⟨ cong (λ φ → φ ∘ g₁) left-inv ⟩
|
||||||
𝟙 ⊕ g₁ ≡⟨ proj₂ ident ⟩
|
𝟙 ∘ g₁ ≡⟨ proj₂ ident ⟩
|
||||||
g₁ ∎
|
g₁ ∎
|
||||||
|
|
||||||
iso-is-epi-mono : Isomorphism {ℂ = ℂ} f → Epimorphism {ℂ = ℂ} {X = X} f × Monomorphism {ℂ = ℂ} {X = X} f
|
iso-is-epi-mono : Isomorphism {ℂ = ℂ} f → Epimorphism {ℂ = ℂ} {X = X} f × Monomorphism {ℂ = ℂ} {X = X} f
|
||||||
|
@ -71,17 +70,22 @@ module _ {ℓ : Level} {ℂ : Category ℓ ℓ} where
|
||||||
|
|
||||||
module _ {A B : ℂ .Object} (f : ℂ .Arrow A B) where
|
module _ {A B : ℂ .Object} (f : ℂ .Arrow A B) where
|
||||||
:func→: : NaturalTransformation (prshf A) (prshf B)
|
:func→: : NaturalTransformation (prshf A) (prshf B)
|
||||||
:func→: = (λ C x → (ℂ ._⊕_ f x)) , λ f₁ → funExt λ x → lem
|
:func→: = (λ C x → ℂ [ f ∘ x ]) , λ f₁ → funExt λ x → lem
|
||||||
where
|
where
|
||||||
lem = (ℂ .isCategory) .IsCategory.assoc
|
lem = (ℂ .isCategory) .IsCategory.assoc
|
||||||
module _ {c : ℂ .Object} where
|
module _ {c : ℂ .Object} where
|
||||||
eqTrans : (:func→: (ℂ .𝟙 {c})) .proj₁ ≡ (Fun .𝟙 {o = prshf c}) .proj₁
|
eqTrans : (:func→: (ℂ .𝟙 {c})) .proj₁ ≡ (Fun .𝟙 {o = prshf c}) .proj₁
|
||||||
eqTrans = funExt λ x → funExt λ x → ℂ .isCategory .IsCategory.ident .proj₂
|
eqTrans = funExt λ x → funExt λ x → ℂ .isCategory .IsCategory.ident .proj₂
|
||||||
eqNat : (i : I) → Natural (prshf c) (prshf c) (eqTrans i)
|
eqNat
|
||||||
eqNat i f = {!!}
|
: PathP (λ i → {A B : ℂ .Object} (f : Opposite ℂ .Arrow A B)
|
||||||
|
→ Sets [ eqTrans i B ∘ prshf c .Functor.func→ f ]
|
||||||
|
≡ Sets [ prshf c .Functor.func→ f ∘ eqTrans i A ])
|
||||||
|
((:func→: (ℂ .𝟙 {c})) .proj₂) ((Fun .𝟙 {o = prshf c}) .proj₂)
|
||||||
|
eqNat = λ i f i' x₁ → {!ℂ ._⊕_ ? ?!}
|
||||||
|
-- eqNat i f = {!!}
|
||||||
|
-- Sets ._⊕_ (eq₁ i B) (prshf A .func→ f) ≡ Sets ._⊕_ (prshf B .func→ f) (eq₁ i A)
|
||||||
:ident: : (:func→: (ℂ .𝟙 {c})) ≡ (Fun .𝟙 {o = prshf c})
|
:ident: : (:func→: (ℂ .𝟙 {c})) ≡ (Fun .𝟙 {o = prshf c})
|
||||||
:ident: i = eqTrans i , eqNat i
|
:ident: = NaturalTransformation≡ eqTrans eqNat
|
||||||
|
|
||||||
yoneda : Functor ℂ (Fun {ℂ = Opposite ℂ} {𝔻 = Sets {ℓ}})
|
yoneda : Functor ℂ (Fun {ℂ = Opposite ℂ} {𝔻 = Sets {ℓ}})
|
||||||
yoneda = record
|
yoneda = record
|
||||||
|
|
|
@ -18,7 +18,7 @@ open import Cat.Functor
|
||||||
-- categorical version of CTT
|
-- categorical version of CTT
|
||||||
|
|
||||||
module CwF {ℓ ℓ' : Level} (ℂ : Category ℓ ℓ') where
|
module CwF {ℓ ℓ' : Level} (ℂ : Category ℓ ℓ') where
|
||||||
open Category
|
open Category hiding (_∘_)
|
||||||
open Functor
|
open Functor
|
||||||
open import Function
|
open import Function
|
||||||
open import Cubical
|
open import Cubical
|
||||||
|
@ -53,7 +53,7 @@ module CwF {ℓ ℓ' : Level} (ℂ : Category ℓ ℓ') where
|
||||||
{ Object = Obj
|
{ Object = Obj
|
||||||
; Arrow = Arr
|
; Arrow = Arr
|
||||||
; 𝟙 = one
|
; 𝟙 = one
|
||||||
; _⊕_ = λ {a b c} → _:⊕:_ {a} {b} {c}
|
; _∘_ = λ {a b c} → _:⊕:_ {a} {b} {c}
|
||||||
}
|
}
|
||||||
|
|
||||||
Contexts = ℂ .Object
|
Contexts = ℂ .Object
|
||||||
|
@ -96,6 +96,6 @@ module _ {ℓ ℓ' : Level} (Ns : Set ℓ) where
|
||||||
{ Object = Ns → Bool
|
{ Object = Ns → Bool
|
||||||
; Arrow = Mor
|
; Arrow = Mor
|
||||||
; 𝟙 = {!!}
|
; 𝟙 = {!!}
|
||||||
; _⊕_ = {!!}
|
; _∘_ = {!!}
|
||||||
; isCategory = {!!}
|
; isCategory = {!!}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ open import Function
|
||||||
|
|
||||||
open import Cat.Category
|
open import Cat.Category
|
||||||
|
|
||||||
open Category
|
open Category hiding (_∘_)
|
||||||
|
|
||||||
module _ {ℓc ℓc' ℓd ℓd'} (ℂ : Category ℓc ℓc') (𝔻 : Category ℓd ℓd') where
|
module _ {ℓc ℓc' ℓd ℓd'} (ℂ : Category ℓc ℓc') (𝔻 : Category ℓd ℓd') where
|
||||||
record IsFunctor
|
record IsFunctor
|
||||||
|
|
Loading…
Reference in a new issue