l3lab/ntp-mathlib huggingface dataset:
instance sigma_ι_isOpenImmersion [HasStrictTerminalObjects C] :
    SheafedSpace.IsOpenImmersion (colimit.ι F i) where
  base_open := sigma_ι_openEmbedding F i
  c_iso U := by
    have e : colimit.ι F i = _ :=
      (ι_preservesColimitsIso_inv SheafedSpace.forgetToPresheafedSpace F i).symm
    have H :
      OpenEmbedding
        (colimit.ι (F ⋙ SheafedSpace.forgetToPresheafedSpace) i ≫
            (preservesColimitIso SheafedSpace.forgetToPresheafedSpace F).inv).base :=
      e ▸ sigma_ι_openEmbedding F i
    suffices IsIso <| (colimit.ι (F ⋙ SheafedSpace.forgetToPresheafedSpace) i ≫
        (preservesColimitIso SheafedSpace.forgetToPresheafedSpace F).inv).c.app <|
      op (H.isOpenMap.functor.obj U) by
      -- Porting note : just `convert` is very slow, so helps it a bit
      convert this using 2 <;> congr
    rw [PresheafedSpace.comp_c_app,
      ← PresheafedSpace.colimitPresheafObjIsoComponentwiseLimit_hom_π]
    -- Porting note : this instance created manually to make the `inferInstance` below work
    have inst1 : IsIso (preservesColimitIso forgetToPresheafedSpace F).inv.c :=
      PresheafedSpace.c_isIso_of_iso _
    rsuffices : IsIso
        (limit.π
          (PresheafedSpace.componentwiseDiagram (F ⋙ SheafedSpace.forgetToPresheafedSpace)
            ((Opens.map
                  (preservesColimitIso SheafedSpace.forgetToPresheafedSpace F).inv.base).obj
              (unop <| op <| H.isOpenMap.functor.obj U)))
          (op i))
    · infer_instance
    apply limit_π_isIso_of_is_strict_terminal
    intro j hj
    induction j using Opposite.rec' with | h j => ?_
    

Proof state:
case H.h
C : Type u_1
inst✝³ : Category.{v, u_1} C
inst✝² : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝¹ : HasColimit F
i : Discrete ι
inst✝ : HasStrictTerminalObjects C
U : Opens ↑↑(F.obj i).toPresheafedSpace
e : colimit.ι F i = colimit.ι (F ⋙ forgetToPresheafedSpace) i ≫ (preservesColimitIso forgetToPresheafedSpace F).inv
H :
  OpenEmbedding ⇑(colimit.ι (F ⋙ forgetToPresheafedSpace) i ≫ (preservesColimitIso forgetToPresheafedSpace F).inv).base
inst1 : IsIso (preservesColimitIso forgetToPresheafedSpace F).inv.c
j : Discrete ι
hj : op j ≠ op i
⊢ IsTerminal
    ((PresheafedSpace.componentwiseDiagram (F ⋙ forgetToPresheafedSpace)
          ((Opens.map (preservesColimitIso forgetToPresheafedSpace F).inv.base).obj
            (op
                ((IsOpenMap.functor
                      (_ :
                        IsOpenMap
                          ⇑(colimit.ι (F ⋙ forgetToPresheafedSpace) i ≫
                                (preservesColimitIso forgetToPresheafedSpace F).inv).base)).obj
                  U)).unop)).obj
      (op j))

Next tactic:
dsimp
instance sigma_ι_isOpenImmersion [HasStrictTerminalObjects C] :
    SheafedSpace.IsOpenImmersion (colimit.ι F i) where
  base_open := sigma_ι_openEmbedding F i
  c_iso U := by
    have e : colimit.ι F i = _ :=
      (ι_preservesColimitsIso_inv SheafedSpace.forgetToPresheafedSpace F i).symm
    have H :
      OpenEmbedding
        (colimit.ι (F ⋙ SheafedSpace.forgetToPresheafedSpace) i ≫
            (preservesColimitIso SheafedSpace.forgetToPresheafedSpace F).inv).base :=
      e ▸ sigma_ι_openEmbedding F i
    suffices IsIso <| (colimit.ι (F ⋙ SheafedSpace.forgetToPresheafedSpace) i ≫
        (preservesColimitIso SheafedSpace.forgetToPresheafedSpace F).inv).c.app <|
      op (H.isOpenMap.functor.obj U) by
      -- Porting note : just `convert` is very slow, so helps it a bit
      convert this using 2 <;> congr
    rw [PresheafedSpace.comp_c_app,
      ← PresheafedSpace.colimitPresheafObjIsoComponentwiseLimit_hom_π]
    -- Porting note : this instance created manually to make the `inferInstance` below work
    have inst1 : IsIso (preservesColimitIso forgetToPresheafedSpace F).inv.c :=
      PresheafedSpace.c_isIso_of_iso _
    rsuffices : IsIso
        (limit.π
          (PresheafedSpace.componentwiseDiagram (F ⋙ SheafedSpace.forgetToPresheafedSpace)
            ((Opens.map
                  (preservesColimitIso SheafedSpace.forgetToPresheafedSpace F).inv.base).obj
              (unop <| op <| H.isOpenMap.functor.obj U)))
          (op i))
    · infer_instance
    apply limit_π_isIso_of_is_strict_terminal
    intro j hj
    induction j using Opposite.rec' with | h j => ?_
    dsimp
    

