l3lab/ntp-mathlib huggingface dataset:
instance componentwise_diagram_π_isIso (i : D.J) (U : Opens (D.U i).carrier) :
    IsIso (D.diagramOverOpenπ U i) := by
  use D.ιInvAppπEqMap U ≫ D.ιInvApp U
  

Proof state:
case h
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i : D.J
U : Opens ↑↑(CategoryTheory.GlueData.U D.toGlueData i)
⊢ diagramOverOpenπ D U i ≫ ιInvAppπEqMap D U ≫ ιInvApp D U = 𝟙 (limit (diagramOverOpen D U)) ∧
    (ιInvAppπEqMap D U ≫ ιInvApp D U) ≫ diagramOverOpenπ D U i =
      𝟙 ((diagramOverOpen D U).obj (op (WalkingMultispan.right i)))

Next tactic:
constructor
instance componentwise_diagram_π_isIso (i : D.J) (U : Opens (D.U i).carrier) :
    IsIso (D.diagramOverOpenπ U i) := by
  use D.ιInvAppπEqMap U ≫ D.ιInvApp U
  constructor
  · 

Proof state:
case h.left
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i : D.J
U : Opens ↑↑(CategoryTheory.GlueData.U D.toGlueData i)
⊢ diagramOverOpenπ D U i ≫ ιInvAppπEqMap D U ≫ ιInvApp D U = 𝟙 (limit (diagramOverOpen D U))

Next tactic:
apply π_ιInvApp_eq_id
instance componentwise_diagram_π_isIso (i : D.J) (U : Opens (D.U i).carrier) :
    IsIso (D.diagramOverOpenπ U i) := by
  use D.ιInvAppπEqMap U ≫ D.ιInvApp U
  constructor
  · apply π_ιInvApp_eq_id
  · 

Proof state:
case h.right
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i : D.J
U : Opens ↑↑(CategoryTheory.GlueData.U D.toGlueData i)
⊢ (ιInvAppπEqMap D U ≫ ιInvApp D U) ≫ diagramOverOpenπ D U i =
    𝟙 ((diagramOverOpen D U).obj (op (WalkingMultispan.right i)))

Next tactic:
rw [Category.assoc, (D.ιInvApp_π _).choose_spec]
instance componentwise_diagram_π_isIso (i : D.J) (U : Opens (D.U i).carrier) :
    IsIso (D.diagramOverOpenπ U i) := by
  use D.ιInvAppπEqMap U ≫ D.ιInvApp U
  constructor
  · apply π_ιInvApp_eq_id
  · rw [Category.assoc, (D.ιInvApp_π _).choose_spec]
    

Proof state:
case h.right
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i : D.J
U : Opens ↑↑(CategoryTheory.GlueData.U D.toGlueData i)
⊢ ιInvAppπEqMap D U ≫
      (CategoryTheory.GlueData.U D.toGlueData i).presheaf.map
        (eqToHom
          (_ :
            op U =
              op
                ((Opens.map
                      (colimit.ι (MultispanIndex.multispan (diagram D.toGlueData))
                          (op (WalkingMultispan.right i)).unop).base).obj
                  ((IsOpenMap.functor (_ : IsOpenMap ⇑(ι D.toGlueData i).base)).obj U)))) =
    𝟙 ((diagramOverOpen D U).obj (op (WalkingMultispan.right i)))

Next tactic:
exact Iso.inv_hom_id ((D.U i).presheaf.mapIso (eqToIso _))
instance ιIsOpenImmersion (i : D.J) : IsOpenImmersion (𝖣.ι i) where
  base_open := D.ι_openEmbedding i
  c_iso U := by 

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i : D.J
U : Opens ↑↑(CategoryTheory.GlueData.U D.toGlueData i)
⊢ IsIso ((ι D.toGlueData i).c.app (op ((IsOpenMap.functor (_ : IsOpenMap ⇑(ι D.toGlueData i).base)).obj U)))

