Lean4
/-- The uniqueness of `lift`. -/
@[simp]
def liftUnique {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, Z ⟶ F.obj x)
(hM : ∀ (x y : C) (f : x ⟶ y), M x ≫ F.map f = M y) (G : WithInitial C ⥤ D) (h : incl ⋙ G ≅ F) (hG : G.obj star ≅ Z)
(hh : ∀ x : C, hG.symm.hom ≫ G.map (starInitial.to (incl.obj x)) = M x ≫ h.symm.hom.app x) : G ≅ lift F M hM :=
NatIso.ofComponents
(fun X =>
match X with
| of x => h.app x
| star => hG)
(by
rintro (X | X) (Y | Y) f
· apply h.hom.naturality
· cases f
· cases f
change G.map _ ≫ h.hom.app _ = hG.hom ≫ _
symm
erw [← Iso.eq_inv_comp, ← Category.assoc, hh]
simp
· cases f
change G.map (𝟙 _) ≫ hG.hom = hG.hom ≫ 𝟙 _
simp)