l3lab/ntp-mathlib huggingface dataset:
instance : Category (Monad C) where
  id M := { toNatTrans := 𝟙 (M : C ⥤ C) }
  comp f g :=
    { toNatTrans :=
        { app := fun X => f.app X ≫ g.app X
          naturality := fun X Y h => by rw [assoc, f.1.naturality_assoc, g.1.naturality] } }
  -- `aesop_cat` can fill in these proofs, but is unfortunately slightly slow.
  id_comp _ := MonadHom.ext _ _ (by funext; simp only [NatTrans.id_app, id_comp])
  comp_id _ := MonadHom.ext _ _ (by funext; 

Proof state:
case h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G : Comonad C
X✝ Y✝ : Monad C
x✝¹ : X✝ ⟶ Y✝
x✝ : C
⊢ (x✝¹ ≫ 𝟙 Y✝).app x✝ = x✝¹.app x✝

Next tactic:
simp only [NatTrans.id_app, comp_id]
instance : Category (Monad C) where
  id M := { toNatTrans := 𝟙 (M : C ⥤ C) }
  comp f g :=
    { toNatTrans :=
        { app := fun X => f.app X ≫ g.app X
          naturality := fun X Y h => by rw [assoc, f.1.naturality_assoc, g.1.naturality] } }
  -- `aesop_cat` can fill in these proofs, but is unfortunately slightly slow.
  id_comp _ := MonadHom.ext _ _ (by funext; simp only [NatTrans.id_app, id_comp])
  comp_id _ := MonadHom.ext _ _ (by funext; simp only [NatTrans.id_app, comp_id])
  assoc _ _ _ := MonadHom.ext _ _ (by 

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G : Comonad C
W✝ X✝ Y✝ Z✝ : Monad C
x✝² : W✝ ⟶ X✝
x✝¹ : X✝ ⟶ Y✝
x✝ : Y✝ ⟶ Z✝
⊢ ((x✝² ≫ x✝¹) ≫ x✝).app = (x✝² ≫ x✝¹ ≫ x✝).app

Next tactic:
funext
instance : Category (Monad C) where
  id M := { toNatTrans := 𝟙 (M : C ⥤ C) }
  comp f g :=
    { toNatTrans :=
        { app := fun X => f.app X ≫ g.app X
          naturality := fun X Y h => by rw [assoc, f.1.naturality_assoc, g.1.naturality] } }
  -- `aesop_cat` can fill in these proofs, but is unfortunately slightly slow.
  id_comp _ := MonadHom.ext _ _ (by funext; simp only [NatTrans.id_app, id_comp])
  comp_id _ := MonadHom.ext _ _ (by funext; simp only [NatTrans.id_app, comp_id])
  assoc _ _ _ := MonadHom.ext _ _ (by funext; 

Proof state:
case h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G : Comonad C
W✝ X✝ Y✝ Z✝ : Monad C
x✝³ : W✝ ⟶ X✝
x✝² : X✝ ⟶ Y✝
x✝¹ : Y✝ ⟶ Z✝
x✝ : C
⊢ ((x✝³ ≫ x✝²) ≫ x✝¹).app x✝ = (x✝³ ≫ x✝² ≫ x✝¹).app x✝

Next tactic:
simp only [assoc]
instance : Category (Comonad C) where
  id M := { toNatTrans := 𝟙 (M : C ⥤ C) }
  comp f g :=
    { toNatTrans :=
        { app := fun X => f.app X ≫ g.app X
          naturality := fun X Y h => by 

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G X✝ Y✝ Z✝ : Comonad C
f : X✝ ⟶ Y✝
g : Y✝ ⟶ Z✝
X Y : C
h : X ⟶ Y
⊢ X✝.map h ≫ (fun X => f.app X ≫ g.app X) Y = (fun X => f.app X ≫ g.app X) X ≫ Z✝.map h

Next tactic:
rw [assoc, f.1.naturality_assoc, g.1.naturality]
instance : Category (Comonad C) where
  id M := { toNatTrans := 𝟙 (M : C ⥤ C) }
  comp f g :=
    { toNatTrans :=
        { app := fun X => f.app X ≫ g.app X
          naturality := fun X Y h => by rw [assoc, f.1.naturality_assoc, g.1.naturality] } }
  -- `aesop_cat` can fill in these proofs, but is unfortunately slightly slow.
  id_comp _ := ComonadHom.ext _ _ (by 

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G X✝ Y✝ : Comonad C
x✝ : X✝ ⟶ Y✝
⊢ (𝟙 X✝ ≫ x✝).app = x✝.app

Next tactic:
funext
instance : Category (Comonad C) where
  id M := { toNatTrans := 𝟙 (M : C ⥤ C) }
  comp f g :=
    { toNatTrans :=
        { app := fun X => f.app X ≫ g.app X
          naturality := fun X Y h => by rw [assoc, f.1.naturality_assoc, g.1.naturality] } }
  -- `aesop_cat` can fill in these proofs, but is unfortunately slightly slow.
  id_comp _ := ComonadHom.ext _ _ (by funext; 

Proof state:
case h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G X✝ Y✝ : Comonad C
x✝¹ : X✝ ⟶ Y✝
x✝ : C
⊢ (𝟙 X✝ ≫ x✝¹).app x✝ = x✝¹.app x✝

Next tactic:
simp only [NatTrans.id_app, id_comp]
instance : Category (Comonad C) where
  id M := { toNatTrans := 𝟙 (M : C ⥤ C) }
  comp f g :=
    { toNatTrans :=
        { app := fun X => f.app X ≫ g.app X
          naturality := fun X Y h => by rw [assoc, f.1.naturality_assoc, g.1.naturality] } }
  -- `aesop_cat` can fill in these proofs, but is unfortunately slightly slow.
  id_comp _ := ComonadHom.ext _ _ (by funext; simp only [NatTrans.id_app, id_comp])
  comp_id _ := ComonadHom.ext _ _ (by 

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G X✝ Y✝ : Comonad C
x✝ : X✝ ⟶ Y✝
⊢ (x✝ ≫ 𝟙 Y✝).app = x✝.app

Next tactic:
funext
instance : Category (Comonad C) where
  id M := { toNatTrans := 𝟙 (M : C ⥤ C) }
  comp f g :=
    { toNatTrans :=
        { app := fun X => f.app X ≫ g.app X
          naturality := fun X Y h => by rw [assoc, f.1.naturality_assoc, g.1.naturality] } }
  -- `aesop_cat` can fill in these proofs, but is unfortunately slightly slow.
  id_comp _ := ComonadHom.ext _ _ (by funext; simp only [NatTrans.id_app, id_comp])
  comp_id _ := ComonadHom.ext _ _ (by funext; 

Proof state:
case h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G X✝ Y✝ : Comonad C
x✝¹ : X✝ ⟶ Y✝
x✝ : C
⊢ (x✝¹ ≫ 𝟙 Y✝).app x✝ = x✝¹.app x✝

Next tactic:
simp only [NatTrans.id_app, comp_id]
instance : Category (Comonad C) where
  id M := { toNatTrans := 𝟙 (M : C ⥤ C) }
  comp f g :=
    { toNatTrans :=
        { app := fun X => f.app X ≫ g.app X
          naturality := fun X Y h => by rw [assoc, f.1.naturality_assoc, g.1.naturality] } }
  -- `aesop_cat` can fill in these proofs, but is unfortunately slightly slow.
  id_comp _ := ComonadHom.ext _ _ (by funext; simp only [NatTrans.id_app, id_comp])
  comp_id _ := ComonadHom.ext _ _ (by funext; simp only [NatTrans.id_app, comp_id])
  assoc _ _ _ := ComonadHom.ext _ _ (by 

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G W✝ X✝ Y✝ Z✝ : Comonad C
x✝² : W✝ ⟶ X✝
x✝¹ : X✝ ⟶ Y✝
x✝ : Y✝ ⟶ Z✝
⊢ ((x✝² ≫ x✝¹) ≫ x✝).app = (x✝² ≫ x✝¹ ≫ x✝).app

Next tactic:
funext
instance : Category (Comonad C) where
  id M := { toNatTrans := 𝟙 (M : C ⥤ C) }
  comp f g :=
    { toNatTrans :=
        { app := fun X => f.app X ≫ g.app X
          naturality := fun X Y h => by rw [assoc, f.1.naturality_assoc, g.1.naturality] } }
  -- `aesop_cat` can fill in these proofs, but is unfortunately slightly slow.
  id_comp _ := ComonadHom.ext _ _ (by funext; simp only [NatTrans.id_app, id_comp])
  comp_id _ := ComonadHom.ext _ _ (by funext; simp only [NatTrans.id_app, comp_id])
  assoc _ _ _ := ComonadHom.ext _ _ (by funext; 

Proof state:
case h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G W✝ X✝ Y✝ Z✝ : Comonad C
x✝³ : W✝ ⟶ X✝
x✝² : X✝ ⟶ Y✝
x✝¹ : Y✝ ⟶ Z✝
x✝ : C
⊢ ((x✝³ ≫ x✝²) ≫ x✝¹).app x✝ = (x✝³ ≫ x✝² ≫ x✝¹).app x✝

Next tactic:
simp only [assoc]
/-- Construct a monad isomorphism from a natural isomorphism of functors where the forward
direction is a monad morphism. -/
@[simps]
def MonadIso.mk {M N : Monad C} (f : (M : C ⥤ C) ≅ N)
    (f_η : ∀ (X : C), M.η.app X ≫ f.hom.app X = N.η.app X := by aesop_cat)
    (f_μ : ∀ (X : C), M.μ.app X ≫ f.hom.app X =
    (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ N.μ.app X := by aesop_cat) : M ≅ N where
  hom :=
    { toNatTrans := f.hom
      app_η := f_η
      app_μ := f_μ }
  inv :=
    { toNatTrans := f.inv
      app_η := fun X => by 

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G : Comonad C
M N : Monad C
f : M.toFunctor ≅ N.toFunctor
f_η : autoParam (∀ (X : C), (Monad.η M).app X ≫ f.hom.app X = (Monad.η N).app X) _auto✝
f_μ :
  autoParam
    (∀ (X : C), (Monad.μ M).app X ≫ f.hom.app X = (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ (Monad.μ N).app X)
    _auto✝
X : C
⊢ (Monad.η N).app X ≫ f.inv.app X = (Monad.η M).app X

Next tactic:
simp [← f_η]
/-- Construct a monad isomorphism from a natural isomorphism of functors where the forward
direction is a monad morphism. -/
@[simps]
def MonadIso.mk {M N : Monad C} (f : (M : C ⥤ C) ≅ N)
    (f_η : ∀ (X : C), M.η.app X ≫ f.hom.app X = N.η.app X := by aesop_cat)
    (f_μ : ∀ (X : C), M.μ.app X ≫ f.hom.app X =
    (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ N.μ.app X := by aesop_cat) : M ≅ N where
  hom :=
    { toNatTrans := f.hom
      app_η := f_η
      app_μ := f_μ }
  inv :=
    { toNatTrans := f.inv
      app_η := fun X => by simp [← f_η]
      app_μ := fun X => by
        

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G : Comonad C
M N : Monad C
f : M.toFunctor ≅ N.toFunctor
f_η : autoParam (∀ (X : C), (Monad.η M).app X ≫ f.hom.app X = (Monad.η N).app X) _auto✝
f_μ :
  autoParam
    (∀ (X : C), (Monad.μ M).app X ≫ f.hom.app X = (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ (Monad.μ N).app X)
    _auto✝
X : C
⊢ (Monad.μ N).app X ≫ f.inv.app X = (N.map (f.inv.app X) ≫ f.inv.app (M.obj X)) ≫ (Monad.μ M).app X

Next tactic:
rw [← NatIso.cancel_natIso_hom_right f]
/-- Construct a monad isomorphism from a natural isomorphism of functors where the forward
direction is a monad morphism. -/
@[simps]
def MonadIso.mk {M N : Monad C} (f : (M : C ⥤ C) ≅ N)
    (f_η : ∀ (X : C), M.η.app X ≫ f.hom.app X = N.η.app X := by aesop_cat)
    (f_μ : ∀ (X : C), M.μ.app X ≫ f.hom.app X =
    (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ N.μ.app X := by aesop_cat) : M ≅ N where
  hom :=
    { toNatTrans := f.hom
      app_η := f_η
      app_μ := f_μ }
  inv :=
    { toNatTrans := f.inv
      app_η := fun X => by simp [← f_η]
      app_μ := fun X => by
        rw [← NatIso.cancel_natIso_hom_right f]
        

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G : Comonad C
M N : Monad C
f : M.toFunctor ≅ N.toFunctor
f_η : autoParam (∀ (X : C), (Monad.η M).app X ≫ f.hom.app X = (Monad.η N).app X) _auto✝
f_μ :
  autoParam
    (∀ (X : C), (Monad.μ M).app X ≫ f.hom.app X = (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ (Monad.μ N).app X)
    _auto✝
X : C
⊢ ((Monad.μ N).app X ≫ f.inv.app X) ≫ f.hom.app X =
    ((N.map (f.inv.app X) ≫ f.inv.app (M.obj X)) ≫ (Monad.μ M).app X) ≫ f.hom.app X

Next tactic:
simp only [NatTrans.naturality, Iso.inv_hom_id_app, assoc, comp_id, f_μ,
          NatTrans.naturality_assoc, Iso.inv_hom_id_app_assoc, ← Functor.map_comp_assoc]
/-- Construct a monad isomorphism from a natural isomorphism of functors where the forward
direction is a monad morphism. -/
@[simps]
def MonadIso.mk {M N : Monad C} (f : (M : C ⥤ C) ≅ N)
    (f_η : ∀ (X : C), M.η.app X ≫ f.hom.app X = N.η.app X := by aesop_cat)
    (f_μ : ∀ (X : C), M.μ.app X ≫ f.hom.app X =
    (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ N.μ.app X := by aesop_cat) : M ≅ N where
  hom :=
    { toNatTrans := f.hom
      app_η := f_η
      app_μ := f_μ }
  inv :=
    { toNatTrans := f.inv
      app_η := fun X => by simp [← f_η]
      app_μ := fun X => by
        rw [← NatIso.cancel_natIso_hom_right f]
        simp only [NatTrans.naturality, Iso.inv_hom_id_app, assoc, comp_id, f_μ,
          NatTrans.naturality_assoc, Iso.inv_hom_id_app_assoc, ← Functor.map_comp_assoc]
        

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G : Comonad C
M N : Monad C
f : M.toFunctor ≅ N.toFunctor
f_η : autoParam (∀ (X : C), (Monad.η M).app X ≫ f.hom.app X = (Monad.η N).app X) _auto✝
f_μ :
  autoParam
    (∀ (X : C), (Monad.μ M).app X ≫ f.hom.app X = (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ (Monad.μ N).app X)
    _auto✝
X : C
⊢ (Monad.μ N).app X = N.map (𝟙 (N.obj X)) ≫ (Monad.μ N).app X

Next tactic:
simp
/-- Construct a comonad isomorphism from a natural isomorphism of functors where the forward
direction is a comonad morphism. -/
@[simps]
def ComonadIso.mk {M N : Comonad C} (f : (M : C ⥤ C) ≅ N)
    (f_ε : ∀ (X : C), f.hom.app X ≫ N.ε.app X = M.ε.app X := by aesop_cat)
    (f_δ : ∀ (X : C), f.hom.app X ≫ N.δ.app X =
    M.δ.app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X) := by aesop_cat) : M ≅ N where
  hom :=
    { toNatTrans := f.hom
      app_ε := f_ε
      app_δ := f_δ }
  inv :=
    { toNatTrans := f.inv
      app_ε := fun X => by 

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G M N : Comonad C
f : M.toFunctor ≅ N.toFunctor
f_ε : autoParam (∀ (X : C), f.hom.app X ≫ (Comonad.ε N).app X = (Comonad.ε M).app X) _auto✝
f_δ :
  autoParam
    (∀ (X : C), f.hom.app X ≫ (Comonad.δ N).app X = (Comonad.δ M).app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X))
    _auto✝
X : C
⊢ f.inv.app X ≫ (Comonad.ε M).app X = (Comonad.ε N).app X

Next tactic:
simp [← f_ε]
/-- Construct a comonad isomorphism from a natural isomorphism of functors where the forward
direction is a comonad morphism. -/
@[simps]
def ComonadIso.mk {M N : Comonad C} (f : (M : C ⥤ C) ≅ N)
    (f_ε : ∀ (X : C), f.hom.app X ≫ N.ε.app X = M.ε.app X := by aesop_cat)
    (f_δ : ∀ (X : C), f.hom.app X ≫ N.δ.app X =
    M.δ.app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X) := by aesop_cat) : M ≅ N where
  hom :=
    { toNatTrans := f.hom
      app_ε := f_ε
      app_δ := f_δ }
  inv :=
    { toNatTrans := f.inv
      app_ε := fun X => by simp [← f_ε]
      app_δ := fun X => by
        

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G M N : Comonad C
f : M.toFunctor ≅ N.toFunctor
f_ε : autoParam (∀ (X : C), f.hom.app X ≫ (Comonad.ε N).app X = (Comonad.ε M).app X) _auto✝
f_δ :
  autoParam
    (∀ (X : C), f.hom.app X ≫ (Comonad.δ N).app X = (Comonad.δ M).app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X))
    _auto✝
X : C
⊢ f.inv.app X ≫ (Comonad.δ M).app X = (Comonad.δ N).app X ≫ f.inv.app (N.obj X) ≫ M.map (f.inv.app X)

Next tactic:
rw [← NatIso.cancel_natIso_hom_left f]
/-- Construct a comonad isomorphism from a natural isomorphism of functors where the forward
direction is a comonad morphism. -/
@[simps]
def ComonadIso.mk {M N : Comonad C} (f : (M : C ⥤ C) ≅ N)
    (f_ε : ∀ (X : C), f.hom.app X ≫ N.ε.app X = M.ε.app X := by aesop_cat)
    (f_δ : ∀ (X : C), f.hom.app X ≫ N.δ.app X =
    M.δ.app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X) := by aesop_cat) : M ≅ N where
  hom :=
    { toNatTrans := f.hom
      app_ε := f_ε
      app_δ := f_δ }
  inv :=
    { toNatTrans := f.inv
      app_ε := fun X => by simp [← f_ε]
      app_δ := fun X => by
        rw [← NatIso.cancel_natIso_hom_left f]
        

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G M N : Comonad C
f : M.toFunctor ≅ N.toFunctor
f_ε : autoParam (∀ (X : C), f.hom.app X ≫ (Comonad.ε N).app X = (Comonad.ε M).app X) _auto✝
f_δ :
  autoParam
    (∀ (X : C), f.hom.app X ≫ (Comonad.δ N).app X = (Comonad.δ M).app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X))
    _auto✝
X : C
⊢ f.hom.app X ≫ f.inv.app X ≫ (Comonad.δ M).app X =
    f.hom.app X ≫ (Comonad.δ N).app X ≫ f.inv.app (N.obj X) ≫ M.map (f.inv.app X)

Next tactic:
simp only [reassoc_of% (f_δ X), Iso.hom_inv_id_app_assoc, NatTrans.naturality_assoc]
/-- Construct a comonad isomorphism from a natural isomorphism of functors where the forward
direction is a comonad morphism. -/
@[simps]
def ComonadIso.mk {M N : Comonad C} (f : (M : C ⥤ C) ≅ N)
    (f_ε : ∀ (X : C), f.hom.app X ≫ N.ε.app X = M.ε.app X := by aesop_cat)
    (f_δ : ∀ (X : C), f.hom.app X ≫ N.δ.app X =
    M.δ.app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X) := by aesop_cat) : M ≅ N where
  hom :=
    { toNatTrans := f.hom
      app_ε := f_ε
      app_δ := f_δ }
  inv :=
    { toNatTrans := f.inv
      app_ε := fun X => by simp [← f_ε]
      app_δ := fun X => by
        rw [← NatIso.cancel_natIso_hom_left f]
        simp only [reassoc_of% (f_δ X), Iso.hom_inv_id_app_assoc, NatTrans.naturality_assoc]
        

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G M N : Comonad C
f : M.toFunctor ≅ N.toFunctor
f_ε : autoParam (∀ (X : C), f.hom.app X ≫ (Comonad.ε N).app X = (Comonad.ε M).app X) _auto✝
f_δ :
  autoParam
    (∀ (X : C), f.hom.app X ≫ (Comonad.δ N).app X = (Comonad.δ M).app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X))
    _auto✝
X : C
⊢ (Comonad.δ M).app X = (Comonad.δ M).app X ≫ M.map (f.hom.app X) ≫ M.map (f.inv.app X)

Next tactic:
rw [← Functor.map_comp, Iso.hom_inv_id_app, Functor.map_id]
/-- Construct a comonad isomorphism from a natural isomorphism of functors where the forward
direction is a comonad morphism. -/
@[simps]
def ComonadIso.mk {M N : Comonad C} (f : (M : C ⥤ C) ≅ N)
    (f_ε : ∀ (X : C), f.hom.app X ≫ N.ε.app X = M.ε.app X := by aesop_cat)
    (f_δ : ∀ (X : C), f.hom.app X ≫ N.δ.app X =
    M.δ.app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X) := by aesop_cat) : M ≅ N where
  hom :=
    { toNatTrans := f.hom
      app_ε := f_ε
      app_δ := f_δ }
  inv :=
    { toNatTrans := f.inv
      app_ε := fun X => by simp [← f_ε]
      app_δ := fun X => by
        rw [← NatIso.cancel_natIso_hom_left f]
        simp only [reassoc_of% (f_δ X), Iso.hom_inv_id_app_assoc, NatTrans.naturality_assoc]
        rw [← Functor.map_comp, Iso.hom_inv_id_app, Functor.map_id]
        

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G M N : Comonad C
f : M.toFunctor ≅ N.toFunctor
f_ε : autoParam (∀ (X : C), f.hom.app X ≫ (Comonad.ε N).app X = (Comonad.ε M).app X) _auto✝
f_δ :
  autoParam
    (∀ (X : C), f.hom.app X ≫ (Comonad.δ N).app X = (Comonad.δ M).app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X))
    _auto✝
X : C
⊢ (Comonad.δ M).app X = (Comonad.δ M).app X ≫ 𝟙 (M.obj (M.obj X))

Next tactic:
apply (comp_id _).symm
theorem monadToFunctor_mapIso_monad_iso_mk {M N : Monad C} (f : (M : C ⥤ C) ≅ N) (f_η f_μ) :
    (monadToFunctor _).mapIso (MonadIso.mk f f_η f_μ) = f := by
  

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G : Comonad C
M N : Monad C
f : M.toFunctor ≅ N.toFunctor
f_η : ∀ (X : C), (Monad.η M).app X ≫ f.hom.app X = (Monad.η N).app X
f_μ : ∀ (X : C), (Monad.μ M).app X ≫ f.hom.app X = (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ (Monad.μ N).app X
⊢ (monadToFunctor C).mapIso (MonadIso.mk f) = f

Next tactic:
ext
theorem monadToFunctor_mapIso_monad_iso_mk {M N : Monad C} (f : (M : C ⥤ C) ≅ N) (f_η f_μ) :
    (monadToFunctor _).mapIso (MonadIso.mk f f_η f_μ) = f := by
  ext
  

Proof state:
case w.w.h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G : Comonad C
M N : Monad C
f : M.toFunctor ≅ N.toFunctor
f_η : ∀ (X : C), (Monad.η M).app X ≫ f.hom.app X = (Monad.η N).app X
f_μ : ∀ (X : C), (Monad.μ M).app X ≫ f.hom.app X = (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ (Monad.μ N).app X
x✝ : C
⊢ ((monadToFunctor C).mapIso (MonadIso.mk f)).hom.app x✝ = f.hom.app x✝

Next tactic:
rfl
theorem comonadToFunctor_mapIso_comonad_iso_mk {M N : Comonad C} (f : (M : C ⥤ C) ≅ N) (f_ε f_δ) :
    (comonadToFunctor _).mapIso (ComonadIso.mk f f_ε f_δ) = f := by
  

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G M N : Comonad C
f : M.toFunctor ≅ N.toFunctor
f_ε : ∀ (X : C), f.hom.app X ≫ (Comonad.ε N).app X = (Comonad.ε M).app X
f_δ : ∀ (X : C), f.hom.app X ≫ (Comonad.δ N).app X = (Comonad.δ M).app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X)
⊢ (comonadToFunctor C).mapIso (ComonadIso.mk f) = f

Next tactic:
ext
theorem comonadToFunctor_mapIso_comonad_iso_mk {M N : Comonad C} (f : (M : C ⥤ C) ≅ N) (f_ε f_δ) :
    (comonadToFunctor _).mapIso (ComonadIso.mk f f_ε f_δ) = f := by
  ext
  

Proof state:
case w.w.h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
T : Monad C
G M N : Comonad C
f : M.toFunctor ≅ N.toFunctor
f_ε : ∀ (X : C), f.hom.app X ≫ (Comonad.ε N).app X = (Comonad.ε M).app X
f_δ : ∀ (X : C), f.hom.app X ≫ (Comonad.δ N).app X = (Comonad.δ M).app X ≫ f.hom.app (M.obj X) ≫ N.map (f.hom.app X)
x✝ : C
⊢ ((comonadToFunctor C).mapIso (ComonadIso.mk f)).hom.app x✝ = f.hom.app x✝

Next tactic:
rfl
theorem neg_lt_of_tendsto_zero_of_pos {f : ℕ → ℝ} (hf : Tendsto f atTop (𝓝 0)) :
    ∀ {r : ℝ}, 0 < r → (-r : ℝ*) < ofSeq f := fun hr =>
  have hg := hf.neg
  neg_lt_of_neg_lt (by 

Proof state:
f : ℕ → ℝ
hf : Tendsto f atTop (𝓝 0)
r✝ : ℝ
hr : 0 < r✝
hg : Tendsto (fun x => -f x) atTop (𝓝 (-0))
⊢ -ofSeq f < ↑r✝

Next tactic:
rw [neg_zero] at hg
theorem neg_lt_of_tendsto_zero_of_pos {f : ℕ → ℝ} (hf : Tendsto f atTop (𝓝 0)) :
    ∀ {r : ℝ}, 0 < r → (-r : ℝ*) < ofSeq f := fun hr =>
  have hg := hf.neg
  neg_lt_of_neg_lt (by rw [neg_zero] at hg; 

Proof state:
f : ℕ → ℝ
hf : Tendsto f atTop (𝓝 0)
r✝ : ℝ
hr : 0 < r✝
hg : Tendsto (fun x => -f x) atTop (𝓝 0)
⊢ -ofSeq f < ↑r✝

Next tactic:
exact lt_of_tendsto_zero_of_pos hg hr
theorem gt_of_tendsto_zero_of_neg {f : ℕ → ℝ} (hf : Tendsto f atTop (𝓝 0)) :
    ∀ {r : ℝ}, r < 0 → (r : ℝ*) < ofSeq f := fun {r} hr => by
  

Proof state:
f : ℕ → ℝ
hf : Tendsto f atTop (𝓝 0)
r : ℝ
hr : r < 0
⊢ ↑r < ofSeq f

Next tactic:
rw [← neg_neg r, coe_neg]
theorem gt_of_tendsto_zero_of_neg {f : ℕ → ℝ} (hf : Tendsto f atTop (𝓝 0)) :
    ∀ {r : ℝ}, r < 0 → (r : ℝ*) < ofSeq f := fun {r} hr => by
  rw [← neg_neg r, coe_neg]; 

Proof state:
f : ℕ → ℝ
hf : Tendsto f atTop (𝓝 0)
r : ℝ
hr : r < 0
⊢ -↑(-r) < ofSeq f

Next tactic:
exact neg_lt_of_tendsto_zero_of_pos hf (neg_pos.mpr hr)
theorem isSt_iff_tendsto {x : ℝ*} {r : ℝ} : IsSt x r ↔ x.Tendsto (𝓝 r) := by
  

Proof state:
x : ℝ*
r : ℝ
⊢ IsSt x r ↔ Germ.Tendsto x (𝓝 r)

Next tactic:
rcases ofSeq_surjective x with ⟨f, rfl⟩
theorem isSt_iff_tendsto {x : ℝ*} {r : ℝ} : IsSt x r ↔ x.Tendsto (𝓝 r) := by
  rcases ofSeq_surjective x with ⟨f, rfl⟩
  

Proof state:
case intro
r : ℝ
f : ℕ → ℝ
⊢ IsSt (ofSeq f) r ↔ Germ.Tendsto (ofSeq f) (𝓝 r)

Next tactic:
exact isSt_ofSeq_iff_tendsto
protected theorem IsSt.lt {x y : ℝ*} {r s : ℝ} (hxr : IsSt x r) (hys : IsSt y s) (hrs : r < s) :
    x < y := by
  

Proof state:
x y : ℝ*
r s : ℝ
hxr : IsSt x r
hys : IsSt y s
hrs : r < s
⊢ x < y

Next tactic:
rcases ofSeq_surjective x with ⟨f, rfl⟩
protected theorem IsSt.lt {x y : ℝ*} {r s : ℝ} (hxr : IsSt x r) (hys : IsSt y s) (hrs : r < s) :
    x < y := by
  rcases ofSeq_surjective x with ⟨f, rfl⟩
  

Proof state:
case intro
y : ℝ*
r s : ℝ
hys : IsSt y s
hrs : r < s
f : ℕ → ℝ
hxr : IsSt (ofSeq f) r
⊢ ofSeq f < y

Next tactic:
rcases ofSeq_surjective y with ⟨g, rfl⟩
protected theorem IsSt.lt {x y : ℝ*} {r s : ℝ} (hxr : IsSt x r) (hys : IsSt y s) (hrs : r < s) :
    x < y := by
  rcases ofSeq_surjective x with ⟨f, rfl⟩
  rcases ofSeq_surjective y with ⟨g, rfl⟩
  

Proof state:
case intro.intro
r s : ℝ
hrs : r < s
f : ℕ → ℝ
hxr : IsSt (ofSeq f) r
g : ℕ → ℝ
hys : IsSt (ofSeq g) s
⊢ ofSeq f < ofSeq g

Next tactic:
rw [isSt_ofSeq_iff_tendsto] at hxr hys
protected theorem IsSt.lt {x y : ℝ*} {r s : ℝ} (hxr : IsSt x r) (hys : IsSt y s) (hrs : r < s) :
    x < y := by
  rcases ofSeq_surjective x with ⟨f, rfl⟩
  rcases ofSeq_surjective y with ⟨g, rfl⟩
  rw [isSt_ofSeq_iff_tendsto] at hxr hys
  

Proof state:
case intro.intro
r s : ℝ
hrs : r < s
f : ℕ → ℝ
hxr : Tendsto f (↑(hyperfilter ℕ)) (𝓝 r)
g : ℕ → ℝ
hys : Tendsto g (↑(hyperfilter ℕ)) (𝓝 s)
⊢ ofSeq f < ofSeq g

Next tactic:
exact ofSeq_lt_ofSeq.2 <| hxr.eventually_lt hys hrs
theorem IsSt.unique {x : ℝ*} {r s : ℝ} (hr : IsSt x r) (hs : IsSt x s) : r = s := by
  

Proof state:
x : ℝ*
r s : ℝ
hr : IsSt x r
hs : IsSt x s
⊢ r = s

Next tactic:
rcases ofSeq_surjective x with ⟨f, rfl⟩
theorem IsSt.unique {x : ℝ*} {r s : ℝ} (hr : IsSt x r) (hs : IsSt x s) : r = s := by
  rcases ofSeq_surjective x with ⟨f, rfl⟩
  

Proof state:
case intro
r s : ℝ
f : ℕ → ℝ
hr : IsSt (ofSeq f) r
hs : IsSt (ofSeq f) s
⊢ r = s

Next tactic:
rw [isSt_ofSeq_iff_tendsto] at hr hs
theorem IsSt.unique {x : ℝ*} {r s : ℝ} (hr : IsSt x r) (hs : IsSt x s) : r = s := by
  rcases ofSeq_surjective x with ⟨f, rfl⟩
  rw [isSt_ofSeq_iff_tendsto] at hr hs
  

Proof state:
case intro
r s : ℝ
f : ℕ → ℝ
hr : Tendsto f (↑(hyperfilter ℕ)) (𝓝 r)
hs : Tendsto f (↑(hyperfilter ℕ)) (𝓝 s)
⊢ r = s

Next tactic:
exact tendsto_nhds_unique hr hs
theorem IsSt.st_eq {x : ℝ*} {r : ℝ} (hxr : IsSt x r) : st x = r := by
  

Proof state:
x : ℝ*
r : ℝ
hxr : IsSt x r
⊢ st x = r

Next tactic:
have h : ∃ r, IsSt x r := ⟨r, hxr⟩
theorem IsSt.st_eq {x : ℝ*} {r : ℝ} (hxr : IsSt x r) : st x = r := by
  have h : ∃ r, IsSt x r := ⟨r, hxr⟩
  

Proof state:
x : ℝ*
r : ℝ
hxr : IsSt x r
h : ∃ r, IsSt x r
⊢ st x = r

Next tactic:
rw [st, dif_pos h]
theorem IsSt.st_eq {x : ℝ*} {r : ℝ} (hxr : IsSt x r) : st x = r := by
  have h : ∃ r, IsSt x r := ⟨r, hxr⟩
  rw [st, dif_pos h]
  

Proof state:
x : ℝ*
r : ℝ
hxr : IsSt x r
h : ∃ r, IsSt x r
⊢ choose h = r

Next tactic:
exact (Classical.choose_spec h).unique hxr
theorem st_eq_sSup {x : ℝ*} : st x = sSup { y : ℝ | (y : ℝ*) < x } := by
  

Proof state:
x : ℝ*
⊢ st x = sSup {y | ↑y < x}

Next tactic:
rcases _root_.em (Infinite x) with (hx|hx)
theorem st_eq_sSup {x : ℝ*} : st x = sSup { y : ℝ | (y : ℝ*) < x } := by
  rcases _root_.em (Infinite x) with (hx|hx)
  · 

Proof state:
case inl
x : ℝ*
hx : Infinite x
⊢ st x = sSup {y | ↑y < x}

Next tactic:
rw [hx.st_eq]