l3lab/ntp-mathlib huggingface dataset:
/-- An open immersion is an iso if the underlying continuous map is epi. -/
theorem to_iso (f : X ⟶ Y) [h : IsOpenImmersion f] [h' : Epi f.base] : IsIso f := by
  -- Porting Note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : ∀ (U : (Opens Y)ᵒᵖ), IsIso (f.c.app U)
  · intro U
    have : U = op (h.openFunctor.obj ((Opens.map f.base).obj (unop U))) := by
      induction U using Opposite.rec' with | h U => ?_
      

Proof state:
case h
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
f✝ : X ⟶ Y
H : IsOpenImmersion f✝
f : X ⟶ Y
h : IsOpenImmersion f
h' : Epi f.base
U : Opens ↑↑Y
⊢ op U = op ((openFunctor h).obj ((Opens.map f.base).obj (op U).unop))

Next tactic:
cases U
/-- An open immersion is an iso if the underlying continuous map is epi. -/
theorem to_iso (f : X ⟶ Y) [h : IsOpenImmersion f] [h' : Epi f.base] : IsIso f := by
  -- Porting Note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : ∀ (U : (Opens Y)ᵒᵖ), IsIso (f.c.app U)
  · intro U
    have : U = op (h.openFunctor.obj ((Opens.map f.base).obj (unop U))) := by
      induction U using Opposite.rec' with | h U => ?_
      cases U
      

Proof state:
case h.mk
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
f✝ : X ⟶ Y
H : IsOpenImmersion f✝
f : X ⟶ Y
h : IsOpenImmersion f
h' : Epi f.base
carrier✝ : Set ↑↑Y
is_open'✝ : IsOpen carrier✝
⊢ op { carrier := carrier✝, is_open' := is_open'✝ } =
    op ((openFunctor h).obj ((Opens.map f.base).obj (op { carrier := carrier✝, is_open' := is_open'✝ }).unop))

Next tactic:
dsimp only [Functor.op, Opens.map]
/-- An open immersion is an iso if the underlying continuous map is epi. -/
theorem to_iso (f : X ⟶ Y) [h : IsOpenImmersion f] [h' : Epi f.base] : IsIso f := by
  -- Porting Note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : ∀ (U : (Opens Y)ᵒᵖ), IsIso (f.c.app U)
  · intro U
    have : U = op (h.openFunctor.obj ((Opens.map f.base).obj (unop U))) := by
      induction U using Opposite.rec' with | h U => ?_
      cases U
      dsimp only [Functor.op, Opens.map]
      

Proof state:
case h.mk
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
f✝ : X ⟶ Y
H : IsOpenImmersion f✝
f : X ⟶ Y
h : IsOpenImmersion f
h' : Epi f.base
carrier✝ : Set ↑↑Y
is_open'✝ : IsOpen carrier✝
⊢ op { carrier := carrier✝, is_open' := is_open'✝ } =
    op
      ((openFunctor h).obj
        { carrier := ⇑f.base ⁻¹' ↑(op { carrier := carrier✝, is_open' := is_open'✝ }).unop,
          is_open' := (_ : IsOpen (⇑f.base ⁻¹' ↑(op { carrier := carrier✝, is_open' := is_open'✝ }).unop)) })

Next tactic:
congr
/-- An open immersion is an iso if the underlying continuous map is epi. -/
theorem to_iso (f : X ⟶ Y) [h : IsOpenImmersion f] [h' : Epi f.base] : IsIso f := by
  -- Porting Note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : ∀ (U : (Opens Y)ᵒᵖ), IsIso (f.c.app U)
  · intro U
    have : U = op (h.openFunctor.obj ((Opens.map f.base).obj (unop U))) := by
      induction U using Opposite.rec' with | h U => ?_
      cases U
      dsimp only [Functor.op, Opens.map]
      congr
      

Proof state:
case h.mk.e_x.e_carrier
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
f✝ : X ⟶ Y
H : IsOpenImmersion f✝
f : X ⟶ Y
h : IsOpenImmersion f
h' : Epi f.base
carrier✝ : Set ↑↑Y
is_open'✝ : IsOpen carrier✝
⊢ carrier✝ =
    ⇑f.base ''
      ↑{ carrier := ⇑f.base ⁻¹' ↑(op { carrier := carrier✝, is_open' := is_open'✝ }).unop,
          is_open' := (_ : IsOpen (⇑f.base ⁻¹' ↑(op { carrier := carrier✝, is_open' := is_open'✝ }).unop)) }

