Lean4
/-- The forgetful functor from the Eilenberg-Moore category for a monad creates any colimit
which the monad itself preserves.
-/
noncomputable instance forgetCreatesColimit (D : J ⥤ Algebra T) [PreservesColimit (D ⋙ forget T) (T : C ⥤ C)]
[PreservesColimit ((D ⋙ forget T) ⋙ ↑T) (T : C ⥤ C)] : CreatesColimit D (forget T) :=
createsColimitOfReflectsIso fun c t =>
{ liftedCocone :=
{ pt := coconePoint c t
ι :=
{ app := fun j =>
{ f := c.ι.app j
h := commuting _ _ _ }
naturality := fun A B f => by
ext1
simpa using (c.w f) } }
validLift := Cocones.ext (Iso.refl _)
makesColimit := liftedCoconeIsColimit _ _ }