l3lab/ntp-mathlib huggingface dataset:
/-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C where
  hom :=
    { app := fun F x => ULift.up ((x.app F.1) (𝟙 (unop F.1)))
      naturality := by
        intro X Y f
        simp only [yonedaEvaluation]
        ext
        dsimp
        erw [Category.id_comp, ← FunctorToTypes.naturality]
        simp only [Category.comp_id, yoneda_obj_map] }
  inv :=
    { app := fun F x =>
        { app := fun X a => (F.2.map a.op) x.down
          naturality := by
            intro X Y f
            ext
            dsimp
            

Proof state:
case h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
F : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)
x : (yonedaEvaluation C).obj F
X Y : Cᵒᵖ
f : X ⟶ Y
a✝ : ((Functor.prod yoneda.op (𝟭 (Cᵒᵖ ⥤ Type v₁))).obj F).1.unop.obj X
⊢ F.2.map (a✝.op ≫ f) x.down = F.2.map f (F.2.map a✝.op x.down)

Next tactic:
rw [FunctorToTypes.map_comp_apply]
/-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C where
  hom :=
    { app := fun F x => ULift.up ((x.app F.1) (𝟙 (unop F.1)))
      naturality := by
        intro X Y f
        simp only [yonedaEvaluation]
        ext
        dsimp
        erw [Category.id_comp, ← FunctorToTypes.naturality]
        simp only [Category.comp_id, yoneda_obj_map] }
  inv :=
    { app := fun F x =>
        { app := fun X a => (F.2.map a.op) x.down
          naturality := by
            intro X Y f
            ext
            dsimp
            rw [FunctorToTypes.map_comp_apply] }
      naturality := by
        

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
⊢ ∀ ⦃X Y : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)⦄ (f : X ⟶ Y),
    (yonedaEvaluation C).map f ≫ (fun F x => NatTrans.mk fun X a => F.2.map a.op x.down) Y =
      (fun F x => NatTrans.mk fun X a => F.2.map a.op x.down) X ≫ (yonedaPairing C).map f

Next tactic:
intro X Y f
/-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C where
  hom :=
    { app := fun F x => ULift.up ((x.app F.1) (𝟙 (unop F.1)))
      naturality := by
        intro X Y f
        simp only [yonedaEvaluation]
        ext
        dsimp
        erw [Category.id_comp, ← FunctorToTypes.naturality]
        simp only [Category.comp_id, yoneda_obj_map] }
  inv :=
    { app := fun F x =>
        { app := fun X a => (F.2.map a.op) x.down
          naturality := by
            intro X Y f
            ext
            dsimp
            rw [FunctorToTypes.map_comp_apply] }
      naturality := by
        intro X Y f
        

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
X Y : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)
f : X ⟶ Y
⊢ (yonedaEvaluation C).map f ≫ (fun F x => NatTrans.mk fun X a => F.2.map a.op x.down) Y =
    (fun F x => NatTrans.mk fun X a => F.2.map a.op x.down) X ≫ (yonedaPairing C).map f

Next tactic:
simp only [yoneda]
/-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C where
  hom :=
    { app := fun F x => ULift.up ((x.app F.1) (𝟙 (unop F.1)))
      naturality := by
        intro X Y f
        simp only [yonedaEvaluation]
        ext
        dsimp
        erw [Category.id_comp, ← FunctorToTypes.naturality]
        simp only [Category.comp_id, yoneda_obj_map] }
  inv :=
    { app := fun F x =>
        { app := fun X a => (F.2.map a.op) x.down
          naturality := by
            intro X Y f
            ext
            dsimp
            rw [FunctorToTypes.map_comp_apply] }
      naturality := by
        intro X Y f
        simp only [yoneda]
        

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
X Y : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)
f : X ⟶ Y
⊢ ((yonedaEvaluation C).map f ≫ fun x => NatTrans.mk fun X a => Y.2.map a.op x.down) =
    (fun x => NatTrans.mk fun X_1 a => X.2.map a.op x.down) ≫ (yonedaPairing C).map f

Next tactic:
ext
/-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C where
  hom :=
    { app := fun F x => ULift.up ((x.app F.1) (𝟙 (unop F.1)))
      naturality := by
        intro X Y f
        simp only [yonedaEvaluation]
        ext
        dsimp
        erw [Category.id_comp, ← FunctorToTypes.naturality]
        simp only [Category.comp_id, yoneda_obj_map] }
  inv :=
    { app := fun F x =>
        { app := fun X a => (F.2.map a.op) x.down
          naturality := by
            intro X Y f
            ext
            dsimp
            rw [FunctorToTypes.map_comp_apply] }
      naturality := by
        intro X Y f
        simp only [yoneda]
        ext
        

Proof state:
case h.w.h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
X Y : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)
f : X ⟶ Y
a✝¹ : (yonedaEvaluation C).obj X
Y✝ : Cᵒᵖ
a✝ : ((Functor.prod yoneda.op (𝟭 (Cᵒᵖ ⥤ Type v₁))).obj Y).1.unop.obj Y✝
⊢ (((yonedaEvaluation C).map f ≫ fun x => NatTrans.mk fun X a => Y.2.map a.op x.down) a✝¹).app Y✝ a✝ =
    (((fun x => NatTrans.mk fun X_1 a => X.2.map a.op x.down) ≫ (yonedaPairing C).map f) a✝¹).app Y✝ a✝

Next tactic:
dsimp
/-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C where
  hom :=
    { app := fun F x => ULift.up ((x.app F.1) (𝟙 (unop F.1)))
      naturality := by
        intro X Y f
        simp only [yonedaEvaluation]
        ext
        dsimp
        erw [Category.id_comp, ← FunctorToTypes.naturality]
        simp only [Category.comp_id, yoneda_obj_map] }
  inv :=
    { app := fun F x =>
        { app := fun X a => (F.2.map a.op) x.down
          naturality := by
            intro X Y f
            ext
            dsimp
            rw [FunctorToTypes.map_comp_apply] }
      naturality := by
        intro X Y f
        simp only [yoneda]
        ext
        dsimp
        

Proof state:
case h.w.h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
X Y : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)
f : X ⟶ Y
a✝¹ : (yonedaEvaluation C).obj X
Y✝ : Cᵒᵖ
a✝ : ((Functor.prod yoneda.op (𝟭 (Cᵒᵖ ⥤ Type v₁))).obj Y).1.unop.obj Y✝
⊢ Y.2.map a✝.op (f.2.app Y.1 (X.2.map f.1 a✝¹.down)) = f.2.app Y✝ (X.2.map (f.1 ≫ a✝.op) a✝¹.down)

Next tactic:
rw [← FunctorToTypes.naturality X.snd Y.snd f.snd, FunctorToTypes.map_comp_apply]
/-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C where
  hom :=
    { app := fun F x => ULift.up ((x.app F.1) (𝟙 (unop F.1)))
      naturality := by
        intro X Y f
        simp only [yonedaEvaluation]
        ext
        dsimp
        erw [Category.id_comp, ← FunctorToTypes.naturality]
        simp only [Category.comp_id, yoneda_obj_map] }
  inv :=
    { app := fun F x =>
        { app := fun X a => (F.2.map a.op) x.down
          naturality := by
            intro X Y f
            ext
            dsimp
            rw [FunctorToTypes.map_comp_apply] }
      naturality := by
        intro X Y f
        simp only [yoneda]
        ext
        dsimp
        rw [← FunctorToTypes.naturality X.snd Y.snd f.snd, FunctorToTypes.map_comp_apply] }
  hom_inv_id := by
    

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
⊢ ((NatTrans.mk fun F x => { down := x.app F.1 (𝟙 F.1.unop) }) ≫
      NatTrans.mk fun F x => NatTrans.mk fun X a => F.2.map a.op x.down) =
    𝟙 (yonedaPairing C)

Next tactic:
ext
/-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C where
  hom :=
    { app := fun F x => ULift.up ((x.app F.1) (𝟙 (unop F.1)))
      naturality := by
        intro X Y f
        simp only [yonedaEvaluation]
        ext
        dsimp
        erw [Category.id_comp, ← FunctorToTypes.naturality]
        simp only [Category.comp_id, yoneda_obj_map] }
  inv :=
    { app := fun F x =>
        { app := fun X a => (F.2.map a.op) x.down
          naturality := by
            intro X Y f
            ext
            dsimp
            rw [FunctorToTypes.map_comp_apply] }
      naturality := by
        intro X Y f
        simp only [yoneda]
        ext
        dsimp
        rw [← FunctorToTypes.naturality X.snd Y.snd f.snd, FunctorToTypes.map_comp_apply] }
  hom_inv_id := by
    ext
    

Proof state:
case w.h.h.w.h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
x✝ : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)
a✝¹ : (yonedaPairing C).obj x✝
Y✝ : Cᵒᵖ
a✝ : ((Functor.prod yoneda.op (𝟭 (Cᵒᵖ ⥤ Type v₁))).obj x✝).1.unop.obj Y✝
⊢ (((NatTrans.mk fun F x => { down := x.app F.1 (𝟙 F.1.unop) }) ≫
              NatTrans.mk fun F x => NatTrans.mk fun X a => F.2.map a.op x.down).app
          x✝ a✝¹).app
      Y✝ a✝ =
    ((𝟙 (yonedaPairing C)).app x✝ a✝¹).app Y✝ a✝