Next tactic:
exact (Set.image_preimage_eq _ ((TopCat.epi_iff_surjective _).mp h')).symm
/-- An open immersion is an iso if the underlying continuous map is epi. -/
theorem to_iso (f : X ⟶ Y) [h : IsOpenImmersion f] [h' : Epi f.base] : IsIso f := by
  -- Porting Note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : ∀ (U : (Opens Y)ᵒᵖ), IsIso (f.c.app U)
  · intro U
    have : U = op (h.openFunctor.obj ((Opens.map f.base).obj (unop U))) := by
      induction U using Opposite.rec' with | h U => ?_
      cases U
      dsimp only [Functor.op, Opens.map]
      congr
      exact (Set.image_preimage_eq _ ((TopCat.epi_iff_surjective _).mp h')).symm
    

Proof state:
case this
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
f✝ : X ⟶ Y
H : IsOpenImmersion f✝
f : X ⟶ Y
h : IsOpenImmersion f
h' : Epi f.base
U : (Opens ↑↑Y)ᵒᵖ
this : U = op ((openFunctor h).obj ((Opens.map f.base).obj U.unop))
⊢ IsIso (f.c.app U)

Next tactic:
convert @IsOpenImmersion.c_iso _ _ _ _ _ h ((Opens.map f.base).obj (unop U))
/-- An open immersion is an iso if the underlying continuous map is epi. -/
theorem to_iso (f : X ⟶ Y) [h : IsOpenImmersion f] [h' : Epi f.base] : IsIso f := by
  -- Porting Note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : ∀ (U : (Opens Y)ᵒᵖ), IsIso (f.c.app U)
  · intro U
    have : U = op (h.openFunctor.obj ((Opens.map f.base).obj (unop U))) := by
      induction U using Opposite.rec' with | h U => ?_
      cases U
      dsimp only [Functor.op, Opens.map]
      congr
      exact (Set.image_preimage_eq _ ((TopCat.epi_iff_surjective _).mp h')).symm
    convert @IsOpenImmersion.c_iso _ _ _ _ _ h ((Opens.map f.base).obj (unop U))
  

Proof state:
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
f✝ : X ⟶ Y
H : IsOpenImmersion f✝
f : X ⟶ Y
h : IsOpenImmersion f
h' : Epi f.base
this : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
⊢ IsIso f

Next tactic:
have : IsIso f.base
/-- An open immersion is an iso if the underlying continuous map is epi. -/
theorem to_iso (f : X ⟶ Y) [h : IsOpenImmersion f] [h' : Epi f.base] : IsIso f := by
  -- Porting Note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : ∀ (U : (Opens Y)ᵒᵖ), IsIso (f.c.app U)
  · intro U
    have : U = op (h.openFunctor.obj ((Opens.map f.base).obj (unop U))) := by
      induction U using Opposite.rec' with | h U => ?_
      cases U
      dsimp only [Functor.op, Opens.map]
      congr
      exact (Set.image_preimage_eq _ ((TopCat.epi_iff_surjective _).mp h')).symm
    convert @IsOpenImmersion.c_iso _ _ _ _ _ h ((Opens.map f.base).obj (unop U))
  have : IsIso f.base
  · 

Proof state:
case this
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
f✝ : X ⟶ Y
H : IsOpenImmersion f✝
f : X ⟶ Y
h : IsOpenImmersion f
h' : Epi f.base
this : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
⊢ IsIso f.base

Next tactic:
let t : X ≃ₜ Y :=
      (Homeomorph.ofEmbedding _ h.base_open.toEmbedding).trans
        { toFun := Subtype.val
          invFun := fun x =>
            ⟨x, by rw [Set.range_iff_surjective.mpr ((TopCat.epi_iff_surjective _).mp h')]; trivial⟩
          left_inv := fun ⟨_, _⟩ => rfl
          right_inv := fun _ => rfl }
/-- An open immersion is an iso if the underlying continuous map is epi. -/
theorem to_iso (f : X ⟶ Y) [h : IsOpenImmersion f] [h' : Epi f.base] : IsIso f := by
  -- Porting Note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : ∀ (U : (Opens Y)ᵒᵖ), IsIso (f.c.app U)
  · intro U
    have : U = op (h.openFunctor.obj ((Opens.map f.base).obj (unop U))) := by
      induction U using Opposite.rec' with | h U => ?_
      cases U
      dsimp only [Functor.op, Opens.map]
      congr
      exact (Set.image_preimage_eq _ ((TopCat.epi_iff_surjective _).mp h')).symm
    convert @IsOpenImmersion.c_iso _ _ _ _ _ h ((Opens.map f.base).obj (unop U))
  have : IsIso f.base
  · let t : X ≃ₜ Y :=
      (Homeomorph.ofEmbedding _ h.base_open.toEmbedding).trans
        { toFun := Subtype.val
          invFun := fun x =>
            ⟨x, by 

Proof state:
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
f✝ : X ⟶ Y
H : IsOpenImmersion f✝
f : X ⟶ Y
h : IsOpenImmersion f
h' : Epi f.base
this : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
x : ↑↑Y
⊢ x ∈ Set.range ⇑f.base

Next tactic:
rw [Set.range_iff_surjective.mpr ((TopCat.epi_iff_surjective _).mp h')]
/-- An open immersion is an iso if the underlying continuous map is epi. -/
theorem to_iso (f : X ⟶ Y) [h : IsOpenImmersion f] [h' : Epi f.base] : IsIso f := by
  -- Porting Note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : ∀ (U : (Opens Y)ᵒᵖ), IsIso (f.c.app U)
  · intro U
    have : U = op (h.openFunctor.obj ((Opens.map f.base).obj (unop U))) := by
      induction U using Opposite.rec' with | h U => ?_
      cases U
      dsimp only [Functor.op, Opens.map]
      congr
      exact (Set.image_preimage_eq _ ((TopCat.epi_iff_surjective _).mp h')).symm
    convert @IsOpenImmersion.c_iso _ _ _ _ _ h ((Opens.map f.base).obj (unop U))
  have : IsIso f.base
  · let t : X ≃ₜ Y :=
      (Homeomorph.ofEmbedding _ h.base_open.toEmbedding).trans
        { toFun := Subtype.val
          invFun := fun x =>
            ⟨x, by rw [Set.range_iff_surjective.mpr ((TopCat.epi_iff_surjective _).mp h')]; 

Proof state:
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
f✝ : X ⟶ Y
H : IsOpenImmersion f✝
f : X ⟶ Y
h : IsOpenImmersion f
h' : Epi f.base
this : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
x : ↑↑Y
⊢ x ∈ Set.univ

Next tactic:
trivial
/-- An open immersion is an iso if the underlying continuous map is epi. -/
theorem to_iso (f : X ⟶ Y) [h : IsOpenImmersion f] [h' : Epi f.base] : IsIso f := by
  -- Porting Note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : ∀ (U : (Opens Y)ᵒᵖ), IsIso (f.c.app U)
  · intro U
    have : U = op (h.openFunctor.obj ((Opens.map f.base).obj (unop U))) := by
      induction U using Opposite.rec' with | h U => ?_
      cases U
      dsimp only [Functor.op, Opens.map]
      congr
      exact (Set.image_preimage_eq _ ((TopCat.epi_iff_surjective _).mp h')).symm
    convert @IsOpenImmersion.c_iso _ _ _ _ _ h ((Opens.map f.base).obj (unop U))
  have : IsIso f.base
  · let t : X ≃ₜ Y :=
      (Homeomorph.ofEmbedding _ h.base_open.toEmbedding).trans
        { toFun := Subtype.val
          invFun := fun x =>
            ⟨x, by rw [Set.range_iff_surjective.mpr ((TopCat.epi_iff_surjective _).mp h')]; trivial⟩
          left_inv := fun ⟨_, _⟩ => rfl
          right_inv := fun _ => rfl }
    

Proof state:
case this
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
f✝ : X ⟶ Y
H : IsOpenImmersion f✝
f : X ⟶ Y
h : IsOpenImmersion f
h' : Epi f.base
this : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
t : ↑↑X ≃ₜ ↑↑Y :=
  Homeomorph.trans (Homeomorph.ofEmbedding ⇑f.base (_ : Embedding ⇑f.base))
    (Homeomorph.mk
      { toFun := Subtype.val, invFun := fun x => { val := x, property := (_ : x ∈ Set.range ⇑f.base) },
        left_inv :=
          (_ : ∀ (x : ↑(Set.range ⇑f.base)), (fun x => { val := x, property := (_ : x ∈ Set.range ⇑f.base) }) ↑x = x),
        right_inv :=
          (_ :
            ∀ (x : ↑↑Y),
              ↑((fun x => { val := x, property := (_ : x ∈ Set.range ⇑f.base) }) x) =
                ↑((fun x => { val := x, property := (_ : x ∈ Set.range ⇑f.base) }) x)) })
⊢ IsIso f.base

Next tactic:
convert IsIso.of_iso (TopCat.isoOfHomeo t)
/-- An open immersion is an iso if the underlying continuous map is epi. -/
theorem to_iso (f : X ⟶ Y) [h : IsOpenImmersion f] [h' : Epi f.base] : IsIso f := by
  -- Porting Note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : ∀ (U : (Opens Y)ᵒᵖ), IsIso (f.c.app U)
  · intro U
    have : U = op (h.openFunctor.obj ((Opens.map f.base).obj (unop U))) := by
      induction U using Opposite.rec' with | h U => ?_
      cases U
      dsimp only [Functor.op, Opens.map]
      congr
      exact (Set.image_preimage_eq _ ((TopCat.epi_iff_surjective _).mp h')).symm
    convert @IsOpenImmersion.c_iso _ _ _ _ _ h ((Opens.map f.base).obj (unop U))
  have : IsIso f.base
  · let t : X ≃ₜ Y :=
      (Homeomorph.ofEmbedding _ h.base_open.toEmbedding).trans
        { toFun := Subtype.val
          invFun := fun x =>
            ⟨x, by rw [Set.range_iff_surjective.mpr ((TopCat.epi_iff_surjective _).mp h')]; trivial⟩
          left_inv := fun ⟨_, _⟩ => rfl
          right_inv := fun _ => rfl }
    convert IsIso.of_iso (TopCat.isoOfHomeo t)
  

Proof state:
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
f✝ : X ⟶ Y
H : IsOpenImmersion f✝
f : X ⟶ Y
h : IsOpenImmersion f
h' : Epi f.base
this✝ : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
this : IsIso f.base
⊢ IsIso f

Next tactic:
have : IsIso f.c := by apply NatIso.isIso_of_isIso_app
/-- An open immersion is an iso if the underlying continuous map is epi. -/
theorem to_iso (f : X ⟶ Y) [h : IsOpenImmersion f] [h' : Epi f.base] : IsIso f := by
  -- Porting Note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : ∀ (U : (Opens Y)ᵒᵖ), IsIso (f.c.app U)
  · intro U
    have : U = op (h.openFunctor.obj ((Opens.map f.base).obj (unop U))) := by
      induction U using Opposite.rec' with | h U => ?_
      cases U
      dsimp only [Functor.op, Opens.map]
      congr
      exact (Set.image_preimage_eq _ ((TopCat.epi_iff_surjective _).mp h')).symm
    convert @IsOpenImmersion.c_iso _ _ _ _ _ h ((Opens.map f.base).obj (unop U))
  have : IsIso f.base
  · let t : X ≃ₜ Y :=
      (Homeomorph.ofEmbedding _ h.base_open.toEmbedding).trans
        { toFun := Subtype.val
          invFun := fun x =>
            ⟨x, by rw [Set.range_iff_surjective.mpr ((TopCat.epi_iff_surjective _).mp h')]; trivial⟩
          left_inv := fun ⟨_, _⟩ => rfl
          right_inv := fun _ => rfl }
    convert IsIso.of_iso (TopCat.isoOfHomeo t)
  have : IsIso f.c := by 

Proof state:
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
f✝ : X ⟶ Y
H : IsOpenImmersion f✝
f : X ⟶ Y
h : IsOpenImmersion f
h' : Epi f.base
this✝ : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
this : IsIso f.base
⊢ IsIso f.c

Next tactic:
apply NatIso.isIso_of_isIso_app
/-- An open immersion is an iso if the underlying continuous map is epi. -/
theorem to_iso (f : X ⟶ Y) [h : IsOpenImmersion f] [h' : Epi f.base] : IsIso f := by
  -- Porting Note : was `apply (config := { instances := False }) ...`
  -- See https://github.com/leanprover/lean4/issues/2273
  have : ∀ (U : (Opens Y)ᵒᵖ), IsIso (f.c.app U)
  · intro U
    have : U = op (h.openFunctor.obj ((Opens.map f.base).obj (unop U))) := by
      induction U using Opposite.rec' with | h U => ?_
      cases U
      dsimp only [Functor.op, Opens.map]
      congr
      exact (Set.image_preimage_eq _ ((TopCat.epi_iff_surjective _).mp h')).symm
    convert @IsOpenImmersion.c_iso _ _ _ _ _ h ((Opens.map f.base).obj (unop U))
  have : IsIso f.base
  · let t : X ≃ₜ Y :=
      (Homeomorph.ofEmbedding _ h.base_open.toEmbedding).trans
        { toFun := Subtype.val
          invFun := fun x =>
            ⟨x, by rw [Set.range_iff_surjective.mpr ((TopCat.epi_iff_surjective _).mp h')]; trivial⟩
          left_inv := fun ⟨_, _⟩ => rfl
          right_inv := fun _ => rfl }
    convert IsIso.of_iso (TopCat.isoOfHomeo t)
  have : IsIso f.c := by apply NatIso.isIso_of_isIso_app
  

Proof state:
C : Type u_1
inst✝ : Category.{u_2, u_1} C
X Y : PresheafedSpace C
f✝ : X ⟶ Y
H : IsOpenImmersion f✝
f : X ⟶ Y
h : IsOpenImmersion f
h' : Epi f.base
this✝¹ : ∀ (U : (Opens ↑↑Y)ᵒᵖ), IsIso (f.c.app U)
this✝ : IsIso f.base
this : IsIso f.c
⊢ IsIso f

Next tactic:
apply isIso_of_components
instance stalk_iso [HasColimits C] [H : IsOpenImmersion f] (x : X) : IsIso (stalkMap f x) := by
  

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.89625, u_1} C
X Y : PresheafedSpace C
f : X ⟶ Y
H✝ : IsOpenImmersion f
inst✝ : HasColimits C
H : IsOpenImmersion f
x : ↑↑X
⊢ IsIso (stalkMap f x)

Next tactic:
rw [← H.isoRestrict_hom_ofRestrict]
instance stalk_iso [HasColimits C] [H : IsOpenImmersion f] (x : X) : IsIso (stalkMap f x) := by
  rw [← H.isoRestrict_hom_ofRestrict]
  

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.89625, u_1} C
X Y : PresheafedSpace C
f : X ⟶ Y
H✝ : IsOpenImmersion f
inst✝ : HasColimits C
H : IsOpenImmersion f
x : ↑↑X
⊢ IsIso (stalkMap ((isoRestrict H).hom ≫ PresheafedSpace.ofRestrict Y (_ : OpenEmbedding ⇑f.base)) x)

Next tactic:
rw [PresheafedSpace.stalkMap.comp]
instance stalk_iso [HasColimits C] [H : IsOpenImmersion f] (x : X) : IsIso (stalkMap f x) := by
  rw [← H.isoRestrict_hom_ofRestrict]
  rw [PresheafedSpace.stalkMap.comp]
  

Proof state:
C : Type u_1
inst✝¹ : Category.{?u.89625, u_1} C
X Y : PresheafedSpace C
f : X ⟶ Y
H✝ : IsOpenImmersion f
inst✝ : HasColimits C
H : IsOpenImmersion f
x : ↑↑X
⊢ IsIso
    (stalkMap (PresheafedSpace.ofRestrict Y (_ : OpenEmbedding ⇑f.base)) ((isoRestrict H).hom.base x) ≫
      stalkMap (isoRestrict H).hom x)

Next tactic:
infer_instance
/-- (Implementation.) The projection map when constructing the pullback along an open immersion.
-/
def pullbackConeOfLeftFst :
    Y.restrict (TopCat.snd_openEmbedding_of_left_openEmbedding hf.base_open g.base) ⟶ X where
  base := pullback.fst
  c :=
    { app := fun U =>
        hf.invApp (unop U) ≫
          g.c.app (op (hf.base_open.isOpenMap.functor.obj (unop U))) ≫
            Y.presheaf.map
              (eqToHom
                (by
                  

Proof state:
C : Type u_1
inst✝ : Category.{?u.91544, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
U : (Opens ↑↑X)ᵒᵖ
⊢ (Opens.map g.base).op.obj (op ((IsOpenMap.functor (_ : IsOpenMap ⇑f.base)).obj U.unop)) =
    (IsOpenMap.functor (_ : IsOpenMap ⇑pullback.snd)).op.obj ((Opens.map pullback.fst).op.obj U)

Next tactic:
simp only [IsOpenMap.functor, Subtype.mk_eq_mk, unop_op, op_inj_iff, Opens.map,
                    Subtype.coe_mk, Functor.op_obj]
/-- (Implementation.) The projection map when constructing the pullback along an open immersion.
-/
def pullbackConeOfLeftFst :
    Y.restrict (TopCat.snd_openEmbedding_of_left_openEmbedding hf.base_open g.base) ⟶ X where
  base := pullback.fst
  c :=
    { app := fun U =>
        hf.invApp (unop U) ≫
          g.c.app (op (hf.base_open.isOpenMap.functor.obj (unop U))) ≫
            Y.presheaf.map
              (eqToHom
                (by
                  simp only [IsOpenMap.functor, Subtype.mk_eq_mk, unop_op, op_inj_iff, Opens.map,
                    Subtype.coe_mk, Functor.op_obj]
                  

Proof state:
C : Type u_1
inst✝ : Category.{?u.91544, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
U : (Opens ↑↑X)ᵒᵖ
⊢ { carrier := ⇑g.base ⁻¹' ↑{ carrier := ⇑f.base '' ↑U.unop, is_open' := (_ : IsOpen (⇑f.base '' ↑U.unop)) },
      is_open' :=
        (_ : IsOpen (⇑g.base ⁻¹' ↑{ carrier := ⇑f.base '' ↑U.unop, is_open' := (_ : IsOpen (⇑f.base '' ↑U.unop)) })) } =
    {
      carrier :=
        ⇑pullback.snd ''
          ↑{ carrier := ⇑pullback.fst ⁻¹' ↑U.unop, is_open' := (_ : IsOpen (⇑pullback.fst ⁻¹' ↑U.unop)) },
      is_open' :=
        (_ :
          IsOpen
            (⇑pullback.snd ''
              ↑{ carrier := ⇑pullback.fst ⁻¹' ↑U.unop, is_open' := (_ : IsOpen (⇑pullback.fst ⁻¹' ↑U.unop)) })) }

Next tactic:
apply LE.le.antisymm
/-- (Implementation.) The projection map when constructing the pullback along an open immersion.
-/
def pullbackConeOfLeftFst :
    Y.restrict (TopCat.snd_openEmbedding_of_left_openEmbedding hf.base_open g.base) ⟶ X where
  base := pullback.fst
  c :=
    { app := fun U =>
        hf.invApp (unop U) ≫
          g.c.app (op (hf.base_open.isOpenMap.functor.obj (unop U))) ≫
            Y.presheaf.map
              (eqToHom
                (by
                  simp only [IsOpenMap.functor, Subtype.mk_eq_mk, unop_op, op_inj_iff, Opens.map,
                    Subtype.coe_mk, Functor.op_obj]
                  apply LE.le.antisymm
                  · 

Proof state:
case a
C : Type u_1
inst✝ : Category.{?u.91544, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
U : (Opens ↑↑X)ᵒᵖ
⊢ { carrier := ⇑g.base ⁻¹' ↑{ carrier := ⇑f.base '' ↑U.unop, is_open' := (_ : IsOpen (⇑f.base '' ↑U.unop)) },
      is_open' :=
        (_ : IsOpen (⇑g.base ⁻¹' ↑{ carrier := ⇑f.base '' ↑U.unop, is_open' := (_ : IsOpen (⇑f.base '' ↑U.unop)) })) } ≤
    {
      carrier :=
        ⇑pullback.snd ''
          ↑{ carrier := ⇑pullback.fst ⁻¹' ↑U.unop, is_open' := (_ : IsOpen (⇑pullback.fst ⁻¹' ↑U.unop)) },
      is_open' :=
        (_ :
          IsOpen
            (⇑pullback.snd ''
              ↑{ carrier := ⇑pullback.fst ⁻¹' ↑U.unop, is_open' := (_ : IsOpen (⇑pullback.fst ⁻¹' ↑U.unop)) })) }

Next tactic:
rintro _ ⟨_, h₁, h₂⟩
/-- (Implementation.) The projection map when constructing the pullback along an open immersion.
-/
def pullbackConeOfLeftFst :
    Y.restrict (TopCat.snd_openEmbedding_of_left_openEmbedding hf.base_open g.base) ⟶ X where
  base := pullback.fst
  c :=
    { app := fun U =>
        hf.invApp (unop U) ≫
          g.c.app (op (hf.base_open.isOpenMap.functor.obj (unop U))) ≫
            Y.presheaf.map
              (eqToHom
                (by
                  simp only [IsOpenMap.functor, Subtype.mk_eq_mk, unop_op, op_inj_iff, Opens.map,
                    Subtype.coe_mk, Functor.op_obj]
                  apply LE.le.antisymm
                  · rintro _ ⟨_, h₁, h₂⟩
                    

Proof state:
case a.intro.intro
C : Type u_1
inst✝ : Category.{?u.91544, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
U : (Opens ↑↑X)ᵒᵖ
a✝ : ↑↑Y
w✝ : (CategoryTheory.forget TopCat).obj ↑X
h₁ : w✝ ∈ ↑U.unop
h₂ : f.base w✝ = g.base a✝
⊢ a✝ ∈
    ↑{
        carrier :=
          ⇑pullback.snd ''
            ↑{ carrier := ⇑pullback.fst ⁻¹' ↑U.unop, is_open' := (_ : IsOpen (⇑pullback.fst ⁻¹' ↑U.unop)) },
        is_open' :=
          (_ :
            IsOpen
              (⇑pullback.snd ''
                ↑{ carrier := ⇑pullback.fst ⁻¹' ↑U.unop, is_open' := (_ : IsOpen (⇑pullback.fst ⁻¹' ↑U.unop)) })) }

Next tactic:
use (TopCat.pullbackIsoProdSubtype _ _).inv ⟨⟨_, _⟩, h₂⟩
/-- (Implementation.) The projection map when constructing the pullback along an open immersion.
-/
def pullbackConeOfLeftFst :
    Y.restrict (TopCat.snd_openEmbedding_of_left_openEmbedding hf.base_open g.base) ⟶ X where
  base := pullback.fst
  c :=
    { app := fun U =>
        hf.invApp (unop U) ≫
          g.c.app (op (hf.base_open.isOpenMap.functor.obj (unop U))) ≫
            Y.presheaf.map
              (eqToHom
                (by
                  simp only [IsOpenMap.functor, Subtype.mk_eq_mk, unop_op, op_inj_iff, Opens.map,
                    Subtype.coe_mk, Functor.op_obj]
                  apply LE.le.antisymm
                  · rintro _ ⟨_, h₁, h₂⟩
                    use (TopCat.pullbackIsoProdSubtype _ _).inv ⟨⟨_, _⟩, h₂⟩
                    -- Porting note : need a slight hand holding
                    

Proof state:
case h
C : Type u_1
inst✝ : Category.{?u.91544, u_1} C
X Y Z : PresheafedSpace C
f : X ⟶ Z
hf : IsOpenImmersion f
g : Y ⟶ Z
U : (Opens ↑↑X)ᵒᵖ
a✝ : ↑↑Y
w✝ : (CategoryTheory.forget TopCat).obj ↑X
h₁ : w✝ ∈ ↑U.unop
h₂ : f.base w✝ = g.base a✝
⊢ (TopCat.pullbackIsoProdSubtype f.base g.base).inv { val := (w✝, a✝), property := h₂ } ∈
      ↑{ carrier := ⇑pullback.fst ⁻¹' ↑U.unop, is_open' := (_ : IsOpen (⇑pullback.fst ⁻¹' ↑U.unop)) } ∧
    pullback.snd ((TopCat.pullbackIsoProdSubtype f.base g.base).inv { val := (w✝, a✝), property := h₂ }) = a✝

Next tactic:
change _ ∈ _ ⁻¹' _ ∧ _