l3lab/ntp-mathlib huggingface dataset:
/-- The left adjoint of evaluation. -/
@[simps]
def evaluationLeftAdjoint (c : C) : D ⥤ C ⥤ D where
  obj d :=
    { obj := fun t => ∐ fun _ : c ⟶ t => d
      map := fun f => Sigma.desc fun g => (Sigma.ι fun _ => d) <| g ≫ f}
  map {_ d₂} f :=
    { app := fun e => Sigma.desc fun h => f ≫ Sigma.ι (fun _ => d₂) h
      naturality := by
        

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
x✝ d₂ : D
f : x✝ ⟶ d₂
⊢ ∀ ⦃X Y : C⦄ (f_1 : X ⟶ Y),
    ((fun d =>
                Functor.mk
                  { obj := fun t => ∐ fun x => d,
                    map := fun {X Y} f => Sigma.desc fun g => Sigma.ι (fun x => d) (g ≫ f) })
              x✝).map
          f_1 ≫
        (fun e => Sigma.desc fun h => f ≫ Sigma.ι (fun x => d₂) h) Y =
      (fun e => Sigma.desc fun h => f ≫ Sigma.ι (fun x => d₂) h) X ≫
        ((fun d =>
                Functor.mk
                  { obj := fun t => ∐ fun x => d,
                    map := fun {X Y} f => Sigma.desc fun g => Sigma.ι (fun x => d) (g ≫ f) })
              d₂).map
          f_1

Next tactic:
intros
/-- The left adjoint of evaluation. -/
@[simps]
def evaluationLeftAdjoint (c : C) : D ⥤ C ⥤ D where
  obj d :=
    { obj := fun t => ∐ fun _ : c ⟶ t => d
      map := fun f => Sigma.desc fun g => (Sigma.ι fun _ => d) <| g ≫ f}
  map {_ d₂} f :=
    { app := fun e => Sigma.desc fun h => f ≫ Sigma.ι (fun _ => d₂) h
      naturality := by
        intros
        

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
x✝ d₂ : D
f : x✝ ⟶ d₂
X✝ Y✝ : C
f✝ : X✝ ⟶ Y✝
⊢ ((fun d =>
              Functor.mk
                { obj := fun t => ∐ fun x => d,
                  map := fun {X Y} f => Sigma.desc fun g => Sigma.ι (fun x => d) (g ≫ f) })
            x✝).map
        f✝ ≫
      (fun e => Sigma.desc fun h => f ≫ Sigma.ι (fun x => d₂) h) Y✝ =
    (fun e => Sigma.desc fun h => f ≫ Sigma.ι (fun x => d₂) h) X✝ ≫
      ((fun d =>
              Functor.mk
                { obj := fun t => ∐ fun x => d,
                  map := fun {X Y} f => Sigma.desc fun g => Sigma.ι (fun x => d) (g ≫ f) })
            d₂).map
        f✝

Next tactic:
dsimp
/-- The left adjoint of evaluation. -/
@[simps]
def evaluationLeftAdjoint (c : C) : D ⥤ C ⥤ D where
  obj d :=
    { obj := fun t => ∐ fun _ : c ⟶ t => d
      map := fun f => Sigma.desc fun g => (Sigma.ι fun _ => d) <| g ≫ f}
  map {_ d₂} f :=
    { app := fun e => Sigma.desc fun h => f ≫ Sigma.ι (fun _ => d₂) h
      naturality := by
        intros
        dsimp
        

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
x✝ d₂ : D
f : x✝ ⟶ d₂
X✝ Y✝ : C
f✝ : X✝ ⟶ Y✝
⊢ ((Sigma.desc fun g => Sigma.ι (fun x => x✝) (g ≫ f✝)) ≫ Sigma.desc fun h => f ≫ Sigma.ι (fun x => d₂) h) =
    (Sigma.desc fun h => f ≫ Sigma.ι (fun x => d₂) h) ≫ Sigma.desc fun g => Sigma.ι (fun x => d₂) (g ≫ f✝)

Next tactic:
ext
/-- The left adjoint of evaluation. -/
@[simps]
def evaluationLeftAdjoint (c : C) : D ⥤ C ⥤ D where
  obj d :=
    { obj := fun t => ∐ fun _ : c ⟶ t => d
      map := fun f => Sigma.desc fun g => (Sigma.ι fun _ => d) <| g ≫ f}
  map {_ d₂} f :=
    { app := fun e => Sigma.desc fun h => f ≫ Sigma.ι (fun _ => d₂) h
      naturality := by
        intros
        dsimp
        ext
        

Proof state:
case h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
x✝ d₂ : D
f : x✝ ⟶ d₂
X✝ Y✝ : C
f✝ : X✝ ⟶ Y✝
b✝ : c ⟶ X✝
⊢ (Sigma.ι (fun x => x✝) b✝ ≫
      (Sigma.desc fun g => Sigma.ι (fun x => x✝) (g ≫ f✝)) ≫ Sigma.desc fun h => f ≫ Sigma.ι (fun x => d₂) h) =
    Sigma.ι (fun x => x✝) b✝ ≫
      (Sigma.desc fun h => f ≫ Sigma.ι (fun x => d₂) h) ≫ Sigma.desc fun g => Sigma.ι (fun x => d₂) (g ≫ f✝)

Next tactic:
simp
/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun d F =>
        { toFun := fun f => Sigma.ι (fun _ => d) (𝟙 _) ≫ f.app c
          invFun := fun f =>
            { app := fun e => Sigma.desc fun h => f ≫ F.map h
              naturality := by
                

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
d : D
F : C ⥤ D
f : d ⟶ ((evaluation C D).obj c).obj F
⊢ ∀ ⦃X Y : C⦄ (f_1 : X ⟶ Y),
    ((evaluationLeftAdjoint D c).obj d).map f_1 ≫ (fun e => Sigma.desc fun h => f ≫ F.map h) Y =
      (fun e => Sigma.desc fun h => f ≫ F.map h) X ≫ F.map f_1

Next tactic:
intros
/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun d F =>
        { toFun := fun f => Sigma.ι (fun _ => d) (𝟙 _) ≫ f.app c
          invFun := fun f =>
            { app := fun e => Sigma.desc fun h => f ≫ F.map h
              naturality := by
                intros
                

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
d : D
F : C ⥤ D
f : d ⟶ ((evaluation C D).obj c).obj F
X✝ Y✝ : C
f✝ : X✝ ⟶ Y✝
⊢ ((evaluationLeftAdjoint D c).obj d).map f✝ ≫ (fun e => Sigma.desc fun h => f ≫ F.map h) Y✝ =
    (fun e => Sigma.desc fun h => f ≫ F.map h) X✝ ≫ F.map f✝

Next tactic:
dsimp
/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun d F =>
        { toFun := fun f => Sigma.ι (fun _ => d) (𝟙 _) ≫ f.app c
          invFun := fun f =>
            { app := fun e => Sigma.desc fun h => f ≫ F.map h
              naturality := by
                intros
                dsimp
                

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
d : D
F : C ⥤ D
f : d ⟶ ((evaluation C D).obj c).obj F
X✝ Y✝ : C
f✝ : X✝ ⟶ Y✝
⊢ ((Sigma.desc fun g => Sigma.ι (fun x => d) (g ≫ f✝)) ≫ Sigma.desc fun h => f ≫ F.map h) =
    (Sigma.desc fun h => f ≫ F.map h) ≫ F.map f✝

Next tactic:
ext
/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun d F =>
        { toFun := fun f => Sigma.ι (fun _ => d) (𝟙 _) ≫ f.app c
          invFun := fun f =>
            { app := fun e => Sigma.desc fun h => f ≫ F.map h
              naturality := by
                intros
                dsimp
                ext
                

Proof state:
case h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
d : D
F : C ⥤ D
f : d ⟶ ((evaluation C D).obj c).obj F
X✝ Y✝ : C
f✝ : X✝ ⟶ Y✝
b✝ : c ⟶ X✝
⊢ (Sigma.ι (fun x => d) b✝ ≫ (Sigma.desc fun g => Sigma.ι (fun x => d) (g ≫ f✝)) ≫ Sigma.desc fun h => f ≫ F.map h) =
    Sigma.ι (fun x => d) b✝ ≫ (Sigma.desc fun h => f ≫ F.map h) ≫ F.map f✝

Next tactic:
simp
/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun d F =>
        { toFun := fun f => Sigma.ι (fun _ => d) (𝟙 _) ≫ f.app c
          invFun := fun f =>
            { app := fun e => Sigma.desc fun h => f ≫ F.map h
              naturality := by
                intros
                dsimp
                ext
                simp }
          left_inv := by
            

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
d : D
F : C ⥤ D
⊢ Function.LeftInverse (fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h) fun f =>
    Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c

Next tactic:
intro f
/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun d F =>
        { toFun := fun f => Sigma.ι (fun _ => d) (𝟙 _) ≫ f.app c
          invFun := fun f =>
            { app := fun e => Sigma.desc fun h => f ≫ F.map h
              naturality := by
                intros
                dsimp
                ext
                simp }
          left_inv := by
            intro f
            

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
d : D
F : C ⥤ D
f : (evaluationLeftAdjoint D c).obj d ⟶ F
⊢ (fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h) ((fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c) f) =
    f

Next tactic:
ext x
/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun d F =>
        { toFun := fun f => Sigma.ι (fun _ => d) (𝟙 _) ≫ f.app c
          invFun := fun f =>
            { app := fun e => Sigma.desc fun h => f ≫ F.map h
              naturality := by
                intros
                dsimp
                ext
                simp }
          left_inv := by
            intro f
            ext x
            

Proof state:
case w.h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
d : D
F : C ⥤ D
f : (evaluationLeftAdjoint D c).obj d ⟶ F
x : C
⊢ ((fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h)
          ((fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c) f)).app
      x =
    f.app x

Next tactic:
dsimp
/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun d F =>
        { toFun := fun f => Sigma.ι (fun _ => d) (𝟙 _) ≫ f.app c
          invFun := fun f =>
            { app := fun e => Sigma.desc fun h => f ≫ F.map h
              naturality := by
                intros
                dsimp
                ext
                simp }
          left_inv := by
            intro f
            ext x
            dsimp
            

Proof state:
case w.h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
d : D
F : C ⥤ D
f : (evaluationLeftAdjoint D c).obj d ⟶ F
x : C
⊢ (Sigma.desc fun h => (Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c) ≫ F.map h) = f.app x

Next tactic:
ext g
/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun d F =>
        { toFun := fun f => Sigma.ι (fun _ => d) (𝟙 _) ≫ f.app c
          invFun := fun f =>
            { app := fun e => Sigma.desc fun h => f ≫ F.map h
              naturality := by
                intros
                dsimp
                ext
                simp }
          left_inv := by
            intro f
            ext x
            dsimp
            ext g
            

Proof state:
case w.h.h
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
d : D
F : C ⥤ D
f : (evaluationLeftAdjoint D c).obj d ⟶ F
x : C
g : c ⟶ x
⊢ (Sigma.ι (fun x => d) g ≫ Sigma.desc fun h => (Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c) ≫ F.map h) =
    Sigma.ι (fun x => d) g ≫ f.app x

Next tactic:
simp only [colimit.ι_desc, Cofan.mk_ι_app, Category.assoc, ← f.naturality,
              evaluationLeftAdjoint_obj_map, colimit.ι_desc_assoc,
              Discrete.functor_obj, Cofan.mk_pt, Discrete.natTrans_app, Category.id_comp]
/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun d F =>
        { toFun := fun f => Sigma.ι (fun _ => d) (𝟙 _) ≫ f.app c
          invFun := fun f =>
            { app := fun e => Sigma.desc fun h => f ≫ F.map h
              naturality := by
                intros
                dsimp
                ext
                simp }
          left_inv := by
            intro f
            ext x
            dsimp
            ext g
            simp only [colimit.ι_desc, Cofan.mk_ι_app, Category.assoc, ← f.naturality,
              evaluationLeftAdjoint_obj_map, colimit.ι_desc_assoc,
              Discrete.functor_obj, Cofan.mk_pt, Discrete.natTrans_app, Category.id_comp]
          right_inv := fun f => by
            

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
d : D
F : C ⥤ D
f : d ⟶ ((evaluation C D).obj c).obj F
⊢ (fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c) ((fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h) f) =
    f

Next tactic:
dsimp
/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun d F =>
        { toFun := fun f => Sigma.ι (fun _ => d) (𝟙 _) ≫ f.app c
          invFun := fun f =>
            { app := fun e => Sigma.desc fun h => f ≫ F.map h
              naturality := by
                intros
                dsimp
                ext
                simp }
          left_inv := by
            intro f
            ext x
            dsimp
            ext g
            simp only [colimit.ι_desc, Cofan.mk_ι_app, Category.assoc, ← f.naturality,
              evaluationLeftAdjoint_obj_map, colimit.ι_desc_assoc,
              Discrete.functor_obj, Cofan.mk_pt, Discrete.natTrans_app, Category.id_comp]
          right_inv := fun f => by
            dsimp
            

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
d : D
F : C ⥤ D
f : d ⟶ ((evaluation C D).obj c).obj F
⊢ (Sigma.ι (fun x => d) (𝟙 c) ≫ Sigma.desc fun h => f ≫ F.map h) = f

Next tactic:
simp
/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun d F =>
        { toFun := fun f => Sigma.ι (fun _ => d) (𝟙 _) ≫ f.app c
          invFun := fun f =>
            { app := fun e => Sigma.desc fun h => f ≫ F.map h
              naturality := by
                intros
                dsimp
                ext
                simp }
          left_inv := by
            intro f
            ext x
            dsimp
            ext g
            simp only [colimit.ι_desc, Cofan.mk_ι_app, Category.assoc, ← f.naturality,
              evaluationLeftAdjoint_obj_map, colimit.ι_desc_assoc,
              Discrete.functor_obj, Cofan.mk_pt, Discrete.natTrans_app, Category.id_comp]
          right_inv := fun f => by
            dsimp
            simp }
      -- This used to be automatic before leanprover/lean4#2644
      homEquiv_naturality_right := by 

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
⊢ ∀ {X : D} {Y Y' : C ⥤ D} (f : (evaluationLeftAdjoint D c).obj X ⟶ Y) (g : Y ⟶ Y'),
    ((fun d F =>
            { toFun := fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c,
              invFun := fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h,
              left_inv :=
                (_ :
                  ∀ (f : (evaluationLeftAdjoint D c).obj d ⟶ F),
                    (fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h)
                        ((fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c) f) =
                      f),
              right_inv :=
                (_ :
                  ∀ (f : d ⟶ ((evaluation C D).obj c).obj F),
                    (fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c)
                        ((fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h) f) =
                      f) })
          X Y')
        (f ≫ g) =
      ((fun d F =>
              { toFun := fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c,
                invFun := fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h,
                left_inv :=
                  (_ :
                    ∀ (f : (evaluationLeftAdjoint D c).obj d ⟶ F),
                      (fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h)
                          ((fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c) f) =
                        f),
                right_inv :=
                  (_ :
                    ∀ (f : d ⟶ ((evaluation C D).obj c).obj F),
                      (fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c)
                          ((fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h) f) =
                        f) })
            X Y)
          f ≫
        ((evaluation C D).obj c).map g

Next tactic:
intros
/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun d F =>
        { toFun := fun f => Sigma.ι (fun _ => d) (𝟙 _) ≫ f.app c
          invFun := fun f =>
            { app := fun e => Sigma.desc fun h => f ≫ F.map h
              naturality := by
                intros
                dsimp
                ext
                simp }
          left_inv := by
            intro f
            ext x
            dsimp
            ext g
            simp only [colimit.ι_desc, Cofan.mk_ι_app, Category.assoc, ← f.naturality,
              evaluationLeftAdjoint_obj_map, colimit.ι_desc_assoc,
              Discrete.functor_obj, Cofan.mk_pt, Discrete.natTrans_app, Category.id_comp]
          right_inv := fun f => by
            dsimp
            simp }
      -- This used to be automatic before leanprover/lean4#2644
      homEquiv_naturality_right := by intros; 

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
X✝ : D
Y✝ Y'✝ : C ⥤ D
f✝ : (evaluationLeftAdjoint D c).obj X✝ ⟶ Y✝
g✝ : Y✝ ⟶ Y'✝
⊢ ((fun d F =>
          { toFun := fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c,
            invFun := fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h,
            left_inv :=
              (_ :
                ∀ (f : (evaluationLeftAdjoint D c).obj d ⟶ F),
                  (fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h)
                      ((fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c) f) =
                    f),
            right_inv :=
              (_ :
                ∀ (f : d ⟶ ((evaluation C D).obj c).obj F),
                  (fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c)
                      ((fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h) f) =
                    f) })
        X✝ Y'✝)
      (f✝ ≫ g✝) =
    ((fun d F =>
            { toFun := fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c,
              invFun := fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h,
              left_inv :=
                (_ :
                  ∀ (f : (evaluationLeftAdjoint D c).obj d ⟶ F),
                    (fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h)
                        ((fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c) f) =
                      f),
              right_inv :=
                (_ :
                  ∀ (f : d ⟶ ((evaluation C D).obj c).obj F),
                    (fun f => Sigma.ι (fun x => d) (𝟙 c) ≫ f.app c)
                        ((fun f => NatTrans.mk fun e => Sigma.desc fun h => f ≫ F.map h) f) =
                      f) })
          X✝ Y✝)
        f✝ ≫
      ((evaluation C D).obj c).map g✝

Next tactic:
dsimp
/-- The adjunction showing that evaluation is a right adjoint. -/
@[simps! unit_app counit_app_app]
def evaluationAdjunctionRight (c : C) : evaluationLeftAdjoint D c ⊣ (evaluation _ _).obj c :=
  Adjunction.mkOfHomEquiv
    { homEquiv := fun d F =>
        { toFun := fun f => Sigma.ι (fun _ => d) (𝟙 _) ≫ f.app c
          invFun := fun f =>
            { app := fun e => Sigma.desc fun h => f ≫ F.map h
              naturality := by
                intros
                dsimp
                ext
                simp }
          left_inv := by
            intro f
            ext x
            dsimp
            ext g
            simp only [colimit.ι_desc, Cofan.mk_ι_app, Category.assoc, ← f.naturality,
              evaluationLeftAdjoint_obj_map, colimit.ι_desc_assoc,
              Discrete.functor_obj, Cofan.mk_pt, Discrete.natTrans_app, Category.id_comp]
          right_inv := fun f => by
            dsimp
            simp }
      -- This used to be automatic before leanprover/lean4#2644
      homEquiv_naturality_right := by intros; dsimp; 

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
c : C
X✝ : D
Y✝ Y'✝ : C ⥤ D
f✝ : (evaluationLeftAdjoint D c).obj X✝ ⟶ Y✝
g✝ : Y✝ ⟶ Y'✝
⊢ Sigma.ι (fun x => X✝) (𝟙 c) ≫ f✝.app c ≫ g✝.app c = (Sigma.ι (fun x => X✝) (𝟙 c) ≫ f✝.app c) ≫ g✝.app c

Next tactic:
simp
theorem NatTrans.mono_iff_mono_app {F G : C ⥤ D} (η : F ⟶ G) : Mono η ↔ ∀ c, Mono (η.app c) := by
  

Proof state:
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
F G : C ⥤ D
η : F ⟶ G
⊢ Mono η ↔ ∀ (c : C), Mono (η.app c)

Next tactic:
constructor
theorem NatTrans.mono_iff_mono_app {F G : C ⥤ D} (η : F ⟶ G) : Mono η ↔ ∀ c, Mono (η.app c) := by
  constructor
  · 

Proof state:
case mp
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
F G : C ⥤ D
η : F ⟶ G
⊢ Mono η → ∀ (c : C), Mono (η.app c)

Next tactic:
intro h c
theorem NatTrans.mono_iff_mono_app {F G : C ⥤ D} (η : F ⟶ G) : Mono η ↔ ∀ c, Mono (η.app c) := by
  constructor
  · intro h c
    

Proof state:
case mp
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
F G : C ⥤ D
η : F ⟶ G
h : Mono η
c : C
⊢ Mono (η.app c)

Next tactic:
exact (inferInstance : Mono (((evaluation _ _).obj c).map η))
theorem NatTrans.mono_iff_mono_app {F G : C ⥤ D} (η : F ⟶ G) : Mono η ↔ ∀ c, Mono (η.app c) := by
  constructor
  · intro h c
    exact (inferInstance : Mono (((evaluation _ _).obj c).map η))
  · 

Proof state:
case mpr
C : Type u₁
inst✝² : Category.{v₁, u₁} C
D : Type u₂
inst✝¹ : Category.{v₂, u₂} D
inst✝ : ∀ (a b : C), HasCoproductsOfShape (a ⟶ b) D
F G : C ⥤ D
η : F ⟶ G
⊢ (∀ (c : C), Mono (η.app c)) → Mono η

Next tactic:
intro _