-- Module: Mathlib.AlgebraicGeometry.AffineTransitionLimit
Goal:
I : Type u
inst : Category.{u, u} I
S X : Scheme
D : I ⥤ Scheme
t : D ⟶ Functor.obj (Functor.const I) S
f : X ⟶ S
c : Cone D
hc : IsLimit c
inst_1 : IsCofiltered I
inst_2 : LocallyOfFinitePresentation f
inst_3 : ∀ {i j : I} (f : i ⟶ j), IsAffineHom (D.map f)
inst_4 : ∀ (i : I), CompactSpace.{u} ↥(D.obj i)
inst_5 : ∀ (i : I), QuasiSeparatedSpace.{u} ↥(D.obj i)
a : c.pt ⟶ X
ha : c.π ≫ t = CategoryTheory.Functor.map (Functor.const I) (a ≫ f)
𝒰 :
  IsOpenCover (X := ↥c.pt)
    fun
      (V :
        { x :
          TopologicalSpace.Opens ↥c.pt ×
            { x : TopologicalSpace.Opens ↥X × (↑S.affineOpens : Type u) //
              x.1 ∈ X.affineOpens ∧
                x.1 ≤
                  (Opens.comap (TopCat.Hom.hom f.base) : (a : TopologicalSpace.Opens ↥S) → TopologicalSpace.Opens ↥X)
                    (↑x.2 : TopologicalSpace.Opens ↥S) } //
          Membership.mem (γ := Set (TopologicalSpace.Opens ↥c.pt)) c.pt.affineOpens x.1 ∧
            x.1 ≤
              (Opens.comap (TopCat.Hom.hom a.base) : (a : TopologicalSpace.Opens ↥X) → TopologicalSpace.Opens ↥c.pt)
                (↑x.2 : TopologicalSpace.Opens ↥X × (↑S.affineOpens : Type u)).1 }) ↦
    (↑V :
        TopologicalSpace.Opens ↥c.pt ×
          { x : TopologicalSpace.Opens ↥X × (↑S.affineOpens : Type u) //
            x.1 ∈ X.affineOpens ∧
              x.1 ≤
                (Opens.comap (TopCat.Hom.hom f.base) : (a : TopologicalSpace.Opens ↥S) → TopologicalSpace.Opens ↥X)
                  (↑x.2 : TopologicalSpace.Opens ↥S) }).1
i : I
s :
  Finset
    { x :
      TopologicalSpace.Opens ↥c.pt ×
        { x : TopologicalSpace.Opens ↥X × (↑S.affineOpens : Type u) //
          x.1 ∈ X.affineOpens ∧
            x.1 ≤
              (Opens.comap (TopCat.Hom.hom f.base) : (a : TopologicalSpace.Opens ↥S) → TopologicalSpace.Opens ↥X)
                (↑x.2 : TopologicalSpace.Opens ↥S) } //
      Membership.mem (γ := Set (TopologicalSpace.Opens ↥c.pt)) c.pt.affineOpens x.1 ∧
        x.1 ≤
          (Opens.comap (TopCat.Hom.hom a.base) : (a : TopologicalSpace.Opens ↥X) → TopologicalSpace.Opens ↥c.pt)
            (↑x.2 : TopologicalSpace.Opens ↥X × (↑S.affineOpens : Type u)).1 }
𝒱 : ↥s → (D.obj i).Opens
h𝒱 : IsOpenCover 𝒱
h𝒱𝒰 :
  ∀ (j : ↥s),
    IsAffineOpen (𝒱 j) ∧
      (↑(↑j :
                { x :
                  TopologicalSpace.Opens ↥c.pt ×
                    { x : TopologicalSpace.Opens ↥X × (↑S.affineOpens : Type u) //
                      x.1 ∈ X.affineOpens ∧
                        x.1 ≤
                          (Opens.comap (TopCat.Hom.hom f.base) :
                              (a : TopologicalSpace.Opens ↥S) → TopologicalSpace.Opens ↥X)
                            (↑x.2 : TopologicalSpace.Opens ↥S) } //
                  x.1 ∈ c.pt.affineOpens ∧
                    x.1 ≤
                      (Opens.comap (TopCat.Hom.hom a.base) :
                          (a : TopologicalSpace.Opens ↥X) → TopologicalSpace.Opens ↥c.pt)
                        (↑x.2 : TopologicalSpace.Opens ↥X × (↑S.affineOpens : Type u)).1 }) :
            TopologicalSpace.Opens ↥c.pt ×
              { x : TopologicalSpace.Opens ↥X × (↑S.affineOpens : Type u) //
                x.1 ∈ X.affineOpens ∧
                  x.1 ≤
                    (Opens.comap (TopCat.Hom.hom f.base) : (a : TopologicalSpace.Opens ↥S) → TopologicalSpace.Opens ↥X)
                      (↑x.2 : TopologicalSpace.Opens ↥S) }).1 =
        c.π.app i ⁻¹ᵁ 𝒱 j