Proof state:
case H.h
C : Type u_1
inst✝³ : Category.{v, u_1} C
inst✝² : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝¹ : HasColimit F
i : Discrete ι
inst✝ : HasStrictTerminalObjects C
U : Opens ↑↑(F.obj i).toPresheafedSpace
e : colimit.ι F i = colimit.ι (F ⋙ forgetToPresheafedSpace) i ≫ (preservesColimitIso forgetToPresheafedSpace F).inv
H :
  OpenEmbedding ⇑(colimit.ι (F ⋙ forgetToPresheafedSpace) i ≫ (preservesColimitIso forgetToPresheafedSpace F).inv).base
inst1 : IsIso (preservesColimitIso forgetToPresheafedSpace F).inv.c
j : Discrete ι
hj : op j ≠ op i
⊢ IsTerminal
    ((F.obj j).presheaf.obj
      (op
        ((Opens.map (colimit.ι (F ⋙ forgetToPresheafedSpace) j).base).obj
          ((Opens.map (preservesColimitIso forgetToPresheafedSpace F).inv.base).obj
            ((IsOpenMap.functor
                  (_ :
                    IsOpenMap
                      ⇑((colimit.ι (F ⋙ forgetToPresheafedSpace) i).base ≫
                          (preservesColimitIso forgetToPresheafedSpace F).inv.base))).obj
              U)))))

Next tactic:
convert (F.obj j).sheaf.isTerminalOfEmpty using 3
instance sigma_ι_isOpenImmersion [HasStrictTerminalObjects C] :
    SheafedSpace.IsOpenImmersion (colimit.ι F i) where
  base_open := sigma_ι_openEmbedding F i
  c_iso U := by
    have e : colimit.ι F i = _ :=
      (ι_preservesColimitsIso_inv SheafedSpace.forgetToPresheafedSpace F i).symm
    have H :
      OpenEmbedding
        (colimit.ι (F ⋙ SheafedSpace.forgetToPresheafedSpace) i ≫
            (preservesColimitIso SheafedSpace.forgetToPresheafedSpace F).inv).base :=
      e ▸ sigma_ι_openEmbedding F i
    suffices IsIso <| (colimit.ι (F ⋙ SheafedSpace.forgetToPresheafedSpace) i ≫
        (preservesColimitIso SheafedSpace.forgetToPresheafedSpace F).inv).c.app <|
      op (H.isOpenMap.functor.obj U) by
      -- Porting note : just `convert` is very slow, so helps it a bit
      convert this using 2 <;> congr
    rw [PresheafedSpace.comp_c_app,
      ← PresheafedSpace.colimitPresheafObjIsoComponentwiseLimit_hom_π]
    -- Porting note : this instance created manually to make the `inferInstance` below work
    have inst1 : IsIso (preservesColimitIso forgetToPresheafedSpace F).inv.c :=
      PresheafedSpace.c_isIso_of_iso _
    rsuffices : IsIso
        (limit.π
          (PresheafedSpace.componentwiseDiagram (F ⋙ SheafedSpace.forgetToPresheafedSpace)
            ((Opens.map
                  (preservesColimitIso SheafedSpace.forgetToPresheafedSpace F).inv.base).obj
              (unop <| op <| H.isOpenMap.functor.obj U)))
          (op i))
    · infer_instance
    apply limit_π_isIso_of_is_strict_terminal
    intro j hj
    induction j using Opposite.rec' with | h j => ?_
    dsimp
    convert (F.obj j).sheaf.isTerminalOfEmpty using 3
    

