Prove that the yoneda embedding is distributive

This commit is contained in:
Frederik Hanghøj Iversen 2018-03-05 14:42:12 +01:00
parent 7fbca1aeeb
commit ce4dd83969

View file

@ -32,12 +32,18 @@ module _ { : Level} { : Category } where
_⇑_ = CatExponential.prodObj
module _ {A B : .Object} (f : [ A , B ]) where
:func→: : NaturalTransformation (prshf A) (prshf B)
:func→: = (λ C x [ f x ]) , λ f₁ funExt λ _ .isAssociative
fmap : Transformation (prshf A) (prshf B)
fmap C x = [ f x ]
fmapNatural : Natural (prshf A) (prshf B) fmap
fmapNatural g = funExt λ _ .isAssociative
fmapNT : NaturalTransformation (prshf A) (prshf B)
fmapNT = fmap , fmapNatural
rawYoneda : RawFunctor Fun
RawFunctor.func* rawYoneda = prshf
RawFunctor.func→ rawYoneda = :func→:
RawFunctor.func→ rawYoneda = fmapNT
open RawFunctor rawYoneda
isIdentity : IsIdentity
@ -47,7 +53,22 @@ module _ { : Level} { : Category } where
eq = funExt λ A funExt λ B proj₂ .isIdentity
isDistributive : IsDistributive
isDistributive = {!!}
isDistributive {A} {B} {C} {f = f} {g}
= lemSig (propIsNatural (prshf A) (prshf C)) _ _ eq
where
T[_∘_]' = T[_∘_] {F = prshf A} {prshf B} {prshf C}
eqq : (X : .Object) (x : [ X , A ])
fmap ( [ g f ]) X x T[ fmap g fmap f ]' X x
eqq X x = begin
fmap ( [ g f ]) X x ≡⟨⟩
[ [ g f ] x ] ≡⟨ sym .isAssociative
[ g [ f x ] ] ≡⟨⟩
[ g fmap f X x ] ≡⟨⟩
T[ fmap g fmap f ]' X x
eq : fmap ( [ g f ]) T[ fmap g fmap f ]'
eq = begin
fmap ( [ g f ]) ≡⟨ funExt (λ X funExt λ α eqq X α)
T[ fmap g fmap f ]'
instance
isFunctor : IsFunctor Fun rawYoneda