Fix typo, rename implicit variables, implement presheaf

This commit is contained in:
Frederik Hanghøj Iversen 2018-01-22 15:03:04 +01:00
parent dd3415a69d
commit 6a25a4c3ff

View file

@ -24,8 +24,8 @@ module _ {c c' d d' : Level} { : Category c c'} {𝔻 : Cat
(f : .Arrow A B) (f : .Arrow A B)
𝔻 ._⊕_ (θ B) (F .func→ f) 𝔻 ._⊕_ (G .func→ f) (θ A) 𝔻 ._⊕_ (θ B) (F .func→ f) 𝔻 ._⊕_ (G .func→ f) (θ A)
NaturalTranformation : Set (c c' d') NaturalTransformation : Set (c c' d')
NaturalTranformation = Σ Transformation Natural NaturalTransformation = Σ Transformation Natural
-- 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)
@ -45,37 +45,38 @@ module _ {c c' d d' : Level} { : Category c c'} {𝔻 : Cat
F→ = F .func→ F→ = F .func→
open module 𝔻 = IsCategory (𝔻 .isCategory) open module 𝔻 = IsCategory (𝔻 .isCategory)
identityNat : (F : Functor 𝔻) NaturalTranformation F F identityNat : (F : Functor 𝔻) NaturalTransformation F F
identityNat F = identityTrans F , identityNatural F identityNat F = identityTrans F , identityNatural F
module _ {a b c : Functor 𝔻} where module _ {F G H : Functor 𝔻} where
private private
_𝔻⊕_ = 𝔻 ._⊕_ _𝔻⊕_ = 𝔻 ._⊕_
_∘nt_ : Transformation b c Transformation a b Transformation a c _∘nt_ : Transformation G H Transformation F G Transformation F H
(θ ∘nt η) C = θ C 𝔻⊕ η C (θ ∘nt η) C = θ C 𝔻⊕ η C
_:⊕:_ : NaturalTranformation b c NaturalTranformation a b NaturalTranformation a c 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) 𝔻⊕ (a .func→ f) ≡⟨⟩ ((θ ∘nt η) B) 𝔻⊕ (F .func→ f) ≡⟨⟩
(θ B 𝔻⊕ η B) 𝔻⊕ (a .func→ f) ≡⟨ sym assoc (θ B 𝔻⊕ η B) 𝔻⊕ (F .func→ f) ≡⟨ sym assoc
θ B 𝔻⊕ (η B 𝔻⊕ (a .func→ f)) ≡⟨ cong (λ φ θ B 𝔻⊕ φ) (ηNat f) θ B 𝔻⊕ (η B 𝔻⊕ (F .func→ f)) ≡⟨ cong (λ φ θ B 𝔻⊕ φ) (ηNat f)
θ B 𝔻⊕ ((b .func→ f) 𝔻⊕ η A) ≡⟨ assoc θ B 𝔻⊕ ((G .func→ f) 𝔻⊕ η A) ≡⟨ assoc
(θ B 𝔻⊕ (b .func→ f)) 𝔻⊕ η A ≡⟨ cong (λ φ φ 𝔻⊕ η A) (θNat f) (θ B 𝔻⊕ (G .func→ f)) 𝔻⊕ η A ≡⟨ cong (λ φ φ 𝔻⊕ η A) (θNat f)
(((c .func→ f) 𝔻⊕ θ A) 𝔻⊕ η A) ≡⟨ sym assoc (((H .func→ f) 𝔻⊕ θ A) 𝔻⊕ η A) ≡⟨ sym assoc
((c .func→ f) 𝔻⊕ (θ A 𝔻⊕ η A)) ≡⟨⟩ ((H .func→ f) 𝔻⊕ (θ A 𝔻⊕ η A)) ≡⟨⟩
((c .func→ f) 𝔻⊕ ((θ ∘nt η) A)) ((H .func→ f) 𝔻⊕ ((θ ∘nt η) A))
where where
open IsCategory (𝔻 .isCategory) open IsCategory (𝔻 .isCategory)
NatComp = _:⊕:_
private private
module _ {A B C D : Functor 𝔻} {f : NaturalTranformation A B} module _ {A B C D : Functor 𝔻} {f : NaturalTransformation A B}
{g : NaturalTranformation B C} {h : NaturalTranformation C D} where {g : NaturalTransformation B C} {h : NaturalTransformation C D} where
_g⊕f_ = _:⊕:_ {A} {B} {C} _g⊕f_ = _:⊕:_ {A} {B} {C}
_h⊕g_ = _:⊕:_ {B} {C} {D} _h⊕g_ = _:⊕:_ {B} {C} {D}
:assoc: : (_:⊕:_ {A} {C} {D} h (_:⊕:_ {A} {B} {C} g f)) (_:⊕:_ {A} {B} {D} (_:⊕:_ {B} {C} {D} h g) f) :assoc: : (_:⊕:_ {A} {C} {D} h (_:⊕:_ {A} {B} {C} g f)) (_:⊕:_ {A} {B} {D} (_:⊕:_ {B} {C} {D} h g) f)
:assoc: = {!!} :assoc: = {!!}
module _ {A B : Functor 𝔻} {f : NaturalTranformation A B} where module _ {A B : Functor 𝔻} {f : NaturalTransformation A B} where
ident-r : (_:⊕:_ {A} {A} {B} f (identityNat A)) f ident-r : (_:⊕:_ {A} {A} {B} f (identityNat A)) f
ident-r = {!!} ident-r = {!!}
ident-l : (_:⊕:_ {A} {B} {B} (identityNat B) f) f ident-l : (_:⊕:_ {A} {B} {B} (identityNat B) f) f
@ -86,7 +87,7 @@ module _ {c c' d d' : Level} { : Category c c'} {𝔻 : Cat
:ident: = ident-r , ident-l :ident: = ident-r , ident-l
instance instance
:isCategory: : IsCategory (Functor 𝔻) NaturalTranformation :isCategory: : IsCategory (Functor 𝔻) NaturalTransformation
(λ {F} identityNat F) (λ {a} {b} {c} _:⊕:_ {a} {b} {c}) (λ {F} identityNat F) (λ {a} {b} {c} _:⊕:_ {a} {b} {c})
:isCategory: = record :isCategory: = record
{ assoc = λ {A B C D} :assoc: {A} {B} {C} {D} { assoc = λ {A B C D} :assoc: {A} {B} {C} {D}
@ -94,10 +95,22 @@ module _ {c c' d d' : Level} { : Category c c'} {𝔻 : Cat
} }
-- Functor categories. Objects are functors, arrows are natural transformations. -- Functor categories. Objects are functors, arrows are natural transformations.
Fun : Category (c (c' (d d'))) (c (c' d')) Fun : Category (c c' d d') (c c' d')
Fun = record Fun = record
{ Object = Functor 𝔻 { Object = Functor 𝔻
; Arrow = NaturalTranformation ; Arrow = NaturalTransformation
; 𝟙 = λ {F} identityNat F ; 𝟙 = λ {F} identityNat F
; _⊕_ = λ {a b c} _:⊕:_ {a} {b} {c} ; _⊕_ = λ {F G H} _:⊕:_ {F} {G} {H}
}
module _ { ' : Level} ( : Category ') where
open import Cat.Categories.Sets
-- Restrict the functors to Presheafs.
Presh : Category ( lsuc ') ( ')
Presh = record
{ Object = Presheaf
; Arrow = NaturalTransformation
; 𝟙 = λ {F} identityNat F
; _⊕_ = λ {F G H} NatComp {F = F} {G = G} {H = H}
} }