Proof state:
case h.e'_3.h.e'_6.h.e'_2
C : Type u_1
inst✝³ : Category.{v, u_1} C
inst✝² : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝¹ : HasColimit F
i : Discrete ι
inst✝ : HasStrictTerminalObjects C
U : Opens ↑↑(F.obj i).toPresheafedSpace
e : colimit.ι F i = colimit.ι (F ⋙ forgetToPresheafedSpace) i ≫ (preservesColimitIso forgetToPresheafedSpace F).inv
H :
  OpenEmbedding ⇑(colimit.ι (F ⋙ forgetToPresheafedSpace) i ≫ (preservesColimitIso forgetToPresheafedSpace F).inv).base
inst1 : IsIso (preservesColimitIso forgetToPresheafedSpace F).inv.c
j : Discrete ι
hj : op j ≠ op i
⊢ (Opens.map (colimit.ι (F ⋙ forgetToPresheafedSpace) j).base).obj
      ((Opens.map (preservesColimitIso forgetToPresheafedSpace F).inv.base).obj
        ((IsOpenMap.functor
              (_ :
                IsOpenMap
                  ⇑((colimit.ι (F ⋙ forgetToPresheafedSpace) i).base ≫
                      (preservesColimitIso forgetToPresheafedSpace F).inv.base))).obj
          U)) =
    ⊥

Next tactic:
convert image_preimage_is_empty F i j (fun h => hj (congr_arg op h.symm)) U using 6
instance sigma_ι_isOpenImmersion [HasStrictTerminalObjects C] :
    SheafedSpace.IsOpenImmersion (colimit.ι F i) where
  base_open := sigma_ι_openEmbedding F i
  c_iso U := by
    have e : colimit.ι F i = _ :=
      (ι_preservesColimitsIso_inv SheafedSpace.forgetToPresheafedSpace F i).symm
    have H :
      OpenEmbedding
        (colimit.ι (F ⋙ SheafedSpace.forgetToPresheafedSpace) i ≫
            (preservesColimitIso SheafedSpace.forgetToPresheafedSpace F).inv).base :=
      e ▸ sigma_ι_openEmbedding F i
    suffices IsIso <| (colimit.ι (F ⋙ SheafedSpace.forgetToPresheafedSpace) i ≫
        (preservesColimitIso SheafedSpace.forgetToPresheafedSpace F).inv).c.app <|
      op (H.isOpenMap.functor.obj U) by
      -- Porting note : just `convert` is very slow, so helps it a bit
      convert this using 2 <;> congr
    rw [PresheafedSpace.comp_c_app,
      ← PresheafedSpace.colimitPresheafObjIsoComponentwiseLimit_hom_π]
    -- Porting note : this instance created manually to make the `inferInstance` below work
    have inst1 : IsIso (preservesColimitIso forgetToPresheafedSpace F).inv.c :=
      PresheafedSpace.c_isIso_of_iso _
    rsuffices : IsIso
        (limit.π
          (PresheafedSpace.componentwiseDiagram (F ⋙ SheafedSpace.forgetToPresheafedSpace)
            ((Opens.map
                  (preservesColimitIso SheafedSpace.forgetToPresheafedSpace F).inv.base).obj
              (unop <| op <| H.isOpenMap.functor.obj U)))
          (op i))
    · infer_instance
    apply limit_π_isIso_of_is_strict_terminal
    intro j hj
    induction j using Opposite.rec' with | h j => ?_
    dsimp
    convert (F.obj j).sheaf.isTerminalOfEmpty using 3
    convert image_preimage_is_empty F i j (fun h => hj (congr_arg op h.symm)) U using 6
    

Proof state:
case h.e'_2.h.h.e'_6.h.e'_6.h.h.e'_5.h.e'_5.h.e'_3
C : Type u_1
inst✝³ : Category.{v, u_1} C
inst✝² : HasLimits C
ι : Type v
F : Discrete ι ⥤ SheafedSpace C
inst✝¹ : HasColimit F
i : Discrete ι
inst✝ : HasStrictTerminalObjects C
U : Opens ↑↑(F.obj i).toPresheafedSpace
e : colimit.ι F i = colimit.ι (F ⋙ forgetToPresheafedSpace) i ≫ (preservesColimitIso forgetToPresheafedSpace F).inv
H :
  OpenEmbedding ⇑(colimit.ι (F ⋙ forgetToPresheafedSpace) i ≫ (preservesColimitIso forgetToPresheafedSpace F).inv).base
