l3lab/ntp-mathlib huggingface dataset:
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
  apply_fun (Homeomorph.ofEmbedding i hi.toEmbedding)
  

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
⊢ (Homeomorph.ofEmbedding ⇑i (_ : Embedding ⇑i)) y =
    (Homeomorph.ofEmbedding ⇑i (_ : Embedding ⇑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:
simpa only [Homeomorph.ofEmbedding, Homeomorph.homeomorph_mk_coe, Equiv.ofInjective_apply,
    Homeomorph.homeomorph_mk_coe_symm, Set.MapsTo.restrict, Subtype.map, Function.comp_apply,
    Equiv.apply_symm_apply, Subtype.mk.injEq]
@[reassoc (attr := simp)]
lemma pullback.lift_snd {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) :
    pullback.lift f hi a b w ≫ Stonean.pullback.snd f hi = b := 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
⊢ lift f hi a b w ≫ snd f hi = b

Next tactic:
congr
@[reassoc (attr := simp)]
lemma pullback.lift_snd {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) :
    pullback.lift f hi a b w ≫ Stonean.pullback.snd f hi = b := by
  congr
  

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
⊢ lift f hi a b w ≫ snd f hi = b

Next tactic:
ext z
@[reassoc (attr := simp)]
lemma pullback.lift_snd {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) :
    pullback.lift f hi a b w ≫ Stonean.pullback.snd f hi = b := by
  congr
  ext z
  

Proof state:
case w
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 : (forget Stonean).obj W
⊢ (lift f hi a b w ≫ snd f hi) z = b z

Next tactic:
have := congr_fun (FunLike.ext'_iff.mp w.symm) z
@[reassoc (attr := simp)]
lemma pullback.lift_snd {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) :
    pullback.lift f hi a b w ≫ Stonean.pullback.snd f hi = b := by
  congr
  ext z
  have := congr_fun (FunLike.ext'_iff.mp w.symm) z
  

Proof state:
case w
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 : (forget Stonean).obj W
this : (b ≫ i) z = (a ≫ f) z
⊢ (lift f hi a b w ≫ snd f hi) z = b z

Next tactic:
have h : i (b z) = f (a z) := this
@[reassoc (attr := simp)]
lemma pullback.lift_snd {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) :
    pullback.lift f hi a b w ≫ Stonean.pullback.snd f hi = b := by
  congr
  ext z
  have := congr_fun (FunLike.ext'_iff.mp w.symm) z
  have h : i (b z) = f (a z) := this
  

Proof state:
case w
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 : (forget Stonean).obj W
this : (b ≫ i) z = (a ≫ f) z
h : i (b z) = f (a z)
⊢ (lift f hi a b w ≫ snd f hi) z = b z

Next tactic:
suffices : b z = (Homeomorph.ofEmbedding i hi.toEmbedding).symm (⟨f (a z), by rw [← h]; simp⟩)
@[reassoc (attr := simp)]
lemma pullback.lift_snd {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) :
    pullback.lift f hi a b w ≫ Stonean.pullback.snd f hi = b := by
  congr
  ext z
  have := congr_fun (FunLike.ext'_iff.mp w.symm) z
  have h : i (b z) = f (a z) := this
  suffices : b z = (Homeomorph.ofEmbedding i hi.toEmbedding).symm (⟨f (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 : (forget Stonean).obj W
this : (b ≫ i) z = (a ≫ f) z
h : i (b z) = f (a z)
⊢ f (a z) ∈ Set.range ⇑i

Next tactic:
rw [← h]
@[reassoc (attr := simp)]
lemma pullback.lift_snd {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) :
    pullback.lift f hi a b w ≫ Stonean.pullback.snd f hi = b := by
  congr
  ext z
  have := congr_fun (FunLike.ext'_iff.mp w.symm) z
  have h : i (b z) = f (a z) := this
  suffices : b z = (Homeomorph.ofEmbedding i hi.toEmbedding).symm (⟨f (a z), by rw [← h]; 

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 : (forget Stonean).obj W
this : (b ≫ i) z = (a ≫ f) z
h : i (b z) = f (a z)
⊢ i (b z) ∈ Set.range ⇑i

Next tactic:
simp
@[reassoc (attr := simp)]
lemma pullback.lift_snd {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) :
    pullback.lift f hi a b w ≫ Stonean.pullback.snd f hi = b := by
  congr
  ext z
  have := congr_fun (FunLike.ext'_iff.mp w.symm) z
  have h : i (b z) = f (a z) := this
  suffices : b z = (Homeomorph.ofEmbedding i hi.toEmbedding).symm (⟨f (a z), by rw [← h]; simp⟩)
  · 

Proof state:
case w
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 : (forget Stonean).obj W
this✝ : (b ≫ i) z = (a ≫ f) z
h : i (b z) = f (a z)
this :
  b z =
    (Homeomorph.symm (Homeomorph.ofEmbedding ⇑i (_ : Embedding ⇑i)))
      { val := f (a z), property := (_ : f (a z) ∈ Set.range ⇑i) }
⊢ (lift f hi a b w ≫ snd f hi) z = b z

Next tactic:
exact this.symm
@[reassoc (attr := simp)]
lemma pullback.lift_snd {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) :
    pullback.lift f hi a b w ≫ Stonean.pullback.snd f hi = b := by
  congr
  ext z
  have := congr_fun (FunLike.ext'_iff.mp w.symm) z
  have h : i (b z) = f (a z) := this
  suffices : b z = (Homeomorph.ofEmbedding i hi.toEmbedding).symm (⟨f (a z), by rw [← h]; simp⟩)
  · exact this.symm
  

Proof state:
case this
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 : (forget Stonean).obj W
this : (b ≫ i) z = (a ≫ f) z
h : i (b z) = f (a z)
⊢ b z =
    (Homeomorph.symm (Homeomorph.ofEmbedding ⇑i (_ : Embedding ⇑i)))
      { val := f (a z), property := (_ : f (a z) ∈ Set.range ⇑i) }

Next tactic:
apply_fun (Homeomorph.ofEmbedding i hi.toEmbedding)
@[reassoc (attr := simp)]
lemma pullback.lift_snd {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) :
    pullback.lift f hi a b w ≫ Stonean.pullback.snd f hi = b := by
  congr
  ext z
  have := congr_fun (FunLike.ext'_iff.mp w.symm) z
  have h : i (b z) = f (a z) := this
  suffices : b z = (Homeomorph.ofEmbedding i hi.toEmbedding).symm (⟨f (a z), by rw [← h]; simp⟩)
  · exact this.symm
  apply_fun (Homeomorph.ofEmbedding i hi.toEmbedding)
  

Proof state:
case this
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 : (forget Stonean).obj W
this : (b ≫ i) z = (a ≫ f) z
h : i (b z) = f (a z)
⊢ (Homeomorph.ofEmbedding ⇑i (_ : Embedding ⇑i)) (b z) =
    (Homeomorph.ofEmbedding ⇑i (_ : Embedding ⇑i))
      ((Homeomorph.symm (Homeomorph.ofEmbedding ⇑i (_ : Embedding ⇑i)))
        { val := f (a z), property := (_ : f (a z) ∈ Set.range ⇑i) })

Next tactic:
simpa only [Homeomorph.ofEmbedding, Homeomorph.homeomorph_mk_coe, Equiv.ofInjective_apply,
    Homeomorph.homeomorph_mk_coe_symm, Equiv.apply_symm_apply, Subtype.mk.injEq]
lemma pullback.hom_ext {X Y Z W : Stonean} (f : X ⟶ Z) {i : Y ⟶ Z} (hi : OpenEmbedding i)
    (a : W ⟶ (pullback.cone f hi).pt) (b : W ⟶ (pullback.cone f hi).pt)
    (hfst : a ≫ pullback.fst f hi = b ≫ pullback.fst f hi) : a = b := 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 b : W ⟶ (cone f hi).pt
hfst : a ≫ fst f hi = b ≫ fst f hi
⊢ a = b

Next tactic:
ext z
lemma pullback.hom_ext {X Y Z W : Stonean} (f : X ⟶ Z) {i : Y ⟶ Z} (hi : OpenEmbedding i)
    (a : W ⟶ (pullback.cone f hi).pt) (b : W ⟶ (pullback.cone f hi).pt)
    (hfst : a ≫ pullback.fst f hi = b ≫ pullback.fst f hi) : a = b := by
  ext z
  

Proof state:
case w
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 b : W ⟶ (cone f hi).pt
hfst : a ≫ fst f hi = b ≫ fst f hi
z : (forget Stonean).obj W
⊢ a z = b z

Next tactic:
apply_fun (fun q => q z) at hfst
lemma pullback.hom_ext {X Y Z W : Stonean} (f : X ⟶ Z) {i : Y ⟶ Z} (hi : OpenEmbedding i)
    (a : W ⟶ (pullback.cone f hi).pt) (b : W ⟶ (pullback.cone f hi).pt)
    (hfst : a ≫ pullback.fst f hi = b ≫ pullback.fst f hi) : a = b := by
  ext z
  apply_fun (fun q => q z) at hfst
  

Proof state:
case w
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 b : W ⟶ (cone f hi).pt
z : (forget Stonean).obj W
hfst : (a ≫ fst f hi) z = (b ≫ fst f hi) z
⊢ a z = b z

Next tactic:
apply Subtype.ext
lemma pullback.hom_ext {X Y Z W : Stonean} (f : X ⟶ Z) {i : Y ⟶ Z} (hi : OpenEmbedding i)
    (a : W ⟶ (pullback.cone f hi).pt) (b : W ⟶ (pullback.cone f hi).pt)
    (hfst : a ≫ pullback.fst f hi = b ≫ pullback.fst f hi) : a = b := by
  ext z
  apply_fun (fun q => q z) at hfst
  apply Subtype.ext
  

Proof state:
case w.a
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 b : W ⟶ (cone f hi).pt
z : (forget Stonean).obj W
hfst : (a ≫ fst f hi) z = (b ≫ fst f hi) z
⊢ ↑(a z) = ↑(b z)

Next tactic:
exact hfst
/-- The isomorphism from the explicit pullback to the abstract pullback. -/
@[simps]
noncomputable
def pullbackIsoPullback : Stonean.pullback f hi ≅
    @Limits.pullback _ _ _ _ _ f i (HasPullbackOpenEmbedding f hi) :=
  haveI : HasPullback f i := HasPullbackOpenEmbedding f hi
  { hom :=
      Limits.pullback.lift (pullback.fst _ hi) (pullback.snd _ hi) (pullback.condition f hi)
    inv :=
      pullback.lift f hi Limits.pullback.fst Limits.pullback.snd Limits.pullback.condition
    hom_inv_id :=
      pullback.hom_ext f hi _ _ (by 

Proof state:
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
this : HasPullback f i
⊢ (Limits.pullback.lift (pullback.fst f hi) (pullback.snd f hi) (_ : pullback.fst f hi ≫ f = pullback.snd f hi ≫ i) ≫
        pullback.lift f hi Limits.pullback.fst Limits.pullback.snd
          (_ : Limits.pullback.fst ≫ f = Limits.pullback.snd ≫ i)) ≫
      pullback.fst f hi =
    𝟙 (pullback f hi) ≫ pullback.fst f hi

Next tactic:
simp only [pullback.cone_pt, Category.assoc, pullback.lift_fst,
        limit.lift_π, PullbackCone.mk_pt, PullbackCone.mk_π_app, Category.id_comp]
/-- The isomorphism from the explicit pullback to the abstract pullback. -/
@[simps]
noncomputable
def pullbackIsoPullback : Stonean.pullback f hi ≅
    @Limits.pullback _ _ _ _ _ f i (HasPullbackOpenEmbedding f hi) :=
  haveI : HasPullback f i := HasPullbackOpenEmbedding f hi
  { hom :=
      Limits.pullback.lift (pullback.fst _ hi) (pullback.snd _ hi) (pullback.condition f hi)
    inv :=
      pullback.lift f hi Limits.pullback.fst Limits.pullback.snd Limits.pullback.condition
    hom_inv_id :=
      pullback.hom_ext f hi _ _ (by simp only [pullback.cone_pt, Category.assoc, pullback.lift_fst,
        limit.lift_π, PullbackCone.mk_pt, PullbackCone.mk_π_app, Category.id_comp])
    inv_hom_id := by
      

Proof state:
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
this : HasPullback f i
⊢ pullback.lift f hi Limits.pullback.fst Limits.pullback.snd (_ : Limits.pullback.fst ≫ f = Limits.pullback.snd ≫ i) ≫
      Limits.pullback.lift (pullback.fst f hi) (pullback.snd f hi) (_ : pullback.fst f hi ≫ f = pullback.snd f hi ≫ i) =
    𝟙 (Limits.pullback f i)

Next tactic:
refine' Limits.pullback.hom_ext (k := (pullback.lift f hi Limits.pullback.fst
        Limits.pullback.snd Limits.pullback.condition ≫ Limits.pullback.lift
        (pullback.fst _ hi) (pullback.snd _ hi) (pullback.condition f hi))) _ _
/-- The isomorphism from the explicit pullback to the abstract pullback. -/
@[simps]
noncomputable
def pullbackIsoPullback : Stonean.pullback f hi ≅
    @Limits.pullback _ _ _ _ _ f i (HasPullbackOpenEmbedding f hi) :=
  haveI : HasPullback f i := HasPullbackOpenEmbedding f hi
  { hom :=
      Limits.pullback.lift (pullback.fst _ hi) (pullback.snd _ hi) (pullback.condition f hi)
    inv :=
      pullback.lift f hi Limits.pullback.fst Limits.pullback.snd Limits.pullback.condition
    hom_inv_id :=
      pullback.hom_ext f hi _ _ (by simp only [pullback.cone_pt, Category.assoc, pullback.lift_fst,
        limit.lift_π, PullbackCone.mk_pt, PullbackCone.mk_π_app, Category.id_comp])
    inv_hom_id := by
      refine' Limits.pullback.hom_ext (k := (pullback.lift f hi Limits.pullback.fst
        Limits.pullback.snd Limits.pullback.condition ≫ Limits.pullback.lift
        (pullback.fst _ hi) (pullback.snd _ hi) (pullback.condition f hi))) _ _
      · 

Proof state:
case refine'_1
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
this : HasPullback f i
⊢ (pullback.lift f hi Limits.pullback.fst Limits.pullback.snd (_ : Limits.pullback.fst ≫ f = Limits.pullback.snd ≫ i) ≫
        Limits.pullback.lift (pullback.fst f hi) (pullback.snd f hi)
          (_ : pullback.fst f hi ≫ f = pullback.snd f hi ≫ i)) ≫
      Limits.pullback.fst =
    𝟙 (Limits.pullback f i) ≫ Limits.pullback.fst

Next tactic:
simp only [Category.assoc, limit.lift_π, PullbackCone.mk_pt, PullbackCone.mk_π_app,
          pullback.lift_fst, Category.id_comp]
/-- The isomorphism from the explicit pullback to the abstract pullback. -/
@[simps]
noncomputable
def pullbackIsoPullback : Stonean.pullback f hi ≅
    @Limits.pullback _ _ _ _ _ f i (HasPullbackOpenEmbedding f hi) :=
  haveI : HasPullback f i := HasPullbackOpenEmbedding f hi
  { hom :=
      Limits.pullback.lift (pullback.fst _ hi) (pullback.snd _ hi) (pullback.condition f hi)
    inv :=
      pullback.lift f hi Limits.pullback.fst Limits.pullback.snd Limits.pullback.condition
    hom_inv_id :=
      pullback.hom_ext f hi _ _ (by simp only [pullback.cone_pt, Category.assoc, pullback.lift_fst,
        limit.lift_π, PullbackCone.mk_pt, PullbackCone.mk_π_app, Category.id_comp])
    inv_hom_id := by
      refine' Limits.pullback.hom_ext (k := (pullback.lift f hi Limits.pullback.fst
        Limits.pullback.snd Limits.pullback.condition ≫ Limits.pullback.lift
        (pullback.fst _ hi) (pullback.snd _ hi) (pullback.condition f hi))) _ _
      · simp only [Category.assoc, limit.lift_π, PullbackCone.mk_pt, PullbackCone.mk_π_app,
          pullback.lift_fst, Category.id_comp]
      · 

Proof state:
case refine'_2
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
this : HasPullback f i
⊢ (pullback.lift f hi Limits.pullback.fst Limits.pullback.snd (_ : Limits.pullback.fst ≫ f = Limits.pullback.snd ≫ i) ≫
        Limits.pullback.lift (pullback.fst f hi) (pullback.snd f hi)
          (_ : pullback.fst f hi ≫ f = pullback.snd f hi ≫ i)) ≫
      Limits.pullback.snd =
    𝟙 (Limits.pullback f i) ≫ Limits.pullback.snd

Next tactic:
rw [Category.id_comp, Category.assoc, Limits.pullback.lift_snd, pullback.lift_snd]
/-- The forgetful from `Stonean` to `TopCat` creates pullbacks along open embeddings -/
noncomputable
def createsPullbacksOfOpenEmbedding :
    CreatesLimit (cospan f i) (Stonean.toCompHaus ⋙ compHausToTop) :=
  createsLimitOfFullyFaithfulOfIso (Stonean.pullback f hi) (by
    

Proof state:
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
⊢ (toCompHaus ⋙ compHausToTop).obj (pullback f hi) ≅ limit (cospan f i ⋙ toCompHaus ⋙ compHausToTop)

Next tactic:
refine (@TopCat.isoOfHomeo (TopCat.of _) (TopCat.of _)
      (TopCat.pullbackHomeoPreimage f f.2 i hi.toEmbedding)).symm ≪≫ ?_
/-- The forgetful from `Stonean` to `TopCat` creates pullbacks along open embeddings -/
noncomputable
def createsPullbacksOfOpenEmbedding :
    CreatesLimit (cospan f i) (Stonean.toCompHaus ⋙ compHausToTop) :=
  createsLimitOfFullyFaithfulOfIso (Stonean.pullback f hi) (by
    refine (@TopCat.isoOfHomeo (TopCat.of _) (TopCat.of _)
      (TopCat.pullbackHomeoPreimage f f.2 i hi.toEmbedding)).symm ≪≫ ?_
    

Proof state:
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
⊢ TopCat.of { p // f p.1 = i p.2 } ≅ limit (cospan f i ⋙ toCompHaus ⋙ compHausToTop)

Next tactic:
refine ?_ ≪≫ Limits.lim.mapIso (diagramIsoCospan _).symm
/-- The forgetful from `Stonean` to `TopCat` creates pullbacks along open embeddings -/
noncomputable
def createsPullbacksOfOpenEmbedding :
    CreatesLimit (cospan f i) (Stonean.toCompHaus ⋙ compHausToTop) :=
  createsLimitOfFullyFaithfulOfIso (Stonean.pullback f hi) (by
    refine (@TopCat.isoOfHomeo (TopCat.of _) (TopCat.of _)
      (TopCat.pullbackHomeoPreimage f f.2 i hi.toEmbedding)).symm ≪≫ ?_
    refine ?_ ≪≫ Limits.lim.mapIso (diagramIsoCospan _).symm
    

Proof state:
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
⊢ TopCat.of { p // f p.1 = i p.2 } ≅
    Limits.lim.obj
      (cospan ((cospan f i ⋙ toCompHaus ⋙ compHausToTop).map WalkingCospan.Hom.inl)
        ((cospan f i ⋙ toCompHaus ⋙ compHausToTop).map WalkingCospan.Hom.inr))

Next tactic:
exact (TopCat.pullbackConeIsLimit f i).conePointUniqueUpToIso (limit.isLimit _)
instance : HasPullbacksOfInclusions Stonean where
  hasPullbackInl f := by
    

Proof state:
X Y Z : Stonean
f✝ : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
X✝ Y✝ Z✝ : Stonean
f : Z✝ ⟶ X✝ ⨿ Y✝
⊢ HasPullback coprod.inl f

Next tactic:
apply (config := { allowSynthFailures := true }) hasPullback_symmetry
instance : HasPullbacksOfInclusions Stonean where
  hasPullbackInl f := by
    apply (config := { allowSynthFailures := true }) hasPullback_symmetry
    

Proof state:
case inst
X Y Z : Stonean
f✝ : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
X✝ Y✝ Z✝ : Stonean
f : Z✝ ⟶ X✝ ⨿ Y✝
⊢ HasPullback f coprod.inl

Next tactic:
apply Stonean.HasPullbackOpenEmbedding
instance : HasPullbacksOfInclusions Stonean where
  hasPullbackInl f := by
    apply (config := { allowSynthFailures := true }) hasPullback_symmetry
    apply Stonean.HasPullbackOpenEmbedding
    

Proof state:
case inst.hi
X Y Z : Stonean
f✝ : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
X✝ Y✝ Z✝ : Stonean
f : Z✝ ⟶ X✝ ⨿ Y✝
⊢ OpenEmbedding ⇑coprod.inl

Next tactic:
apply Stonean.Sigma.openEmbedding_ι
noncomputable
instance : PreservesPullbacksOfInclusions Stonean.toCompHaus.{u} where
  preservesPullbackInl := by
    

Proof state:
X Y Z : Stonean
f : X ⟶ Z
i : Y ⟶ Z
hi : OpenEmbedding ⇑i
⊢ {X Y Z : Stonean} → (f : Z ⟶ X ⨿ Y) → PreservesLimit (cospan coprod.inl f) toCompHaus

Next tactic:
intros X Y Z f
noncomputable
instance : PreservesPullbacksOfInclusions Stonean.toCompHaus.{u} where
  preservesPullbackInl := by
    intros X Y Z f
    

Proof state:
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i : Y✝ ⟶ Z✝
hi : OpenEmbedding ⇑i
X Y Z : Stonean
f : Z ⟶ X ⨿ Y
⊢ PreservesLimit (cospan coprod.inl f) toCompHaus

Next tactic:
apply (config := { allowSynthFailures := true }) preservesPullbackSymmetry
noncomputable
instance : PreservesPullbacksOfInclusions Stonean.toCompHaus.{u} where
  preservesPullbackInl := by
    intros X Y Z f
    apply (config := { allowSynthFailures := true }) preservesPullbackSymmetry
    

Proof state:
case inst
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i : Y✝ ⟶ Z✝
hi : OpenEmbedding ⇑i
X Y Z : Stonean
f : Z ⟶ X ⨿ Y
⊢ PreservesLimit (cospan f coprod.inl) toCompHaus

Next tactic:
have : OpenEmbedding (coprod.inl : X ⟶ X ⨿ Y) := Stonean.Sigma.openEmbedding_ι _ _
noncomputable
instance : PreservesPullbacksOfInclusions Stonean.toCompHaus.{u} where
  preservesPullbackInl := by
    intros X Y Z f
    apply (config := { allowSynthFailures := true }) preservesPullbackSymmetry
    have : OpenEmbedding (coprod.inl : X ⟶ X ⨿ Y) := Stonean.Sigma.openEmbedding_ι _ _
    

Proof state:
case inst
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i : Y✝ ⟶ Z✝
hi : OpenEmbedding ⇑i
X Y Z : Stonean
f : Z ⟶ X ⨿ Y
this : OpenEmbedding ⇑coprod.inl
⊢ PreservesLimit (cospan f coprod.inl) toCompHaus

Next tactic:
have := Stonean.createsPullbacksOfOpenEmbedding f this
noncomputable
instance : PreservesPullbacksOfInclusions Stonean.toCompHaus.{u} where
  preservesPullbackInl := by
    intros X Y Z f
    apply (config := { allowSynthFailures := true }) preservesPullbackSymmetry
    have : OpenEmbedding (coprod.inl : X ⟶ X ⨿ Y) := Stonean.Sigma.openEmbedding_ι _ _
    have := Stonean.createsPullbacksOfOpenEmbedding f this
    

Proof state:
case inst
X✝ Y✝ Z✝ : Stonean
f✝ : X✝ ⟶ Z✝
i : Y✝ ⟶ Z✝
hi : OpenEmbedding ⇑i
X Y Z : Stonean
f : Z ⟶ X ⨿ Y
this✝ : OpenEmbedding ⇑coprod.inl
this : CreatesLimit (cospan f coprod.inl) (toCompHaus ⋙ compHausToTop)
⊢ PreservesLimit (cospan f coprod.inl) toCompHaus

Next tactic:
exact preservesLimitOfReflectsOfPreserves Stonean.toCompHaus compHausToTop
protected lemma mul_le_of_le_div (k x y : ℕ) (h : x ≤ y / k) : x * k ≤ y := by
  

Proof state:
k x y : ℕ
h : x ≤ y / k
⊢ x * k ≤ y

Next tactic:
by_cases hk : k = 0
protected lemma mul_le_of_le_div (k x y : ℕ) (h : x ≤ y / k) : x * k ≤ y := by
  by_cases hk : k = 0
  

Proof state:
case pos
k x y : ℕ
h : x ≤ y / k
hk : k = 0
⊢ x * k ≤ y
case neg k x y : ℕ h : x ≤ y / k hk : ¬k = 0 ⊢ x * k ≤ y

Next tactic:
case pos => rw [hk, mul_zero]; exact zero_le _
protected lemma mul_le_of_le_div (k x y : ℕ) (h : x ≤ y / k) : x * k ≤ y := by
  by_cases hk : k = 0
  

Proof state:
k x y : ℕ
h : x ≤ y / k
hk : k = 0
⊢ x * k ≤ y

Next tactic:
case pos => rw [hk, mul_zero]; exact zero_le _
protected lemma mul_le_of_le_div (k x y : ℕ) (h : x ≤ y / k) : x * k ≤ y := by
  by_cases hk : k = 0
  case pos => 

Proof state:
k x y : ℕ
h : x ≤ y / k
hk : k = 0
⊢ x * k ≤ y

Next tactic:
rw [hk, mul_zero]
protected lemma mul_le_of_le_div (k x y : ℕ) (h : x ≤ y / k) : x * k ≤ y := by
  by_cases hk : k = 0
  case pos => rw [hk, mul_zero]; 

Proof state:
k x y : ℕ
h : x ≤ y / k
hk : k = 0
⊢ 0 ≤ y

Next tactic:
exact zero_le _
protected lemma mul_le_of_le_div (k x y : ℕ) (h : x ≤ y / k) : x * k ≤ y := by
  by_cases hk : k = 0
  case pos => rw [hk, mul_zero]; exact zero_le _
  

Proof state:
case neg
k x y : ℕ
h : x ≤ y / k
hk : ¬k = 0
⊢ x * k ≤ y

Next tactic:
case neg => rwa [← le_div_iff_mul_le (pos_iff_ne_zero.2 hk)]
protected lemma mul_le_of_le_div (k x y : ℕ) (h : x ≤ y / k) : x * k ≤ y := by
  by_cases hk : k = 0
  case pos => rw [hk, mul_zero]; exact zero_le _
  

Proof state:
k x y : ℕ
h : x ≤ y / k
hk : ¬k = 0
⊢ x * k ≤ y

Next tactic:
case neg => rwa [← le_div_iff_mul_le (pos_iff_ne_zero.2 hk)]
protected lemma mul_le_of_le_div (k x y : ℕ) (h : x ≤ y / k) : x * k ≤ y := by
  by_cases hk : k = 0
  case pos => rw [hk, mul_zero]; exact zero_le _
  case neg => 

Proof state:
k x y : ℕ
h : x ≤ y / k
hk : ¬k = 0
⊢ x * k ≤ y

Next tactic:
rwa [← le_div_iff_mul_le (pos_iff_ne_zero.2 hk)]
protected lemma div_mul_div_le (a b c d : ℕ) :
    (a / b) * (c / d) ≤ (a * c) / (b * d) := by
  

Proof state:
a b c d : ℕ
⊢ a / b * (c / d) ≤ a * c / (b * d)

Next tactic:
by_cases hb : b = 0