l3lab/ntp-mathlib huggingface dataset:
/-- Given two functors L₁ and L₂ which preserve colimits, if they agree when restricted to the
representable presheaves then they agree everywhere.
-/
noncomputable def natIsoOfNatIsoOnRepresentables (L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ)
    [PreservesColimits L₁] [PreservesColimits L₂] (h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂) : L₁ ≅ L₂ := by
  apply NatIso.ofComponents _ _
  · intro P
    refine'
      (isColimitOfPreserves L₁ (colimitOfRepresentable P)).coconePointsIsoOfNatIso
        (isColimitOfPreserves L₂ (colimitOfRepresentable P)) _
    apply Functor.associator _ _ _ ≪≫ _
    exact isoWhiskerLeft (CategoryOfElements.π P).leftOp h
  · intro P₁ P₂ f
    apply (isColimitOfPreserves L₁ (colimitOfRepresentable P₁)).hom_ext
    intro j
    dsimp only [id.def, IsColimit.comp_coconePointsIsoOfNatIso_hom, isoWhiskerLeft_hom]
    

Proof state:
C : Type u₁
inst✝³ : SmallCategory C
ℰ : Type u₂
inst✝² : Category.{u₁, u₂} ℰ
A : C ⥤ ℰ
L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ
inst✝¹ : PreservesColimits L₁
inst✝ : PreservesColimits L₂
h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂
P₁ P₂ : Cᵒᵖ ⥤ Type u₁
f : P₁ ⟶ P₂
j : (Functor.Elements P₁)ᵒᵖ
⊢ (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫
      L₁.map f ≫
        (IsColimit.coconePointsIsoOfNatIso (isColimitOfPreserves L₁ (colimitOfRepresentable P₂))
            (isColimitOfPreserves L₂ (colimitOfRepresentable P₂))
            (Functor.associator (CategoryOfElements.π P₂).leftOp yoneda L₁ ≪≫
              isoWhiskerLeft (CategoryOfElements.π P₂).leftOp h)).hom =
    (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫
      (IsColimit.coconePointsIsoOfNatIso (isColimitOfPreserves L₁ (colimitOfRepresentable P₁))
            (isColimitOfPreserves L₂ (colimitOfRepresentable P₁))
            (Functor.associator (CategoryOfElements.π P₁).leftOp yoneda L₁ ≪≫
              isoWhiskerLeft (CategoryOfElements.π P₁).leftOp h)).hom ≫
        L₂.map f

Next tactic:
have :
      (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫ L₁.map f =
        (L₁.mapCocone (coconeOfRepresentable P₂)).ι.app
          ((CategoryOfElements.map f).op.obj j) := by
      dsimp
      rw [← L₁.map_comp, coconeOfRepresentable_naturality]
      rfl
/-- Given two functors L₁ and L₂ which preserve colimits, if they agree when restricted to the
representable presheaves then they agree everywhere.
-/
noncomputable def natIsoOfNatIsoOnRepresentables (L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ)
    [PreservesColimits L₁] [PreservesColimits L₂] (h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂) : L₁ ≅ L₂ := by
  apply NatIso.ofComponents _ _
  · intro P
    refine'
      (isColimitOfPreserves L₁ (colimitOfRepresentable P)).coconePointsIsoOfNatIso
        (isColimitOfPreserves L₂ (colimitOfRepresentable P)) _
    apply Functor.associator _ _ _ ≪≫ _
    exact isoWhiskerLeft (CategoryOfElements.π P).leftOp h
  · intro P₁ P₂ f
    apply (isColimitOfPreserves L₁ (colimitOfRepresentable P₁)).hom_ext
    intro j
    dsimp only [id.def, IsColimit.comp_coconePointsIsoOfNatIso_hom, isoWhiskerLeft_hom]
    have :
      (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫ L₁.map f =
        (L₁.mapCocone (coconeOfRepresentable P₂)).ι.app
          ((CategoryOfElements.map f).op.obj j) := by
      

Proof state:
C : Type u₁
inst✝³ : SmallCategory C
ℰ : Type u₂
inst✝² : Category.{u₁, u₂} ℰ
A : C ⥤ ℰ
L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ
inst✝¹ : PreservesColimits L₁
inst✝ : PreservesColimits L₂
h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂
P₁ P₂ : Cᵒᵖ ⥤ Type u₁
f : P₁ ⟶ P₂
j : (Functor.Elements P₁)ᵒᵖ
⊢ (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫ L₁.map f =
    (L₁.mapCocone (coconeOfRepresentable P₂)).ι.app ((CategoryOfElements.map f).op.obj j)

Next tactic:
dsimp
/-- Given two functors L₁ and L₂ which preserve colimits, if they agree when restricted to the
representable presheaves then they agree everywhere.
-/
noncomputable def natIsoOfNatIsoOnRepresentables (L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ)
    [PreservesColimits L₁] [PreservesColimits L₂] (h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂) : L₁ ≅ L₂ := by
  apply NatIso.ofComponents _ _
  · intro P
    refine'
      (isColimitOfPreserves L₁ (colimitOfRepresentable P)).coconePointsIsoOfNatIso
        (isColimitOfPreserves L₂ (colimitOfRepresentable P)) _
    apply Functor.associator _ _ _ ≪≫ _
    exact isoWhiskerLeft (CategoryOfElements.π P).leftOp h
  · intro P₁ P₂ f
    apply (isColimitOfPreserves L₁ (colimitOfRepresentable P₁)).hom_ext
    intro j
    dsimp only [id.def, IsColimit.comp_coconePointsIsoOfNatIso_hom, isoWhiskerLeft_hom]
    have :
      (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫ L₁.map f =
        (L₁.mapCocone (coconeOfRepresentable P₂)).ι.app
          ((CategoryOfElements.map f).op.obj j) := by
      dsimp
      

Proof state:
C : Type u₁
inst✝³ : SmallCategory C
ℰ : Type u₂
inst✝² : Category.{u₁, u₂} ℰ
A : C ⥤ ℰ
L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ
inst✝¹ : PreservesColimits L₁
inst✝ : PreservesColimits L₂
h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂
P₁ P₂ : Cᵒᵖ ⥤ Type u₁
f : P₁ ⟶ P₂
j : (Functor.Elements P₁)ᵒᵖ
⊢ L₁.map ((coconeOfRepresentable P₁).ι.app j) ≫ L₁.map f =
    L₁.map ((coconeOfRepresentable P₂).ι.app (Opposite.op ((CategoryOfElements.map f).obj j.unop)))

Next tactic:
rw [← L₁.map_comp, coconeOfRepresentable_naturality]
/-- Given two functors L₁ and L₂ which preserve colimits, if they agree when restricted to the
representable presheaves then they agree everywhere.
-/
noncomputable def natIsoOfNatIsoOnRepresentables (L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ)
    [PreservesColimits L₁] [PreservesColimits L₂] (h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂) : L₁ ≅ L₂ := by
  apply NatIso.ofComponents _ _
  · intro P
    refine'
      (isColimitOfPreserves L₁ (colimitOfRepresentable P)).coconePointsIsoOfNatIso
        (isColimitOfPreserves L₂ (colimitOfRepresentable P)) _
    apply Functor.associator _ _ _ ≪≫ _
    exact isoWhiskerLeft (CategoryOfElements.π P).leftOp h
  · intro P₁ P₂ f
    apply (isColimitOfPreserves L₁ (colimitOfRepresentable P₁)).hom_ext
    intro j
    dsimp only [id.def, IsColimit.comp_coconePointsIsoOfNatIso_hom, isoWhiskerLeft_hom]
    have :
      (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫ L₁.map f =
        (L₁.mapCocone (coconeOfRepresentable P₂)).ι.app
          ((CategoryOfElements.map f).op.obj j) := by
      dsimp
      rw [← L₁.map_comp, coconeOfRepresentable_naturality]
      

Proof state:
C : Type u₁
inst✝³ : SmallCategory C
ℰ : Type u₂
inst✝² : Category.{u₁, u₂} ℰ
A : C ⥤ ℰ
L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ
inst✝¹ : PreservesColimits L₁
inst✝ : PreservesColimits L₂
h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂
P₁ P₂ : Cᵒᵖ ⥤ Type u₁
f : P₁ ⟶ P₂
j : (Functor.Elements P₁)ᵒᵖ
⊢ L₁.map ((coconeOfRepresentable P₂).ι.app ((CategoryOfElements.map f).op.obj j)) =
    L₁.map ((coconeOfRepresentable P₂).ι.app (Opposite.op ((CategoryOfElements.map f).obj j.unop)))

Next tactic:
rfl
/-- Given two functors L₁ and L₂ which preserve colimits, if they agree when restricted to the
representable presheaves then they agree everywhere.
-/
noncomputable def natIsoOfNatIsoOnRepresentables (L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ)
    [PreservesColimits L₁] [PreservesColimits L₂] (h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂) : L₁ ≅ L₂ := by
  apply NatIso.ofComponents _ _
  · intro P
    refine'
      (isColimitOfPreserves L₁ (colimitOfRepresentable P)).coconePointsIsoOfNatIso
        (isColimitOfPreserves L₂ (colimitOfRepresentable P)) _
    apply Functor.associator _ _ _ ≪≫ _
    exact isoWhiskerLeft (CategoryOfElements.π P).leftOp h
  · intro P₁ P₂ f
    apply (isColimitOfPreserves L₁ (colimitOfRepresentable P₁)).hom_ext
    intro j
    dsimp only [id.def, IsColimit.comp_coconePointsIsoOfNatIso_hom, isoWhiskerLeft_hom]
    have :
      (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫ L₁.map f =
        (L₁.mapCocone (coconeOfRepresentable P₂)).ι.app
          ((CategoryOfElements.map f).op.obj j) := by
      dsimp
      rw [← L₁.map_comp, coconeOfRepresentable_naturality]
      rfl
    

Proof state:
C : Type u₁
inst✝³ : SmallCategory C
ℰ : Type u₂
inst✝² : Category.{u₁, u₂} ℰ
A : C ⥤ ℰ
L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ
inst✝¹ : PreservesColimits L₁
inst✝ : PreservesColimits L₂
h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂
P₁ P₂ : Cᵒᵖ ⥤ Type u₁
f : P₁ ⟶ P₂
j : (Functor.Elements P₁)ᵒᵖ
this :
  (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫ L₁.map f =
    (L₁.mapCocone (coconeOfRepresentable P₂)).ι.app ((CategoryOfElements.map f).op.obj j)
⊢ (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫
      L₁.map f ≫
        (IsColimit.coconePointsIsoOfNatIso (isColimitOfPreserves L₁ (colimitOfRepresentable P₂))
            (isColimitOfPreserves L₂ (colimitOfRepresentable P₂))
            (Functor.associator (CategoryOfElements.π P₂).leftOp yoneda L₁ ≪≫
              isoWhiskerLeft (CategoryOfElements.π P₂).leftOp h)).hom =
    (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫
      (IsColimit.coconePointsIsoOfNatIso (isColimitOfPreserves L₁ (colimitOfRepresentable P₁))
            (isColimitOfPreserves L₂ (colimitOfRepresentable P₁))
            (Functor.associator (CategoryOfElements.π P₁).leftOp yoneda L₁ ≪≫
              isoWhiskerLeft (CategoryOfElements.π P₁).leftOp h)).hom ≫
        L₂.map f

Next tactic:
erw [reassoc_of% this, IsColimit.ι_map_assoc, IsColimit.ι_map]
/-- Given two functors L₁ and L₂ which preserve colimits, if they agree when restricted to the
representable presheaves then they agree everywhere.
-/
noncomputable def natIsoOfNatIsoOnRepresentables (L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ)
    [PreservesColimits L₁] [PreservesColimits L₂] (h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂) : L₁ ≅ L₂ := by
  apply NatIso.ofComponents _ _
  · intro P
    refine'
      (isColimitOfPreserves L₁ (colimitOfRepresentable P)).coconePointsIsoOfNatIso
        (isColimitOfPreserves L₂ (colimitOfRepresentable P)) _
    apply Functor.associator _ _ _ ≪≫ _
    exact isoWhiskerLeft (CategoryOfElements.π P).leftOp h
  · intro P₁ P₂ f
    apply (isColimitOfPreserves L₁ (colimitOfRepresentable P₁)).hom_ext
    intro j
    dsimp only [id.def, IsColimit.comp_coconePointsIsoOfNatIso_hom, isoWhiskerLeft_hom]
    have :
      (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫ L₁.map f =
        (L₁.mapCocone (coconeOfRepresentable P₂)).ι.app
          ((CategoryOfElements.map f).op.obj j) := by
      dsimp
      rw [← L₁.map_comp, coconeOfRepresentable_naturality]
      rfl
    erw [reassoc_of% this, IsColimit.ι_map_assoc, IsColimit.ι_map]
    

Proof state:
C : Type u₁
inst✝³ : SmallCategory C
ℰ : Type u₂
inst✝² : Category.{u₁, u₂} ℰ
A : C ⥤ ℰ
L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ
inst✝¹ : PreservesColimits L₁
inst✝ : PreservesColimits L₂
h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂
P₁ P₂ : Cᵒᵖ ⥤ Type u₁
f : P₁ ⟶ P₂
j : (Functor.Elements P₁)ᵒᵖ
this :
  (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫ L₁.map f =
    (L₁.mapCocone (coconeOfRepresentable P₂)).ι.app ((CategoryOfElements.map f).op.obj j)
⊢ (Functor.associator (CategoryOfElements.π P₂).leftOp yoneda L₁ ≪≫
              isoWhiskerLeft (CategoryOfElements.π P₂).leftOp h).hom.app
        ((CategoryOfElements.map f).op.obj j) ≫
      (L₂.mapCocone (coconeOfRepresentable P₂)).ι.app ((CategoryOfElements.map f).op.obj j) =
    (Functor.associator (CategoryOfElements.π P₁).leftOp yoneda L₁ ≪≫
              isoWhiskerLeft (CategoryOfElements.π P₁).leftOp h).hom.app
        j ≫
      (L₂.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫ L₂.map f

Next tactic:
dsimp
/-- Given two functors L₁ and L₂ which preserve colimits, if they agree when restricted to the
representable presheaves then they agree everywhere.
-/
noncomputable def natIsoOfNatIsoOnRepresentables (L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ)
    [PreservesColimits L₁] [PreservesColimits L₂] (h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂) : L₁ ≅ L₂ := by
  apply NatIso.ofComponents _ _
  · intro P
    refine'
      (isColimitOfPreserves L₁ (colimitOfRepresentable P)).coconePointsIsoOfNatIso
        (isColimitOfPreserves L₂ (colimitOfRepresentable P)) _
    apply Functor.associator _ _ _ ≪≫ _
    exact isoWhiskerLeft (CategoryOfElements.π P).leftOp h
  · intro P₁ P₂ f
    apply (isColimitOfPreserves L₁ (colimitOfRepresentable P₁)).hom_ext
    intro j
    dsimp only [id.def, IsColimit.comp_coconePointsIsoOfNatIso_hom, isoWhiskerLeft_hom]
    have :
      (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫ L₁.map f =
        (L₁.mapCocone (coconeOfRepresentable P₂)).ι.app
          ((CategoryOfElements.map f).op.obj j) := by
      dsimp
      rw [← L₁.map_comp, coconeOfRepresentable_naturality]
      rfl
    erw [reassoc_of% this, IsColimit.ι_map_assoc, IsColimit.ι_map]
    dsimp
    

Proof state:
C : Type u₁
inst✝³ : SmallCategory C
ℰ : Type u₂
inst✝² : Category.{u₁, u₂} ℰ
A : C ⥤ ℰ
L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ
inst✝¹ : PreservesColimits L₁
inst✝ : PreservesColimits L₂
h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂
P₁ P₂ : Cᵒᵖ ⥤ Type u₁
f : P₁ ⟶ P₂
j : (Functor.Elements P₁)ᵒᵖ
this :
  (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫ L₁.map f =
    (L₁.mapCocone (coconeOfRepresentable P₂)).ι.app ((CategoryOfElements.map f).op.obj j)
⊢ (𝟙 (L₁.obj (yoneda.obj j.unop.fst.unop)) ≫ h.hom.app j.unop.fst.unop) ≫
      L₂.map ((coconeOfRepresentable P₂).ι.app (Opposite.op ((CategoryOfElements.map f).obj j.unop))) =
    (𝟙 (L₁.obj (yoneda.obj j.unop.fst.unop)) ≫ h.hom.app j.unop.fst.unop) ≫
      L₂.map ((coconeOfRepresentable P₁).ι.app j) ≫ L₂.map f

Next tactic:
rw [← L₂.map_comp, coconeOfRepresentable_naturality]
/-- Given two functors L₁ and L₂ which preserve colimits, if they agree when restricted to the
representable presheaves then they agree everywhere.
-/
noncomputable def natIsoOfNatIsoOnRepresentables (L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ)
    [PreservesColimits L₁] [PreservesColimits L₂] (h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂) : L₁ ≅ L₂ := by
  apply NatIso.ofComponents _ _
  · intro P
    refine'
      (isColimitOfPreserves L₁ (colimitOfRepresentable P)).coconePointsIsoOfNatIso
        (isColimitOfPreserves L₂ (colimitOfRepresentable P)) _
    apply Functor.associator _ _ _ ≪≫ _
    exact isoWhiskerLeft (CategoryOfElements.π P).leftOp h
  · intro P₁ P₂ f
    apply (isColimitOfPreserves L₁ (colimitOfRepresentable P₁)).hom_ext
    intro j
    dsimp only [id.def, IsColimit.comp_coconePointsIsoOfNatIso_hom, isoWhiskerLeft_hom]
    have :
      (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫ L₁.map f =
        (L₁.mapCocone (coconeOfRepresentable P₂)).ι.app
          ((CategoryOfElements.map f).op.obj j) := by
      dsimp
      rw [← L₁.map_comp, coconeOfRepresentable_naturality]
      rfl
    erw [reassoc_of% this, IsColimit.ι_map_assoc, IsColimit.ι_map]
    dsimp
    rw [← L₂.map_comp, coconeOfRepresentable_naturality]
    

Proof state:
C : Type u₁
inst✝³ : SmallCategory C
ℰ : Type u₂
inst✝² : Category.{u₁, u₂} ℰ
A : C ⥤ ℰ
L₁ L₂ : (Cᵒᵖ ⥤ Type u₁) ⥤ ℰ
inst✝¹ : PreservesColimits L₁
inst✝ : PreservesColimits L₂
h : yoneda ⋙ L₁ ≅ yoneda ⋙ L₂
P₁ P₂ : Cᵒᵖ ⥤ Type u₁
f : P₁ ⟶ P₂
j : (Functor.Elements P₁)ᵒᵖ
this :
  (L₁.mapCocone (coconeOfRepresentable P₁)).ι.app j ≫ L₁.map f =
    (L₁.mapCocone (coconeOfRepresentable P₂)).ι.app ((CategoryOfElements.map f).op.obj j)
⊢ (𝟙 (L₁.obj (yoneda.obj j.unop.fst.unop)) ≫ h.hom.app j.unop.fst.unop) ≫
      L₂.map ((coconeOfRepresentable P₂).ι.app (Opposite.op ((CategoryOfElements.map f).obj j.unop))) =
    (𝟙 (L₁.obj (yoneda.obj j.unop.fst.unop)) ≫ h.hom.app j.unop.fst.unop) ≫
      L₂.map ((coconeOfRepresentable P₂).ι.app ((CategoryOfElements.map f).op.obj j))

Next tactic:
rfl
/-- The tautological cocone with point `P` is a colimit cocone, exhibiting `P` as a colimit of
    representables. -/
def isColimitTautologicalCocone : IsColimit (tautologicalCocone P) where
  desc := fun s => by
    

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
P : Cᵒᵖ ⥤ Type v₁
s : Cocone (CostructuredArrow.proj yoneda P ⋙ yoneda)
⊢ (tautologicalCocone P).pt ⟶ s.pt

Next tactic:
refine' ⟨fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t))), _⟩
/-- The tautological cocone with point `P` is a colimit cocone, exhibiting `P` as a colimit of
    representables. -/
def isColimitTautologicalCocone : IsColimit (tautologicalCocone P) where
  desc := fun s => by
    refine' ⟨fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t))), _⟩
    

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
P : Cᵒᵖ ⥤ Type v₁
s : Cocone (CostructuredArrow.proj yoneda P ⋙ yoneda)
⊢ ∀ ⦃X Y : Cᵒᵖ⦄ (f : X ⟶ Y),
    (tautologicalCocone P).pt.map f ≫ (fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t)))) Y =
      (fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t)))) X ≫ s.pt.map f

Next tactic:
intros X Y f
/-- The tautological cocone with point `P` is a colimit cocone, exhibiting `P` as a colimit of
    representables. -/
def isColimitTautologicalCocone : IsColimit (tautologicalCocone P) where
  desc := fun s => by
    refine' ⟨fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t))), _⟩
    intros X Y f
    

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
P : Cᵒᵖ ⥤ Type v₁
s : Cocone (CostructuredArrow.proj yoneda P ⋙ yoneda)
X Y : Cᵒᵖ
f : X ⟶ Y
⊢ (tautologicalCocone P).pt.map f ≫ (fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t)))) Y =
    (fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t)))) X ≫ s.pt.map f

Next tactic:
ext t
/-- The tautological cocone with point `P` is a colimit cocone, exhibiting `P` as a colimit of
    representables. -/
def isColimitTautologicalCocone : IsColimit (tautologicalCocone P) where
  desc := fun s => by
    refine' ⟨fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t))), _⟩
    intros X Y f
    ext t
    

Proof state:
case h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
P : Cᵒᵖ ⥤ Type v₁
s : Cocone (CostructuredArrow.proj yoneda P ⋙ yoneda)
X Y : Cᵒᵖ
f : X ⟶ Y
t : (tautologicalCocone P).pt.obj X
⊢ ((tautologicalCocone P).pt.map f ≫ (fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t)))) Y)
      t =
    ((fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t)))) X ≫ s.pt.map f) t

