l3lab/ntp-mathlib huggingface dataset:
/-- (Impl) Prove that the lifted cone is limiting. -/
@[simps]
def liftedConeIsLimit : IsLimit (liftedCone D c t) where
  lift s :=
    { f := t.lift ((forget T).mapCone s)
      h :=
        t.hom_ext fun j => by
          dsimp
          

Proof state:
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
T : Monad C
J : Type u
inst✝ : Category.{v, u} J
D : J ⥤ Algebra T
c : Cone (D ⋙ forget T)
t : IsLimit c
s : Cone D
j : J
⊢ (T.map (IsLimit.lift t ((forget T).mapCone s)) ≫ IsLimit.lift t (newCone D c)) ≫ c.π.app j =
    (s.pt.a ≫ IsLimit.lift t ((forget T).mapCone s)) ≫ c.π.app j

Next tactic:
rw [Category.assoc, Category.assoc, t.fac, newCone_π_app, ← Functor.map_comp_assoc,
            t.fac, Functor.mapCone_π_app]
/-- (Impl) Prove that the lifted cone is limiting. -/
@[simps]
def liftedConeIsLimit : IsLimit (liftedCone D c t) where
  lift s :=
    { f := t.lift ((forget T).mapCone s)
      h :=
        t.hom_ext fun j => by
          dsimp
          rw [Category.assoc, Category.assoc, t.fac, newCone_π_app, ← Functor.map_comp_assoc,
            t.fac, Functor.mapCone_π_app]
          

Proof state:
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
T : Monad C
J : Type u
inst✝ : Category.{v, u} J
D : J ⥤ Algebra T
c : Cone (D ⋙ forget T)
t : IsLimit c
s : Cone D
j : J
⊢ T.map ((forget T).map (s.π.app j)) ≫ (D.obj j).a = s.pt.a ≫ (forget T).map (s.π.app j)

Next tactic:
apply (s.π.app j).h
/-- (Impl) Prove that the lifted cone is limiting. -/
@[simps]
def liftedConeIsLimit : IsLimit (liftedCone D c t) where
  lift s :=
    { f := t.lift ((forget T).mapCone s)
      h :=
        t.hom_ext fun j => by
          dsimp
          rw [Category.assoc, Category.assoc, t.fac, newCone_π_app, ← Functor.map_comp_assoc,
            t.fac, Functor.mapCone_π_app]
          apply (s.π.app j).h }
  uniq s m J := by
    

Proof state:
C : Type u₁
inst✝¹ : Category.{v₁, u₁} C
T : Monad C
J✝ : Type u
inst✝ : Category.{v, u} J✝
D : J✝ ⥤ Algebra T
c : Cone (D ⋙ forget T)
t : IsLimit c
s : Cone D
m : s.pt ⟶ (liftedCone D c t).pt
J : ∀ (j : J✝), m ≫ (liftedCone D c t).π.app j = s.π.app j
⊢ m = (fun s => Algebra.Hom.mk (IsLimit.lift t ((forget T).mapCone s))) s

Next tactic:
ext1
/-- (Impl) Prove that the lifted cone is limiting. -/
@[simps]
def liftedConeIsLimit : IsLimit (liftedCone D c t) where
  lift s :=
    { f := t.lift ((forget T).mapCone s)
      h :=
        t.hom_ext fun j => by
          dsimp
          rw [Category.assoc, Category.assoc, t.fac, newCone_π_app, ← Functor.map_comp_assoc,
            t.fac, Functor.mapCone_π_app]
          apply (s.π.app j).h }
  uniq s m J := by
    ext1
    

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
c : Cone (D ⋙ forget T)
t : IsLimit c
s : Cone D
m : s.pt ⟶ (liftedCone D c t).pt
J : ∀ (j : J✝), m ≫ (liftedCone D c t).π.app j = s.π.app j
⊢ m.f = ((fun s => Algebra.Hom.mk (IsLimit.lift t ((forget T).mapCone s))) s).f

Next tactic:
apply t.hom_ext
/-- (Impl) Prove that the lifted cone is limiting. -/
@[simps]
def liftedConeIsLimit : IsLimit (liftedCone D c t) where
  lift s :=
    { f := t.lift ((forget T).mapCone s)
      h :=
        t.hom_ext fun j => by
          dsimp
          rw [Category.assoc, Category.assoc, t.fac, newCone_π_app, ← Functor.map_comp_assoc,
            t.fac, Functor.mapCone_π_app]
          apply (s.π.app j).h }
  uniq s m J := by
    ext1
    apply t.hom_ext
    

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
c : Cone (D ⋙ forget T)
t : IsLimit c
s : Cone D
m : s.pt ⟶ (liftedCone D c t).pt
J : ∀ (j : J✝), m ≫ (liftedCone D c t).π.app j = s.π.app j
⊢ ∀ (j : J✝), m.f ≫ c.π.app j = ((fun s => Algebra.Hom.mk (IsLimit.lift t ((forget T).mapCone s))) s).f ≫ c.π.app j

Next tactic:
intro j
/-- (Impl) Prove that the lifted cone is limiting. -/
@[simps]
def liftedConeIsLimit : IsLimit (liftedCone D c t) where
  lift s :=
    { f := t.lift ((forget T).mapCone s)
      h :=
        t.hom_ext fun j => by
          dsimp
          rw [Category.assoc, Category.assoc, t.fac, newCone_π_app, ← Functor.map_comp_assoc,
            t.fac, Functor.mapCone_π_app]
          apply (s.π.app j).h }
  uniq s m J := by
    ext1
    apply t.hom_ext
    intro j
    

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
c : Cone (D ⋙ forget T)
t : IsLimit c
s : Cone D
m : s.pt ⟶ (liftedCone D c t).pt
J : ∀ (j : J✝), m ≫ (liftedCone D c t).π.app j = s.π.app j
j : J✝
⊢ m.f ≫ c.π.app j = ((fun s => Algebra.Hom.mk (IsLimit.lift t ((forget T).mapCone s))) s).f ≫ c.π.app j

Next tactic:
simpa [t.fac ((forget T).mapCone s) j] using congr_arg Algebra.Hom.f (J j)
/-- (Impl)
Construct the colimiting algebra from the map `λ : TL ⟶ L` given by `lambda`. We are required to
show it satisfies the two algebra laws, which follow from the algebra laws for the image of `D` and
our `commuting` lemma.
-/
@[simps]
def coconePoint : Algebra T where
  A := c.pt
  a := lambda c t
  unit := by
    

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

Next tactic:
apply t.hom_ext
/-- (Impl)
Construct the colimiting algebra from the map `λ : TL ⟶ L` given by `lambda`. We are required to
show it satisfies the two algebra laws, which follow from the algebra laws for the image of `D` and
our `commuting` lemma.
-/
@[simps]
def coconePoint : Algebra T where
  A := c.pt
  a := lambda c t
  unit := by
    apply t.hom_ext
    

Proof state:
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
T : Monad C
J : Type u
inst✝² : Category.{v, u} J
D : J ⥤ Algebra T
c : Cocone (D ⋙ forget T)
t : IsColimit c
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
⊢ ∀ (j : J), c.ι.app j ≫ (η T).app c.pt ≫ lambda c t = c.ι.app j ≫ 𝟙 c.pt

Next tactic:
intro j
/-- (Impl)
Construct the colimiting algebra from the map `λ : TL ⟶ L` given by `lambda`. We are required to
show it satisfies the two algebra laws, which follow from the algebra laws for the image of `D` and
our `commuting` lemma.
-/
@[simps]
def coconePoint : Algebra T where
  A := c.pt
  a := lambda c t
  unit := by
    apply t.hom_ext
    intro j
    

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

Next tactic:
rw [show c.ι.app j ≫ T.η.app c.pt ≫ _ = T.η.app (D.obj j).A ≫ _ ≫ _ from
        T.η.naturality_assoc _ _,
      commuting, Algebra.unit_assoc (D.obj j)]
/-- (Impl)
Construct the colimiting algebra from the map `λ : TL ⟶ L` given by `lambda`. We are required to
show it satisfies the two algebra laws, which follow from the algebra laws for the image of `D` and
our `commuting` lemma.
-/
@[simps]
def coconePoint : Algebra T where
  A := c.pt
  a := lambda c t
  unit := by
    apply t.hom_ext
    intro j
    rw [show c.ι.app j ≫ T.η.app c.pt ≫ _ = T.η.app (D.obj j).A ≫ _ ≫ _ from
        T.η.naturality_assoc _ _,
      commuting, Algebra.unit_assoc (D.obj j)]
    

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

Next tactic:
dsimp
/-- (Impl)
Construct the colimiting algebra from the map `λ : TL ⟶ L` given by `lambda`. We are required to
show it satisfies the two algebra laws, which follow from the algebra laws for the image of `D` and
our `commuting` lemma.
-/
@[simps]
def coconePoint : Algebra T where
  A := c.pt
  a := lambda c t
  unit := by
    apply t.hom_ext
    intro j
    rw [show c.ι.app j ≫ T.η.app c.pt ≫ _ = T.η.app (D.obj j).A ≫ _ ≫ _ from
        T.η.naturality_assoc _ _,
      commuting, Algebra.unit_assoc (D.obj j)]
    dsimp; 

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

Next tactic:
simp
/-- (Impl)
Construct the colimiting algebra from the map `λ : TL ⟶ L` given by `lambda`. We are required to
show it satisfies the two algebra laws, which follow from the algebra laws for the image of `D` and
our `commuting` lemma.
-/
@[simps]
def coconePoint : Algebra T where
  A := c.pt
  a := lambda c t
  unit := by
    apply t.hom_ext
    intro j
    rw [show c.ι.app j ≫ T.η.app c.pt ≫ _ = T.η.app (D.obj j).A ≫ _ ≫ _ from
        T.η.naturality_assoc _ _,
      commuting, Algebra.unit_assoc (D.obj j)]
    dsimp; simp
  -- See library note [dsimp, simp]
  assoc := by
    

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

Next tactic:
refine' (isColimitOfPreserves _ (isColimitOfPreserves _ t)).hom_ext fun j => _
/-- (Impl)
Construct the colimiting algebra from the map `λ : TL ⟶ L` given by `lambda`. We are required to
show it satisfies the two algebra laws, which follow from the algebra laws for the image of `D` and
our `commuting` lemma.
-/
@[simps]
def coconePoint : Algebra T where
  A := c.pt
  a := lambda c t
  unit := by
    apply t.hom_ext
    intro j
    rw [show c.ι.app j ≫ T.η.app c.pt ≫ _ = T.η.app (D.obj j).A ≫ _ ≫ _ from
        T.η.naturality_assoc _ _,
      commuting, Algebra.unit_assoc (D.obj j)]
    dsimp; simp
  -- See library note [dsimp, simp]
  assoc := by
    refine' (isColimitOfPreserves _ (isColimitOfPreserves _ t)).hom_ext fun j => _
    

Proof state:
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
T : Monad C
J : Type u
inst✝² : Category.{v, u} J
D : J ⥤ Algebra T
c : Cocone (D ⋙ forget T)
t : IsColimit c
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
j : J
⊢ (T.mapCocone (T.mapCocone c)).ι.app j ≫ (μ T).app c.pt ≫ lambda c t =
    (T.mapCocone (T.mapCocone c)).ι.app j ≫ T.map (lambda c t) ≫ lambda c t

Next tactic:
rw [Functor.mapCocone_ι_app, Functor.mapCocone_ι_app,
      show (T : C ⥤ C).map ((T : C ⥤ C).map _) ≫ _ ≫ _ = _ from T.μ.naturality_assoc _ _, ←
      Functor.map_comp_assoc, commuting, Functor.map_comp, Category.assoc, commuting]
/-- (Impl)
Construct the colimiting algebra from the map `λ : TL ⟶ L` given by `lambda`. We are required to
show it satisfies the two algebra laws, which follow from the algebra laws for the image of `D` and
our `commuting` lemma.
-/
@[simps]
def coconePoint : Algebra T where
  A := c.pt
  a := lambda c t
  unit := by
    apply t.hom_ext
    intro j
    rw [show c.ι.app j ≫ T.η.app c.pt ≫ _ = T.η.app (D.obj j).A ≫ _ ≫ _ from
        T.η.naturality_assoc _ _,
      commuting, Algebra.unit_assoc (D.obj j)]
    dsimp; simp
  -- See library note [dsimp, simp]
  assoc := by
    refine' (isColimitOfPreserves _ (isColimitOfPreserves _ t)).hom_ext fun j => _
    rw [Functor.mapCocone_ι_app, Functor.mapCocone_ι_app,
      show (T : C ⥤ C).map ((T : C ⥤ C).map _) ≫ _ ≫ _ = _ from T.μ.naturality_assoc _ _, ←
      Functor.map_comp_assoc, commuting, Functor.map_comp, Category.assoc, commuting]
    

Proof state:
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
T : Monad C
J : Type u
inst✝² : Category.{v, u} J
D : J ⥤ Algebra T
c : Cocone (D ⋙ forget T)
t : IsColimit c
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
j : J
⊢ (μ T).app ((D ⋙ forget T).obj j) ≫ (D.obj j).a ≫ c.ι.app j = T.map (D.obj j).a ≫ (D.obj j).a ≫ c.ι.app j

Next tactic:
apply (D.obj j).assoc_assoc _
/-- (Impl) Construct the lifted cocone in `Algebra T` which will be colimiting. -/
@[simps]
def liftedCocone : Cocone D where
  pt := coconePoint c t
  ι :=
    { app := fun j =>
        { f := c.ι.app j
          h := commuting _ _ _ }
      naturality := fun A B f => by
        

Proof state:
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
T : Monad C
J : Type u
inst✝² : Category.{v, u} J
D : J ⥤ Algebra T
c : Cocone (D ⋙ forget T)
t : IsColimit c
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
A B : J
f : A ⟶ B
⊢ D.map f ≫ (fun j => Algebra.Hom.mk (c.ι.app j)) B =
    (fun j => Algebra.Hom.mk (c.ι.app j)) A ≫ ((Functor.const J).obj (coconePoint c t)).map f

Next tactic:
ext1
/-- (Impl) Construct the lifted cocone in `Algebra T` which will be colimiting. -/
@[simps]
def liftedCocone : Cocone D where
  pt := coconePoint c t
  ι :=
    { app := fun j =>
        { f := c.ι.app j
          h := commuting _ _ _ }
      naturality := fun A B f => by
        ext1
        

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
c : Cocone (D ⋙ forget T)
t : IsColimit c
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
A B : J
f : A ⟶ B
⊢ (D.map f ≫ (fun j => Algebra.Hom.mk (c.ι.app j)) B).f =
    ((fun j => Algebra.Hom.mk (c.ι.app j)) A ≫ ((Functor.const J).obj (coconePoint c t)).map f).f

Next tactic:
dsimp
/-- (Impl) Construct the lifted cocone in `Algebra T` which will be colimiting. -/
@[simps]
def liftedCocone : Cocone D where
  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
c : Cocone (D ⋙ forget T)
t : IsColimit c
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
A B : J
f : A ⟶ B
⊢ (D.map f).f ≫ c.ι.app B = c.ι.app A ≫ 𝟙 c.pt

Next tactic:
rw [comp_id]
/-- (Impl) Construct the lifted cocone in `Algebra T` which will be colimiting. -/
@[simps]
def liftedCocone : Cocone D where
  pt := coconePoint c t
  ι :=
    { app := fun j =>
        { f := c.ι.app j
          h := commuting _ _ _ }
      naturality := fun A B f => by
        ext1
        dsimp
        rw [comp_id]
        

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
c : Cocone (D ⋙ forget T)
t : IsColimit c
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
A B : J
f : A ⟶ B
⊢ (D.map f).f ≫ c.ι.app B = c.ι.app A

Next tactic:
apply c.w
/-- (Impl) Prove that the lifted cocone is colimiting. -/
@[simps]
def liftedCoconeIsColimit : IsColimit (liftedCocone c t) where
  desc s :=
    { f := t.desc ((forget T).mapCocone s)
      h :=
        (isColimitOfPreserves (T : C ⥤ C) t).hom_ext fun j => by
          

Proof state:
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
T : Monad C
J : Type u
inst✝² : Category.{v, u} J
D : J ⥤ Algebra T
c : Cocone (D ⋙ forget T)
t : IsColimit c
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
s : Cocone D
j : J
⊢ (T.mapCocone c).ι.app j ≫ T.map (IsColimit.desc t ((forget T).mapCocone s)) ≫ s.pt.a =
    (T.mapCocone c).ι.app j ≫ (liftedCocone c t).pt.a ≫ IsColimit.desc t ((forget T).mapCocone s)

Next tactic:
dsimp
/-- (Impl) Prove that the lifted cocone is colimiting. -/
@[simps]
def liftedCoconeIsColimit : IsColimit (liftedCocone c t) where
  desc s :=
    { f := t.desc ((forget T).mapCocone s)
      h :=
        (isColimitOfPreserves (T : C ⥤ C) t).hom_ext fun j => by
          dsimp
          

Proof state:
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
T : Monad C
J : Type u
inst✝² : Category.{v, u} J
D : J ⥤ Algebra T
c : Cocone (D ⋙ forget T)
t : IsColimit c
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
s : Cocone D
j : J
⊢ T.map (c.ι.app j) ≫ T.map (IsColimit.desc t ((forget T).mapCocone s)) ≫ s.pt.a =
    T.map (c.ι.app j) ≫ lambda c t ≫ IsColimit.desc t ((forget T).mapCocone s)

Next tactic:
rw [← Functor.map_comp_assoc, ← Category.assoc, t.fac, commuting, Category.assoc, t.fac]
/-- (Impl) Prove that the lifted cocone is colimiting. -/
@[simps]
def liftedCoconeIsColimit : IsColimit (liftedCocone c t) where
  desc s :=
    { f := t.desc ((forget T).mapCocone s)
      h :=
        (isColimitOfPreserves (T : C ⥤ C) t).hom_ext fun j => by
          dsimp
          rw [← Functor.map_comp_assoc, ← Category.assoc, t.fac, commuting, Category.assoc, t.fac]
          

Proof state:
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
T : Monad C
J : Type u
inst✝² : Category.{v, u} J
D : J ⥤ Algebra T
c : Cocone (D ⋙ forget T)
t : IsColimit c
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
s : Cocone D
j : J
⊢ T.map (((forget T).mapCocone s).ι.app j) ≫ s.pt.a = (D.obj j).a ≫ ((forget T).mapCocone s).ι.app j

Next tactic:
apply Algebra.Hom.h
/-- (Impl) Prove that the lifted cocone is colimiting. -/
@[simps]
def liftedCoconeIsColimit : IsColimit (liftedCocone c t) where
  desc s :=
    { f := t.desc ((forget T).mapCocone s)
      h :=
        (isColimitOfPreserves (T : C ⥤ C) t).hom_ext fun j => by
          dsimp
          rw [← Functor.map_comp_assoc, ← Category.assoc, t.fac, commuting, Category.assoc, t.fac]
          apply Algebra.Hom.h }
  uniq s m J := by
    

Proof state:
C : Type u₁
inst✝³ : Category.{v₁, u₁} C
T : Monad C
J✝ : Type u
inst✝² : Category.{v, u} J✝
D : J✝ ⥤ Algebra T
c : Cocone (D ⋙ forget T)
t : IsColimit c
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
s : Cocone D
m : (liftedCocone c t).pt ⟶ s.pt
J : ∀ (j : J✝), (liftedCocone c t).ι.app j ≫ m = s.ι.app j
⊢ m = (fun s => Algebra.Hom.mk (IsColimit.desc t ((forget T).mapCocone s))) s

Next tactic:
ext1
/-- (Impl) Prove that the lifted cocone is colimiting. -/
@[simps]
def liftedCoconeIsColimit : IsColimit (liftedCocone c t) where
  desc s :=
    { f := t.desc ((forget T).mapCocone s)
      h :=
        (isColimitOfPreserves (T : C ⥤ C) t).hom_ext fun j => by
          dsimp
          rw [← Functor.map_comp_assoc, ← Category.assoc, t.fac, commuting, Category.assoc, t.fac]
          apply Algebra.Hom.h }
  uniq s m J := by
    ext1
    

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
c : Cocone (D ⋙ forget T)
t : IsColimit c
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
s : Cocone D
m : (liftedCocone c t).pt ⟶ s.pt
J : ∀ (j : J✝), (liftedCocone c t).ι.app j ≫ m = s.ι.app j
⊢ m.f = ((fun s => Algebra.Hom.mk (IsColimit.desc t ((forget T).mapCocone s))) s).f

Next tactic:
apply t.hom_ext
/-- (Impl) Prove that the lifted cocone is colimiting. -/
@[simps]
def liftedCoconeIsColimit : IsColimit (liftedCocone c t) where
  desc s :=
    { f := t.desc ((forget T).mapCocone s)
      h :=
        (isColimitOfPreserves (T : C ⥤ C) t).hom_ext fun j => by
          dsimp
          rw [← Functor.map_comp_assoc, ← Category.assoc, t.fac, commuting, Category.assoc, t.fac]
          apply Algebra.Hom.h }
  uniq s m J := by
    ext1
    apply t.hom_ext
    

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
c : Cocone (D ⋙ forget T)
t : IsColimit c
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
s : Cocone D
m : (liftedCocone c t).pt ⟶ s.pt
J : ∀ (j : J✝), (liftedCocone c t).ι.app j ≫ m = s.ι.app j
⊢ ∀ (j : J✝), c.ι.app j ≫ m.f = c.ι.app j ≫ ((fun s => Algebra.Hom.mk (IsColimit.desc t ((forget T).mapCocone s))) s).f

Next tactic:
intro j
/-- (Impl) Prove that the lifted cocone is colimiting. -/
@[simps]
def liftedCoconeIsColimit : IsColimit (liftedCocone c t) where
  desc s :=
    { f := t.desc ((forget T).mapCocone s)
      h :=
        (isColimitOfPreserves (T : C ⥤ C) t).hom_ext fun j => by
          dsimp
          rw [← Functor.map_comp_assoc, ← Category.assoc, t.fac, commuting, Category.assoc, t.fac]
          apply Algebra.Hom.h }
  uniq s m J := by
    ext1
    apply t.hom_ext
    intro j
    

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
c : Cocone (D ⋙ forget T)
t : IsColimit c
inst✝¹ : PreservesColimit (D ⋙ forget T) T.toFunctor
inst✝ : PreservesColimit ((D ⋙ forget T) ⋙ T.toFunctor) T.toFunctor
s : Cocone D
m : (liftedCocone c t).pt ⟶ s.pt
J : ∀ (j : J✝), (liftedCocone c t).ι.app j ≫ m = s.ι.app j
j : J✝
⊢ c.ι.app j ≫ m.f = c.ι.app j ≫ ((fun s => Algebra.Hom.mk (IsColimit.desc t ((forget T).mapCocone s))) s).f

Next tactic:
simpa using congr_arg Algebra.Hom.f (J j)
/-- 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
                

Proof state:
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 ≫ (fun j => Algebra.Hom.mk (c.ι.app j)) B =
    (fun j => Algebra.Hom.mk (c.ι.app j)) A ≫ ((Functor.const J).obj (coconePoint c t)).map f

Next tactic:
ext1
/-- 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
                

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 ≫ (fun j => Algebra.Hom.mk (c.ι.app j)) B).f =
    ((fun j => Algebra.Hom.mk (c.ι.app j)) A ≫ ((Functor.const J).obj (coconePoint c t)).map f).f

Next tactic:
dsimp