Next tactic:
dsimp
/-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C where
  hom :=
    { app := fun F x => ULift.up ((x.app F.1) (𝟙 (unop F.1)))
      naturality := by
        intro X Y f
        simp only [yonedaEvaluation]
        ext
        dsimp
        erw [Category.id_comp, ← FunctorToTypes.naturality]
        simp only [Category.comp_id, yoneda_obj_map] }
  inv :=
    { app := fun F x =>
        { app := fun X a => (F.2.map a.op) x.down
          naturality := by
            intro X Y f
            ext
            dsimp
            rw [FunctorToTypes.map_comp_apply] }
      naturality := by
        intro X Y f
        simp only [yoneda]
        ext
        dsimp
        rw [← FunctorToTypes.naturality X.snd Y.snd f.snd, FunctorToTypes.map_comp_apply] }
  hom_inv_id := by
    ext
    dsimp
    

Proof state:
case w.h.h.w.h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
x✝ : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)
a✝¹ : (yonedaPairing C).obj x✝
Y✝ : Cᵒᵖ
a✝ : ((Functor.prod yoneda.op (𝟭 (Cᵒᵖ ⥤ Type v₁))).obj x✝).1.unop.obj Y✝
⊢ x✝.2.map a✝.op (a✝¹.app x✝.1 (𝟙 x✝.1.unop)) = a✝¹.app Y✝ a✝

