/-- 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
    

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
⊢ ({
            toFun := fun f =>
              NatTrans.mk fun x =>
                colimit.ι (Lan.diagram ι X' (ι.obj x)) (CostructuredArrow.mk (𝟙 (ι.obj x))) ≫ f.app (ι.obj x),
            invFun := fun f =>
              NatTrans.mk fun x =>
                colimit.desc (Lan.diagram ι X' x)
                  { pt := Y.obj x, ι := NatTrans.mk fun i => f.app i.left ≫ Y.map i.hom },
            left_inv :=
              (_ :
                Function.LeftInverse
                  (fun f =>
                    NatTrans.mk fun x =>
                      colimit.desc (Lan.diagram ι X' x)
                        { pt := Y.obj x, ι := NatTrans.mk fun i => f.app i.left ≫ Y.map i.hom })
                  fun f =>
                  NatTrans.mk fun x =>
                    colimit.ι (Lan.diagram ι X' (ι.obj x)) (CostructuredArrow.mk (𝟙 (ι.obj x))) ≫ f.app (ι.obj x)),
            right_inv :=
              (_ :
                Function.RightInverse
                  (fun f =>
                    NatTrans.mk fun x =>
                      colimit.desc (Lan.diagram ι X' x)
                        { pt := Y.obj x, ι := NatTrans.mk fun i => f.app i.left ≫ Y.map i.hom })
                  fun f =>
                  NatTrans.mk fun x =>
                    colimit.ι (Lan.diagram ι X' (ι.obj x)) (CostructuredArrow.mk (𝟙 (ι.obj x))) ≫ f.app (ι.obj x)) }
          (g ≫ f)).app
      x✝ =
    ({
              toFun := fun f =>
                NatTrans.mk fun x =>
                  colimit.ι (Lan.diagram ι X' (ι.obj x)) (CostructuredArrow.mk (𝟙 (ι.obj x))) ≫ f.app (ι.obj x),
              invFun := fun f =>
                NatTrans.mk fun x =>
                  colimit.desc (Lan.diagram ι X' x)
                    { pt := X.obj x, ι := NatTrans.mk fun i => f.app i.left ≫ X.map i.hom },
              left_inv :=
                (_ :
                  Function.LeftInverse
                    (fun f =>
                      NatTrans.mk fun x =>
                        colimit.desc (Lan.diagram ι X' x)
                          { pt := X.obj x, ι := NatTrans.mk fun i => f.app i.left ≫ X.map i.hom })
                    fun f =>
                    NatTrans.mk fun x =>
                      colimit.ι (Lan.diagram ι X' (ι.obj x)) (CostructuredArrow.mk (𝟙 (ι.obj x))) ≫ f.app (ι.obj x)),
              right_inv :=
                (_ :
                  Function.RightInverse
                    (fun f =>
                      NatTrans.mk fun x =>
                        colimit.desc (Lan.diagram ι X' x)
                          { pt := X.obj x, ι := NatTrans.mk fun i => f.app i.left ≫ X.map i.hom })
                    fun f =>
                    NatTrans.mk fun x =>
                      colimit.ι (Lan.diagram ι X' (ι.obj x)) (CostructuredArrow.mk (𝟙 (ι.obj x))) ≫ f.app (ι.obj x)) }
            g).app
        x✝ ≫
      f.app (ι.obj x✝)

Next tactic:
erw [Equiv.coe_fn_mk, Equiv.coe_fn_mk]