Lean4
/-- The reverse direction of the equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)`,
given by `CategoryTheory.yonedaEquiv`.
-/
@[simps]
def fromCostructuredArrow (F : Cᵒᵖ ⥤ Type v) : (CostructuredArrow yoneda F)ᵒᵖ ⥤ F.Elements
where
obj X := ⟨op (unop X).1, yonedaEquiv.1 (unop X).3⟩
map {X Y}
f :=
⟨f.unop.1.op, by
convert (congr_fun ((unop X).hom.naturality f.unop.left.op) (𝟙 _)).symm
simp only [Equiv.toFun_as_coe, Quiver.Hom.unop_op, yonedaEquiv_apply, types_comp_apply, Category.comp_id,
yoneda_obj_map]
have : yoneda.map f.unop.left ≫ (unop X).hom = (unop Y).hom := by convert f.unop.3
rw [← this]
simp only [yoneda_map_app, FunctorToTypes.comp]
rw [Category.id_comp]⟩