l3lab/ntp-mathlib huggingface dataset:
/--
The pullback of a morphism `f` and an open embedding `i` in `Stonean`, constructed explicitly as
the preimage under `f`of the image of `i` with the subspace topology.
-/
def pullback : Stonean where
  compHaus := {
    toTop := TopCat.of (f ⁻¹' (Set.range i))
    is_compact := by
      dsimp [TopCat.of]
      rw [← isCompact_iff_compactSpace]
      refine IsClosed.isCompact (IsClosed.preimage f.continuous (IsCompact.isClosed ?_))
      simp only [← Set.image_univ]
      exact IsCompact.image isCompact_univ i.continuous
    is_hausdorff := by
      dsimp [TopCat.of]
      exact inferInstance }
  extrDisc := by
    constructor
    intro U hU
    dsimp at U
    have h : IsClopen (f ⁻¹' (Set.range i))
    · constructor
      · exact IsOpen.preimage f.continuous hi.open_range
      · refine' IsClosed.preimage f.continuous _
        

Proof state:
case h.right
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
U : Set ↑(⇑f ⁻¹' Set.range ⇑i)
hU : IsOpen U
⊢ IsClosed (Set.range ⇑i)

Next tactic:
apply IsCompact.isClosed
/--
The pullback of a morphism `f` and an open embedding `i` in `Stonean`, constructed explicitly as
the preimage under `f`of the image of `i` with the subspace topology.
-/
def pullback : Stonean where
  compHaus := {
    toTop := TopCat.of (f ⁻¹' (Set.range i))
    is_compact := by
      dsimp [TopCat.of]
      rw [← isCompact_iff_compactSpace]
      refine IsClosed.isCompact (IsClosed.preimage f.continuous (IsCompact.isClosed ?_))
      simp only [← Set.image_univ]
      exact IsCompact.image isCompact_univ i.continuous
    is_hausdorff := by
      dsimp [TopCat.of]
      exact inferInstance }
  extrDisc := by
    constructor
    intro U hU
    dsimp at U
    have h : IsClopen (f ⁻¹' (Set.range i))
    · constructor
      · exact IsOpen.preimage f.continuous hi.open_range
      · refine' IsClosed.preimage f.continuous _
        apply IsCompact.isClosed
        

Proof state:
case h.right.hs
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
U : Set ↑(⇑f ⁻¹' Set.range ⇑i)
hU : IsOpen U
⊢ IsCompact (Set.range ⇑i)

Next tactic:
simp only [← Set.image_univ]
/--
The pullback of a morphism `f` and an open embedding `i` in `Stonean`, constructed explicitly as
the preimage under `f`of the image of `i` with the subspace topology.
-/
def pullback : Stonean where
  compHaus := {
    toTop := TopCat.of (f ⁻¹' (Set.range i))
    is_compact := by
      dsimp [TopCat.of]
      rw [← isCompact_iff_compactSpace]
      refine IsClosed.isCompact (IsClosed.preimage f.continuous (IsCompact.isClosed ?_))
      simp only [← Set.image_univ]
      exact IsCompact.image isCompact_univ i.continuous
    is_hausdorff := by
      dsimp [TopCat.of]
      exact inferInstance }
  extrDisc := by
    constructor
    intro U hU
    dsimp at U
    have h : IsClopen (f ⁻¹' (Set.range i))
    · constructor
      · exact IsOpen.preimage f.continuous hi.open_range
      · refine' IsClosed.preimage f.continuous _
        apply IsCompact.isClosed
        simp only [← Set.image_univ]
        

Proof state:
case h.right.hs
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
U : Set ↑(⇑f ⁻¹' Set.range ⇑i)
hU : IsOpen U
⊢ IsCompact (⇑i '' Set.univ)

Next tactic:
exact IsCompact.image isCompact_univ i.continuous
/--
The pullback of a morphism `f` and an open embedding `i` in `Stonean`, constructed explicitly as
the preimage under `f`of the image of `i` with the subspace topology.
-/
def pullback : Stonean where
  compHaus := {
    toTop := TopCat.of (f ⁻¹' (Set.range i))
    is_compact := by
      dsimp [TopCat.of]
      rw [← isCompact_iff_compactSpace]
      refine IsClosed.isCompact (IsClosed.preimage f.continuous (IsCompact.isClosed ?_))
      simp only [← Set.image_univ]
      exact IsCompact.image isCompact_univ i.continuous
    is_hausdorff := by
      dsimp [TopCat.of]
      exact inferInstance }
  extrDisc := by
    constructor
    intro U hU
    dsimp at U
    have h : IsClopen (f ⁻¹' (Set.range i))
    · constructor
      · exact IsOpen.preimage f.continuous hi.open_range
      · refine' IsClosed.preimage f.continuous _
        apply IsCompact.isClosed
        simp only [← Set.image_univ]
        exact IsCompact.image isCompact_univ i.continuous
    

Proof state:
case open_closure
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
U : Set ↑(⇑f ⁻¹' Set.range ⇑i)
hU : IsOpen U
h : IsClopen (⇑f ⁻¹' Set.range ⇑i)
⊢ IsOpen (closure U)

Next tactic:
have hU' : IsOpen (Subtype.val '' U) := h.1.openEmbedding_subtype_val.isOpenMap U hU
/--
The pullback of a morphism `f` and an open embedding `i` in `Stonean`, constructed explicitly as
the preimage under `f`of the image of `i` with the subspace topology.
-/
def pullback : Stonean where
  compHaus := {
    toTop := TopCat.of (f ⁻¹' (Set.range i))
    is_compact := by
      dsimp [TopCat.of]
      rw [← isCompact_iff_compactSpace]
      refine IsClosed.isCompact (IsClosed.preimage f.continuous (IsCompact.isClosed ?_))
      simp only [← Set.image_univ]
      exact IsCompact.image isCompact_univ i.continuous
    is_hausdorff := by
      dsimp [TopCat.of]
      exact inferInstance }
  extrDisc := by
    constructor
    intro U hU
    dsimp at U
    have h : IsClopen (f ⁻¹' (Set.range i))
    · constructor
      · exact IsOpen.preimage f.continuous hi.open_range
      · refine' IsClosed.preimage f.continuous _
        apply IsCompact.isClosed
        simp only [← Set.image_univ]
        exact IsCompact.image isCompact_univ i.continuous
    have hU' : IsOpen (Subtype.val '' U) := h.1.openEmbedding_subtype_val.isOpenMap U hU
    

Proof state:
case open_closure
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
U : Set ↑(⇑f ⁻¹' Set.range ⇑i)
hU : IsOpen U
h : IsClopen (⇑f ⁻¹' Set.range ⇑i)
hU' : IsOpen (Subtype.val '' U)
⊢ IsOpen (closure U)

Next tactic:
have := ExtremallyDisconnected.open_closure _ hU'
/--
The pullback of a morphism `f` and an open embedding `i` in `Stonean`, constructed explicitly as
the preimage under `f`of the image of `i` with the subspace topology.
-/
def pullback : Stonean where
  compHaus := {
    toTop := TopCat.of (f ⁻¹' (Set.range i))
    is_compact := by
      dsimp [TopCat.of]
      rw [← isCompact_iff_compactSpace]
      refine IsClosed.isCompact (IsClosed.preimage f.continuous (IsCompact.isClosed ?_))
      simp only [← Set.image_univ]
      exact IsCompact.image isCompact_univ i.continuous
    is_hausdorff := by
      dsimp [TopCat.of]
      exact inferInstance }
  extrDisc := by
    constructor
    intro U hU
    dsimp at U
    have h : IsClopen (f ⁻¹' (Set.range i))
    · constructor
      · exact IsOpen.preimage f.continuous hi.open_range
      · refine' IsClosed.preimage f.continuous _
        apply IsCompact.isClosed
        simp only [← Set.image_univ]
        exact IsCompact.image isCompact_univ i.continuous
    have hU' : IsOpen (Subtype.val '' U) := h.1.openEmbedding_subtype_val.isOpenMap U hU
    have := ExtremallyDisconnected.open_closure _ hU'
    

Proof state:
case open_closure
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
U : Set ↑(⇑f ⁻¹' Set.range ⇑i)
hU : IsOpen U
h : IsClopen (⇑f ⁻¹' Set.range ⇑i)
hU' : IsOpen (Subtype.val '' U)
this : IsOpen (closure (Subtype.val '' U))
⊢ IsOpen (closure U)

Next tactic:
rw [h.2.closedEmbedding_subtype_val.closure_image_eq U] at this
/--
The pullback of a morphism `f` and an open embedding `i` in `Stonean`, constructed explicitly as
the preimage under `f`of the image of `i` with the subspace topology.
-/
def pullback : Stonean where
  compHaus := {
    toTop := TopCat.of (f ⁻¹' (Set.range i))
    is_compact := by
      dsimp [TopCat.of]
      rw [← isCompact_iff_compactSpace]
      refine IsClosed.isCompact (IsClosed.preimage f.continuous (IsCompact.isClosed ?_))
      simp only [← Set.image_univ]
      exact IsCompact.image isCompact_univ i.continuous
    is_hausdorff := by
      dsimp [TopCat.of]
      exact inferInstance }
  extrDisc := by
    constructor
    intro U hU
    dsimp at U
    have h : IsClopen (f ⁻¹' (Set.range i))
    · constructor
      · exact IsOpen.preimage f.continuous hi.open_range
      · refine' IsClosed.preimage f.continuous _
        apply IsCompact.isClosed
        simp only [← Set.image_univ]
        exact IsCompact.image isCompact_univ i.continuous
    have hU' : IsOpen (Subtype.val '' U) := h.1.openEmbedding_subtype_val.isOpenMap U hU
    have := ExtremallyDisconnected.open_closure _ hU'
    rw [h.2.closedEmbedding_subtype_val.closure_image_eq U] at this
    

Proof state:
case open_closure
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
U : Set ↑(⇑f ⁻¹' Set.range ⇑i)
hU : IsOpen U
h : IsClopen (⇑f ⁻¹' Set.range ⇑i)
hU' : IsOpen (Subtype.val '' U)
this : IsOpen (Subtype.val '' closure U)
⊢ IsOpen (closure U)

Next tactic:
suffices hhU : closure U = Subtype.val ⁻¹' (Subtype.val '' (closure U))
/--
The pullback of a morphism `f` and an open embedding `i` in `Stonean`, constructed explicitly as
the preimage under `f`of the image of `i` with the subspace topology.
-/
def pullback : Stonean where
  compHaus := {
    toTop := TopCat.of (f ⁻¹' (Set.range i))
    is_compact := by
      dsimp [TopCat.of]
      rw [← isCompact_iff_compactSpace]
      refine IsClosed.isCompact (IsClosed.preimage f.continuous (IsCompact.isClosed ?_))
      simp only [← Set.image_univ]
      exact IsCompact.image isCompact_univ i.continuous
    is_hausdorff := by
      dsimp [TopCat.of]
      exact inferInstance }
  extrDisc := by
    constructor
    intro U hU
    dsimp at U
    have h : IsClopen (f ⁻¹' (Set.range i))
    · constructor
      · exact IsOpen.preimage f.continuous hi.open_range
      · refine' IsClosed.preimage f.continuous _
        apply IsCompact.isClosed
        simp only [← Set.image_univ]
        exact IsCompact.image isCompact_univ i.continuous
    have hU' : IsOpen (Subtype.val '' U) := h.1.openEmbedding_subtype_val.isOpenMap U hU
    have := ExtremallyDisconnected.open_closure _ hU'
    rw [h.2.closedEmbedding_subtype_val.closure_image_eq U] at this
    suffices hhU : closure U = Subtype.val ⁻¹' (Subtype.val '' (closure U))
    · 

Proof state:
case open_closure
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
U : Set ↑(⇑f ⁻¹' Set.range ⇑i)
hU : IsOpen U
h : IsClopen (⇑f ⁻¹' Set.range ⇑i)
hU' : IsOpen (Subtype.val '' U)
this : IsOpen (Subtype.val '' closure U)
hhU : closure U = Subtype.val ⁻¹' (Subtype.val '' closure U)
⊢ IsOpen (closure U)

Next tactic:
rw [hhU]
/--
The pullback of a morphism `f` and an open embedding `i` in `Stonean`, constructed explicitly as
the preimage under `f`of the image of `i` with the subspace topology.
-/
def pullback : Stonean where
  compHaus := {
    toTop := TopCat.of (f ⁻¹' (Set.range i))
    is_compact := by
      dsimp [TopCat.of]
      rw [← isCompact_iff_compactSpace]
      refine IsClosed.isCompact (IsClosed.preimage f.continuous (IsCompact.isClosed ?_))
      simp only [← Set.image_univ]
      exact IsCompact.image isCompact_univ i.continuous
    is_hausdorff := by
      dsimp [TopCat.of]
      exact inferInstance }
  extrDisc := by
    constructor
    intro U hU
    dsimp at U
    have h : IsClopen (f ⁻¹' (Set.range i))
    · constructor
      · exact IsOpen.preimage f.continuous hi.open_range
      · refine' IsClosed.preimage f.continuous _
        apply IsCompact.isClosed
        simp only [← Set.image_univ]
        exact IsCompact.image isCompact_univ i.continuous
    have hU' : IsOpen (Subtype.val '' U) := h.1.openEmbedding_subtype_val.isOpenMap U hU
    have := ExtremallyDisconnected.open_closure _ hU'
    rw [h.2.closedEmbedding_subtype_val.closure_image_eq U] at this
    suffices hhU : closure U = Subtype.val ⁻¹' (Subtype.val '' (closure U))
    · rw [hhU]
      

Proof state:
case open_closure
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
U : Set ↑(⇑f ⁻¹' Set.range ⇑i)
hU : IsOpen U
h : IsClopen (⇑f ⁻¹' Set.range ⇑i)
hU' : IsOpen (Subtype.val '' U)
this : IsOpen (Subtype.val '' closure U)
hhU : closure U = Subtype.val ⁻¹' (Subtype.val '' closure U)
⊢ IsOpen (Subtype.val ⁻¹' (Subtype.val '' closure U))

Next tactic:
exact isOpen_induced this
/--
The pullback of a morphism `f` and an open embedding `i` in `Stonean`, constructed explicitly as
the preimage under `f`of the image of `i` with the subspace topology.
-/
def pullback : Stonean where
  compHaus := {
    toTop := TopCat.of (f ⁻¹' (Set.range i))
    is_compact := by
      dsimp [TopCat.of]
      rw [← isCompact_iff_compactSpace]
      refine IsClosed.isCompact (IsClosed.preimage f.continuous (IsCompact.isClosed ?_))
      simp only [← Set.image_univ]
      exact IsCompact.image isCompact_univ i.continuous
    is_hausdorff := by
      dsimp [TopCat.of]
      exact inferInstance }
  extrDisc := by
    constructor
    intro U hU
    dsimp at U
    have h : IsClopen (f ⁻¹' (Set.range i))
    · constructor
      · exact IsOpen.preimage f.continuous hi.open_range
      · refine' IsClosed.preimage f.continuous _
        apply IsCompact.isClosed
        simp only [← Set.image_univ]
        exact IsCompact.image isCompact_univ i.continuous
    have hU' : IsOpen (Subtype.val '' U) := h.1.openEmbedding_subtype_val.isOpenMap U hU
    have := ExtremallyDisconnected.open_closure _ hU'
    rw [h.2.closedEmbedding_subtype_val.closure_image_eq U] at this
    suffices hhU : closure U = Subtype.val ⁻¹' (Subtype.val '' (closure U))
    · rw [hhU]
      exact isOpen_induced this
    

Proof state:
case hhU
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
U : Set ↑(⇑f ⁻¹' Set.range ⇑i)
hU : IsOpen U
h : IsClopen (⇑f ⁻¹' Set.range ⇑i)
hU' : IsOpen (Subtype.val '' U)
this : IsOpen (Subtype.val '' closure U)
⊢ closure U = Subtype.val ⁻¹' (Subtype.val '' closure U)

Next tactic:
exact ((closure U).preimage_image_eq Subtype.coe_injective).symm
/--
Construct a morphism to the explicit pullback given morphisms to the factors
which are compatible with the maps to the base.
This is essentially the universal property of the pullback.
-/
def pullback.lift {X Y Z W : Stonean} (f : X ⟶ Z) {i : Y ⟶ Z} (hi : OpenEmbedding i)
    (a : W ⟶ X) (b : W ⟶ Y) (w : a ≫ f = b ≫ i) :
    W ⟶ pullback f hi where
  toFun := fun z => ⟨a z, by
    

Proof state:
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
hi✝ : OpenEmbedding ⇑i✝
X Y Z W : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
a : W ⟶ X
b : W ⟶ Y
w : a ≫ f = b ≫ i
z : ↑((fun x => x.compHaus) W).toTop
⊢ a z ∈ ⇑f ⁻¹' Set.range ⇑i

Next tactic:
simp only [Set.mem_preimage]
/--
Construct a morphism to the explicit pullback given morphisms to the factors
which are compatible with the maps to the base.
This is essentially the universal property of the pullback.
-/
def pullback.lift {X Y Z W : Stonean} (f : X ⟶ Z) {i : Y ⟶ Z} (hi : OpenEmbedding i)
    (a : W ⟶ X) (b : W ⟶ Y) (w : a ≫ f = b ≫ i) :
    W ⟶ pullback f hi where
  toFun := fun z => ⟨a z, by
    simp only [Set.mem_preimage]
    

Proof state:
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
hi✝ : OpenEmbedding ⇑i✝
X Y Z W : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
a : W ⟶ X
b : W ⟶ Y
w : a ≫ f = b ≫ i
z : ↑((fun x => x.compHaus) W).toTop
⊢ f (a z) ∈ Set.range ⇑i

Next tactic:
use (b z)
/--
Construct a morphism to the explicit pullback given morphisms to the factors
which are compatible with the maps to the base.
This is essentially the universal property of the pullback.
-/
def pullback.lift {X Y Z W : Stonean} (f : X ⟶ Z) {i : Y ⟶ Z} (hi : OpenEmbedding i)
    (a : W ⟶ X) (b : W ⟶ Y) (w : a ≫ f = b ≫ i) :
    W ⟶ pullback f hi where
  toFun := fun z => ⟨a z, by
    simp only [Set.mem_preimage]
    use (b z)
    

Proof state:
case h
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
hi✝ : OpenEmbedding ⇑i✝
X Y Z W : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
a : W ⟶ X
b : W ⟶ Y
w : a ≫ f = b ≫ i
z : ↑((fun x => x.compHaus) W).toTop
⊢ i (b z) = f (a z)

Next tactic:
exact congr_fun (FunLike.ext'_iff.mp w.symm) z
/--
Construct a morphism to the explicit pullback given morphisms to the factors
which are compatible with the maps to the base.
This is essentially the universal property of the pullback.
-/
def pullback.lift {X Y Z W : Stonean} (f : X ⟶ Z) {i : Y ⟶ Z} (hi : OpenEmbedding i)
    (a : W ⟶ X) (b : W ⟶ Y) (w : a ≫ f = b ≫ i) :
    W ⟶ pullback f hi where
  toFun := fun z => ⟨a z, by
    simp only [Set.mem_preimage]
    use (b z)
    exact congr_fun (FunLike.ext'_iff.mp w.symm) z⟩
  continuous_toFun := by
    

Proof state:
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
hi✝ : OpenEmbedding ⇑i✝
X Y Z W : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
a : W ⟶ X
b : W ⟶ Y
w : a ≫ f = b ≫ i
⊢ Continuous fun z => { val := a z, property := (_ : a z ∈ ⇑f ⁻¹' Set.range ⇑i) }

Next tactic:
apply Continuous.subtype_mk
/--
Construct a morphism to the explicit pullback given morphisms to the factors
which are compatible with the maps to the base.
This is essentially the universal property of the pullback.
-/
def pullback.lift {X Y Z W : Stonean} (f : X ⟶ Z) {i : Y ⟶ Z} (hi : OpenEmbedding i)
    (a : W ⟶ X) (b : W ⟶ Y) (w : a ≫ f = b ≫ i) :
    W ⟶ pullback f hi where
  toFun := fun z => ⟨a z, by
    simp only [Set.mem_preimage]
    use (b z)
    exact congr_fun (FunLike.ext'_iff.mp w.symm) z⟩
  continuous_toFun := by
    apply Continuous.subtype_mk
    

Proof state:
case h
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
hi✝ : OpenEmbedding ⇑i✝
X Y Z W : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
a : W ⟶ X
b : W ⟶ Y
w : a ≫ f = b ≫ i
⊢ Continuous fun x => a x

Next tactic:
exact a.continuous
lemma pullback.condition {X Y Z : Stonean.{u}} (f : X ⟶ Z) {i : Y ⟶ Z}
    (hi : OpenEmbedding i) : pullback.fst f hi ≫ f = pullback.snd f hi ≫ i := by
  

Proof state:
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
hi✝ : OpenEmbedding ⇑i✝
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
⊢ fst f hi ≫ f = snd f hi ≫ i

Next tactic:
ext ⟨x, h⟩
lemma pullback.condition {X Y Z : Stonean.{u}} (f : X ⟶ Z) {i : Y ⟶ Z}
    (hi : OpenEmbedding i) : pullback.fst f hi ≫ f = pullback.snd f hi ≫ i := by
  ext ⟨x, h⟩
  

Proof state:
case w.mk
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
hi✝ : OpenEmbedding ⇑i✝
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
x : CoeSort.coe X
h : x ∈ ⇑f ⁻¹' Set.range ⇑i
⊢ (fst f hi ≫ f) { val := x, property := h } = (snd f hi ≫ i) { val := x, property := h }

Next tactic:
simp only [Set.mem_preimage] at h
lemma pullback.condition {X Y Z : Stonean.{u}} (f : X ⟶ Z) {i : Y ⟶ Z}
    (hi : OpenEmbedding i) : pullback.fst f hi ≫ f = pullback.snd f hi ≫ i := by
  ext ⟨x, h⟩
  simp only [Set.mem_preimage] at h
  

Proof state:
case w.mk
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
hi✝ : OpenEmbedding ⇑i✝
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
x : CoeSort.coe X
h✝ : x ∈ ⇑f ⁻¹' Set.range ⇑i
h : f x ∈ Set.range ⇑i
⊢ (fst f hi ≫ f) { val := x, property := h✝ } = (snd f hi ≫ i) { val := x, property := h✝ }

Next tactic:
obtain ⟨y, hy⟩ := h
lemma pullback.condition {X Y Z : Stonean.{u}} (f : X ⟶ Z) {i : Y ⟶ Z}
    (hi : OpenEmbedding i) : pullback.fst f hi ≫ f = pullback.snd f hi ≫ i := by
  ext ⟨x, h⟩
  simp only [Set.mem_preimage] at h
  obtain ⟨y, hy⟩ := h
  

Proof state:
case w.mk.intro
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
hi✝ : OpenEmbedding ⇑i✝
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
x : CoeSort.coe X
h : x ∈ ⇑f ⁻¹' Set.range ⇑i
y : CoeSort.coe Y
hy : i y = f x
⊢ (fst f hi ≫ f) { val := x, property := h } = (snd f hi ≫ i) { val := x, property := h }

Next tactic:
simp only [fst, snd, comp_apply]
lemma pullback.condition {X Y Z : Stonean.{u}} (f : X ⟶ Z) {i : Y ⟶ Z}
    (hi : OpenEmbedding i) : pullback.fst f hi ≫ f = pullback.snd f hi ≫ i := by
  ext ⟨x, h⟩
  simp only [Set.mem_preimage] at h
  obtain ⟨y, hy⟩ := h
  simp only [fst, snd, comp_apply]
  

Proof state:
case w.mk.intro
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
hi✝ : OpenEmbedding ⇑i✝
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
x : CoeSort.coe X
h : x ∈ ⇑f ⁻¹' Set.range ⇑i
y : CoeSort.coe Y
hy : i y = f x
⊢ f ((ContinuousMap.mk Subtype.val) { val := x, property := h }) =
    i
      ((ContinuousMap.mk
          (⇑(Homeomorph.symm (Homeomorph.ofEmbedding ⇑i (_ : Embedding ⇑i))) ∘
            Set.MapsTo.restrict (⇑f) (⇑f ⁻¹' Set.range ⇑i) (Set.range ⇑i)
              (_ : Set.MapsTo (⇑f) (⇑f ⁻¹' Set.range ⇑i) (Set.range ⇑i))))
        { val := x, property := h })

Next tactic:
change f x = _
lemma pullback.condition {X Y Z : Stonean.{u}} (f : X ⟶ Z) {i : Y ⟶ Z}
    (hi : OpenEmbedding i) : pullback.fst f hi ≫ f = pullback.snd f hi ≫ i := by
  ext ⟨x, h⟩
  simp only [Set.mem_preimage] at h
  obtain ⟨y, hy⟩ := h
  simp only [fst, snd, comp_apply]
  change f x = _
  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
  

Proof state:
case w.mk.intro
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
hi✝ : OpenEmbedding ⇑i✝
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
x : CoeSort.coe X
h : x ∈ ⇑f ⁻¹' Set.range ⇑i
y : CoeSort.coe Y
hy : i y = f x
⊢ f x =
    i
      ((ContinuousMap.mk
          (⇑(Homeomorph.symm (Homeomorph.ofEmbedding ⇑i (_ : Embedding ⇑i))) ∘
            Set.MapsTo.restrict (⇑f) (⇑f ⁻¹' Set.range ⇑i) (Set.range ⇑i)
              (_ : Set.MapsTo (⇑f) (⇑f ⁻¹' Set.range ⇑i) (Set.range ⇑i))))
        { val := x, property := h })

Next tactic:
erw [← hy, @ContinuousMap.coe_mk _ _ (Stonean.instTopologicalSpace (pullback f hi)) _ _ _]
lemma pullback.condition {X Y Z : Stonean.{u}} (f : X ⟶ Z) {i : Y ⟶ Z}
    (hi : OpenEmbedding i) : pullback.fst f hi ≫ f = pullback.snd f hi ≫ i := by
  ext ⟨x, h⟩
  simp only [Set.mem_preimage] at h
  obtain ⟨y, hy⟩ := h
  simp only [fst, snd, comp_apply]
  change f x = _
  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
  erw [← hy, @ContinuousMap.coe_mk _ _ (Stonean.instTopologicalSpace (pullback f hi)) _ _ _]
  

Proof state:
case w.mk.intro
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
hi✝ : OpenEmbedding ⇑i✝
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
x : CoeSort.coe X
h : x ∈ ⇑f ⁻¹' Set.range ⇑i
y : CoeSort.coe Y
hy : i y = f x
⊢ i y =
    i
      ((⇑(Homeomorph.symm (Homeomorph.ofEmbedding ⇑i (_ : Embedding ⇑i))) ∘
          Set.MapsTo.restrict (⇑f) (⇑f ⁻¹' Set.range ⇑i) (Set.range ⇑i)
            (_ : Set.MapsTo (⇑f) (⇑f ⁻¹' Set.range ⇑i) (Set.range ⇑i)))
        { val := x, property := h })

Next tactic:
congr
lemma pullback.condition {X Y Z : Stonean.{u}} (f : X ⟶ Z) {i : Y ⟶ Z}
    (hi : OpenEmbedding i) : pullback.fst f hi ≫ f = pullback.snd f hi ≫ i := by
  ext ⟨x, h⟩
  simp only [Set.mem_preimage] at h
  obtain ⟨y, hy⟩ := h
  simp only [fst, snd, comp_apply]
  change f x = _
  -- This used to be `rw`, but we need `erw` after leanprover/lean4#2644
  erw [← hy, @ContinuousMap.coe_mk _ _ (Stonean.instTopologicalSpace (pullback f hi)) _ _ _]
  congr
  

Proof state:
case w.mk.intro.h.e_6.h
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i✝ : Y✝ ⟶ Z✝
hi✝ : OpenEmbedding ⇑i✝
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
x : CoeSort.coe X
h : x ∈ ⇑f ⁻¹' Set.range ⇑i
y : CoeSort.coe Y
hy : i y = f x
⊢ y =
    (⇑(Homeomorph.symm (Homeomorph.ofEmbedding ⇑i (_ : Embedding ⇑i))) ∘
        Set.MapsTo.restrict (⇑f) (⇑f ⁻¹' Set.range ⇑i) (Set.range ⇑i)
          (_ : Set.MapsTo (⇑f) (⇑f ⁻¹' Set.range ⇑i) (Set.range ⇑i)))
      { val := x, property := h }

Next tactic:
apply_fun (Homeomorph.ofEmbedding i hi.toEmbedding)