Next tactic:
erw [← colimitPresheafObjIsoComponentwiseLimit_hom_π]
instance ιIsOpenImmersion (i : D.J) : IsOpenImmersion (𝖣.ι i) where
  base_open := D.ι_openEmbedding i
  c_iso U := by erw [← colimitPresheafObjIsoComponentwiseLimit_hom_π]; 

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i : D.J
U : Opens ↑↑(CategoryTheory.GlueData.U D.toGlueData i)
⊢ IsIso
    ((colimitPresheafObjIsoComponentwiseLimit (MultispanIndex.multispan (diagram D.toGlueData))
          ((IsOpenMap.functor (_ : IsOpenMap ⇑(ι D.toGlueData i).base)).obj U)).hom ≫
      limit.π
        (componentwiseDiagram (MultispanIndex.multispan (diagram D.toGlueData))
          ((IsOpenMap.functor (_ : IsOpenMap ⇑(ι D.toGlueData i).base)).obj U))
        (op (WalkingMultispan.right i)))

Next tactic:
infer_instance
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
⊢ { l //
    l ≫ PullbackCone.fst (vPullbackCone D.toGlueData i j) = PullbackCone.fst s ∧
      l ≫ PullbackCone.snd (vPullbackCone D.toGlueData i j) = PullbackCone.snd s ∧
        ∀ {m : s.pt ⟶ (vPullbackCone D.toGlueData i j).pt},
          m ≫ PullbackCone.fst (vPullbackCone D.toGlueData i j) = PullbackCone.fst s →
            m ≫ PullbackCone.snd (vPullbackCone D.toGlueData i j) = PullbackCone.snd s → m = l }

Next tactic:
refine' ⟨_, _, _, _⟩
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · 

Proof state:
case refine'_1
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
⊢ s.pt ⟶ (vPullbackCone D.toGlueData i j).pt

Next tactic:
refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
      

Proof state:
case refine'_1
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
⊢ Set.range ⇑(PullbackCone.fst s).base ⊆ Set.range ⇑(f D.toGlueData i j).base

Next tactic:
erw [← D.toTopGlueData.preimage_range j i]
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
      erw [← D.toTopGlueData.preimage_range j i]
      

Proof state:
case refine'_1
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
⊢ Set.range ⇑(PullbackCone.fst s).base ⊆
    ⇑(ι (toTopGlueData D).toGlueData i) ⁻¹' Set.range ⇑(ι (toTopGlueData D).toGlueData j)

Next tactic:
have :
        s.fst.base ≫ D.toTopGlueData.ι i =
          s.snd.base ≫ D.toTopGlueData.ι j := by
        rw [← 𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _, ←
          𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _]
        have := congr_arg PresheafedSpace.Hom.base s.condition
        rw [comp_base, comp_base] at this
        replace this := reassoc_of% this
        exact this _
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
      erw [← D.toTopGlueData.preimage_range j i]
      have :
        s.fst.base ≫ D.toTopGlueData.ι i =
          s.snd.base ≫ D.toTopGlueData.ι j := by
        

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
⊢ (PullbackCone.fst s).base ≫ ι (toTopGlueData D).toGlueData i =
    (PullbackCone.snd s).base ≫ ι (toTopGlueData D).toGlueData j

Next tactic:
rw [← 𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _, ←
          𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _]
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
      erw [← D.toTopGlueData.preimage_range j i]
      have :
        s.fst.base ≫ D.toTopGlueData.ι i =
          s.snd.base ≫ D.toTopGlueData.ι j := by
        rw [← 𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _, ←
          𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _]
        

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
⊢ (PullbackCone.fst s).base ≫ (forget C).map (ι D.toGlueData i) ≫ (gluedIso D.toGlueData (forget C)).hom =
    (PullbackCone.snd s).base ≫ (forget C).map (ι D.toGlueData j) ≫ (gluedIso D.toGlueData (forget C)).hom