Next tactic:
erw [← FunctorToTypes.naturality, obj_map_id]
/-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C where
  hom :=
    { app := fun F x => ULift.up ((x.app F.1) (𝟙 (unop F.1)))
      naturality := by
        intro X Y f
        simp only [yonedaEvaluation]
        ext
        dsimp
        erw [Category.id_comp, ← FunctorToTypes.naturality]
        simp only [Category.comp_id, yoneda_obj_map] }
  inv :=
    { app := fun F x =>
        { app := fun X a => (F.2.map a.op) x.down
          naturality := by
            intro X Y f
            ext
            dsimp
            rw [FunctorToTypes.map_comp_apply] }
      naturality := by
        intro X Y f
        simp only [yoneda]
        ext
        dsimp
        rw [← FunctorToTypes.naturality X.snd Y.snd f.snd, FunctorToTypes.map_comp_apply] }
  hom_inv_id := by
    ext
    dsimp
    erw [← FunctorToTypes.naturality, obj_map_id]
    

Proof state:
case w.h.h.w.h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
x✝ : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)
a✝¹ : (yonedaPairing C).obj x✝
Y✝ : Cᵒᵖ
a✝ : ((Functor.prod yoneda.op (𝟭 (Cᵒᵖ ⥤ Type v₁))).obj x✝).1.unop.obj Y✝
⊢ a✝¹.app Y✝ ((yoneda.map a✝.op.unop).app (op Y✝.unop) (𝟙 Y✝.unop)) = a✝¹.app Y✝ a✝