Next tactic:
dsimp
/-- The tautological cocone with point `P` is a colimit cocone, exhibiting `P` as a colimit of
    representables. -/
def isColimitTautologicalCocone : IsColimit (tautologicalCocone P) where
  desc := fun s => by
    refine' ⟨fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t))), _⟩
    intros X Y f
    ext t
    dsimp
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    

Proof state:
case h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
P : Cᵒᵖ ⥤ Type v₁
s : Cocone (CostructuredArrow.proj yoneda P ⋙ yoneda)
X Y : Cᵒᵖ
f : X ⟶ Y
t : (tautologicalCocone P).pt.obj X
⊢ yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm (P.map f t)))) =
    s.pt.map f (yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t))))

Next tactic:
erw [yonedaEquiv_naturality', yonedaEquiv_symm_map]
/-- The tautological cocone with point `P` is a colimit cocone, exhibiting `P` as a colimit of
    representables. -/
def isColimitTautologicalCocone : IsColimit (tautologicalCocone P) where
  desc := fun s => by
    refine' ⟨fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t))), _⟩
    intros X Y f
    ext t
    dsimp
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [yonedaEquiv_naturality', yonedaEquiv_symm_map]
    

Proof state:
case h
C : Type u₁
inst✝ : Category.{v₁, u₁} C
P : Cᵒᵖ ⥤ Type v₁
s : Cocone (CostructuredArrow.proj yoneda P ⋙ yoneda)
X Y : Cᵒᵖ
f : X ⟶ Y
t : (tautologicalCocone P).pt.obj X
⊢ yonedaEquiv (s.ι.app (CostructuredArrow.mk (yoneda.map f.unop ≫ yonedaEquiv.symm t))) =
    yonedaEquiv (yoneda.map f.unop ≫ s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t)))

