Prove inverse law

This commit is contained in:
Frederik Hanghøj Iversen 2018-03-01 17:50:06 +01:00
parent ff2952e9ad
commit f526fd6010

View file

@ -284,10 +284,21 @@ module Kleisli {a b : Level} ( : Category a b) where
isInverse = inv-l , inv-r
where
inv-l = begin
join pure ≡⟨ {!!}
pure >>> join ≡⟨⟩
pure >>> bind 𝟙 ≡⟨ isNatural _
𝟙
inv-r = begin
join fmap pure ≡⟨ {!!}
fmap pure >>> join ≡⟨⟩
bind (pure >>> pure) >>> bind 𝟙
≡⟨ isDistributive _ _
bind ((pure >>> pure) >=> 𝟙) ≡⟨⟩
bind ((pure >>> pure) >>> bind 𝟙)
≡⟨ cong bind .isAssociative
bind (pure >>> (pure >>> bind 𝟙))
≡⟨ cong (λ φ bind (pure >>> φ)) (isNatural _)
bind (pure >>> 𝟙)
≡⟨ cong bind (proj₂ .isIdentity)
bind pure ≡⟨ isIdentity
𝟙
record Monad : Set where