Next tactic:
simp only [yoneda_map_app, Quiver.Hom.unop_op]
/-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C where
  hom :=
    { app := fun F x => ULift.up ((x.app F.1) (𝟙 (unop F.1)))
      naturality := by
        intro X Y f
        simp only [yonedaEvaluation]
        ext
        dsimp
        erw [Category.id_comp, ← FunctorToTypes.naturality]
        simp only [Category.comp_id, yoneda_obj_map] }
  inv :=
    { app := fun F x =>
        { app := fun X a => (F.2.map a.op) x.down
          naturality := by
            intro X Y f
            ext
            dsimp
            rw [FunctorToTypes.map_comp_apply] }
      naturality := by
        intro X Y f
        simp only [yoneda]
        ext
        dsimp
        rw [← FunctorToTypes.naturality X.snd Y.snd f.snd, FunctorToTypes.map_comp_apply] }
  hom_inv_id := by
    ext
    dsimp
    erw [← FunctorToTypes.naturality, obj_map_id]
    simp only [yoneda_map_app, Quiver.Hom.unop_op]
    

Proof state:
case w.h.h.w.h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
x✝ : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)
a✝¹ : (yonedaPairing C).obj x✝
Y✝ : Cᵒᵖ
a✝ : ((Functor.prod yoneda.op (𝟭 (Cᵒᵖ ⥤ Type v₁))).obj x✝).1.unop.obj Y✝
⊢ a✝¹.app Y✝ (𝟙 Y✝.unop ≫ a✝) = a✝¹.app Y✝ a✝

Next tactic:
erw [Category.id_comp]
/-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C where
  hom :=
    { app := fun F x => ULift.up ((x.app F.1) (𝟙 (unop F.1)))
      naturality := by
        intro X Y f
        simp only [yonedaEvaluation]
        ext
        dsimp
        erw [Category.id_comp, ← FunctorToTypes.naturality]
        simp only [Category.comp_id, yoneda_obj_map] }
  inv :=
    { app := fun F x =>
        { app := fun X a => (F.2.map a.op) x.down
          naturality := by
            intro X Y f
            ext
            dsimp
            rw [FunctorToTypes.map_comp_apply] }
      naturality := by
        intro X Y f
        simp only [yoneda]
        ext
        dsimp
        rw [← FunctorToTypes.naturality X.snd Y.snd f.snd, FunctorToTypes.map_comp_apply] }
  hom_inv_id := by
    ext
    dsimp
    erw [← FunctorToTypes.naturality, obj_map_id]
    simp only [yoneda_map_app, Quiver.Hom.unop_op]
    erw [Category.id_comp]
  inv_hom_id := by
    

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
⊢ ((NatTrans.mk fun F x => NatTrans.mk fun X a => F.2.map a.op x.down) ≫
      NatTrans.mk fun F x => { down := x.app F.1 (𝟙 F.1.unop) }) =
    𝟙 (yonedaEvaluation C)

Next tactic:
ext
/-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C where
  hom :=
    { app := fun F x => ULift.up ((x.app F.1) (𝟙 (unop F.1)))
      naturality := by
        intro X Y f
        simp only [yonedaEvaluation]
        ext
        dsimp
        erw [Category.id_comp, ← FunctorToTypes.naturality]
        simp only [Category.comp_id, yoneda_obj_map] }
  inv :=
    { app := fun F x =>
        { app := fun X a => (F.2.map a.op) x.down
          naturality := by
            intro X Y f
            ext
            dsimp
            rw [FunctorToTypes.map_comp_apply] }
      naturality := by
        intro X Y f
        simp only [yoneda]
        ext
        dsimp
        rw [← FunctorToTypes.naturality X.snd Y.snd f.snd, FunctorToTypes.map_comp_apply] }
  hom_inv_id := by
    ext
    dsimp
    erw [← FunctorToTypes.naturality, obj_map_id]
    simp only [yoneda_map_app, Quiver.Hom.unop_op]
    erw [Category.id_comp]
  inv_hom_id := by
    ext
    

