Sort of half of the proof of an inverse

This commit is contained in:
Frederik Hanghøj Iversen 2018-03-08 00:09:49 +01:00
parent 459718da23
commit 36cbe711fb

View file

@ -735,16 +735,59 @@ module _ {a b : Level} { : Category a b} where
Voe-2-3-1-inverse = (toMonad ∘f fromMonad) Function.id Voe-2-3-1-inverse = (toMonad ∘f fromMonad) Function.id
where where
toMonad : voe-2-3-1 M.Monad fromMonad : (m : M.Monad) voe-2-3.voe-2-3-1 (M.Monad.Romap m) (λ {X} M.Monad.pureT m X)
toMonad = voe-2-3-1.toMonad fromMonad = voe-2-3-1-fromMonad
t : (m : M.Monad) voe-2-3.voe-2-3-1 (M.Monad.Romap m) (λ {X} M.Monad.pureT m X) toMonad : {omap} {pure : {X : Object} Arrow X (omap X)} voe-2-3.voe-2-3-1 omap pure M.Monad
t = voe-2-3-1-fromMonad toMonad = voe-2-3.voe-2-3-1.toMonad
-- Problem: `t` does not fit the type of `fromMonad`!
fromMonad : M.Monad voe-2-3-1
fromMonad = {!t!}
-- voe-2-3-1-inverse : (voe-2-3.voe-2-3-1.toMonad ∘f voe-2-3-1-fromMonad) ≡ Function.id
voe-2-3-1-inverse : Voe-2-3-1-inverse voe-2-3-1-inverse : Voe-2-3-1-inverse
voe-2-3-1-inverse = {!!} voe-2-3-1-inverse = refl
Voe-2-3-2-inverse = (toMonad ∘f fromMonad) Function.id
where
fromMonad : (m : K.Monad) voe-2-3.voe-2-3-2 (K.Monad.omap m) (K.Monad.pure m)
fromMonad = voe-2-3-2-fromMonad
toMonad : {omap} {pure : {X : Object} Arrow X (omap X)} voe-2-3.voe-2-3-2 omap pure K.Monad
toMonad = voe-2-3.voe-2-3-2.toMonad
voe-2-3-2-inverse : Voe-2-3-2-inverse
voe-2-3-2-inverse = refl
forthEq' : m _ _
forthEq' m = begin
(forth ∘f back) m ≡⟨⟩
-- In full gory detail:
( voe-2-3-2-fromMonad
∘f Monoidal→Kleisli
∘f voe-2-3.voe-2-3-1.toMonad
∘f voe-2-3-1-fromMonad
∘f Kleisli→Monoidal
∘f voe-2-3.voe-2-3-2.toMonad
) m ≡⟨⟩ -- fromMonad and toMonad are inverses
( voe-2-3-2-fromMonad
∘f Monoidal→Kleisli
∘f Kleisli→Monoidal
∘f voe-2-3.voe-2-3-2.toMonad
) m ≡⟨ u
-- Monoidal→Kleisli and Kleisli→Monoidal are inverses
-- I should be able to prove this using congruence and `lem` below.
( voe-2-3-2-fromMonad
∘f voe-2-3.voe-2-3-2.toMonad
) m ≡⟨⟩
( voe-2-3-2-fromMonad
∘f voe-2-3.voe-2-3-2.toMonad
) m ≡⟨⟩ -- fromMonad and toMonad are inverses
m
where
lem : Monoidal→Kleisli ∘f Kleisli→Monoidal Function.id
lem = verso-recto Monoidal≃Kleisli
t : { : Level} {A B : Set } {a : _ A} {b : B _}
a ∘f (Monoidal→Kleisli ∘f Kleisli→Monoidal) ∘f b a ∘f b
t {a = a} {b} = cong (λ φ a ∘f φ ∘f b) lem
u : { : Level} {A B : Set } {a : _ A} {b : B _}
{m : _} (a ∘f (Monoidal→Kleisli ∘f Kleisli→Monoidal) ∘f b) m (a ∘f b) m
u {m = m} = cong (λ φ φ m) t
forthEq : m (forth ∘f back) m m forthEq : m (forth ∘f back) m m
forthEq m = begin forthEq m = begin