Next tactic:
have := congr_arg PresheafedSpace.Hom.base s.condition
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
      erw [← D.toTopGlueData.preimage_range j i]
      have :
        s.fst.base ≫ D.toTopGlueData.ι i =
          s.snd.base ≫ D.toTopGlueData.ι j := by
        rw [← 𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _, ←
          𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _]
        have := congr_arg PresheafedSpace.Hom.base s.condition
        

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
this : (PullbackCone.fst s ≫ ι D.toGlueData i).base = (PullbackCone.snd s ≫ ι D.toGlueData j).base
⊢ (PullbackCone.fst s).base ≫ (forget C).map (ι D.toGlueData i) ≫ (gluedIso D.toGlueData (forget C)).hom =
    (PullbackCone.snd s).base ≫ (forget C).map (ι D.toGlueData j) ≫ (gluedIso D.toGlueData (forget C)).hom

Next tactic:
rw [comp_base, comp_base] at this
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
      erw [← D.toTopGlueData.preimage_range j i]
      have :
        s.fst.base ≫ D.toTopGlueData.ι i =
          s.snd.base ≫ D.toTopGlueData.ι j := by
        rw [← 𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _, ←
          𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _]
        have := congr_arg PresheafedSpace.Hom.base s.condition
        rw [comp_base, comp_base] at this
        

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
this : (PullbackCone.fst s).base ≫ (ι D.toGlueData i).base = (PullbackCone.snd s).base ≫ (ι D.toGlueData j).base
⊢ (PullbackCone.fst s).base ≫ (forget C).map (ι D.toGlueData i) ≫ (gluedIso D.toGlueData (forget C)).hom =
    (PullbackCone.snd s).base ≫ (forget C).map (ι D.toGlueData j) ≫ (gluedIso D.toGlueData (forget C)).hom

Next tactic:
replace this := reassoc_of% this
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
      erw [← D.toTopGlueData.preimage_range j i]
      have :
        s.fst.base ≫ D.toTopGlueData.ι i =
          s.snd.base ≫ D.toTopGlueData.ι j := by
        rw [← 𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _, ←
          𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _]
        have := congr_arg PresheafedSpace.Hom.base s.condition
        rw [comp_base, comp_base] at this
        replace this := reassoc_of% this
        

Proof state:
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
this :
  ∀ {Z : TopCat} (h : ↑(glued D.toGlueData) ⟶ Z),
    (PullbackCone.fst s).base ≫ (ι D.toGlueData i).base ≫ h = (PullbackCone.snd s).base ≫ (ι D.toGlueData j).base ≫ h
⊢ (PullbackCone.fst s).base ≫ (forget C).map (ι D.toGlueData i) ≫ (gluedIso D.toGlueData (forget C)).hom =
    (PullbackCone.snd s).base ≫ (forget C).map (ι D.toGlueData j) ≫ (gluedIso D.toGlueData (forget C)).hom

Next tactic:
exact this _
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
      erw [← D.toTopGlueData.preimage_range j i]
      have :
        s.fst.base ≫ D.toTopGlueData.ι i =
          s.snd.base ≫ D.toTopGlueData.ι j := by
        rw [← 𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _, ←
          𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _]
        have := congr_arg PresheafedSpace.Hom.base s.condition
        rw [comp_base, comp_base] at this
        replace this := reassoc_of% this
        exact this _
      

Proof state:
case refine'_1
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
this :
  (PullbackCone.fst s).base ≫ ι (toTopGlueData D).toGlueData i =
    (PullbackCone.snd s).base ≫ ι (toTopGlueData D).toGlueData j
⊢ Set.range ⇑(PullbackCone.fst s).base ⊆
    ⇑(ι (toTopGlueData D).toGlueData i) ⁻¹' Set.range ⇑(ι (toTopGlueData D).toGlueData j)

Next tactic:
rw [← Set.image_subset_iff, ← Set.image_univ, ← Set.image_comp, Set.image_univ]
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
      erw [← D.toTopGlueData.preimage_range j i]
      have :
        s.fst.base ≫ D.toTopGlueData.ι i =
          s.snd.base ≫ D.toTopGlueData.ι j := by
        rw [← 𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _, ←
          𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _]
        have := congr_arg PresheafedSpace.Hom.base s.condition
        rw [comp_base, comp_base] at this
        replace this := reassoc_of% this
        exact this _
      rw [← Set.image_subset_iff, ← Set.image_univ, ← Set.image_comp, Set.image_univ]
      -- Porting note : change `rw` to `erw`
      