Proof state:
case w.h.h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
x✝ : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)
a✝ : (yonedaEvaluation C).obj x✝
⊢ ((NatTrans.mk fun F x => NatTrans.mk fun X a => F.2.map a.op x.down) ≫
          NatTrans.mk fun F x => { down := x.app F.1 (𝟙 F.1.unop) }).app
      x✝ a✝ =
    (𝟙 (yonedaEvaluation C)).app x✝ a✝

Next tactic:
dsimp
/-- The Yoneda lemma asserts that the Yoneda pairing
`(X : Cᵒᵖ, F : Cᵒᵖ ⥤ Type) ↦ (yoneda.obj (unop X) ⟶ F)`
is naturally isomorphic to the evaluation `(X, F) ↦ F.obj X`.

See <https://stacks.math.columbia.edu/tag/001P>.
-/
def yonedaLemma : yonedaPairing C ≅ yonedaEvaluation C where
  hom :=
    { app := fun F x => ULift.up ((x.app F.1) (𝟙 (unop F.1)))
      naturality := by
        intro X Y f
        simp only [yonedaEvaluation]
        ext
        dsimp
        erw [Category.id_comp, ← FunctorToTypes.naturality]
        simp only [Category.comp_id, yoneda_obj_map] }
  inv :=
    { app := fun F x =>
        { app := fun X a => (F.2.map a.op) x.down
          naturality := by
            intro X Y f
            ext
            dsimp
            rw [FunctorToTypes.map_comp_apply] }
      naturality := by
        intro X Y f
        simp only [yoneda]
        ext
        dsimp
        rw [← FunctorToTypes.naturality X.snd Y.snd f.snd, FunctorToTypes.map_comp_apply] }
  hom_inv_id := by
    ext
    dsimp
    erw [← FunctorToTypes.naturality, obj_map_id]
    simp only [yoneda_map_app, Quiver.Hom.unop_op]
    erw [Category.id_comp]
  inv_hom_id := by
    ext
    dsimp
    

Proof state:
case w.h.h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
x✝ : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)
a✝ : (yonedaEvaluation C).obj x✝
⊢ { down := x✝.2.map (𝟙 x✝.1) a✝.down } = a✝

Next tactic:
rw [FunctorToTypes.map_id_apply, ULift.up_down]
theorem yonedaEquiv_naturality {X Y : C} {F : Cᵒᵖ ⥤ Type v₁} (f : yoneda.obj X ⟶ F) (g : Y ⟶ X) :
    F.map g.op (yonedaEquiv f) = yonedaEquiv (yoneda.map g ≫ f) := by
  

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
X Y : C
F : Cᵒᵖ ⥤ Type v₁
f : yoneda.obj X ⟶ F
g : Y ⟶ X
⊢ F.map g.op (yonedaEquiv f) = yonedaEquiv (yoneda.map g ≫ f)

Next tactic:
change (f.app (op X) ≫ F.map g.op) (𝟙 X) = f.app (op Y) (𝟙 Y ≫ g)
theorem yonedaEquiv_naturality {X Y : C} {F : Cᵒᵖ ⥤ Type v₁} (f : yoneda.obj X ⟶ F) (g : Y ⟶ X) :
    F.map g.op (yonedaEquiv f) = yonedaEquiv (yoneda.map g ≫ f) := by
  change (f.app (op X) ≫ F.map g.op) (𝟙 X) = f.app (op Y) (𝟙 Y ≫ g)
  

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
X Y : C
F : Cᵒᵖ ⥤ Type v₁
f : yoneda.obj X ⟶ F
g : Y ⟶ X
⊢ (f.app (op X) ≫ F.map g.op) (𝟙 X) = f.app (op Y) (𝟙 Y ≫ g)

