-- Lean 4 proof step from Mathlib.CategoryTheory.MorphismProperty.Representable (goal)
Goal:
C : Type u₁
inst : Category.{v₁, u₁} C
D : Type u₂
inst_1 : Category.{v₂, u₂} D
F : Functor.{v₁, v₂, u₁, u₂} C D
inst_2 : HasBinaryProducts.{v₁, u₁} C
inst_3 : HasPullbacks.{v₂, u₂} D
inst_4 : HasBinaryProducts.{v₂, u₂} D
inst_5 : HasTerminal.{v₂, u₂} D
inst_6 : F.Full
inst_7 : PreservesLimitsOfShape (Discrete WalkingPair) F
inst_8 : HasPullbacks.{v₁, u₁} C
inst_9 : PreservesLimitsOfShape WalkingCospan F
X : D
h : ∀ ⦃a : C⦄ (g : F.obj a ⟶ X), F.relativelyRepresentable g
a : C
g : F.obj a ⟶ Limits.pullback.{v₂, u₂} (Z := terminal.{v₂, u₂} D) (terminal.from X) (terminal.from X)
w : C
w_1 : w ⟶ a
w_2 : F.obj w ⟶ F.obj a
pbRepr :
  IsPullback w_2 (F.map w_1) (g ≫ pullback.fst (terminal.from X) (terminal.from X))
    (g ≫ pullback.snd (terminal.from X) (terminal.from X))
⊢ Eq (α := F.obj w ⟶ pullback.diagonalObj.{v₂, u₂} (Y := terminal.{v₂, u₂} D) (terminal.from X))
    (CategoryStruct.comp (Y :=
        Limits.pullback (Y :=
          Limits.pullback (Z := terminal.{v₂, u₂} D)
            ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
            ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X))
          (Z := pullback.diagonalObj.{v₂, u₂} (Y := terminal.{v₂, u₂} D) (terminal.from X))
          (pullback.diagonal (terminal.from X))
          (pullback.map ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
            ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X) (terminal.from X)
            (terminal.from X) (g ≫ pullback.fst (terminal.from X) (terminal.from X))
            (g ≫ pullback.snd (terminal.from X) (terminal.from X)) (𝟙 (terminal.{v₂, u₂} D)) ⋯ ⋯))
        (Iso.hom
          (Iso.trans (Y :=
            Limits.pullback (g ≫ pullback.fst (terminal.from X) (terminal.from X))
              (g ≫ pullback.snd (terminal.from X) (terminal.from X)))
            pbRepr.isoPullback
            (Iso.symm
              (pullbackDiagonalMapIdIso (g ≫ pullback.fst (terminal.from X) (terminal.from X))
                (g ≫ pullback.snd (terminal.from X) (terminal.from X)) (terminal.from X)))))
        (pullback.fst (pullback.diagonal (terminal.from X))
          (pullback.map ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
            ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X) (terminal.from X)
            (terminal.from X) (g ≫ pullback.fst (terminal.from X) (terminal.from X))
            (g ≫ pullback.snd (terminal.from X) (terminal.from X)) (𝟙 (terminal.{v₂, u₂} D)) ⋯ ⋯)) ≫
      pullback.diagonal (terminal.from X))
    (CategoryStruct.comp (Y :=
      Limits.pullback (Z := terminal.{v₂, u₂} D)
        ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
        ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X))
      (CategoryStruct.comp (Y :=
        Limits.pullback (Y :=
          Limits.pullback (Z := terminal.{v₂, u₂} D)
            ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
            ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X))
          (Z := pullback.diagonalObj.{v₂, u₂} (Y := terminal.{v₂, u₂} D) (terminal.from X))
          (pullback.diagonal (terminal.from X))
          (pullback.map ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
            ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X) (terminal.from X)
            (terminal.from X) (g ≫ pullback.fst (terminal.from X) (terminal.from X))
            (g ≫ pullback.snd (terminal.from X) (terminal.from X)) (𝟙 (terminal.{v₂, u₂} D)) ⋯ ⋯))
        (Iso.hom
          (Iso.trans (Y :=
            Limits.pullback (g ≫ pullback.fst (terminal.from X) (terminal.from X))
              (g ≫ pullback.snd (terminal.from X) (terminal.from X)))
            pbRepr.isoPullback
            (Iso.symm
              (pullbackDiagonalMapIdIso (g ≫ pullback.fst (terminal.from X) (terminal.from X))
                (g ≫ pullback.snd (terminal.from X) (terminal.from X)) (terminal.from X)))))
        (pullback.snd (pullback.diagonal (terminal.from X))
          (pullback.map ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
            ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X) (terminal.from X)
            (terminal.from X) (g ≫ pullback.fst (terminal.from X) (terminal.from X))
            (g ≫ pullback.snd (terminal.from X) (terminal.from X)) (𝟙 (terminal.{v₂, u₂} D)) ⋯ ⋯)))
      (pullback.map ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
        ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X) (terminal.from X) (terminal.from X)
        (g ≫ pullback.fst (terminal.from X) (terminal.from X)) (g ≫ pullback.snd (terminal.from X) (terminal.from X))
        (𝟙 (terminal.{v₂, u₂} D)) ⋯ ⋯))