Proof state:
case refine'_1
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
this :
  (PullbackCone.fst s).base ≫ ι (toTopGlueData D).toGlueData i =
    (PullbackCone.snd s).base ≫ ι (toTopGlueData D).toGlueData j
⊢ Set.range (⇑(ι (toTopGlueData D).toGlueData i) ∘ ⇑(PullbackCone.fst s).base) ⊆
    Set.range ⇑(ι (toTopGlueData D).toGlueData j)

Next tactic:
erw [← coe_comp]
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
      erw [← D.toTopGlueData.preimage_range j i]
      have :
        s.fst.base ≫ D.toTopGlueData.ι i =
          s.snd.base ≫ D.toTopGlueData.ι j := by
        rw [← 𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _, ←
          𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _]
        have := congr_arg PresheafedSpace.Hom.base s.condition
        rw [comp_base, comp_base] at this
        replace this := reassoc_of% this
        exact this _
      rw [← Set.image_subset_iff, ← Set.image_univ, ← Set.image_comp, Set.image_univ]
      -- Porting note : change `rw` to `erw`
      erw [← coe_comp]
      

Proof state:
case refine'_1
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
this :
  (PullbackCone.fst s).base ≫ ι (toTopGlueData D).toGlueData i =
    (PullbackCone.snd s).base ≫ ι (toTopGlueData D).toGlueData j
⊢ Set.range ⇑((PullbackCone.fst s).base ≫ ι (toTopGlueData D).toGlueData i) ⊆
    Set.range ⇑(ι (toTopGlueData D).toGlueData j)

Next tactic:
rw [this, coe_comp, ← Set.image_univ, Set.image_comp]
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
      erw [← D.toTopGlueData.preimage_range j i]
      have :
        s.fst.base ≫ D.toTopGlueData.ι i =
          s.snd.base ≫ D.toTopGlueData.ι j := by
        rw [← 𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _, ←
          𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _]
        have := congr_arg PresheafedSpace.Hom.base s.condition
        rw [comp_base, comp_base] at this
        replace this := reassoc_of% this
        exact this _
      rw [← Set.image_subset_iff, ← Set.image_univ, ← Set.image_comp, Set.image_univ]
      -- Porting note : change `rw` to `erw`
      erw [← coe_comp]
      rw [this, coe_comp, ← Set.image_univ, Set.image_comp]
      

Proof state:
case refine'_1
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
this :
  (PullbackCone.fst s).base ≫ ι (toTopGlueData D).toGlueData i =
    (PullbackCone.snd s).base ≫ ι (toTopGlueData D).toGlueData j
⊢ ⇑(ι (toTopGlueData D).toGlueData j) '' (⇑(PullbackCone.snd s).base '' Set.univ) ⊆
    Set.range ⇑(ι (toTopGlueData D).toGlueData j)

Next tactic:
exact Set.image_subset_range _ _
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
      erw [← D.toTopGlueData.preimage_range j i]
      have :
        s.fst.base ≫ D.toTopGlueData.ι i =
          s.snd.base ≫ D.toTopGlueData.ι j := by
        rw [← 𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _, ←
          𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _]
        have := congr_arg PresheafedSpace.Hom.base s.condition
        rw [comp_base, comp_base] at this
        replace this := reassoc_of% this
        exact this _
      rw [← Set.image_subset_iff, ← Set.image_univ, ← Set.image_comp, Set.image_univ]
      -- Porting note : change `rw` to `erw`
      erw [← coe_comp]
      rw [this, coe_comp, ← Set.image_univ, Set.image_comp]
      exact Set.image_subset_range _ _
    · 

