l3lab/ntp-mathlib huggingface dataset:
/-- 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
                dsimp
                

Proof state:
case h
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
T : Monad C
J : Type u
inst✝² : Category.{v, u} J
D : J ⥤ Algebra T
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
c : Cocone (D ⋙ forget T)
t : IsColimit c
A B : J
f : A ⟶ B
⊢ (D.map f).f ≫ c.ι.app B = c.ι.app A ≫ 𝟙 c.pt

Next tactic:
erw [comp_id, c.w]
noncomputable instance forgetCreatesColimitsOfShape [PreservesColimitsOfShape J (T : C ⥤ C)] :
    CreatesColimitsOfShape J (forget T) where CreatesColimit := by 

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
T : Monad C
J : Type u
inst✝¹ : Category.{v, u} J
inst✝ : PreservesColimitsOfShape J T.toFunctor
⊢ {K : J ⥤ Algebra T} → CreatesColimit K (forget T)

Next tactic:
infer_instance
noncomputable instance forgetCreatesColimits [PreservesColimitsOfSize.{v, u} (T : C ⥤ C)] :
    CreatesColimitsOfSize.{v, u} (forget T) where CreatesColimitsOfShape := by 

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
T : Monad C
J : Type u
inst✝¹ : Category.{v, u} J
inst✝ : PreservesColimitsOfSize.{v, u, v₁, v₁, u₁, u₁} T.toFunctor
⊢ {J : Type u} → [inst : Category.{v, u} J] → CreatesColimitsOfShape J (forget T)

Next tactic:
infer_instance
/-- The forgetful functor from the Eilenberg-Moore category for a monad creates any colimit
which the monad itself preserves.
-/
noncomputable def monadicCreatesColimitOfPreservesColimit (R : D ⥤ C) (K : J ⥤ D)
    [MonadicRightAdjoint R] [PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)]
    [PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)] :
      CreatesColimit K R := by
  -- Porting note: It would be nice to have a variant of apply which introduces goals for missing
  -- instances.
  

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
J : Type u
inst✝³ : Category.{v, u} J
R : D ⥤ C
K : J ⥤ D
inst✝² : MonadicRightAdjoint R
inst✝¹ : PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)
inst✝ : PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)
⊢ CreatesColimit K R

Next tactic:
letI A := Monad.comparison (Adjunction.ofRightAdjoint R)
/-- The forgetful functor from the Eilenberg-Moore category for a monad creates any colimit
which the monad itself preserves.
-/
noncomputable def monadicCreatesColimitOfPreservesColimit (R : D ⥤ C) (K : J ⥤ D)
    [MonadicRightAdjoint R] [PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)]
    [PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)] :
      CreatesColimit K R := by
  -- Porting note: It would be nice to have a variant of apply which introduces goals for missing
  -- instances.
  letI A := Monad.comparison (Adjunction.ofRightAdjoint R)
  

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
J : Type u
inst✝³ : Category.{v, u} J
R : D ⥤ C
K : J ⥤ D
inst✝² : MonadicRightAdjoint R
inst✝¹ : PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)
inst✝ : PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)
A : D ⥤ Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) :=
  Monad.comparison (Adjunction.ofRightAdjoint R)
⊢ CreatesColimit K R

Next tactic:
letI B := Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
/-- The forgetful functor from the Eilenberg-Moore category for a monad creates any colimit
which the monad itself preserves.
-/
noncomputable def monadicCreatesColimitOfPreservesColimit (R : D ⥤ C) (K : J ⥤ D)
    [MonadicRightAdjoint R] [PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)]
    [PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)] :
      CreatesColimit K R := by
  -- Porting note: It would be nice to have a variant of apply which introduces goals for missing
  -- instances.
  letI A := Monad.comparison (Adjunction.ofRightAdjoint R)
  letI B := Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
  

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
J : Type u
inst✝³ : Category.{v, u} J
R : D ⥤ C
K : J ⥤ D
inst✝² : MonadicRightAdjoint R
inst✝¹ : PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)
inst✝ : PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)
A : D ⥤ Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) :=
  Monad.comparison (Adjunction.ofRightAdjoint R)
B : Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ⥤ C :=
  Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
⊢ CreatesColimit K R

Next tactic:
let i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙ Monad.forget _ ≅ K ⋙ R :=
    Functor.associator _ _ _ ≪≫
      isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