have rw : Eq (α := F.obj w ⟶ pullback.diagonalObj.{v₂, u₂} (Y := terminal.{v₂, u₂} D) (terminal.from X))
  (CategoryStruct.comp (Y :=
    Limits.pullback (Y :=
      Limits.pullback (Z := terminal.{v₂, u₂} D)
        ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
        ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X))
      (Z := pullback.diagonalObj.{v₂, u₂} (Y := terminal.{v₂, u₂} D) (terminal.from X))
      (pullback.diagonal (terminal.from X))
      (pullback.map ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
        ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X) (terminal.from X) (terminal.from X)
        (g ≫ pullback.fst (terminal.from X) (terminal.from X)) (g ≫ pullback.snd (terminal.from X) (terminal.from X))
        (𝟙 (terminal.{v₂, u₂} D)) sorry sorry))
    (Iso.hom
      (Iso.trans (Y :=
        Limits.pullback (g ≫ pullback.fst (terminal.from X) (terminal.from X))
          (g ≫ pullback.snd (terminal.from X) (terminal.from X)))
        pbRepr.isoPullback
        (Iso.symm
          (pullbackDiagonalMapIdIso (g ≫ pullback.fst (terminal.from X) (terminal.from X))
            (g ≫ pullback.snd (terminal.from X) (terminal.from X)) (terminal.from X)))))
    (pullback.fst (pullback.diagonal (terminal.from X))
        (pullback.map ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
          ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X) (terminal.from X) (terminal.from X)
          (g ≫ pullback.fst (terminal.from X) (terminal.from X)) (g ≫ pullback.snd (terminal.from X) (terminal.from X))
          (𝟙 (terminal.{v₂, u₂} D)) sorry sorry) ≫
      pullback.diagonal (terminal.from X)))
  (CategoryStruct.comp (Y :=
    Limits.pullback (Z := terminal.{v₂, u₂} D)
      ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
      ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X))
    (CategoryStruct.comp (Y :=
      Limits.pullback (Y :=
        Limits.pullback (Z := terminal.{v₂, u₂} D)
          ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
          ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X))
        (Z := pullback.diagonalObj.{v₂, u₂} (Y := terminal.{v₂, u₂} D) (terminal.from X))
        (pullback.diagonal (terminal.from X))
        (pullback.map ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
          ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X) (terminal.from X) (terminal.from X)
          (g ≫ pullback.fst (terminal.from X) (terminal.from X)) (g ≫ pullback.snd (terminal.from X) (terminal.from X))
          (𝟙 (terminal.{v₂, u₂} D)) sorry sorry))
      (Iso.hom
        (Iso.trans (Y :=
          Limits.pullback (g ≫ pullback.fst (terminal.from X) (terminal.from X))
            (g ≫ pullback.snd (terminal.from X) (terminal.from X)))
          pbRepr.isoPullback
          (Iso.symm
            (pullbackDiagonalMapIdIso (g ≫ pullback.fst (terminal.from X) (terminal.from X))
              (g ≫ pullback.snd (terminal.from X) (terminal.from X)) (terminal.from X)))))
      (pullback.snd (pullback.diagonal (terminal.from X))
        (pullback.map ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
          ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X) (terminal.from X) (terminal.from X)
          (g ≫ pullback.fst (terminal.from X) (terminal.from X)) (g ≫ pullback.snd (terminal.from X) (terminal.from X))
          (𝟙 (terminal.{v₂, u₂} D)) sorry sorry)))
    (pullback.map ((g ≫ pullback.fst (terminal.from X) (terminal.from X)) ≫ terminal.from X)
      ((g ≫ pullback.snd (terminal.from X) (terminal.from X)) ≫ terminal.from X) (terminal.from X) (terminal.from X)
      (g ≫ pullback.fst (terminal.from X) (terminal.from X)) (g ≫ pullback.snd (terminal.from X) (terminal.from X))
      (𝟙 (terminal.{v₂, u₂} D)) sorry sorry))
Tactic: rw [assoc]