Lemma LModule_comp_law2 {D : category} {T : Monad C} {S : Monad C} {a : T ∙ S ⟹ S ∙ T} (l : monad_dist_laws a) (L : LModule T D) : ∏ x : C, #L (#S (μ T x)) · (#L (a x) · lm_mult T L (S x)) = (#L (a (T x)) · lm_mult T L (S (T x))) · (#L (a x) · lm_mult T L (S x)). Proof. intro x. rewrite assoc. rewrite <- functor_comp. rewrite <- (monad_dist_law3 l). rewrite !functor_comp. rewrite <- assoc. rewrite (LModule_law2 T (S x)). rewrite assoc. rewrite <- (assoc _ (#L (#T (a x)))). etrans. { apply cancel_postcomposition. apply cancel_precomposition. apply (nat_trans_ax (lm_mult T L)). } now rewrite !assoc. Defined.
Require Import UniMath.Foundations.PartD. Require Import UniMath.Foundations.Propositions. Require Import UniMath.Foundations.Sets. Require Import UniMath.MoreFoundations.Tactics. Require Import UniMath.CategoryTheory.Core.Categories. Require Import UniMath.CategoryTheory.Core.Isos. Require Import UniMath.CategoryTheory.Core.Functors. Require Import UniMath.CategoryTheory.Core.NaturalTransformations. Require Import UniMath.CategoryTheory.Monads.Monads. Require Import UniMath.CategoryTheory.Limits.BinCoproducts. Require Import UniMath.CategoryTheory.PrecategoryBinProduct. Require Import UniMath.CategoryTheory.whiskering. Require Import UniMath.CategoryTheory.Monads.LModules.