/-- The forgetful functor from the Eilenberg-Moore category for a monad creates any colimit
which the monad itself preserves.
-/
noncomputable def monadicCreatesColimitOfPreservesColimit (R : D ⥤ C) (K : J ⥤ D)
    [MonadicRightAdjoint R] [PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)]
    [PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)] :
      CreatesColimit K R := by
  -- Porting note: It would be nice to have a variant of apply which introduces goals for missing
  -- instances.
  letI A := Monad.comparison (Adjunction.ofRightAdjoint R)
  letI B := Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
  let i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙ Monad.forget _ ≅ K ⋙ R :=
    Functor.associator _ _ _ ≪≫
      isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
  

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
J : Type u
inst✝³ : Category.{v, u} J
R : D ⥤ C
K : J ⥤ D
inst✝² : MonadicRightAdjoint R
inst✝¹ : PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)
inst✝ : PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)
A : D ⥤ Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) :=
  Monad.comparison (Adjunction.ofRightAdjoint R)
B : Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ⥤ C :=
  Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙
    Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ≅
  K ⋙ R :=
  Functor.associator K (Monad.comparison (Adjunction.ofRightAdjoint R))
      (Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))) ≪≫
    isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
⊢ CreatesColimit K R

Next tactic:
letI : PreservesColimit ((K ⋙ A) ⋙ Monad.forget
    (Adjunction.toMonad (Adjunction.ofRightAdjoint R)))
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor := by
    dsimp
    refine' preservesColimitOfIsoDiagram _ i.symm
/-- The forgetful functor from the Eilenberg-Moore category for a monad creates any colimit
which the monad itself preserves.
-/
noncomputable def monadicCreatesColimitOfPreservesColimit (R : D ⥤ C) (K : J ⥤ D)
    [MonadicRightAdjoint R] [PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)]
    [PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)] :
      CreatesColimit K R := by
  -- Porting note: It would be nice to have a variant of apply which introduces goals for missing
  -- instances.
  letI A := Monad.comparison (Adjunction.ofRightAdjoint R)
  letI B := Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
  let i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙ Monad.forget _ ≅ K ⋙ R :=
    Functor.associator _ _ _ ≪≫
      isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
  letI : PreservesColimit ((K ⋙ A) ⋙ Monad.forget
    (Adjunction.toMonad (Adjunction.ofRightAdjoint R)))
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor := by
    

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
J : Type u
inst✝³ : Category.{v, u} J
R : D ⥤ C
K : J ⥤ D
inst✝² : MonadicRightAdjoint R
inst✝¹ : PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)
inst✝ : PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)
A : D ⥤ Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) :=
  Monad.comparison (Adjunction.ofRightAdjoint R)
B : Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ⥤ C :=
  Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙
    Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ≅
  K ⋙ R :=
  Functor.associator K (Monad.comparison (Adjunction.ofRightAdjoint R))
      (Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))) ≪≫
    isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
⊢ PreservesColimit ((K ⋙ A) ⋙ Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R)))
    (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor

Next tactic:
dsimp
/-- The forgetful functor from the Eilenberg-Moore category for a monad creates any colimit
which the monad itself preserves.
-/
noncomputable def monadicCreatesColimitOfPreservesColimit (R : D ⥤ C) (K : J ⥤ D)
    [MonadicRightAdjoint R] [PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)]
    [PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)] :
      CreatesColimit K R := by
  -- Porting note: It would be nice to have a variant of apply which introduces goals for missing
  -- instances.
  letI A := Monad.comparison (Adjunction.ofRightAdjoint R)
  letI B := Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
  let i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙ Monad.forget _ ≅ K ⋙ R :=
    Functor.associator _ _ _ ≪≫
      isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
  letI : PreservesColimit ((K ⋙ A) ⋙ Monad.forget
    (Adjunction.toMonad (Adjunction.ofRightAdjoint R)))
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor := by
    dsimp
    

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
J : Type u
inst✝³ : Category.{v, u} J
R : D ⥤ C
K : J ⥤ D
inst✝² : MonadicRightAdjoint R
inst✝¹ : PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)
inst✝ : PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)
A : D ⥤ Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) :=
  Monad.comparison (Adjunction.ofRightAdjoint R)
B : Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ⥤ C :=
  Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙
    Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ≅
  K ⋙ R :=
  Functor.associator K (Monad.comparison (Adjunction.ofRightAdjoint R))
      (Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))) ≪≫
    isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
⊢ PreservesColimit
    ((K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙
      Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R)))
    (leftAdjoint R ⋙ R)