i' : I
fi'i : i' ⟶ i
hi' :
  ∀ (j : ↥s),
    D.map fi'i ⁻¹ᵁ 𝒱 j ≤
      t.app i' ⁻¹ᵁ
        (↑(↑(↑(↑j :
                          { x :
                            TopologicalSpace.Opens ↥c.pt ×
                              { x : TopologicalSpace.Opens ↥X × (↑S.affineOpens : Type u) //
                                x.1 ∈ X.affineOpens ∧
                                  x.1 ≤
                                    (Opens.comap (TopCat.Hom.hom f.base) :
                                        (a : TopologicalSpace.Opens ↥S) → TopologicalSpace.Opens ↥X)
                                      (↑x.2 : TopologicalSpace.Opens ↥S) } //
                            x.1 ∈ c.pt.affineOpens ∧
                              x.1 ≤
                                (Opens.comap (TopCat.Hom.hom a.base) :
                                    (a : TopologicalSpace.Opens ↥X) → TopologicalSpace.Opens ↥c.pt)
                                  (↑x.2 : TopologicalSpace.Opens ↥X × (↑S.affineOpens : Type u)).1 }) :
                      TopologicalSpace.Opens ↥c.pt ×
                        { x : TopologicalSpace.Opens ↥X × (↑S.affineOpens : Type u) //
                          x.1 ∈ X.affineOpens ∧
                            x.1 ≤
                              (Opens.comap (TopCat.Hom.hom f.base) :
                                  (a : TopologicalSpace.Opens ↥S) → TopologicalSpace.Opens ↥X)
                                (↑x.2 : TopologicalSpace.Opens ↥S) }).2 :
                TopologicalSpace.Opens ↥X × (↑S.affineOpens : Type u)).2 :
          TopologicalSpace.Opens ↥S)
k : I
fki : k ⟶ i
ak : (j : ↥s) → (↑(D.map fki ⁻¹ᵁ 𝒱 j) : Scheme) ⟶ X
hak : ∀ (j : ↥s), ak j ≫ f = (D.map fki ⁻¹ᵁ 𝒱 j).ι ≫ t.app k
hak' : ∀ (j : ↥s), c.π.app k ∣_ D.map fki ⁻¹ᵁ 𝒱 j ≫ ak j = (c.π.app k ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 j).ι ≫ a
l : I
flk : l ⟶ k
hl :
  ∀ (j₁ j₂ : ↥s),
    (D.obj l).homOfLE ⋯ ≫ D.map flk ∣_ D.map fki ⁻¹ᵁ 𝒱 j₁ ≫ ak j₁ =
      (D.obj l).homOfLE ⋯ ≫ D.map flk ∣_ D.map fki ⁻¹ᵁ 𝒱 j₂ ≫ ak j₂
h𝒲 : IsOpenCover (X := ↥(D.obj l)) fun (k_1 : ↥s) ↦
  (Opens.comap (TopCat.Hom.hom (D.map flk).base) :
      (a : TopologicalSpace.Opens ↥(D.obj k)) → TopologicalSpace.Opens ↥(D.obj l))
    ((Opens.comap (TopCat.Hom.hom (D.map fki).base) :
        (a : TopologicalSpace.Opens ↥(D.obj i)) → TopologicalSpace.Opens ↥(D.obj k))
      (𝒱 k_1)) :=
  ⋯
𝒲 : (D.obj l).OpenCover := (D.obj l).openCoverOfIsOpenCover (fun (x : ↥s) ↦ D.map flk ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 x) h𝒲
j₁ j₂ : 𝒲.I₀
rw :
  Eq (α :=
    (↑((fun (x : ↥s) ↦ D.map flk ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 x) j₁ ⊓ (fun (x : ↥s) ↦ D.map flk ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 x) j₂) :
        Scheme) ⟶
      X)
    (CategoryStruct.comp (Y :=
      pullback (X := (↑((fun (x : ↥s) ↦ D.map flk ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 x) j₁) : Scheme)) (Y :=
        (↑((fun (x : ↥s) ↦ D.map flk ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 x) j₂) : Scheme))
        (Opens.ι ((fun (x : ↥s) ↦ D.map flk ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 x) j₁))
        (Opens.ι ((fun (x : ↥s) ↦ D.map flk ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 x) j₂)))
      (Iso.hom (IsPullback.isoPullback ⋯))
      (pullback.fst (𝒲.f j₁) (𝒲.f j₂) ≫ (fun (j : 𝒲.I₀) ↦ D.map flk ∣_ D.map fki ⁻¹ᵁ 𝒱 j ≫ ak j) j₁))
    (CategoryStruct.comp (Y :=
      pullback (X := (↑((fun (x : ↥s) ↦ D.map flk ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 x) j₁) : Scheme)) (Y :=
        (↑((fun (x : ↥s) ↦ D.map flk ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 x) j₂) : Scheme))
        (Opens.ι ((fun (x : ↥s) ↦ D.map flk ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 x) j₁))
        (Opens.ι ((fun (x : ↥s) ↦ D.map flk ⁻¹ᵁ D.map fki ⁻¹ᵁ 𝒱 x) j₂)))
      (Iso.hom (IsPullback.isoPullback ⋯))
      (pullback.snd (𝒲.f j₁) (𝒲.f j₂) ≫ (fun (j : 𝒲.I₀) ↦ D.map flk ∣_ D.map fki ⁻¹ᵁ 𝒱 j ≫ ak j) j₂))
⊢ Eq (α := pullback (𝒲.f j₁) (𝒲.f j₂) ⟶ X)
    (pullback.fst (𝒲.f j₁) (𝒲.f j₂) ≫ (fun (j : 𝒲.I₀) ↦ D.map flk ∣_ D.map fki ⁻¹ᵁ 𝒱 j ≫ ak j) j₁)
    (pullback.snd (𝒲.f j₁) (𝒲.f j₂) ≫ (fun (j : 𝒲.I₀) ↦ D.map flk ∣_ D.map fki ⁻¹ᵁ 𝒱 j ≫ ak j) j₂)

Tactic:
rw [← cancel_epi (isPullback_opens_inf _ _).isoPullback.hom]

Premises used: AlgebraicGeometry.isPullback_opens_inf, CategoryTheory.IsPullback.isoPullback, CategoryTheory.cancel_epi, CategoryTheory.Iso.hom