Next tactic:
rw [← f.naturality]
theorem yonedaEquiv_naturality {X Y : C} {F : Cᵒᵖ ⥤ Type v₁} (f : yoneda.obj X ⟶ F) (g : Y ⟶ X) :
    F.map g.op (yonedaEquiv f) = yonedaEquiv (yoneda.map g ≫ f) := by
  change (f.app (op X) ≫ F.map g.op) (𝟙 X) = f.app (op Y) (𝟙 Y ≫ g)
  rw [← f.naturality]
  

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
X Y : C
F : Cᵒᵖ ⥤ Type v₁
f : yoneda.obj X ⟶ F
g : Y ⟶ X
⊢ ((yoneda.obj X).map g.op ≫ f.app (op Y)) (𝟙 X) = f.app (op Y) (𝟙 Y ≫ g)

Next tactic:
dsimp
theorem yonedaEquiv_naturality {X Y : C} {F : Cᵒᵖ ⥤ Type v₁} (f : yoneda.obj X ⟶ F) (g : Y ⟶ X) :
    F.map g.op (yonedaEquiv f) = yonedaEquiv (yoneda.map g ≫ f) := by
  change (f.app (op X) ≫ F.map g.op) (𝟙 X) = f.app (op Y) (𝟙 Y ≫ g)
  rw [← f.naturality]
  dsimp
  

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
X Y : C
F : Cᵒᵖ ⥤ Type v₁
f : yoneda.obj X ⟶ F
g : Y ⟶ X
⊢ f.app (op Y) (g ≫ 𝟙 X) = f.app (op Y) (𝟙 Y ≫ g)

Next tactic:
simp
@[simp, nolint simpNF]
lemma yonedaEquiv_yoneda_map {X Y : C} (f : X ⟶ Y) : yonedaEquiv (yoneda.map f) = f := by
  

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
X Y : C
f : X ⟶ Y
⊢ yonedaEquiv (yoneda.map f) = f

Next tactic:
rw [yonedaEquiv_apply]
@[simp, nolint simpNF]
lemma yonedaEquiv_yoneda_map {X Y : C} (f : X ⟶ Y) : yonedaEquiv (yoneda.map f) = f := by
  rw [yonedaEquiv_apply]
  

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
X Y : C
f : X ⟶ Y
⊢ (yoneda.map f).app (op X) (𝟙 X) = f

Next tactic:
simp
lemma yonedaEquiv_symm_map {X Y : Cᵒᵖ} (f : X ⟶ Y) {F : Cᵒᵖ ⥤ Type v₁} (t : F.obj X) :
    yonedaEquiv.symm (F.map f t) = yoneda.map f.unop ≫ yonedaEquiv.symm t := by
  

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
X Y : Cᵒᵖ
f : X ⟶ Y
F : Cᵒᵖ ⥤ Type v₁
t : F.obj X
⊢ yonedaEquiv.symm (F.map f t) = yoneda.map f.unop ≫ yonedaEquiv.symm t

Next tactic:
obtain ⟨u, rfl⟩ := yonedaEquiv.surjective t
lemma yonedaEquiv_symm_map {X Y : Cᵒᵖ} (f : X ⟶ Y) {F : Cᵒᵖ ⥤ Type v₁} (t : F.obj X) :
    yonedaEquiv.symm (F.map f t) = yoneda.map f.unop ≫ yonedaEquiv.symm t := by
  obtain ⟨u, rfl⟩ := yonedaEquiv.surjective t
  

Proof state:
case intro
C : Type u₁
inst✝ : Category.{v₁, u₁} C
X Y : Cᵒᵖ
f : X ⟶ Y
F : Cᵒᵖ ⥤ Type v₁
u : yoneda.obj X.unop ⟶ F
⊢ yonedaEquiv.symm (F.map f (yonedaEquiv u)) = yoneda.map f.unop ≫ yonedaEquiv.symm (yonedaEquiv u)

