l3lab/ntp-mathlib huggingface dataset:
/-- An auxiliary definition used to define `Lan` and `Lan.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [I : ∀ x, HasColimit (diagram ι F x)] (G : L ⥤ D) :
    (loc ι F ⟶ G) ≃ (F ⟶ ((whiskeringLeft _ _ _).obj ι).obj G)
    where
  toFun f :=
    { app := fun x => colimit.ι (diagram ι F (ι.obj x)) (CostructuredArrow.mk (𝟙 _)) ≫ f.app _
      naturality := by
        intro x y ff
        dsimp only [whiskeringLeft]
        simp only [Functor.comp_map, Category.assoc]
        rw [← f.naturality (ι.map ff), ← Category.assoc, ← Category.assoc]
        let fff : CostructuredArrow ι _ ⥤ _ := CostructuredArrow.map (ι.map ff)
        -- same issue :-(
        haveI : HasColimit (fff ⋙ diagram ι F (ι.obj y)) := I _
        erw [colimit.ι_pre (diagram ι F (ι.obj y)) fff (CostructuredArrow.mk (𝟙 _))]
        let xx : CostructuredArrow ι (ι.obj y) := CostructuredArrow.mk (ι.map ff)
        let yy : CostructuredArrow ι (ι.obj y) := CostructuredArrow.mk (𝟙 _)
        let fff : xx ⟶ yy :=
          CostructuredArrow.homMk ff
            (by
              simp only [CostructuredArrow.mk_hom_eq_self]
              erw [Category.comp_id])
        erw [colimit.w (diagram ι F (ι.obj y)) fff]
        congr
        simp }
  invFun f :=
    { app := fun x => colimit.desc (diagram ι F x) (cocone _ f)
      naturality := by
        intro x y ff
        apply colimit.hom_ext
        intros j
        haveI : HasColimit (CostructuredArrow.map ff ⋙ diagram ι F y) := I _
        erw [colimit.pre_desc, ← Category.assoc, colimit.ι_desc, colimit.ι_desc]
        simp }
  left_inv := by
    intros x
    dsimp
    ext k
    dsimp
    apply colimit.hom_ext
    intros j
    rw [colimit.ι_desc]
    dsimp only [cocone]
    rw [Category.assoc, ← x.naturality j.hom, ← Category.assoc]
    congr 1
    dsimp [loc]
    

Proof state:
case w.h.w.e_a
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
I : ∀ (x : L), HasColimit (diagram ι F x)
G : L ⥤ D
x : loc ι F ⟶ G
k : L
j : CostructuredArrow ι k
⊢ colimit.ι (diagram ι F (ι.obj j.left)) (CostructuredArrow.mk (𝟙 (ι.obj j.left))) ≫
      colimit.pre (diagram ι F k) (CostructuredArrow.map j.hom) =
    colimit.ι (diagram ι F k) j

Next tactic:
haveI : HasColimit (CostructuredArrow.map j.hom ⋙ diagram ι F k) := I _
/-- An auxiliary definition used to define `Lan` and `Lan.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [I : ∀ x, HasColimit (diagram ι F x)] (G : L ⥤ D) :
    (loc ι F ⟶ G) ≃ (F ⟶ ((whiskeringLeft _ _ _).obj ι).obj G)
    where
  toFun f :=
    { app := fun x => colimit.ι (diagram ι F (ι.obj x)) (CostructuredArrow.mk (𝟙 _)) ≫ f.app _
      naturality := by
        intro x y ff
        dsimp only [whiskeringLeft]
        simp only [Functor.comp_map, Category.assoc]
        rw [← f.naturality (ι.map ff), ← Category.assoc, ← Category.assoc]
        let fff : CostructuredArrow ι _ ⥤ _ := CostructuredArrow.map (ι.map ff)
        -- same issue :-(
        haveI : HasColimit (fff ⋙ diagram ι F (ι.obj y)) := I _
        erw [colimit.ι_pre (diagram ι F (ι.obj y)) fff (CostructuredArrow.mk (𝟙 _))]
        let xx : CostructuredArrow ι (ι.obj y) := CostructuredArrow.mk (ι.map ff)
        let yy : CostructuredArrow ι (ι.obj y) := CostructuredArrow.mk (𝟙 _)
        let fff : xx ⟶ yy :=
          CostructuredArrow.homMk ff
            (by
              simp only [CostructuredArrow.mk_hom_eq_self]
              erw [Category.comp_id])
        erw [colimit.w (diagram ι F (ι.obj y)) fff]
        congr
        simp }
  invFun f :=
    { app := fun x => colimit.desc (diagram ι F x) (cocone _ f)
      naturality := by
        intro x y ff
        apply colimit.hom_ext
        intros j
        haveI : HasColimit (CostructuredArrow.map ff ⋙ diagram ι F y) := I _
        erw [colimit.pre_desc, ← Category.assoc, colimit.ι_desc, colimit.ι_desc]
        simp }
  left_inv := by
    intros x
    dsimp
    ext k
    dsimp
    apply colimit.hom_ext
    intros j
    rw [colimit.ι_desc]
    dsimp only [cocone]
    rw [Category.assoc, ← x.naturality j.hom, ← Category.assoc]
    congr 1
    dsimp [loc]
    haveI : HasColimit (CostructuredArrow.map j.hom ⋙ diagram ι F k) := I _
    

Proof state:
case w.h.w.e_a
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
I : ∀ (x : L), HasColimit (diagram ι F x)
G : L ⥤ D
x : loc ι F ⟶ G
k : L
j : CostructuredArrow ι k
this : HasColimit (CostructuredArrow.map j.hom ⋙ diagram ι F k)
⊢ colimit.ι (diagram ι F (ι.obj j.left)) (CostructuredArrow.mk (𝟙 (ι.obj j.left))) ≫
      colimit.pre (diagram ι F k) (CostructuredArrow.map j.hom) =
    colimit.ι (diagram ι F k) j

Next tactic:
erw [colimit.ι_pre (diagram ι F k) (CostructuredArrow.map j.hom)]
/-- An auxiliary definition used to define `Lan` and `Lan.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [I : ∀ x, HasColimit (diagram ι F x)] (G : L ⥤ D) :
    (loc ι F ⟶ G) ≃ (F ⟶ ((whiskeringLeft _ _ _).obj ι).obj G)
    where
  toFun f :=
    { app := fun x => colimit.ι (diagram ι F (ι.obj x)) (CostructuredArrow.mk (𝟙 _)) ≫ f.app _
      naturality := by
        intro x y ff
        dsimp only [whiskeringLeft]
        simp only [Functor.comp_map, Category.assoc]
        rw [← f.naturality (ι.map ff), ← Category.assoc, ← Category.assoc]
        let fff : CostructuredArrow ι _ ⥤ _ := CostructuredArrow.map (ι.map ff)
        -- same issue :-(
        haveI : HasColimit (fff ⋙ diagram ι F (ι.obj y)) := I _
        erw [colimit.ι_pre (diagram ι F (ι.obj y)) fff (CostructuredArrow.mk (𝟙 _))]
        let xx : CostructuredArrow ι (ι.obj y) := CostructuredArrow.mk (ι.map ff)
        let yy : CostructuredArrow ι (ι.obj y) := CostructuredArrow.mk (𝟙 _)
        let fff : xx ⟶ yy :=
          CostructuredArrow.homMk ff
            (by
              simp only [CostructuredArrow.mk_hom_eq_self]
              erw [Category.comp_id])
        erw [colimit.w (diagram ι F (ι.obj y)) fff]
        congr
        simp }
  invFun f :=
    { app := fun x => colimit.desc (diagram ι F x) (cocone _ f)
      naturality := by
        intro x y ff
        apply colimit.hom_ext
        intros j
        haveI : HasColimit (CostructuredArrow.map ff ⋙ diagram ι F y) := I _
        erw [colimit.pre_desc, ← Category.assoc, colimit.ι_desc, colimit.ι_desc]
        simp }
  left_inv := by
    intros x
    dsimp
    ext k
    dsimp
    apply colimit.hom_ext
    intros j
    rw [colimit.ι_desc]
    dsimp only [cocone]
    rw [Category.assoc, ← x.naturality j.hom, ← Category.assoc]
    congr 1
    dsimp [loc]
    haveI : HasColimit (CostructuredArrow.map j.hom ⋙ diagram ι F k) := I _
    erw [colimit.ι_pre (diagram ι F k) (CostructuredArrow.map j.hom)]
    

Proof state:
case w.h.w.e_a
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
I : ∀ (x : L), HasColimit (diagram ι F x)
G : L ⥤ D
x : loc ι F ⟶ G
k : L
j : CostructuredArrow ι k
this : HasColimit (CostructuredArrow.map j.hom ⋙ diagram ι F k)
⊢ colimit.ι (diagram ι F k) ((CostructuredArrow.map j.hom).obj (CostructuredArrow.mk (𝟙 (ι.obj j.left)))) =
    colimit.ι (diagram ι F k) j

Next tactic:
congr
/-- An auxiliary definition used to define `Lan` and `Lan.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [I : ∀ x, HasColimit (diagram ι F x)] (G : L ⥤ D) :
    (loc ι F ⟶ G) ≃ (F ⟶ ((whiskeringLeft _ _ _).obj ι).obj G)
    where
  toFun f :=
    { app := fun x => colimit.ι (diagram ι F (ι.obj x)) (CostructuredArrow.mk (𝟙 _)) ≫ f.app _
      naturality := by
        intro x y ff
        dsimp only [whiskeringLeft]
        simp only [Functor.comp_map, Category.assoc]
        rw [← f.naturality (ι.map ff), ← Category.assoc, ← Category.assoc]
        let fff : CostructuredArrow ι _ ⥤ _ := CostructuredArrow.map (ι.map ff)
        -- same issue :-(
        haveI : HasColimit (fff ⋙ diagram ι F (ι.obj y)) := I _
        erw [colimit.ι_pre (diagram ι F (ι.obj y)) fff (CostructuredArrow.mk (𝟙 _))]
        let xx : CostructuredArrow ι (ι.obj y) := CostructuredArrow.mk (ι.map ff)
        let yy : CostructuredArrow ι (ι.obj y) := CostructuredArrow.mk (𝟙 _)
        let fff : xx ⟶ yy :=
          CostructuredArrow.homMk ff
            (by
              simp only [CostructuredArrow.mk_hom_eq_self]
              erw [Category.comp_id])
        erw [colimit.w (diagram ι F (ι.obj y)) fff]
        congr
        simp }
  invFun f :=
    { app := fun x => colimit.desc (diagram ι F x) (cocone _ f)
      naturality := by
        intro x y ff
        apply colimit.hom_ext
        intros j
        haveI : HasColimit (CostructuredArrow.map ff ⋙ diagram ι F y) := I _
        erw [colimit.pre_desc, ← Category.assoc, colimit.ι_desc, colimit.ι_desc]
        simp }
  left_inv := by
    intros x
    dsimp
    ext k
    dsimp
    apply colimit.hom_ext
    intros j
    rw [colimit.ι_desc]
    dsimp only [cocone]
    rw [Category.assoc, ← x.naturality j.hom, ← Category.assoc]
    congr 1
    dsimp [loc]
    haveI : HasColimit (CostructuredArrow.map j.hom ⋙ diagram ι F k) := I _
    erw [colimit.ι_pre (diagram ι F k) (CostructuredArrow.map j.hom)]
    congr
    

Proof state:
case w.h.w.e_a.h.e_7.h
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
I : ∀ (x : L), HasColimit (diagram ι F x)
G : L ⥤ D
x : loc ι F ⟶ G
k : L
j : CostructuredArrow ι k
this : HasColimit (CostructuredArrow.map j.hom ⋙ diagram ι F k)
⊢ (CostructuredArrow.map j.hom).obj (CostructuredArrow.mk (𝟙 (ι.obj j.left))) = j

Next tactic:
rcases j with ⟨_, ⟨⟩, _⟩
/-- An auxiliary definition used to define `Lan` and `Lan.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [I : ∀ x, HasColimit (diagram ι F x)] (G : L ⥤ D) :
    (loc ι F ⟶ G) ≃ (F ⟶ ((whiskeringLeft _ _ _).obj ι).obj G)
    where
  toFun f :=
    { app := fun x => colimit.ι (diagram ι F (ι.obj x)) (CostructuredArrow.mk (𝟙 _)) ≫ f.app _
      naturality := by
        intro x y ff
        dsimp only [whiskeringLeft]
        simp only [Functor.comp_map, Category.assoc]
        rw [← f.naturality (ι.map ff), ← Category.assoc, ← Category.assoc]
        let fff : CostructuredArrow ι _ ⥤ _ := CostructuredArrow.map (ι.map ff)
        -- same issue :-(
        haveI : HasColimit (fff ⋙ diagram ι F (ι.obj y)) := I _
        erw [colimit.ι_pre (diagram ι F (ι.obj y)) fff (CostructuredArrow.mk (𝟙 _))]
        let xx : CostructuredArrow ι (ι.obj y) := CostructuredArrow.mk (ι.map ff)
        let yy : CostructuredArrow ι (ι.obj y) := CostructuredArrow.mk (𝟙 _)
        let fff : xx ⟶ yy :=
          CostructuredArrow.homMk ff
            (by
              simp only [CostructuredArrow.mk_hom_eq_self]
              erw [Category.comp_id])
        erw [colimit.w (diagram ι F (ι.obj y)) fff]
        congr
        simp }
  invFun f :=
    { app := fun x => colimit.desc (diagram ι F x) (cocone _ f)
      naturality := by
        intro x y ff
        apply colimit.hom_ext
        intros j
        haveI : HasColimit (CostructuredArrow.map ff ⋙ diagram ι F y) := I _
        erw [colimit.pre_desc, ← Category.assoc, colimit.ι_desc, colimit.ι_desc]
        simp }
  left_inv := by
    intros x
    dsimp
    ext k
    dsimp
    apply colimit.hom_ext
    intros j
    rw [colimit.ι_desc]
    dsimp only [cocone]
    rw [Category.assoc, ← x.naturality j.hom, ← Category.assoc]
    congr 1
    dsimp [loc]
    haveI : HasColimit (CostructuredArrow.map j.hom ⋙ diagram ι F k) := I _
    erw [colimit.ι_pre (diagram ι F k) (CostructuredArrow.map j.hom)]
    congr
    rcases j with ⟨_, ⟨⟩, _⟩
    

Proof state:
case w.h.w.e_a.h.e_7.h.mk.mk
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
I : ∀ (x : L), HasColimit (diagram ι F x)
G : L ⥤ D
x : loc ι F ⟶ G
k : L
left✝ : S
as✝ : PUnit.{1}
hom✝ : ι.obj left✝ ⟶ (Functor.fromPUnit k).obj { as := as✝ }
this : HasColimit (CostructuredArrow.map { left := left✝, right := { as := as✝ }, hom := hom✝ }.hom ⋙ diagram ι F k)
⊢ (CostructuredArrow.map { left := left✝, right := { as := as✝ }, hom := hom✝ }.hom).obj
      (CostructuredArrow.mk (𝟙 (ι.obj { left := left✝, right := { as := as✝ }, hom := hom✝ }.left))) =
    { left := left✝, right := { as := as✝ }, hom := hom✝ }

Next tactic:
simp only [CostructuredArrow.map_mk, Category.id_comp]
/-- An auxiliary definition used to define `Lan` and `Lan.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [I : ∀ x, HasColimit (diagram ι F x)] (G : L ⥤ D) :
    (loc ι F ⟶ G) ≃ (F ⟶ ((whiskeringLeft _ _ _).obj ι).obj G)
    where
  toFun f :=
    { app := fun x => colimit.ι (diagram ι F (ι.obj x)) (CostructuredArrow.mk (𝟙 _)) ≫ f.app _
      naturality := by
        intro x y ff
        dsimp only [whiskeringLeft]
        simp only [Functor.comp_map, Category.assoc]
        rw [← f.naturality (ι.map ff), ← Category.assoc, ← Category.assoc]
        let fff : CostructuredArrow ι _ ⥤ _ := CostructuredArrow.map (ι.map ff)
        -- same issue :-(
        haveI : HasColimit (fff ⋙ diagram ι F (ι.obj y)) := I _
        erw [colimit.ι_pre (diagram ι F (ι.obj y)) fff (CostructuredArrow.mk (𝟙 _))]
        let xx : CostructuredArrow ι (ι.obj y) := CostructuredArrow.mk (ι.map ff)
        let yy : CostructuredArrow ι (ι.obj y) := CostructuredArrow.mk (𝟙 _)
        let fff : xx ⟶ yy :=
          CostructuredArrow.homMk ff
            (by
              simp only [CostructuredArrow.mk_hom_eq_self]
              erw [Category.comp_id])
        erw [colimit.w (diagram ι F (ι.obj y)) fff]
        congr
        simp }
  invFun f :=
    { app := fun x => colimit.desc (diagram ι F x) (cocone _ f)
      naturality := by
        intro x y ff
        apply colimit.hom_ext
        intros j
        haveI : HasColimit (CostructuredArrow.map ff ⋙ diagram ι F y) := I _
        erw [colimit.pre_desc, ← Category.assoc, colimit.ι_desc, colimit.ι_desc]
        simp }
  left_inv := by
    intros x
    dsimp
    ext k
    dsimp
    apply colimit.hom_ext
    intros j
    rw [colimit.ι_desc]
    dsimp only [cocone]
    rw [Category.assoc, ← x.naturality j.hom, ← Category.assoc]
    congr 1
    dsimp [loc]
    haveI : HasColimit (CostructuredArrow.map j.hom ⋙ diagram ι F k) := I _
    erw [colimit.ι_pre (diagram ι F k) (CostructuredArrow.map j.hom)]
    congr
    rcases j with ⟨_, ⟨⟩, _⟩
    simp only [CostructuredArrow.map_mk, Category.id_comp]
    

Proof state:
case w.h.w.e_a.h.e_7.h.mk.mk
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
I : ∀ (x : L), HasColimit (diagram ι F x)
G : L ⥤ D
x : loc ι F ⟶ G
k : L
left✝ : S
as✝ : PUnit.{1}
hom✝ : ι.obj left✝ ⟶ (Functor.fromPUnit k).obj { as := as✝ }
this : HasColimit (CostructuredArrow.map { left := left✝, right := { as := as✝ }, hom := hom✝ }.hom ⋙ diagram ι F k)
⊢ CostructuredArrow.mk hom✝ = { left := left✝, right := { as := as✝ }, hom := hom✝ }

Next tactic:
rfl
/-- An auxiliary definition used to define `Lan` and `Lan.adjunction`. -/
@[simps]
def equiv (F : S ⥤ D) [I : ∀ x, HasColimit (diagram ι F x)] (G : L ⥤ D) :
    (loc ι F ⟶ G) ≃ (F ⟶ ((whiskeringLeft _ _ _).obj ι).obj G)
    where
  toFun f :=
    { app := fun x => colimit.ι (diagram ι F (ι.obj x)) (CostructuredArrow.mk (𝟙 _)) ≫ f.app _
      naturality := by
        intro x y ff
        dsimp only [whiskeringLeft]
        simp only [Functor.comp_map, Category.assoc]
        rw [← f.naturality (ι.map ff), ← Category.assoc, ← Category.assoc]
        let fff : CostructuredArrow ι _ ⥤ _ := CostructuredArrow.map (ι.map ff)
        -- same issue :-(
        haveI : HasColimit (fff ⋙ diagram ι F (ι.obj y)) := I _
        erw [colimit.ι_pre (diagram ι F (ι.obj y)) fff (CostructuredArrow.mk (𝟙 _))]
        let xx : CostructuredArrow ι (ι.obj y) := CostructuredArrow.mk (ι.map ff)
        let yy : CostructuredArrow ι (ι.obj y) := CostructuredArrow.mk (𝟙 _)
        let fff : xx ⟶ yy :=
          CostructuredArrow.homMk ff
            (by
              simp only [CostructuredArrow.mk_hom_eq_self]
              erw [Category.comp_id])
        erw [colimit.w (diagram ι F (ι.obj y)) fff]
        congr
        simp }
  invFun f :=
    { app := fun x => colimit.desc (diagram ι F x) (cocone _ f)
      naturality := by
        intro x y ff
        apply colimit.hom_ext
        intros j
        haveI : HasColimit (CostructuredArrow.map ff ⋙ diagram ι F y) := I _
        erw [colimit.pre_desc, ← Category.assoc, colimit.ι_desc, colimit.ι_desc]
        simp }
  left_inv := by
    intros x
    dsimp
    ext k
    dsimp
    apply colimit.hom_ext
    intros j
    rw [colimit.ι_desc]
    dsimp only [cocone]
    rw [Category.assoc, ← x.naturality j.hom, ← Category.assoc]
    congr 1
    dsimp [loc]
    haveI : HasColimit (CostructuredArrow.map j.hom ⋙ diagram ι F k) := I _
    erw [colimit.ι_pre (diagram ι F k) (CostructuredArrow.map j.hom)]
    congr
    rcases j with ⟨_, ⟨⟩, _⟩
    simp only [CostructuredArrow.map_mk, Category.id_comp]
    rfl
  right_inv := by 

Proof state:
S : Type u₁
L : Type u₂
D : Type u₃
inst✝² : Category.{v₁, u₁} S
inst✝¹ : Category.{v₂, u₂} L
inst✝ : Category.{v₃, u₃} D
ι : S ⥤ L
F : S ⥤ D
I : ∀ (x : L), HasColimit (diagram ι F x)
G : L ⥤ D
⊢ Function.RightInverse (fun f => NatTrans.mk fun x => colimit.desc (diagram ι F x) (cocone x f)) fun f =>
    NatTrans.mk fun x => colimit.ι (diagram ι F (ι.obj x)) (CostructuredArrow.mk (𝟙 (ι.obj x))) ≫ f.app (ι.obj x)

Next tactic:
aesop_cat
/-- The left Kan extension of a functor. -/
@[simps!]
def lan [∀ X, HasColimitsOfShape (CostructuredArrow ι X) D] : (S ⥤ D) ⥤ L ⥤ D :=
  Adjunction.leftAdjointOfEquiv (fun F G => Lan.equiv ι F G) (by 

Proof state:
S : Type u₁
L : Type u₂
D : Type u₃
inst✝³ : Category.{v₁, u₁} S
inst✝² : Category.{v₂, u₂} L
inst✝¹ : Category.{v₃, u₃} D
ι : S ⥤ L
inst✝ : ∀ (X : L), HasColimitsOfShape (CostructuredArrow ι X) D
⊢ ∀ (X : S ⥤ D) (Y Y' : L ⥤ D) (g : Y ⟶ Y') (h : Lan.loc ι X ⟶ Y),
    ((fun F G => Lan.equiv ι F G) X Y') (h ≫ g) =
      ((fun F G => Lan.equiv ι F G) X Y) h ≫ ((whiskeringLeft S L D).obj ι).map g

Next tactic:
{
    intros X' X Y f g
    ext
    simp [Lan.equiv]
    -- This used to be the end of the proof before leanprover/lean4#2644
    erw [Equiv.coe_fn_mk, Equiv.coe_fn_mk]
    simp }
/-- The left Kan extension of a functor. -/
@[simps!]
def lan [∀ X, HasColimitsOfShape (CostructuredArrow ι X) D] : (S ⥤ D) ⥤ L ⥤ D :=
  Adjunction.leftAdjointOfEquiv (fun F G => Lan.equiv ι F G) (by {
    

Proof state:
S : Type u₁
L : Type u₂
D : Type u₃
inst✝³ : Category.{v₁, u₁} S
inst✝² : Category.{v₂, u₂} L
inst✝¹ : Category.{v₃, u₃} D
ι : S ⥤ L
inst✝ : ∀ (X : L), HasColimitsOfShape (CostructuredArrow ι X) D
⊢ ∀ (X : S ⥤ D) (Y Y' : L ⥤ D) (g : Y ⟶ Y') (h : Lan.loc ι X ⟶ Y),
    ((fun F G => Lan.equiv ι F G) X Y') (h ≫ g) =
      ((fun F G => Lan.equiv ι F G) X Y) h ≫ ((whiskeringLeft S L D).obj ι).map g

Next tactic:
intros X' X Y f g
/-- The left Kan extension of a functor. -/
@[simps!]
def lan [∀ X, HasColimitsOfShape (CostructuredArrow ι X) D] : (S ⥤ D) ⥤ L ⥤ D :=
  Adjunction.leftAdjointOfEquiv (fun F G => Lan.equiv ι F G) (by {
    intros X' X Y f g
    

Proof state:
S : Type u₁
L : Type u₂
D : Type u₃
inst✝³ : Category.{v₁, u₁} S
inst✝² : Category.{v₂, u₂} L
inst✝¹ : Category.{v₃, u₃} D
ι : S ⥤ L
inst✝ : ∀ (X : L), HasColimitsOfShape (CostructuredArrow ι X) D
X' : S ⥤ D
X Y : L ⥤ D
f : X ⟶ Y
g : Lan.loc ι X' ⟶ X
⊢ ((fun F G => Lan.equiv ι F G) X' Y) (g ≫ f) =
    ((fun F G => Lan.equiv ι F G) X' X) g ≫ ((whiskeringLeft S L D).obj ι).map f

Next tactic:
ext
/-- The left Kan extension of a functor. -/
@[simps!]
def lan [∀ X, HasColimitsOfShape (CostructuredArrow ι X) D] : (S ⥤ D) ⥤ L ⥤ D :=
  Adjunction.leftAdjointOfEquiv (fun F G => Lan.equiv ι F G) (by {
    intros X' X Y f g
    ext
    

Proof state:
case w.h
S : Type u₁
L : Type u₂
D : Type u₃
inst✝³ : Category.{v₁, u₁} S
inst✝² : Category.{v₂, u₂} L
inst✝¹ : Category.{v₃, u₃} D
ι : S ⥤ L
inst✝ : ∀ (X : L), HasColimitsOfShape (CostructuredArrow ι X) D
X' : S ⥤ D
X Y : L ⥤ D
f : X ⟶ Y
g : Lan.loc ι X' ⟶ X
x✝ : S
⊢ (((fun F G => Lan.equiv ι F G) X' Y) (g ≫ f)).app x✝ =
    (((fun F G => Lan.equiv ι F G) X' X) g ≫ ((whiskeringLeft S L D).obj ι).map f).app x✝

Next tactic:
simp [Lan.equiv]
/-- The left Kan extension of a functor. -/
@[simps!]
def lan [∀ X, HasColimitsOfShape (CostructuredArrow ι X) D] : (S ⥤ D) ⥤ L ⥤ D :=
  Adjunction.leftAdjointOfEquiv (fun F G => Lan.equiv ι F G) (by {
    intros X' X Y f g
    ext
    simp [Lan.equiv]
    -- This used to be the end of the proof before leanprover/lean4#2644
    erw [Equiv.coe_fn_mk, Equiv.coe_fn_mk]
    

Proof state:
case w.h
S : Type u₁
L : Type u₂
D : Type u₃
inst✝³ : Category.{v₁, u₁} S
inst✝² : Category.{v₂, u₂} L
inst✝¹ : Category.{v₃, u₃} D
ι : S ⥤ L
inst✝ : ∀ (X : L), HasColimitsOfShape (CostructuredArrow ι X) D
X' : S ⥤ D
X Y : L ⥤ D
f : X ⟶ Y
g : Lan.loc ι X' ⟶ X
x✝ : S
⊢ (NatTrans.mk fun x =>
          colimit.ι (Lan.diagram ι X' (ι.obj x)) (CostructuredArrow.mk (𝟙 (ι.obj x))) ≫ (g ≫ f).app (ι.obj x)).app
      x✝ =
    (NatTrans.mk fun x =>
            colimit.ι (Lan.diagram ι X' (ι.obj x)) (CostructuredArrow.mk (𝟙 (ι.obj x))) ≫ g.app (ι.obj x)).app
        x✝ ≫
      f.app (ι.obj x✝)

Next tactic:
simp
theorem coreflective [Full ι] [Faithful ι] [∀ X, HasColimitsOfShape (CostructuredArrow ι X) D] :
    IsIso (adjunction D ι).unit := by
  

Proof state:
S : Type u₁
L : Type u₂
D : Type u₃
inst✝⁵ : Category.{v₁, u₁} S
inst✝⁴ : Category.{v₂, u₂} L
inst✝³ : Category.{v₃, u₃} D
ι : S ⥤ L
inst✝² : Full ι
inst✝¹ : Faithful ι
inst✝ : ∀ (X : L), HasColimitsOfShape (CostructuredArrow ι X) D
⊢ IsIso (adjunction D ι).unit

Next tactic:
suffices ∀ (X : S ⥤ D), IsIso (NatTrans.app (adjunction D ι).unit X) by
    apply NatIso.isIso_of_isIso_app
theorem coreflective [Full ι] [Faithful ι] [∀ X, HasColimitsOfShape (CostructuredArrow ι X) D] :
    IsIso (adjunction D ι).unit := by
  suffices ∀ (X : S ⥤ D), IsIso (NatTrans.app (adjunction D ι).unit X) by
    

Proof state:
S : Type u₁
L : Type u₂
D : Type u₃
inst✝⁵ : Category.{v₁, u₁} S
inst✝⁴ : Category.{v₂, u₂} L
inst✝³ : Category.{v₃, u₃} D
ι : S ⥤ L
inst✝² : Full ι
inst✝¹ : Faithful ι
inst✝ : ∀ (X : L), HasColimitsOfShape (CostructuredArrow ι X) D
this : ∀ (X : S ⥤ D), IsIso ((adjunction D ι).unit.app X)
⊢ IsIso (adjunction D ι).unit

Next tactic:
apply NatIso.isIso_of_isIso_app
theorem coreflective [Full ι] [Faithful ι] [∀ X, HasColimitsOfShape (CostructuredArrow ι X) D] :
    IsIso (adjunction D ι).unit := by
  suffices ∀ (X : S ⥤ D), IsIso (NatTrans.app (adjunction D ι).unit X) by
    apply NatIso.isIso_of_isIso_app
  

Proof state:
S : Type u₁
L : Type u₂
D : Type u₃
inst✝⁵ : Category.{v₁, u₁} S
inst✝⁴ : Category.{v₂, u₂} L
inst✝³ : Category.{v₃, u₃} D
ι : S ⥤ L
inst✝² : Full ι
inst✝¹ : Faithful ι
inst✝ : ∀ (X : L), HasColimitsOfShape (CostructuredArrow ι X) D
⊢ ∀ (X : S ⥤ D), IsIso ((adjunction D ι).unit.app X)

Next tactic:
intro F
theorem coreflective [Full ι] [Faithful ι] [∀ X, HasColimitsOfShape (CostructuredArrow ι X) D] :
    IsIso (adjunction D ι).unit := by
  suffices ∀ (X : S ⥤ D), IsIso (NatTrans.app (adjunction D ι).unit X) by
    apply NatIso.isIso_of_isIso_app
  intro F
  

Proof state:
S : Type u₁
L : Type u₂
D : Type u₃
inst✝⁵ : Category.{v₁, u₁} S
inst✝⁴ : Category.{v₂, u₂} L
inst✝³ : Category.{v₃, u₃} D
ι : S ⥤ L
inst✝² : Full ι
inst✝¹ : Faithful ι
inst✝ : ∀ (X : L), HasColimitsOfShape (CostructuredArrow ι X) D
F : S ⥤ D
⊢ IsIso ((adjunction D ι).unit.app F)

Next tactic:
suffices ∀ (X : S), IsIso (NatTrans.app (NatTrans.app (adjunction D ι).unit F) X) by
    apply NatIso.isIso_of_isIso_app