Next tactic:
simpa using (s.ι.naturality
      (CostructuredArrow.homMk' (CostructuredArrow.mk (yonedaEquiv.symm t)) f.unop)).symm
/-- The tautological cocone with point `P` is a colimit cocone, exhibiting `P` as a colimit of
    representables. -/
def isColimitTautologicalCocone : IsColimit (tautologicalCocone P) where
  desc := fun s => by
    refine' ⟨fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t))), _⟩
    intros X Y f
    ext t
    dsimp
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [yonedaEquiv_naturality', yonedaEquiv_symm_map]
    simpa using (s.ι.naturality
      (CostructuredArrow.homMk' (CostructuredArrow.mk (yonedaEquiv.symm t)) f.unop)).symm
  fac := by
    

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
P : Cᵒᵖ ⥤ Type v₁
⊢ ∀ (s : Cocone (CostructuredArrow.proj yoneda P ⋙ yoneda)) (j : CostructuredArrow yoneda P),
    (tautologicalCocone P).ι.app j ≫
        (fun s => NatTrans.mk fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t)))) s =
      s.ι.app j

Next tactic:
intro s t
/-- The tautological cocone with point `P` is a colimit cocone, exhibiting `P` as a colimit of
    representables. -/
def isColimitTautologicalCocone : IsColimit (tautologicalCocone P) where
  desc := fun s => by
    refine' ⟨fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t))), _⟩
    intros X Y f
    ext t
    dsimp
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [yonedaEquiv_naturality', yonedaEquiv_symm_map]
    simpa using (s.ι.naturality
      (CostructuredArrow.homMk' (CostructuredArrow.mk (yonedaEquiv.symm t)) f.unop)).symm
  fac := by
    intro s t
    

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
P : Cᵒᵖ ⥤ Type v₁
s : Cocone (CostructuredArrow.proj yoneda P ⋙ yoneda)
t : CostructuredArrow yoneda P
⊢ (tautologicalCocone P).ι.app t ≫
      (fun s => NatTrans.mk fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t)))) s =
    s.ι.app t

Next tactic:
dsimp
/-- The tautological cocone with point `P` is a colimit cocone, exhibiting `P` as a colimit of
    representables. -/
def isColimitTautologicalCocone : IsColimit (tautologicalCocone P) where
  desc := fun s => by
    refine' ⟨fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t))), _⟩
    intros X Y f
    ext t
    dsimp
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [yonedaEquiv_naturality', yonedaEquiv_symm_map]
    simpa using (s.ι.naturality
      (CostructuredArrow.homMk' (CostructuredArrow.mk (yonedaEquiv.symm t)) f.unop)).symm
  fac := by
    intro s t
    dsimp
    

Proof state:
C : Type u₁
inst✝ : Category.{v₁, u₁} C
P : Cᵒᵖ ⥤ Type v₁
s : Cocone (CostructuredArrow.proj yoneda P ⋙ yoneda)
t : CostructuredArrow yoneda P
⊢ (t.hom ≫ NatTrans.mk fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t)))) = s.ι.app t

Next tactic:
apply yonedaEquiv.injective
/-- The tautological cocone with point `P` is a colimit cocone, exhibiting `P` as a colimit of
    representables. -/
def isColimitTautologicalCocone : IsColimit (tautologicalCocone P) where
  desc := fun s => by
    refine' ⟨fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t))), _⟩
    intros X Y f
    ext t
    dsimp
    -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
    erw [yonedaEquiv_naturality', yonedaEquiv_symm_map]
    simpa using (s.ι.naturality
      (CostructuredArrow.homMk' (CostructuredArrow.mk (yonedaEquiv.symm t)) f.unop)).symm
  fac := by
    intro s t
    dsimp
    apply yonedaEquiv.injective
    

Proof state:
case a
C : Type u₁
inst✝ : Category.{v₁, u₁} C
P : Cᵒᵖ ⥤ Type v₁
s : Cocone (CostructuredArrow.proj yoneda P ⋙ yoneda)
t : CostructuredArrow yoneda P
⊢ yonedaEquiv (t.hom ≫ NatTrans.mk fun X t => yonedaEquiv (s.ι.app (CostructuredArrow.mk (yonedaEquiv.symm t)))) =
    yonedaEquiv (s.ι.app t)

Next tactic:
rw [yonedaEquiv_comp]