Next tactic:
rw [yonedaEquiv_naturality', Equiv.symm_apply_apply, Equiv.symm_apply_apply]
/-- The curried version of yoneda lemma when `C` is small. -/
def curriedYonedaLemma {C : Type u₁} [SmallCategory C] :
    (yoneda.op ⋙ coyoneda : Cᵒᵖ ⥤ (Cᵒᵖ ⥤ Type u₁) ⥤ Type u₁) ≅ evaluation Cᵒᵖ (Type u₁) := by
  

Proof state:
C✝ : Type u₁
inst✝¹ : Category.{v₁, u₁} C✝
C : Type u₁
inst✝ : SmallCategory C
⊢ yoneda.op ⋙ coyoneda ≅ evaluation Cᵒᵖ (Type u₁)

Next tactic:
refine eqToIso ?_ ≪≫ curry.mapIso
    (yonedaLemma C ≪≫ isoWhiskerLeft (evaluationUncurried Cᵒᵖ (Type u₁)) uliftFunctorTrivial) ≪≫
    eqToIso ?_
/-- The curried version of yoneda lemma when `C` is small. -/
def curriedYonedaLemma {C : Type u₁} [SmallCategory C] :
    (yoneda.op ⋙ coyoneda : Cᵒᵖ ⥤ (Cᵒᵖ ⥤ Type u₁) ⥤ Type u₁) ≅ evaluation Cᵒᵖ (Type u₁) := by
  refine eqToIso ?_ ≪≫ curry.mapIso
    (yonedaLemma C ≪≫ isoWhiskerLeft (evaluationUncurried Cᵒᵖ (Type u₁)) uliftFunctorTrivial) ≪≫
    eqToIso ?_
  · 

Proof state:
case refine_1
C✝ : Type u₁
inst✝¹ : Category.{v₁, u₁} C✝
C : Type u₁
inst✝ : SmallCategory C
⊢ yoneda.op ⋙ coyoneda = curry.obj (yonedaPairing C)

Next tactic:
apply Functor.ext
/-- The curried version of yoneda lemma when `C` is small. -/
def curriedYonedaLemma {C : Type u₁} [SmallCategory C] :
    (yoneda.op ⋙ coyoneda : Cᵒᵖ ⥤ (Cᵒᵖ ⥤ Type u₁) ⥤ Type u₁) ≅ evaluation Cᵒᵖ (Type u₁) := by
  refine eqToIso ?_ ≪≫ curry.mapIso
    (yonedaLemma C ≪≫ isoWhiskerLeft (evaluationUncurried Cᵒᵖ (Type u₁)) uliftFunctorTrivial) ≪≫
    eqToIso ?_
  · apply Functor.ext
    · 

Proof state:
case refine_1.h_map
C✝ : Type u₁
inst✝¹ : Category.{v₁, u₁} C✝
C : Type u₁
inst✝ : SmallCategory C
⊢ autoParam
    (∀ (X Y : Cᵒᵖ) (f : X ⟶ Y),
      (yoneda.op ⋙ coyoneda).map f =
        eqToHom (_ : ?F.obj X = ?G.obj X) ≫
          (curry.obj (yonedaPairing C)).map f ≫
            eqToHom (_ : (curry.obj (yonedaPairing C)).obj Y = (yoneda.op ⋙ coyoneda).obj Y))
    _auto✝

Next tactic:
intro X Y f
/-- The curried version of yoneda lemma when `C` is small. -/
def curriedYonedaLemma {C : Type u₁} [SmallCategory C] :
    (yoneda.op ⋙ coyoneda : Cᵒᵖ ⥤ (Cᵒᵖ ⥤ Type u₁) ⥤ Type u₁) ≅ evaluation Cᵒᵖ (Type u₁) := by
  refine eqToIso ?_ ≪≫ curry.mapIso
    (yonedaLemma C ≪≫ isoWhiskerLeft (evaluationUncurried Cᵒᵖ (Type u₁)) uliftFunctorTrivial) ≪≫
    eqToIso ?_
  · apply Functor.ext
    · intro X Y f
      

Proof state:
case refine_1.h_map
C✝ : Type u₁
inst✝¹ : Category.{v₁, u₁} C✝
C : Type u₁
inst✝ : SmallCategory C
X Y : Cᵒᵖ
f : X ⟶ Y
⊢ (yoneda.op ⋙ coyoneda).map f =
    eqToHom (_ : ?F.obj X = ?G.obj X) ≫
      (curry.obj (yonedaPairing C)).map f ≫
        eqToHom (_ : (curry.obj (yonedaPairing C)).obj Y = (yoneda.op ⋙ coyoneda).obj Y)

Next tactic:
ext