Proposition mor_from_free_alg_eq {X : hSet} {Y : category_of_monad_algebra} {f g : monad_free_alg_functor X --> Y} (p : η M X · pr1 f = η M X · pr1 g) : f = g. Proof. refine (!(id_left _) @ _ @ id_left _). etrans. { apply maponpaths_2. refine (!_). exact (triangle_id_left_ad (pr2 monad_underlying_is_right_adjoint) X). } refine (!_). etrans. { apply maponpaths_2. refine (!_). exact (triangle_id_left_ad (pr2 monad_underlying_is_right_adjoint) X). } refine (!_). rewrite !assoc'. use subtypePath. { intro ; apply homset_property. } enough (# M (η M X · η M (M X)) · μ M (M X) · (# M (identity _) · μ M X · pr1 f) = # M (η M X · η M (M X)) · μ M (M X) · (# M (identity _) · μ M X · pr1 g)) as q. { exact q. } rewrite !functor_id. rewrite id_left. etrans. { apply maponpaths. exact (pr2 f). } refine (!_). etrans. { apply maponpaths. exact (pr2 g). } refine (!_). rewrite !assoc. apply maponpaths_2. rewrite !functor_comp. rewrite !assoc'. rewrite !(maponpaths (λ z, _ · z) (assoc _ _ _)). etrans. { apply maponpaths. apply maponpaths_2. exact (@Monad_law2 _ M (M X)). } refine (!_). etrans. { apply maponpaths. apply maponpaths_2. exact (@Monad_law2 _ M (M X)). } refine (!_). rewrite !id_left. rewrite <- !functor_comp. apply maponpaths. exact p. Qed.
Require Import UniMath.MoreFoundations.All. Require Import UniMath.CategoryTheory.Core.Categories. Require Import UniMath.CategoryTheory.Core.Functors. Require Import UniMath.CategoryTheory.Core.NaturalTransformations. Require Import UniMath.CategoryTheory.Adjunctions.Core. Require Import UniMath.CategoryTheory.Categories.HSET.All. Require Import UniMath.CategoryTheory.Limits.BinProducts. Require Import UniMath.CategoryTheory.Limits.BinCoproducts. Require Import UniMath.CategoryTheory.Limits.Equalizers. Require Import UniMath.CategoryTheory.Limits.Coequalizers. Require Import UniMath.CategoryTheory.Limits.Products. Require Import UniMath.CategoryTheory.Limits.Preservation. Require Import UniMath.CategoryTheory.DisplayedCats.Core. Require Import UniMath.CategoryTheory.DisplayedCats.Structures.CartesianStructure. Require Import UniMath.CategoryTheory.DisplayedCats.Structures.StructureLimitsAndColimits. Require Import UniMath.CategoryTheory.Monads.Monads.