Lean4
/-- Given a functor `F` and a collection of limit cones for each diagram `X ↦ F X k`, we can stitch
them together to give a cone for the diagram `F`.
`combinedIsLimit` shows that the new cone is limiting, and `evalCombined` shows it is
(essentially) made up of the original cones.
-/
@[simps]
def combineCones (F : J ⥤ K ⥤ C) (c : ∀ k : K, LimitCone (F.flip.obj k)) : Cone F
where
pt :=
{ obj := fun k => (c k).cone.pt
map := fun {k₁} {k₂} f => (c k₂).isLimit.lift ⟨_, (c k₁).cone.π ≫ F.flip.map f⟩
map_id := fun k => (c k).isLimit.hom_ext fun j => by simp
map_comp := fun {k₁} {k₂} {k₃} f₁ f₂ => (c k₃).isLimit.hom_ext fun j => by simp }
π :=
{ app := fun j => { app := fun k => (c k).cone.π.app j }
naturality := fun j₁ j₂ g => by ext k; exact (c k).cone.π.naturality g }