Proof state:
case refine'_2
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
⊢ IsOpenImmersion.lift (f D.toGlueData i j) (PullbackCone.fst s)
        (_ : Set.range ⇑(PullbackCone.fst s).base ⊆ Set.range ⇑(f D.toGlueData i j).base) ≫
      PullbackCone.fst (vPullbackCone D.toGlueData i j) =
    PullbackCone.fst s

Next tactic:
apply IsOpenImmersion.lift_fac
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
      erw [← D.toTopGlueData.preimage_range j i]
      have :
        s.fst.base ≫ D.toTopGlueData.ι i =
          s.snd.base ≫ D.toTopGlueData.ι j := by
        rw [← 𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _, ←
          𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _]
        have := congr_arg PresheafedSpace.Hom.base s.condition
        rw [comp_base, comp_base] at this
        replace this := reassoc_of% this
        exact this _
      rw [← Set.image_subset_iff, ← Set.image_univ, ← Set.image_comp, Set.image_univ]
      -- Porting note : change `rw` to `erw`
      erw [← coe_comp]
      rw [this, coe_comp, ← Set.image_univ, Set.image_comp]
      exact Set.image_subset_range _ _
    · apply IsOpenImmersion.lift_fac
    · 

Proof state:
case refine'_3
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
⊢ IsOpenImmersion.lift (f D.toGlueData i j) (PullbackCone.fst s)
        (_ : Set.range ⇑(PullbackCone.fst s).base ⊆ Set.range ⇑(f D.toGlueData i j).base) ≫
      PullbackCone.snd (vPullbackCone D.toGlueData i j) =
    PullbackCone.snd s

Next tactic:
rw [← cancel_mono (𝖣.ι j), Category.assoc, ← (𝖣.vPullbackCone i j).condition]
/-- The following diagram is a pullback, i.e. `Vᵢⱼ` is the intersection of `Uᵢ` and `Uⱼ` in `X`.

Vᵢⱼ ⟶ Uᵢ
 |      |
 ↓      ↓
 Uⱼ ⟶ X
-/
def vPullbackConeIsLimit (i j : D.J) : IsLimit (𝖣.vPullbackCone i j) :=
  PullbackCone.isLimitAux' _ fun s => by
    refine' ⟨_, _, _, _⟩
    · refine' PresheafedSpace.IsOpenImmersion.lift (D.f i j) s.fst _
      erw [← D.toTopGlueData.preimage_range j i]
      have :
        s.fst.base ≫ D.toTopGlueData.ι i =
          s.snd.base ≫ D.toTopGlueData.ι j := by
        rw [← 𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _, ←
          𝖣.ι_gluedIso_hom (PresheafedSpace.forget _) _]
        have := congr_arg PresheafedSpace.Hom.base s.condition
        rw [comp_base, comp_base] at this
        replace this := reassoc_of% this
        exact this _
      rw [← Set.image_subset_iff, ← Set.image_univ, ← Set.image_comp, Set.image_univ]
      -- Porting note : change `rw` to `erw`
      erw [← coe_comp]
      rw [this, coe_comp, ← Set.image_univ, Set.image_comp]
      exact Set.image_subset_range _ _
    · apply IsOpenImmersion.lift_fac
    · rw [← cancel_mono (𝖣.ι j), Category.assoc, ← (𝖣.vPullbackCone i j).condition]
      

Proof state:
case refine'_3
C : Type u
inst✝¹ : Category.{v, u} C
D : GlueData C
inst✝ : HasLimits C
i j : D.J
s : PullbackCone (ι D.toGlueData i) (ι D.toGlueData j)
⊢ IsOpenImmersion.lift (f D.toGlueData i j) (PullbackCone.fst s)
        (_ : Set.range ⇑(PullbackCone.fst s).base ⊆ Set.range ⇑(f D.toGlueData i j).base) ≫
      PullbackCone.fst (vPullbackCone D.toGlueData i j) ≫ ι D.toGlueData i =
    PullbackCone.snd s ≫ ι D.toGlueData j

Next tactic:
conv_rhs => rw [← s.condition]