l3lab/ntp-mathlib huggingface dataset:
/-- Open immersions are stable under base-change. -/
instance pullback_snd_of_left :
    LocallyRingedSpace.IsOpenImmersion (pullback.snd : pullback f g ⟶ _) := by
  delta pullback.snd
  rw [← limit.isoLimitCone_hom_π ⟨_, pullbackConeOfLeftIsLimit f g⟩ WalkingCospan.right]
  

Proof state:
C : Type u_1
inst✝ : Category.{?u.497958, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ IsOpenImmersion
    ((limit.isoLimitCone { cone := pullbackConeOfLeft f g, isLimit := pullbackConeOfLeftIsLimit f g }).hom ≫
      { cone := pullbackConeOfLeft f g, isLimit := pullbackConeOfLeftIsLimit f g }.cone.π.app WalkingCospan.right)

Next tactic:
infer_instance
/-- Open immersions are stable under base-change. -/
instance pullback_fst_of_right :
    LocallyRingedSpace.IsOpenImmersion (pullback.fst : pullback g f ⟶ _) := by
  

Proof state:
C : Type u_1
inst✝ : Category.{?u.499458, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ IsOpenImmersion pullback.fst

Next tactic:
rw [← pullbackSymmetry_hom_comp_snd]
/-- Open immersions are stable under base-change. -/
instance pullback_fst_of_right :
    LocallyRingedSpace.IsOpenImmersion (pullback.fst : pullback g f ⟶ _) := by
  rw [← pullbackSymmetry_hom_comp_snd]
  

Proof state:
C : Type u_1
inst✝ : Category.{?u.499458, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ IsOpenImmersion ((pullbackSymmetry g f).hom ≫ pullback.snd)

Next tactic:
infer_instance
instance pullback_to_base_isOpenImmersion [LocallyRingedSpace.IsOpenImmersion g] :
    LocallyRingedSpace.IsOpenImmersion (limit.π (cospan f g) WalkingCospan.one) := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.500654, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsOpenImmersion g
⊢ IsOpenImmersion (limit.π (cospan f g) WalkingCospan.one)

Next tactic:
rw [← limit.w (cospan f g) WalkingCospan.Hom.inl, cospan_map_inl]
instance pullback_to_base_isOpenImmersion [LocallyRingedSpace.IsOpenImmersion g] :
    LocallyRingedSpace.IsOpenImmersion (limit.π (cospan f g) WalkingCospan.one) := by
  rw [← limit.w (cospan f g) WalkingCospan.Hom.inl, cospan_map_inl]
  

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.500654, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsOpenImmersion g
⊢ IsOpenImmersion (limit.π (cospan f g) WalkingCospan.left ≫ f)

Next tactic:
infer_instance
instance forgetPreservesPullbackOfLeft :
    PreservesLimit (cospan f g) LocallyRingedSpace.forgetToSheafedSpace :=
  preservesLimitOfPreservesLimitCone (pullbackConeOfLeftIsLimit f g) <| by
    

Proof state:
C : Type u_1
inst✝ : Category.{?u.501835, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ IsLimit (forgetToSheafedSpace.mapCone (pullbackConeOfLeft f g))

Next tactic:
apply (isLimitMapConePullbackConeEquiv _ _).symm.toFun
instance forgetPreservesPullbackOfLeft :
    PreservesLimit (cospan f g) LocallyRingedSpace.forgetToSheafedSpace :=
  preservesLimitOfPreservesLimitCone (pullbackConeOfLeftIsLimit f g) <| by
    apply (isLimitMapConePullbackConeEquiv _ _).symm.toFun
    

Proof state:
C : Type u_1
inst✝ : Category.{?u.501835, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ IsLimit
    (PullbackCone.mk
      (forgetToSheafedSpace.map
        { val := PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val,
          prop :=
            (_ :
              ∀ (x : ↑↑(restrict Y (_ : OpenEmbedding ⇑pullback.snd)).toSheafedSpace.toPresheafedSpace),
                IsLocalRingHom
                  (PresheafedSpace.stalkMap (PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val) x)) })
      (forgetToSheafedSpace.map (ofRestrict Y (_ : OpenEmbedding ⇑pullback.snd)))
      (_ :
        forgetToSheafedSpace.map
              { val := PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val,
                prop :=
                  (_ :
                    ∀ (x : ↑↑(restrict Y (_ : OpenEmbedding ⇑pullback.snd)).toSheafedSpace.toPresheafedSpace),
                      IsLocalRingHom
                        (PresheafedSpace.stalkMap (PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val)
                          x)) } ≫
            forgetToSheafedSpace.map f =
          forgetToSheafedSpace.map (ofRestrict Y (_ : OpenEmbedding ⇑pullback.snd)) ≫ forgetToSheafedSpace.map g))

Next tactic:
apply isLimitOfIsLimitPullbackConeMap SheafedSpace.forgetToPresheafedSpace
instance forgetPreservesPullbackOfLeft :
    PreservesLimit (cospan f g) LocallyRingedSpace.forgetToSheafedSpace :=
  preservesLimitOfPreservesLimitCone (pullbackConeOfLeftIsLimit f g) <| by
    apply (isLimitMapConePullbackConeEquiv _ _).symm.toFun
    apply isLimitOfIsLimitPullbackConeMap SheafedSpace.forgetToPresheafedSpace
    

Proof state:
case l
C : Type u_1
inst✝ : Category.{?u.501835, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ IsLimit
    (PullbackCone.mk
      (SheafedSpace.forgetToPresheafedSpace.map
        (forgetToSheafedSpace.map
          { val := PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val,
            prop :=
              (_ :
                ∀ (x : ↑↑(restrict Y (_ : OpenEmbedding ⇑pullback.snd)).toSheafedSpace.toPresheafedSpace),
                  IsLocalRingHom
                    (PresheafedSpace.stalkMap (PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val)
                      x)) }))
      (SheafedSpace.forgetToPresheafedSpace.map
        (forgetToSheafedSpace.map (ofRestrict Y (_ : OpenEmbedding ⇑pullback.snd))))
      (_ :
        SheafedSpace.forgetToPresheafedSpace.map
              (forgetToSheafedSpace.map
                { val := PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val,
                  prop :=
                    (_ :
                      ∀ (x : ↑↑(restrict Y (_ : OpenEmbedding ⇑pullback.snd)).toSheafedSpace.toPresheafedSpace),
                        IsLocalRingHom
                          (PresheafedSpace.stalkMap (PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val)
                            x)) }) ≫
            SheafedSpace.forgetToPresheafedSpace.map (forgetToSheafedSpace.map f) =
          SheafedSpace.forgetToPresheafedSpace.map
              (forgetToSheafedSpace.map (ofRestrict Y (_ : OpenEmbedding ⇑pullback.snd))) ≫
            SheafedSpace.forgetToPresheafedSpace.map (forgetToSheafedSpace.map g)))

Next tactic:
exact PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftIsLimit f.1 g.1
instance forgetToPresheafedSpacePreservesPullbackOfLeft :
    PreservesLimit (cospan f g)
      (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace) :=
  preservesLimitOfPreservesLimitCone (pullbackConeOfLeftIsLimit f g) <| by
    

Proof state:
C : Type u_1
inst✝ : Category.{?u.505909, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ IsLimit ((forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).mapCone (pullbackConeOfLeft f g))

Next tactic:
apply (isLimitMapConePullbackConeEquiv _ _).symm.toFun
instance forgetToPresheafedSpacePreservesPullbackOfLeft :
    PreservesLimit (cospan f g)
      (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace) :=
  preservesLimitOfPreservesLimitCone (pullbackConeOfLeftIsLimit f g) <| by
    apply (isLimitMapConePullbackConeEquiv _ _).symm.toFun
    

Proof state:
C : Type u_1
inst✝ : Category.{?u.505909, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ IsLimit
    (PullbackCone.mk
      ((forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
        { val := PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val,
          prop :=
            (_ :
              ∀ (x : ↑↑(restrict Y (_ : OpenEmbedding ⇑pullback.snd)).toSheafedSpace.toPresheafedSpace),
                IsLocalRingHom
                  (PresheafedSpace.stalkMap (PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val) x)) })
      ((forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
        (ofRestrict Y (_ : OpenEmbedding ⇑pullback.snd)))
      (_ :
        (forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
              { val := PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val,
                prop :=
                  (_ :
                    ∀ (x : ↑↑(restrict Y (_ : OpenEmbedding ⇑pullback.snd)).toSheafedSpace.toPresheafedSpace),
                      IsLocalRingHom
                        (PresheafedSpace.stalkMap (PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val)
                          x)) } ≫
            (forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map f =
          (forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
              (ofRestrict Y (_ : OpenEmbedding ⇑pullback.snd)) ≫
            (forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map g))

Next tactic:
exact PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftIsLimit f.1 g.1
instance forgetToTopPreservesPullbackOfLeft :
    PreservesLimit (cospan f g)
      (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forget _) := by
  

Proof state:
C : Type u_1
inst✝ : Category.{?u.510184, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ PreservesLimit (cospan f g) (forgetToSheafedSpace ⋙ SheafedSpace.forget CommRingCat)

Next tactic:
change PreservesLimit _ <|
    (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace) ⋙
    PresheafedSpace.forget _
instance forgetToTopPreservesPullbackOfLeft :
    PreservesLimit (cospan f g)
      (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forget _) := by
  change PreservesLimit _ <|
    (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace) ⋙
    PresheafedSpace.forget _
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  

Proof state:
C : Type u_1
inst✝ : Category.{?u.510184, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ PreservesLimit (cospan f g)
    ((forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace) ⋙ PresheafedSpace.forget CommRingCat)

Next tactic:
have : PreservesLimit
      (cospan ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
        WalkingCospan.Hom.inl)
      ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
        WalkingCospan.Hom.inr)) (PresheafedSpace.forget CommRingCat)
instance forgetToTopPreservesPullbackOfLeft :
    PreservesLimit (cospan f g)
      (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forget _) := by
  change PreservesLimit _ <|
    (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace) ⋙
    PresheafedSpace.forget _
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : PreservesLimit
      (cospan ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
        WalkingCospan.Hom.inl)
      ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
        WalkingCospan.Hom.inr)) (PresheafedSpace.forget CommRingCat)
  · 

Proof state:
case this
C : Type u_1
inst✝ : Category.{?u.510184, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ PreservesLimit
    (cospan ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map WalkingCospan.Hom.inl)
      ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map WalkingCospan.Hom.inr))
    (PresheafedSpace.forget CommRingCat)

Next tactic:
dsimp
instance forgetToTopPreservesPullbackOfLeft :
    PreservesLimit (cospan f g)
      (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forget _) := by
  change PreservesLimit _ <|
    (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace) ⋙
    PresheafedSpace.forget _
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : PreservesLimit
      (cospan ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
        WalkingCospan.Hom.inl)
      ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
        WalkingCospan.Hom.inr)) (PresheafedSpace.forget CommRingCat)
  · dsimp; 

Proof state:
case this
C : Type u_1
inst✝ : Category.{?u.510184, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ PreservesLimit (cospan f.val g.val) (PresheafedSpace.forget CommRingCat)

Next tactic:
infer_instance
instance forgetToTopPreservesPullbackOfLeft :
    PreservesLimit (cospan f g)
      (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forget _) := by
  change PreservesLimit _ <|
    (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace) ⋙
    PresheafedSpace.forget _
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : PreservesLimit
      (cospan ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
        WalkingCospan.Hom.inl)
      ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
        WalkingCospan.Hom.inr)) (PresheafedSpace.forget CommRingCat)
  · dsimp; infer_instance
  

Proof state:
C : Type u_1
inst✝ : Category.{?u.510184, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
this :
  PreservesLimit
    (cospan ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map WalkingCospan.Hom.inl)
      ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map WalkingCospan.Hom.inr))
    (PresheafedSpace.forget CommRingCat)
⊢ PreservesLimit (cospan f g)
    ((forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace) ⋙ PresheafedSpace.forget CommRingCat)

Next tactic:
have : PreservesLimit (cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace)
    (PresheafedSpace.forget CommRingCat)
instance forgetToTopPreservesPullbackOfLeft :
    PreservesLimit (cospan f g)
      (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forget _) := by
  change PreservesLimit _ <|
    (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace) ⋙
    PresheafedSpace.forget _
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : PreservesLimit
      (cospan ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
        WalkingCospan.Hom.inl)
      ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
        WalkingCospan.Hom.inr)) (PresheafedSpace.forget CommRingCat)
  · dsimp; infer_instance
  have : PreservesLimit (cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace)
    (PresheafedSpace.forget CommRingCat)
  · 

Proof state:
case this
C : Type u_1
inst✝ : Category.{?u.510184, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
this :
  PreservesLimit
    (cospan ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map WalkingCospan.Hom.inl)
      ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map WalkingCospan.Hom.inr))
    (PresheafedSpace.forget CommRingCat)
⊢ PreservesLimit (cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace)
    (PresheafedSpace.forget CommRingCat)

Next tactic:
apply preservesLimitOfIsoDiagram _ (diagramIsoCospan _).symm
instance forgetToTopPreservesPullbackOfLeft :
    PreservesLimit (cospan f g)
      (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forget _) := by
  change PreservesLimit _ <|
    (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace) ⋙
    PresheafedSpace.forget _
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : PreservesLimit
      (cospan ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
        WalkingCospan.Hom.inl)
      ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map
        WalkingCospan.Hom.inr)) (PresheafedSpace.forget CommRingCat)
  · dsimp; infer_instance
  have : PreservesLimit (cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace)
    (PresheafedSpace.forget CommRingCat)
  · apply preservesLimitOfIsoDiagram _ (diagramIsoCospan _).symm
  

Proof state:
C : Type u_1
inst✝ : Category.{?u.510184, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
this✝ :
  PreservesLimit
    (cospan ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map WalkingCospan.Hom.inl)
      ((cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace).map WalkingCospan.Hom.inr))
    (PresheafedSpace.forget CommRingCat)
this :
  PreservesLimit (cospan f g ⋙ forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace)
    (PresheafedSpace.forget CommRingCat)
⊢ PreservesLimit (cospan f g)
    ((forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace) ⋙ PresheafedSpace.forget CommRingCat)

Next tactic:
apply Limits.compPreservesLimit
theorem pullback_snd_isIso_of_range_subset (H' : Set.range g.1.base ⊆ Set.range f.1.base) :
    IsIso (pullback.snd : pullback f g ⟶ _) := by
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  

Proof state:
C : Type u_1
inst✝ : Category.{?u.534473, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
H' : Set.range ⇑g.val.base ⊆ Set.range ⇑f.val.base
⊢ IsIso pullback.snd

Next tactic:
have h1 := @ReflectsIsomorphisms.reflects (F := LocallyRingedSpace.forgetToSheafedSpace) _ _ _
theorem pullback_snd_isIso_of_range_subset (H' : Set.range g.1.base ⊆ Set.range f.1.base) :
    IsIso (pullback.snd : pullback f g ⟶ _) := by
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have h1 := @ReflectsIsomorphisms.reflects (F := LocallyRingedSpace.forgetToSheafedSpace) _ _ _
  

Proof state:
C : Type u_1
inst✝ : Category.{?u.534473, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
H' : Set.range ⇑g.val.base ⊆ Set.range ⇑f.val.base
h1 : ∀ {A B : LocallyRingedSpace} (f : A ⟶ B) [inst : IsIso (forgetToSheafedSpace.map f)], IsIso f
⊢ IsIso pullback.snd

Next tactic:
refine @h1 _ _ _ ?_
theorem pullback_snd_isIso_of_range_subset (H' : Set.range g.1.base ⊆ Set.range f.1.base) :
    IsIso (pullback.snd : pullback f g ⟶ _) := by
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have h1 := @ReflectsIsomorphisms.reflects (F := LocallyRingedSpace.forgetToSheafedSpace) _ _ _
  refine @h1 _ _ _ ?_; 

Proof state:
C : Type u_1
inst✝ : Category.{?u.534473, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
H' : Set.range ⇑g.val.base ⊆ Set.range ⇑f.val.base
h1 : ∀ {A B : LocallyRingedSpace} (f : A ⟶ B) [inst : IsIso (forgetToSheafedSpace.map f)], IsIso f
⊢ IsIso (forgetToSheafedSpace.map pullback.snd)

Next tactic:
clear h1
theorem pullback_snd_isIso_of_range_subset (H' : Set.range g.1.base ⊆ Set.range f.1.base) :
    IsIso (pullback.snd : pullback f g ⟶ _) := by
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have h1 := @ReflectsIsomorphisms.reflects (F := LocallyRingedSpace.forgetToSheafedSpace) _ _ _
  refine @h1 _ _ _ ?_; clear h1
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  

Proof state:
C : Type u_1
inst✝ : Category.{?u.534473, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
H' : Set.range ⇑g.val.base ⊆ Set.range ⇑f.val.base
⊢ IsIso (forgetToSheafedSpace.map pullback.snd)

Next tactic:
have h2 := @ReflectsIsomorphisms.reflects
    (F := SheafedSpace.forgetToPresheafedSpace (C := CommRingCat)) _ _ _
theorem pullback_snd_isIso_of_range_subset (H' : Set.range g.1.base ⊆ Set.range f.1.base) :
    IsIso (pullback.snd : pullback f g ⟶ _) := by
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have h1 := @ReflectsIsomorphisms.reflects (F := LocallyRingedSpace.forgetToSheafedSpace) _ _ _
  refine @h1 _ _ _ ?_; clear h1
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have h2 := @ReflectsIsomorphisms.reflects
    (F := SheafedSpace.forgetToPresheafedSpace (C := CommRingCat)) _ _ _
  

Proof state:
C : Type u_1
inst✝ : Category.{?u.534473, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
H' : Set.range ⇑g.val.base ⊆ Set.range ⇑f.val.base
h2 : ∀ {A B : SheafedSpace CommRingCat} (f : A ⟶ B) [inst : IsIso (SheafedSpace.forgetToPresheafedSpace.map f)], IsIso f
⊢ IsIso (forgetToSheafedSpace.map pullback.snd)

Next tactic:
refine @h2 _ _ _ ?_
theorem pullback_snd_isIso_of_range_subset (H' : Set.range g.1.base ⊆ Set.range f.1.base) :
    IsIso (pullback.snd : pullback f g ⟶ _) := by
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have h1 := @ReflectsIsomorphisms.reflects (F := LocallyRingedSpace.forgetToSheafedSpace) _ _ _
  refine @h1 _ _ _ ?_; clear h1
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have h2 := @ReflectsIsomorphisms.reflects
    (F := SheafedSpace.forgetToPresheafedSpace (C := CommRingCat)) _ _ _
  refine @h2 _ _ _ ?_; 

Proof state:
C : Type u_1
inst✝ : Category.{?u.534473, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
H' : Set.range ⇑g.val.base ⊆ Set.range ⇑f.val.base
h2 : ∀ {A B : SheafedSpace CommRingCat} (f : A ⟶ B) [inst : IsIso (SheafedSpace.forgetToPresheafedSpace.map f)], IsIso f
⊢ IsIso (SheafedSpace.forgetToPresheafedSpace.map (forgetToSheafedSpace.map pullback.snd))

Next tactic:
clear h2
theorem pullback_snd_isIso_of_range_subset (H' : Set.range g.1.base ⊆ Set.range f.1.base) :
    IsIso (pullback.snd : pullback f g ⟶ _) := by
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have h1 := @ReflectsIsomorphisms.reflects (F := LocallyRingedSpace.forgetToSheafedSpace) _ _ _
  refine @h1 _ _ _ ?_; clear h1
  -- Porting note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have h2 := @ReflectsIsomorphisms.reflects
    (F := SheafedSpace.forgetToPresheafedSpace (C := CommRingCat)) _ _ _
  refine @h2 _ _ _ ?_; clear h2
  

Proof state:
C : Type u_1
inst✝ : Category.{?u.534473, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
H' : Set.range ⇑g.val.base ⊆ Set.range ⇑f.val.base
⊢ IsIso (SheafedSpace.forgetToPresheafedSpace.map (forgetToSheafedSpace.map pullback.snd))

Next tactic:
erw [← PreservesPullback.iso_hom_snd
      (LocallyRingedSpace.forgetToSheafedSpace ⋙ SheafedSpace.forgetToPresheafedSpace) f g]