Next tactic:
refine' preservesColimitOfIsoDiagram _ i.symm
/-- The forgetful functor from the Eilenberg-Moore category for a monad creates any colimit
which the monad itself preserves.
-/
noncomputable def monadicCreatesColimitOfPreservesColimit (R : D ⥤ C) (K : J ⥤ D)
    [MonadicRightAdjoint R] [PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)]
    [PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)] :
      CreatesColimit K R := by
  -- Porting note: It would be nice to have a variant of apply which introduces goals for missing
  -- instances.
  letI A := Monad.comparison (Adjunction.ofRightAdjoint R)
  letI B := Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
  let i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙ Monad.forget _ ≅ K ⋙ R :=
    Functor.associator _ _ _ ≪≫
      isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
  letI : PreservesColimit ((K ⋙ A) ⋙ Monad.forget
    (Adjunction.toMonad (Adjunction.ofRightAdjoint R)))
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor := by
    dsimp
    refine' preservesColimitOfIsoDiagram _ i.symm
  

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
J : Type u
inst✝³ : Category.{v, u} J
R : D ⥤ C
K : J ⥤ D
inst✝² : MonadicRightAdjoint R
inst✝¹ : PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)
inst✝ : PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)
A : D ⥤ Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) :=
  Monad.comparison (Adjunction.ofRightAdjoint R)
B : Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ⥤ C :=
  Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙
    Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ≅
  K ⋙ R :=
  Functor.associator K (Monad.comparison (Adjunction.ofRightAdjoint R))
      (Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))) ≪≫
    isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
this : PreservesColimit ((K ⋙ A) ⋙ Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R)))
  (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor :=
  id (preservesColimitOfIsoDiagram (leftAdjoint R ⋙ R) i.symm)
⊢ CreatesColimit K R

Next tactic:
letI : PreservesColimit
    (((K ⋙ A) ⋙ Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))) ⋙
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor)
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor := by
    dsimp
    refine' preservesColimitOfIsoDiagram _ (isoWhiskerRight i (leftAdjoint R ⋙ R)).symm
/-- The forgetful functor from the Eilenberg-Moore category for a monad creates any colimit
which the monad itself preserves.
-/
noncomputable def monadicCreatesColimitOfPreservesColimit (R : D ⥤ C) (K : J ⥤ D)
    [MonadicRightAdjoint R] [PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)]
    [PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)] :
      CreatesColimit K R := by
  -- Porting note: It would be nice to have a variant of apply which introduces goals for missing
  -- instances.
  letI A := Monad.comparison (Adjunction.ofRightAdjoint R)
  letI B := Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
  let i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙ Monad.forget _ ≅ K ⋙ R :=
    Functor.associator _ _ _ ≪≫
      isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
  letI : PreservesColimit ((K ⋙ A) ⋙ Monad.forget
    (Adjunction.toMonad (Adjunction.ofRightAdjoint R)))
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor := by
    dsimp
    refine' preservesColimitOfIsoDiagram _ i.symm
  letI : PreservesColimit
    (((K ⋙ A) ⋙ Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))) ⋙
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor)
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor := by
    

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
J : Type u
inst✝³ : Category.{v, u} J
R : D ⥤ C
K : J ⥤ D
inst✝² : MonadicRightAdjoint R
inst✝¹ : PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)
inst✝ : PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)
A : D ⥤ Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) :=
  Monad.comparison (Adjunction.ofRightAdjoint R)
B : Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ⥤ C :=
  Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙
    Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ≅
  K ⋙ R :=
  Functor.associator K (Monad.comparison (Adjunction.ofRightAdjoint R))
      (Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))) ≪≫
    isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
this : PreservesColimit ((K ⋙ A) ⋙ Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R)))
  (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor :=
  id (preservesColimitOfIsoDiagram (leftAdjoint R ⋙ R) i.symm)
⊢ PreservesColimit
    (((K ⋙ A) ⋙ Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))) ⋙
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor)
    (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor

Next tactic:
dsimp
/-- The forgetful functor from the Eilenberg-Moore category for a monad creates any colimit
which the monad itself preserves.
-/
noncomputable def monadicCreatesColimitOfPreservesColimit (R : D ⥤ C) (K : J ⥤ D)
    [MonadicRightAdjoint R] [PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)]
    [PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)] :
      CreatesColimit K R := by
  -- Porting note: It would be nice to have a variant of apply which introduces goals for missing
  -- instances.
  letI A := Monad.comparison (Adjunction.ofRightAdjoint R)
  letI B := Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
  let i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙ Monad.forget _ ≅ K ⋙ R :=
    Functor.associator _ _ _ ≪≫
      isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
  letI : PreservesColimit ((K ⋙ A) ⋙ Monad.forget
    (Adjunction.toMonad (Adjunction.ofRightAdjoint R)))
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor := by
    dsimp
    refine' preservesColimitOfIsoDiagram _ i.symm
  letI : PreservesColimit
    (((K ⋙ A) ⋙ Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))) ⋙
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor)
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor := by
    dsimp
    

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
J : Type u
inst✝³ : Category.{v, u} J
R : D ⥤ C
K : J ⥤ D
inst✝² : MonadicRightAdjoint R
inst✝¹ : PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)
inst✝ : PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)
A : D ⥤ Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) :=
  Monad.comparison (Adjunction.ofRightAdjoint R)
B : Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ⥤ C :=
  Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙
    Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ≅
  K ⋙ R :=
  Functor.associator K (Monad.comparison (Adjunction.ofRightAdjoint R))
      (Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))) ≪≫
    isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
this : PreservesColimit ((K ⋙ A) ⋙ Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R)))
  (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor :=
  id (preservesColimitOfIsoDiagram (leftAdjoint R ⋙ R) i.symm)
⊢ PreservesColimit
    (((K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙
        Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))) ⋙
      leftAdjoint R ⋙ R)
    (leftAdjoint R ⋙ R)

Next tactic:
refine' preservesColimitOfIsoDiagram _ (isoWhiskerRight i (leftAdjoint R ⋙ R)).symm
/-- The forgetful functor from the Eilenberg-Moore category for a monad creates any colimit
which the monad itself preserves.
-/
noncomputable def monadicCreatesColimitOfPreservesColimit (R : D ⥤ C) (K : J ⥤ D)
    [MonadicRightAdjoint R] [PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)]
    [PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)] :
      CreatesColimit K R := by
  -- Porting note: It would be nice to have a variant of apply which introduces goals for missing
  -- instances.
  letI A := Monad.comparison (Adjunction.ofRightAdjoint R)
  letI B := Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
  let i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙ Monad.forget _ ≅ K ⋙ R :=
    Functor.associator _ _ _ ≪≫
      isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
  letI : PreservesColimit ((K ⋙ A) ⋙ Monad.forget
    (Adjunction.toMonad (Adjunction.ofRightAdjoint R)))
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor := by
    dsimp
    refine' preservesColimitOfIsoDiagram _ i.symm
  letI : PreservesColimit
    (((K ⋙ A) ⋙ Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))) ⋙
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor)
      (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor := by
    dsimp
    refine' preservesColimitOfIsoDiagram _ (isoWhiskerRight i (leftAdjoint R ⋙ R)).symm
  

Proof state:
C : Type u₁
inst✝⁵ : Category.{v₁, u₁} C
D : Type u₂
inst✝⁴ : Category.{v₂, u₂} D
J : Type u
inst✝³ : Category.{v, u} J
R : D ⥤ C
K : J ⥤ D
inst✝² : MonadicRightAdjoint R
inst✝¹ : PreservesColimit (K ⋙ R) (leftAdjoint R ⋙ R)
inst✝ : PreservesColimit ((K ⋙ R) ⋙ leftAdjoint R ⋙ R) (leftAdjoint R ⋙ R)
A : D ⥤ Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) :=
  Monad.comparison (Adjunction.ofRightAdjoint R)
B : Monad.Algebra (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ⥤ C :=
  Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))
i : (K ⋙ Monad.comparison (Adjunction.ofRightAdjoint R)) ⋙
    Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R)) ≅
  K ⋙ R :=
  Functor.associator K (Monad.comparison (Adjunction.ofRightAdjoint R))
      (Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))) ≪≫
    isoWhiskerLeft K (Monad.comparisonForget (Adjunction.ofRightAdjoint R))
this✝ : PreservesColimit ((K ⋙ A) ⋙ Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R)))
  (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor :=
  id (preservesColimitOfIsoDiagram (leftAdjoint R ⋙ R) i.symm)
this : PreservesColimit
  (((K ⋙ A) ⋙ Monad.forget (Adjunction.toMonad (Adjunction.ofRightAdjoint R))) ⋙
    (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor)
  (Adjunction.toMonad (Adjunction.ofRightAdjoint R)).toFunctor :=
  id (preservesColimitOfIsoDiagram (leftAdjoint R ⋙ R) (isoWhiskerRight i (leftAdjoint R ⋙ R)).symm)
⊢ CreatesColimit K R

Next tactic:
letI : CreatesColimit (K ⋙ A) B := CategoryTheory.Monad.forgetCreatesColimit _
/-- A monadic functor creates any colimits of shapes it preserves. -/
noncomputable def monadicCreatesColimitsOfShapeOfPreservesColimitsOfShape (R : D ⥤ C)
    [MonadicRightAdjoint R] [PreservesColimitsOfShape J R] : CreatesColimitsOfShape J R :=
  letI : PreservesColimitsOfShape J (leftAdjoint R) := by
    

Proof state:
C : Type u₁
inst✝⁴ : Category.{v₁, u₁} C
D : Type u₂
inst✝³ : Category.{v₂, u₂} D
J : Type u
inst✝² : Category.{v, u} J
R : D ⥤ C
inst✝¹ : MonadicRightAdjoint R
inst✝ : PreservesColimitsOfShape J R
⊢ PreservesColimitsOfShape J (leftAdjoint R)

Next tactic:
apply (Adjunction.leftAdjointPreservesColimits (Adjunction.ofRightAdjoint R)).1