-- Module: Mathlib.CategoryTheory.MorphismProperty.Representable
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))
obtain :
  ∀
    (toCommSq :
      CommSq (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))
        (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)) ⋯ ⋯)))
        (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.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)) ⋯ ⋯))
    (bot :
      IsLimit
        (PullbackCone.mk
          (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)) ⋯ ⋯)))
          (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)) ⋯ ⋯)))
          ⋯)),
    ∃ (b : C) (snd : b ⟶ a) (fst : F.obj b ⟶ X), IsPullback fst (F.map snd) (pullback.lift (𝟙 X) (𝟙 X) ⋯) g
⊢ ∃ (b : C) (snd : b ⟶ a) (fst : F.obj b ⟶ X), IsPullback fst (F.map snd) (pullback.lift (𝟙 X) (𝟙 X) ⋯) g

Tactic:
obtain ⟨_, ⟨bot⟩⟩ := IsPullback.of_iso_pullback ⟨by rw [assoc]; simp [pullback.condition]⟩
    (pbRepr.isoPullback ≪≫ (pullbackDiagonalMapIdIso (g ≫ pullback.fst _ _) (g ≫ pullback.snd _ _)
      (terminal.from X)).symm) rfl rfl

Premises used: CategoryTheory.Limits.pullback.snd, CategoryTheory.Limits.terminal.from, CategoryTheory.CommSq.mk, CategoryTheory.IsPullback.isoPullback, CategoryTheory.Iso.trans, CategoryTheory.Limits.pullback.fst, CategoryTheory.Iso.symm, CategoryTheory.CategoryStruct.comp, CategoryTheory.IsPullback.of_iso_pullback, CategoryTheory.Limits.pullbackDiagonalMapIdIso, rfl