inst1 : IsIso (preservesColimitIso forgetToPresheafedSpace F).inv.c
j : Discrete ι
hj : op j ≠ op i
e_1✝¹ : Opens ↑↑(F.obj j).toPresheafedSpace = Opens ↑↑((F ⋙ forgetToPresheafedSpace).obj j)
e_1✝ : Opens ↑↑(colimit F).toPresheafedSpace = Opens ↑↑(forgetToPresheafedSpace.obj (colimit F))
⊢ (colimit.ι (F ⋙ forgetToPresheafedSpace) i).base ≫ (preservesColimitIso forgetToPresheafedSpace F).inv.base =
    (colimit.ι F i).base

Next tactic:
exact (congr_arg PresheafedSpace.Hom.base e).symm
instance (priority := 100) of_isIso [IsIso g] : LocallyRingedSpace.IsOpenImmersion g :=
  @PresheafedSpace.IsOpenImmersion.ofIsIso _ _ _ _ g.1
    ⟨⟨(inv g).1, by
        

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.485514, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsIso g
⊢ g.val ≫ (inv g).val = 𝟙 Y.toPresheafedSpace ∧ (inv g).val ≫ g.val = 𝟙 Z.toPresheafedSpace

Next tactic:
erw [← LocallyRingedSpace.comp_val]
instance (priority := 100) of_isIso [IsIso g] : LocallyRingedSpace.IsOpenImmersion g :=
  @PresheafedSpace.IsOpenImmersion.ofIsIso _ _ _ _ g.1
    ⟨⟨(inv g).1, by
        erw [← LocallyRingedSpace.comp_val]; 

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.485514, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsIso g
⊢ (g ≫ inv g).val = 𝟙 Y.toPresheafedSpace ∧ (inv g).val ≫ g.val = 𝟙 Z.toPresheafedSpace

Next tactic:
rw [IsIso.hom_inv_id]
instance (priority := 100) of_isIso [IsIso g] : LocallyRingedSpace.IsOpenImmersion g :=
  @PresheafedSpace.IsOpenImmersion.ofIsIso _ _ _ _ g.1
    ⟨⟨(inv g).1, by
        erw [← LocallyRingedSpace.comp_val]; rw [IsIso.hom_inv_id]
        

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.485514, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsIso g
⊢ (𝟙 Y).val = 𝟙 Y.toPresheafedSpace ∧ (inv g).val ≫ g.val = 𝟙 Z.toPresheafedSpace

Next tactic:
erw [← LocallyRingedSpace.comp_val]
instance (priority := 100) of_isIso [IsIso g] : LocallyRingedSpace.IsOpenImmersion g :=
  @PresheafedSpace.IsOpenImmersion.ofIsIso _ _ _ _ g.1
    ⟨⟨(inv g).1, by
        erw [← LocallyRingedSpace.comp_val]; rw [IsIso.hom_inv_id]
        erw [← LocallyRingedSpace.comp_val]; 

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.485514, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsIso g
⊢ (𝟙 Y).val = 𝟙 Y.toPresheafedSpace ∧ (inv g ≫ g).val = 𝟙 Z.toPresheafedSpace

Next tactic:
rw [IsIso.inv_hom_id]
instance (priority := 100) of_isIso [IsIso g] : LocallyRingedSpace.IsOpenImmersion g :=
  @PresheafedSpace.IsOpenImmersion.ofIsIso _ _ _ _ g.1
    ⟨⟨(inv g).1, by
        erw [← LocallyRingedSpace.comp_val]; rw [IsIso.hom_inv_id]
        erw [← LocallyRingedSpace.comp_val]; rw [IsIso.inv_hom_id]; 

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.485514, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsIso g
⊢ (𝟙 Y).val = 𝟙 Y.toPresheafedSpace ∧ (𝟙 Z).val = 𝟙 Z.toPresheafedSpace

Next tactic:
constructor
instance (priority := 100) of_isIso [IsIso g] : LocallyRingedSpace.IsOpenImmersion g :=
  @PresheafedSpace.IsOpenImmersion.ofIsIso _ _ _ _ g.1
    ⟨⟨(inv g).1, by
        erw [← LocallyRingedSpace.comp_val]; rw [IsIso.hom_inv_id]
        erw [← LocallyRingedSpace.comp_val]; rw [IsIso.inv_hom_id]; constructor <;> 

Proof state:
case left
C : Type u_1
inst✝¹ : Category.{?u.485514, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsIso g
⊢ (𝟙 Y).val = 𝟙 Y.toPresheafedSpace

Next tactic:
rfl
instance (priority := 100) of_isIso [IsIso g] : LocallyRingedSpace.IsOpenImmersion g :=
  @PresheafedSpace.IsOpenImmersion.ofIsIso _ _ _ _ g.1
    ⟨⟨(inv g).1, by
        erw [← LocallyRingedSpace.comp_val]; rw [IsIso.hom_inv_id]
        erw [← LocallyRingedSpace.comp_val]; rw [IsIso.inv_hom_id]; constructor <;> 

Proof state:
case right
C : Type u_1
inst✝¹ : Category.{?u.485514, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
inst✝ : IsIso g
⊢ (𝟙 Z).val = 𝟙 Z.toPresheafedSpace

Next tactic:
rfl
instance mono : Mono f :=
  LocallyRingedSpace.forgetToSheafedSpace.mono_of_mono_map (show Mono f.1 by 

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

Next tactic:
infer_instance
/-- An explicit pullback cone over `cospan f g` if `f` is an open immersion. -/
def pullbackConeOfLeft : PullbackCone f g := by
  

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

Next tactic:
refine' PullbackCone.mk _
      (Y.ofRestrict (TopCat.snd_openEmbedding_of_left_openEmbedding H.base_open g.1.base)) _
/-- An explicit pullback cone over `cospan f g` if `f` is an open immersion. -/
def pullbackConeOfLeft : PullbackCone f g := by
  refine' PullbackCone.mk _
      (Y.ofRestrict (TopCat.snd_openEmbedding_of_left_openEmbedding H.base_open g.1.base)) _
  · 

Proof state:
case refine'_1
C : Type u_1
inst✝ : Category.{?u.488555, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
⊢ restrict Y (_ : OpenEmbedding ⇑pullback.snd) ⟶ X

Next tactic:
use PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.1 g.1
/-- An explicit pullback cone over `cospan f g` if `f` is an open immersion. -/
def pullbackConeOfLeft : PullbackCone f g := by
  refine' PullbackCone.mk _
      (Y.ofRestrict (TopCat.snd_openEmbedding_of_left_openEmbedding H.base_open g.1.base)) _
  · use PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.1 g.1
    

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

Next tactic:
intro x
/-- An explicit pullback cone over `cospan f g` if `f` is an open immersion. -/
def pullbackConeOfLeft : PullbackCone f g := by
  refine' PullbackCone.mk _
      (Y.ofRestrict (TopCat.snd_openEmbedding_of_left_openEmbedding H.base_open g.1.base)) _
  · use PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.1 g.1
    intro x
    

Proof state:
case prop
C : Type u_1
inst✝ : Category.{?u.488555, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
x : ↑↑(restrict Y (_ : OpenEmbedding ⇑pullback.snd)).toSheafedSpace.toPresheafedSpace
⊢ IsLocalRingHom (PresheafedSpace.stalkMap (PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val) x)

Next tactic:
have := PresheafedSpace.stalkMap.congr_hom _ _
        (PresheafedSpace.IsOpenImmersion.pullback_cone_of_left_condition f.1 g.1) x
/-- An explicit pullback cone over `cospan f g` if `f` is an open immersion. -/
def pullbackConeOfLeft : PullbackCone f g := by
  refine' PullbackCone.mk _
      (Y.ofRestrict (TopCat.snd_openEmbedding_of_left_openEmbedding H.base_open g.1.base)) _
  · use PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.1 g.1
    intro x
    have := PresheafedSpace.stalkMap.congr_hom _ _
        (PresheafedSpace.IsOpenImmersion.pullback_cone_of_left_condition f.1 g.1) x
    

Proof state:
case prop
C : Type u_1
inst✝ : Category.{?u.488555, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
x : ↑↑(restrict Y (_ : OpenEmbedding ⇑pullback.snd)).toSheafedSpace.toPresheafedSpace
this :
  PresheafedSpace.stalkMap (PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val ≫ f.val) x =
    eqToHom
        (_ :
          PresheafedSpace.stalk Z.toPresheafedSpace
              ((PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val ≫ f.val).base x) =
            PresheafedSpace.stalk Z.toPresheafedSpace
              ((PresheafedSpace.ofRestrict Y.toPresheafedSpace (_ : OpenEmbedding ⇑pullback.snd) ≫ g.val).base x)) ≫
      PresheafedSpace.stalkMap
        (PresheafedSpace.ofRestrict Y.toPresheafedSpace (_ : OpenEmbedding ⇑pullback.snd) ≫ g.val) x
⊢ IsLocalRingHom (PresheafedSpace.stalkMap (PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val) x)

Next tactic:
rw [PresheafedSpace.stalkMap.comp, PresheafedSpace.stalkMap.comp] at this
/-- An explicit pullback cone over `cospan f g` if `f` is an open immersion. -/
def pullbackConeOfLeft : PullbackCone f g := by
  refine' PullbackCone.mk _
      (Y.ofRestrict (TopCat.snd_openEmbedding_of_left_openEmbedding H.base_open g.1.base)) _
  · use PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.1 g.1
    intro x
    have := PresheafedSpace.stalkMap.congr_hom _ _
        (PresheafedSpace.IsOpenImmersion.pullback_cone_of_left_condition f.1 g.1) x
    rw [PresheafedSpace.stalkMap.comp, PresheafedSpace.stalkMap.comp] at this
    

Proof state:
case prop
C : Type u_1
inst✝ : Category.{?u.488555, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
x : ↑↑(restrict Y (_ : OpenEmbedding ⇑pullback.snd)).toSheafedSpace.toPresheafedSpace
this :
  PresheafedSpace.stalkMap f.val ((PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val).base x) ≫
      PresheafedSpace.stalkMap (PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val) x =
    eqToHom
        (_ :
          PresheafedSpace.stalk Z.toPresheafedSpace
              ((PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val ≫ f.val).base x) =
            PresheafedSpace.stalk Z.toPresheafedSpace
              ((PresheafedSpace.ofRestrict Y.toPresheafedSpace (_ : OpenEmbedding ⇑pullback.snd) ≫ g.val).base x)) ≫
      PresheafedSpace.stalkMap g.val
          ((PresheafedSpace.ofRestrict Y.toPresheafedSpace (_ : OpenEmbedding ⇑pullback.snd)).base x) ≫
        PresheafedSpace.stalkMap (PresheafedSpace.ofRestrict Y.toPresheafedSpace (_ : OpenEmbedding ⇑pullback.snd)) x
⊢ IsLocalRingHom (PresheafedSpace.stalkMap (PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val) x)

Next tactic:
rw [← IsIso.eq_inv_comp] at this
/-- An explicit pullback cone over `cospan f g` if `f` is an open immersion. -/
def pullbackConeOfLeft : PullbackCone f g := by
  refine' PullbackCone.mk _
      (Y.ofRestrict (TopCat.snd_openEmbedding_of_left_openEmbedding H.base_open g.1.base)) _
  · use PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.1 g.1
    intro x
    have := PresheafedSpace.stalkMap.congr_hom _ _
        (PresheafedSpace.IsOpenImmersion.pullback_cone_of_left_condition f.1 g.1) x
    rw [PresheafedSpace.stalkMap.comp, PresheafedSpace.stalkMap.comp] at this
    rw [← IsIso.eq_inv_comp] at this
    

Proof state:
case prop
C : Type u_1
inst✝ : Category.{?u.488555, u_1} C
X Y Z : LocallyRingedSpace
f : X ⟶ Z
g : Y ⟶ Z
H : IsOpenImmersion f
x : ↑↑(restrict Y (_ : OpenEmbedding ⇑pullback.snd)).toSheafedSpace.toPresheafedSpace
this :
  PresheafedSpace.stalkMap (PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val) x =
    inv (PresheafedSpace.stalkMap f.val ((PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val).base x)) ≫
      eqToHom
          (_ :
            PresheafedSpace.stalk Z.toPresheafedSpace
                ((PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val ≫ f.val).base x) =
              PresheafedSpace.stalk Z.toPresheafedSpace
                ((PresheafedSpace.ofRestrict Y.toPresheafedSpace (_ : OpenEmbedding ⇑pullback.snd) ≫ g.val).base x)) ≫
        PresheafedSpace.stalkMap g.val
            ((PresheafedSpace.ofRestrict Y.toPresheafedSpace (_ : OpenEmbedding ⇑pullback.snd)).base x) ≫
          PresheafedSpace.stalkMap (PresheafedSpace.ofRestrict Y.toPresheafedSpace (_ : OpenEmbedding ⇑pullback.snd)) x
⊢ IsLocalRingHom (PresheafedSpace.stalkMap (PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftFst f.val g.val) x)

Next tactic:
rw [this]