l3lab/ntp-mathlib huggingface dataset:
theorem len_lt_of_mono {Δ' Δ : SimplexCategory} (i : Δ' ⟶ Δ) [hi : Mono i] (hi' : Δ ≠ Δ') :
    Δ'.len < Δ.len := by
  rcases lt_or_eq_of_le (len_le_of_mono hi) with (h | h)
  · exact h
  · exfalso
    

Proof state:
case inr.h
Δ' Δ : SimplexCategory
i : Δ' ⟶ Δ
hi : Mono i
hi' : Δ ≠ Δ'
h : len Δ' = len Δ
⊢ False

Next tactic:
exact hi' (by ext; exact h.symm)
theorem len_lt_of_mono {Δ' Δ : SimplexCategory} (i : Δ' ⟶ Δ) [hi : Mono i] (hi' : Δ ≠ Δ') :
    Δ'.len < Δ.len := by
  rcases lt_or_eq_of_le (len_le_of_mono hi) with (h | h)
  · exact h
  · exfalso
    exact hi' (by 

Proof state:
Δ' Δ : SimplexCategory
i : Δ' ⟶ Δ
hi : Mono i
hi' : Δ ≠ Δ'
h : len Δ' = len Δ
⊢ Δ = Δ'

Next tactic:
ext
theorem len_lt_of_mono {Δ' Δ : SimplexCategory} (i : Δ' ⟶ Δ) [hi : Mono i] (hi' : Δ ≠ Δ') :
    Δ'.len < Δ.len := by
  rcases lt_or_eq_of_le (len_le_of_mono hi) with (h | h)
  · exact h
  · exfalso
    exact hi' (by ext; 

Proof state:
case a
Δ' Δ : SimplexCategory
i : Δ' ⟶ Δ
hi : Mono i
hi' : Δ ≠ Δ'
h : len Δ' = len Δ
⊢ len Δ = len Δ'

Next tactic:
exact h.symm
theorem image_eq {Δ Δ' Δ'' : SimplexCategory} {φ : Δ ⟶ Δ''} {e : Δ ⟶ Δ'} [Epi e] {i : Δ' ⟶ Δ''}
    [Mono i] (fac : e ≫ i = φ) : image φ = Δ' := by
  

Proof state:
Δ Δ' Δ'' : SimplexCategory
φ : Δ ⟶ Δ''
e : Δ ⟶ Δ'
inst✝¹ : Epi e
i : Δ' ⟶ Δ''
inst✝ : Mono i
fac : e ≫ i = φ
⊢ image φ = Δ'

Next tactic:
haveI := strongEpi_of_epi e
theorem image_eq {Δ Δ' Δ'' : SimplexCategory} {φ : Δ ⟶ Δ''} {e : Δ ⟶ Δ'} [Epi e] {i : Δ' ⟶ Δ''}
    [Mono i] (fac : e ≫ i = φ) : image φ = Δ' := by
  haveI := strongEpi_of_epi e
  

Proof state:
Δ Δ' Δ'' : SimplexCategory
φ : Δ ⟶ Δ''
e : Δ ⟶ Δ'
inst✝¹ : Epi e
i : Δ' ⟶ Δ''
inst✝ : Mono i
fac : e ≫ i = φ
this : StrongEpi e
⊢ image φ = Δ'

Next tactic:
let e := image.isoStrongEpiMono e i fac
theorem image_eq {Δ Δ' Δ'' : SimplexCategory} {φ : Δ ⟶ Δ''} {e : Δ ⟶ Δ'} [Epi e] {i : Δ' ⟶ Δ''}
    [Mono i] (fac : e ≫ i = φ) : image φ = Δ' := by
  haveI := strongEpi_of_epi e
  let e := image.isoStrongEpiMono e i fac
  

Proof state:
Δ Δ' Δ'' : SimplexCategory
φ : Δ ⟶ Δ''
e✝ : Δ ⟶ Δ'
inst✝¹ : Epi e✝
i : Δ' ⟶ Δ''
inst✝ : Mono i
fac : e✝ ≫ i = φ
this : StrongEpi e✝
e : Δ' ≅ image φ := image.isoStrongEpiMono e✝ i fac
⊢ image φ = Δ'

Next tactic:
ext
theorem image_eq {Δ Δ' Δ'' : SimplexCategory} {φ : Δ ⟶ Δ''} {e : Δ ⟶ Δ'} [Epi e] {i : Δ' ⟶ Δ''}
    [Mono i] (fac : e ≫ i = φ) : image φ = Δ' := by
  haveI := strongEpi_of_epi e
  let e := image.isoStrongEpiMono e i fac
  ext
  

Proof state:
case a
Δ Δ' Δ'' : SimplexCategory
φ : Δ ⟶ Δ''
e✝ : Δ ⟶ Δ'
inst✝¹ : Epi e✝
i : Δ' ⟶ Δ''
inst✝ : Mono i
fac : e✝ ≫ i = φ
this : StrongEpi e✝
e : Δ' ≅ image φ := image.isoStrongEpiMono e✝ i fac
⊢ len (image φ) = len Δ'

Next tactic:
exact
    le_antisymm (len_le_of_epi (inferInstance : Epi e.hom))
      (len_le_of_mono (inferInstance : Mono e.hom))
theorem image_ι_eq {Δ Δ'' : SimplexCategory} {φ : Δ ⟶ Δ''} {e : Δ ⟶ image φ} [Epi e]
    {i : image φ ⟶ Δ''} [Mono i] (fac : e ≫ i = φ) : image.ι φ = i := by
  

Proof state:
Δ Δ'' : SimplexCategory
φ : Δ ⟶ Δ''
e : Δ ⟶ image φ
inst✝¹ : Epi e
i : image φ ⟶ Δ''
inst✝ : Mono i
fac : e ≫ i = φ
⊢ image.ι φ = i

Next tactic:
haveI := strongEpi_of_epi e
theorem image_ι_eq {Δ Δ'' : SimplexCategory} {φ : Δ ⟶ Δ''} {e : Δ ⟶ image φ} [Epi e]
    {i : image φ ⟶ Δ''} [Mono i] (fac : e ≫ i = φ) : image.ι φ = i := by
  haveI := strongEpi_of_epi e
  

Proof state:
Δ Δ'' : SimplexCategory
φ : Δ ⟶ Δ''
e : Δ ⟶ image φ
inst✝¹ : Epi e
i : image φ ⟶ Δ''
inst✝ : Mono i
fac : e ≫ i = φ
this : StrongEpi e
⊢ image.ι φ = i

Next tactic:
rw [← image.isoStrongEpiMono_hom_comp_ι e i fac,
    SimplexCategory.eq_id_of_isIso (image.isoStrongEpiMono e i fac).hom, Category.id_comp]
theorem factorThruImage_eq {Δ Δ'' : SimplexCategory} {φ : Δ ⟶ Δ''} {e : Δ ⟶ image φ} [Epi e]
    {i : image φ ⟶ Δ''} [Mono i] (fac : e ≫ i = φ) : factorThruImage φ = e := by
  

Proof state:
Δ Δ'' : SimplexCategory
φ : Δ ⟶ Δ''
e : Δ ⟶ image φ
inst✝¹ : Epi e
i : image φ ⟶ Δ''
inst✝ : Mono i
fac : e ≫ i = φ
⊢ factorThruImage φ = e

Next tactic:
rw [← cancel_mono i, fac, ← image_ι_eq fac, image.fac]
/-- Any continuous bijection of compact Hausdorff spaces is an isomorphism. -/
theorem isIso_of_bijective {X Y : CompHaus.{u}} (f : X ⟶ Y) (bij : Function.Bijective f) :
    IsIso f := by
  

Proof state:
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ⟶ Y
bij : Function.Bijective ⇑f
⊢ IsIso f

Next tactic:
let E := Equiv.ofBijective _ bij
/-- Any continuous bijection of compact Hausdorff spaces is an isomorphism. -/
theorem isIso_of_bijective {X Y : CompHaus.{u}} (f : X ⟶ Y) (bij : Function.Bijective f) :
    IsIso f := by
  let E := Equiv.ofBijective _ bij
  

Proof state:
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ⟶ Y
bij : Function.Bijective ⇑f
E : (forget CompHaus).obj X ≃ (forget CompHaus).obj Y := Equiv.ofBijective (⇑f) bij
⊢ IsIso f

Next tactic:
have hE : Continuous E.symm := by
    rw [continuous_iff_isClosed]
    intro S hS
    rw [← E.image_eq_preimage]
    exact isClosedMap f S hS
/-- Any continuous bijection of compact Hausdorff spaces is an isomorphism. -/
theorem isIso_of_bijective {X Y : CompHaus.{u}} (f : X ⟶ Y) (bij : Function.Bijective f) :
    IsIso f := by
  let E := Equiv.ofBijective _ bij
  have hE : Continuous E.symm := by
    

Proof state:
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ⟶ Y
bij : Function.Bijective ⇑f
E : (forget CompHaus).obj X ≃ (forget CompHaus).obj Y := Equiv.ofBijective (⇑f) bij
⊢ Continuous ⇑E.symm

Next tactic:
rw [continuous_iff_isClosed]
/-- Any continuous bijection of compact Hausdorff spaces is an isomorphism. -/
theorem isIso_of_bijective {X Y : CompHaus.{u}} (f : X ⟶ Y) (bij : Function.Bijective f) :
    IsIso f := by
  let E := Equiv.ofBijective _ bij
  have hE : Continuous E.symm := by
    rw [continuous_iff_isClosed]
    

Proof state:
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ⟶ Y
bij : Function.Bijective ⇑f
E : (forget CompHaus).obj X ≃ (forget CompHaus).obj Y := Equiv.ofBijective (⇑f) bij
⊢ ∀ (s : Set ((forget CompHaus).obj X)), IsClosed s → IsClosed (⇑E.symm ⁻¹' s)

Next tactic:
intro S hS
/-- Any continuous bijection of compact Hausdorff spaces is an isomorphism. -/
theorem isIso_of_bijective {X Y : CompHaus.{u}} (f : X ⟶ Y) (bij : Function.Bijective f) :
    IsIso f := by
  let E := Equiv.ofBijective _ bij
  have hE : Continuous E.symm := by
    rw [continuous_iff_isClosed]
    intro S hS
    

Proof state:
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ⟶ Y
bij : Function.Bijective ⇑f
E : (forget CompHaus).obj X ≃ (forget CompHaus).obj Y := Equiv.ofBijective (⇑f) bij
S : Set ((forget CompHaus).obj X)
hS : IsClosed S
⊢ IsClosed (⇑E.symm ⁻¹' S)

Next tactic:
rw [← E.image_eq_preimage]
/-- Any continuous bijection of compact Hausdorff spaces is an isomorphism. -/
theorem isIso_of_bijective {X Y : CompHaus.{u}} (f : X ⟶ Y) (bij : Function.Bijective f) :
    IsIso f := by
  let E := Equiv.ofBijective _ bij
  have hE : Continuous E.symm := by
    rw [continuous_iff_isClosed]
    intro S hS
    rw [← E.image_eq_preimage]
    

Proof state:
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ⟶ Y
bij : Function.Bijective ⇑f
E : (forget CompHaus).obj X ≃ (forget CompHaus).obj Y := Equiv.ofBijective (⇑f) bij
S : Set ((forget CompHaus).obj X)
hS : IsClosed S
⊢ IsClosed (⇑E '' S)

Next tactic:
exact isClosedMap f S hS
/-- Any continuous bijection of compact Hausdorff spaces is an isomorphism. -/
theorem isIso_of_bijective {X Y : CompHaus.{u}} (f : X ⟶ Y) (bij : Function.Bijective f) :
    IsIso f := by
  let E := Equiv.ofBijective _ bij
  have hE : Continuous E.symm := by
    rw [continuous_iff_isClosed]
    intro S hS
    rw [← E.image_eq_preimage]
    exact isClosedMap f S hS
  

Proof state:
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ⟶ Y
bij : Function.Bijective ⇑f
E : (forget CompHaus).obj X ≃ (forget CompHaus).obj Y := Equiv.ofBijective (⇑f) bij
hE : Continuous ⇑E.symm
⊢ IsIso f

Next tactic:
refine' ⟨⟨⟨E.symm, hE⟩, _, _⟩⟩
/-- Any continuous bijection of compact Hausdorff spaces is an isomorphism. -/
theorem isIso_of_bijective {X Y : CompHaus.{u}} (f : X ⟶ Y) (bij : Function.Bijective f) :
    IsIso f := by
  let E := Equiv.ofBijective _ bij
  have hE : Continuous E.symm := by
    rw [continuous_iff_isClosed]
    intro S hS
    rw [← E.image_eq_preimage]
    exact isClosedMap f S hS
  refine' ⟨⟨⟨E.symm, hE⟩, _, _⟩⟩
  · 

Proof state:
case refine'_1
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ⟶ Y
bij : Function.Bijective ⇑f
E : (forget CompHaus).obj X ≃ (forget CompHaus).obj Y := Equiv.ofBijective (⇑f) bij
hE : Continuous ⇑E.symm
⊢ f ≫ ContinuousMap.mk ⇑E.symm = 𝟙 X

Next tactic:
ext x
/-- Any continuous bijection of compact Hausdorff spaces is an isomorphism. -/
theorem isIso_of_bijective {X Y : CompHaus.{u}} (f : X ⟶ Y) (bij : Function.Bijective f) :
    IsIso f := by
  let E := Equiv.ofBijective _ bij
  have hE : Continuous E.symm := by
    rw [continuous_iff_isClosed]
    intro S hS
    rw [← E.image_eq_preimage]
    exact isClosedMap f S hS
  refine' ⟨⟨⟨E.symm, hE⟩, _, _⟩⟩
  · ext x
    

Proof state:
case refine'_1.w
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ⟶ Y
bij : Function.Bijective ⇑f
E : (forget CompHaus).obj X ≃ (forget CompHaus).obj Y := Equiv.ofBijective (⇑f) bij
hE : Continuous ⇑E.symm
x : (forget CompHaus).obj X
⊢ (f ≫ ContinuousMap.mk ⇑E.symm) x = (𝟙 X) x

Next tactic:
apply E.symm_apply_apply
/-- Any continuous bijection of compact Hausdorff spaces is an isomorphism. -/
theorem isIso_of_bijective {X Y : CompHaus.{u}} (f : X ⟶ Y) (bij : Function.Bijective f) :
    IsIso f := by
  let E := Equiv.ofBijective _ bij
  have hE : Continuous E.symm := by
    rw [continuous_iff_isClosed]
    intro S hS
    rw [← E.image_eq_preimage]
    exact isClosedMap f S hS
  refine' ⟨⟨⟨E.symm, hE⟩, _, _⟩⟩
  · ext x
    apply E.symm_apply_apply
  · 

Proof state:
case refine'_2
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ⟶ Y
bij : Function.Bijective ⇑f
E : (forget CompHaus).obj X ≃ (forget CompHaus).obj Y := Equiv.ofBijective (⇑f) bij
hE : Continuous ⇑E.symm
⊢ ContinuousMap.mk ⇑E.symm ≫ f = 𝟙 Y

Next tactic:
ext x
/-- Any continuous bijection of compact Hausdorff spaces is an isomorphism. -/
theorem isIso_of_bijective {X Y : CompHaus.{u}} (f : X ⟶ Y) (bij : Function.Bijective f) :
    IsIso f := by
  let E := Equiv.ofBijective _ bij
  have hE : Continuous E.symm := by
    rw [continuous_iff_isClosed]
    intro S hS
    rw [← E.image_eq_preimage]
    exact isClosedMap f S hS
  refine' ⟨⟨⟨E.symm, hE⟩, _, _⟩⟩
  · ext x
    apply E.symm_apply_apply
  · ext x
    

Proof state:
case refine'_2.w
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ⟶ Y
bij : Function.Bijective ⇑f
E : (forget CompHaus).obj X ≃ (forget CompHaus).obj Y := Equiv.ofBijective (⇑f) bij
hE : Continuous ⇑E.symm
x : (forget CompHaus).obj Y
⊢ (ContinuousMap.mk ⇑E.symm ≫ f) x = (𝟙 Y) x

Next tactic:
apply E.apply_symm_apply
/-- Construct an isomorphism from a homeomorphism. -/
@[simps hom inv]
def isoOfHomeo {X Y : CompHaus.{u}} (f : X ≃ₜ Y) : X ≅ Y where
  hom := ⟨f, f.continuous⟩
  inv := ⟨f.symm, f.symm.continuous⟩
  hom_inv_id := by
    

Proof state:
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : ↑X.toTop ≃ₜ ↑Y.toTop
⊢ ContinuousMap.mk ⇑f ≫ ContinuousMap.mk ⇑(Homeomorph.symm f) = 𝟙 X

Next tactic:
ext x
/-- Construct an isomorphism from a homeomorphism. -/
@[simps hom inv]
def isoOfHomeo {X Y : CompHaus.{u}} (f : X ≃ₜ Y) : X ≅ Y where
  hom := ⟨f, f.continuous⟩
  inv := ⟨f.symm, f.symm.continuous⟩
  hom_inv_id := by
    ext x
    

Proof state:
case w
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : ↑X.toTop ≃ₜ ↑Y.toTop
x : (forget CompHaus).obj X
⊢ (ContinuousMap.mk ⇑f ≫ ContinuousMap.mk ⇑(Homeomorph.symm f)) x = (𝟙 X) x

Next tactic:
exact f.symm_apply_apply x
/-- Construct an isomorphism from a homeomorphism. -/
@[simps hom inv]
def isoOfHomeo {X Y : CompHaus.{u}} (f : X ≃ₜ Y) : X ≅ Y where
  hom := ⟨f, f.continuous⟩
  inv := ⟨f.symm, f.symm.continuous⟩
  hom_inv_id := by
    ext x
    exact f.symm_apply_apply x
  inv_hom_id := by
    

Proof state:
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : ↑X.toTop ≃ₜ ↑Y.toTop
⊢ ContinuousMap.mk ⇑(Homeomorph.symm f) ≫ ContinuousMap.mk ⇑f = 𝟙 Y

Next tactic:
ext x
/-- Construct an isomorphism from a homeomorphism. -/
@[simps hom inv]
def isoOfHomeo {X Y : CompHaus.{u}} (f : X ≃ₜ Y) : X ≅ Y where
  hom := ⟨f, f.continuous⟩
  inv := ⟨f.symm, f.symm.continuous⟩
  hom_inv_id := by
    ext x
    exact f.symm_apply_apply x
  inv_hom_id := by
    ext x
    

Proof state:
case w
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : ↑X.toTop ≃ₜ ↑Y.toTop
x : (forget CompHaus).obj Y
⊢ (ContinuousMap.mk ⇑(Homeomorph.symm f) ≫ ContinuousMap.mk ⇑f) x = (𝟙 Y) x

Next tactic:
exact f.apply_symm_apply x
/-- Construct a homeomorphism from an isomorphism. -/
@[simps]
def homeoOfIso {X Y : CompHaus.{u}} (f : X ≅ Y) : X ≃ₜ Y where
  toFun := f.hom
  invFun := f.inv
  left_inv x := by 

Proof state:
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ≅ Y
x : ↑X.toTop
⊢ f.inv (f.hom x) = x

Next tactic:
simp
/-- Construct a homeomorphism from an isomorphism. -/
@[simps]
def homeoOfIso {X Y : CompHaus.{u}} (f : X ≅ Y) : X ≃ₜ Y where
  toFun := f.hom
  invFun := f.inv
  left_inv x := by simp
  right_inv x := by 

Proof state:
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ≅ Y
x : ↑Y.toTop
⊢ f.hom (f.inv x) = x

Next tactic:
simp
/-- The equivalence between isomorphisms in `CompHaus` and homeomorphisms
of topological spaces. -/
@[simps]
def isoEquivHomeo {X Y : CompHaus.{u}} : (X ≅ Y) ≃ (X ≃ₜ Y) where
  toFun := homeoOfIso
  invFun := isoOfHomeo
  left_inv f := by
    

Proof state:
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ≅ Y
⊢ isoOfHomeo (homeoOfIso f) = f

Next tactic:
ext
/-- The equivalence between isomorphisms in `CompHaus` and homeomorphisms
of topological spaces. -/
@[simps]
def isoEquivHomeo {X Y : CompHaus.{u}} : (X ≅ Y) ≃ (X ≃ₜ Y) where
  toFun := homeoOfIso
  invFun := isoOfHomeo
  left_inv f := by
    ext
    

Proof state:
case w.w
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : X ≅ Y
x✝ : (forget CompHaus).obj X
⊢ (isoOfHomeo (homeoOfIso f)).hom x✝ = f.hom x✝

Next tactic:
rfl
/-- The equivalence between isomorphisms in `CompHaus` and homeomorphisms
of topological spaces. -/
@[simps]
def isoEquivHomeo {X Y : CompHaus.{u}} : (X ≅ Y) ≃ (X ≃ₜ Y) where
  toFun := homeoOfIso
  invFun := isoOfHomeo
  left_inv f := by
    ext
    rfl
  right_inv f := by
    

Proof state:
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : ↑X.toTop ≃ₜ ↑Y.toTop
⊢ homeoOfIso (isoOfHomeo f) = f

Next tactic:
ext
/-- The equivalence between isomorphisms in `CompHaus` and homeomorphisms
of topological spaces. -/
@[simps]
def isoEquivHomeo {X Y : CompHaus.{u}} : (X ≅ Y) ≃ (X ≃ₜ Y) where
  toFun := homeoOfIso
  invFun := isoOfHomeo
  left_inv f := by
    ext
    rfl
  right_inv f := by
    ext
    

Proof state:
case H
X✝ : Type u_1
inst✝² : TopologicalSpace X✝
inst✝¹ : CompactSpace X✝
inst✝ : T2Space X✝
X Y : CompHaus
f : ↑X.toTop ≃ₜ ↑Y.toTop
x✝ : ↑X.toTop
⊢ (homeoOfIso (isoOfHomeo f)) x✝ = f x✝

Next tactic:
rfl
instance CompHaus.forget_reflectsIsomorphisms : ReflectsIsomorphisms (forget CompHaus.{u}) :=
  ⟨by 

Proof state:
⊢ ∀ {A B : CompHaus} (f : A ⟶ B) [inst : IsIso ((forget CompHaus).map f)], IsIso f

Next tactic:
intro A B f hf
instance CompHaus.forget_reflectsIsomorphisms : ReflectsIsomorphisms (forget CompHaus.{u}) :=
  ⟨by intro A B f hf; 

Proof state:
A B : CompHaus
f : A ⟶ B
hf : IsIso ((forget CompHaus).map f)
⊢ IsIso f

Next tactic:
exact CompHaus.isIso_of_bijective _ ((isIso_iff_bijective f).mp hf)
/-- (Implementation) The bijection of homsets to establish the reflective adjunction of compact
Hausdorff spaces in topological spaces.
-/
noncomputable def stoneCechEquivalence (X : TopCat.{u}) (Y : CompHaus.{u}) :
    (stoneCechObj X ⟶ Y) ≃ (X ⟶ compHausToTop.obj Y) where
  toFun f :=
    { toFun := f ∘ stoneCechUnit
      continuous_toFun := f.2.comp (@continuous_stoneCechUnit X _) }
  invFun f :=
    { toFun := stoneCechExtend f.2
      continuous_toFun := continuous_stoneCechExtend f.2 }
  left_inv := by
    

Proof state:
X : TopCat
Y : CompHaus
⊢ Function.LeftInverse (fun f => ContinuousMap.mk (stoneCechExtend (_ : Continuous f.toFun))) fun f =>
    ContinuousMap.mk (⇑f ∘ stoneCechUnit)

Next tactic:
rintro ⟨f : StoneCech X ⟶ Y, hf : Continuous f⟩
/-- (Implementation) The bijection of homsets to establish the reflective adjunction of compact
Hausdorff spaces in topological spaces.
-/
noncomputable def stoneCechEquivalence (X : TopCat.{u}) (Y : CompHaus.{u}) :
    (stoneCechObj X ⟶ Y) ≃ (X ⟶ compHausToTop.obj Y) where
  toFun f :=
    { toFun := f ∘ stoneCechUnit
      continuous_toFun := f.2.comp (@continuous_stoneCechUnit X _) }
  invFun f :=
    { toFun := stoneCechExtend f.2
      continuous_toFun := continuous_stoneCechExtend f.2 }
  left_inv := by
    rintro ⟨f : StoneCech X ⟶ Y, hf : Continuous f⟩
    -- Porting note: `ext` fails.
    

Proof state:
case mk
X : TopCat
Y : CompHaus
f : StoneCech ↑X ⟶ ↑Y.toTop
hf : Continuous f
⊢ (fun f => ContinuousMap.mk (stoneCechExtend (_ : Continuous f.toFun)))
      ((fun f => ContinuousMap.mk (⇑f ∘ stoneCechUnit)) (ContinuousMap.mk f)) =
    ContinuousMap.mk f

Next tactic:
apply ContinuousMap.ext
/-- (Implementation) The bijection of homsets to establish the reflective adjunction of compact
Hausdorff spaces in topological spaces.
-/
noncomputable def stoneCechEquivalence (X : TopCat.{u}) (Y : CompHaus.{u}) :
    (stoneCechObj X ⟶ Y) ≃ (X ⟶ compHausToTop.obj Y) where
  toFun f :=
    { toFun := f ∘ stoneCechUnit
      continuous_toFun := f.2.comp (@continuous_stoneCechUnit X _) }
  invFun f :=
    { toFun := stoneCechExtend f.2
      continuous_toFun := continuous_stoneCechExtend f.2 }
  left_inv := by
    rintro ⟨f : StoneCech X ⟶ Y, hf : Continuous f⟩
    -- Porting note: `ext` fails.
    apply ContinuousMap.ext
    

Proof state:
case mk.h
X : TopCat
Y : CompHaus
f : StoneCech ↑X ⟶ ↑Y.toTop
hf : Continuous f
⊢ ∀ (a : ↑(stoneCechObj X).toTop),
    ((fun f => ContinuousMap.mk (stoneCechExtend (_ : Continuous f.toFun)))
          ((fun f => ContinuousMap.mk (⇑f ∘ stoneCechUnit)) (ContinuousMap.mk f)))
        a =
      (ContinuousMap.mk f) a

Next tactic:
intro (x : StoneCech X)
/-- (Implementation) The bijection of homsets to establish the reflective adjunction of compact
Hausdorff spaces in topological spaces.
-/
noncomputable def stoneCechEquivalence (X : TopCat.{u}) (Y : CompHaus.{u}) :
    (stoneCechObj X ⟶ Y) ≃ (X ⟶ compHausToTop.obj Y) where
  toFun f :=
    { toFun := f ∘ stoneCechUnit
      continuous_toFun := f.2.comp (@continuous_stoneCechUnit X _) }
  invFun f :=
    { toFun := stoneCechExtend f.2
      continuous_toFun := continuous_stoneCechExtend f.2 }
  left_inv := by
    rintro ⟨f : StoneCech X ⟶ Y, hf : Continuous f⟩
    -- Porting note: `ext` fails.
    apply ContinuousMap.ext
    intro (x : StoneCech X)
    

Proof state:
case mk.h
X : TopCat
Y : CompHaus
f : StoneCech ↑X ⟶ ↑Y.toTop
hf : Continuous f
x : StoneCech ↑X
⊢ ((fun f => ContinuousMap.mk (stoneCechExtend (_ : Continuous f.toFun)))
        ((fun f => ContinuousMap.mk (⇑f ∘ stoneCechUnit)) (ContinuousMap.mk f)))
      x =
    (ContinuousMap.mk f) x

Next tactic:
refine' congr_fun _ x
/-- (Implementation) The bijection of homsets to establish the reflective adjunction of compact
Hausdorff spaces in topological spaces.
-/
noncomputable def stoneCechEquivalence (X : TopCat.{u}) (Y : CompHaus.{u}) :
    (stoneCechObj X ⟶ Y) ≃ (X ⟶ compHausToTop.obj Y) where
  toFun f :=
    { toFun := f ∘ stoneCechUnit
      continuous_toFun := f.2.comp (@continuous_stoneCechUnit X _) }
  invFun f :=
    { toFun := stoneCechExtend f.2
      continuous_toFun := continuous_stoneCechExtend f.2 }
  left_inv := by
    rintro ⟨f : StoneCech X ⟶ Y, hf : Continuous f⟩
    -- Porting note: `ext` fails.
    apply ContinuousMap.ext
    intro (x : StoneCech X)
    refine' congr_fun _ x
    

Proof state:
case mk.h
X : TopCat
Y : CompHaus
f : StoneCech ↑X ⟶ ↑Y.toTop
hf : Continuous f
x : StoneCech ↑X
⊢ ⇑((fun f => ContinuousMap.mk (stoneCechExtend (_ : Continuous f.toFun)))
        ((fun f => ContinuousMap.mk (⇑f ∘ stoneCechUnit)) (ContinuousMap.mk f))) =
    ⇑(ContinuousMap.mk f)

Next tactic:
apply Continuous.ext_on denseRange_stoneCechUnit (continuous_stoneCechExtend _) hf
/-- (Implementation) The bijection of homsets to establish the reflective adjunction of compact
Hausdorff spaces in topological spaces.
-/
noncomputable def stoneCechEquivalence (X : TopCat.{u}) (Y : CompHaus.{u}) :
    (stoneCechObj X ⟶ Y) ≃ (X ⟶ compHausToTop.obj Y) where
  toFun f :=
    { toFun := f ∘ stoneCechUnit
      continuous_toFun := f.2.comp (@continuous_stoneCechUnit X _) }
  invFun f :=
    { toFun := stoneCechExtend f.2
      continuous_toFun := continuous_stoneCechExtend f.2 }
  left_inv := by
    rintro ⟨f : StoneCech X ⟶ Y, hf : Continuous f⟩
    -- Porting note: `ext` fails.
    apply ContinuousMap.ext
    intro (x : StoneCech X)
    refine' congr_fun _ x
    apply Continuous.ext_on denseRange_stoneCechUnit (continuous_stoneCechExtend _) hf
    

Proof state:
case mk.h
X : TopCat
Y : CompHaus
f : StoneCech ↑X ⟶ ↑Y.toTop
hf : Continuous f
x : StoneCech ↑X
⊢ Set.EqOn (stoneCechExtend ?m.48591) f (Set.range stoneCechUnit)
X : TopCat
Y : CompHaus
f : StoneCech ↑X ⟶ ↑Y.toTop
hf : Continuous f
x : StoneCech ↑X
⊢ Continuous ((fun f => ContinuousMap.mk (⇑f ∘ stoneCechUnit)) (ContinuousMap.mk f)).toFun

Next tactic:
rintro _ ⟨y, rfl⟩
/-- (Implementation) The bijection of homsets to establish the reflective adjunction of compact
Hausdorff spaces in topological spaces.
-/
noncomputable def stoneCechEquivalence (X : TopCat.{u}) (Y : CompHaus.{u}) :
    (stoneCechObj X ⟶ Y) ≃ (X ⟶ compHausToTop.obj Y) where
  toFun f :=
    { toFun := f ∘ stoneCechUnit
      continuous_toFun := f.2.comp (@continuous_stoneCechUnit X _) }
  invFun f :=
    { toFun := stoneCechExtend f.2
      continuous_toFun := continuous_stoneCechExtend f.2 }
  left_inv := by
    rintro ⟨f : StoneCech X ⟶ Y, hf : Continuous f⟩
    -- Porting note: `ext` fails.
    apply ContinuousMap.ext
    intro (x : StoneCech X)
    refine' congr_fun _ x
    apply Continuous.ext_on denseRange_stoneCechUnit (continuous_stoneCechExtend _) hf
    rintro _ ⟨y, rfl⟩
    

Proof state:
case mk.h.intro
X : TopCat
Y : CompHaus
f : StoneCech ↑X ⟶ ↑Y.toTop
hf : Continuous f
x : StoneCech ↑X
y : ↑X
⊢ stoneCechExtend ?m.48591 (stoneCechUnit y) = f (stoneCechUnit y)
X : TopCat
Y : CompHaus
f : StoneCech ↑X ⟶ ↑Y.toTop
hf : Continuous f
x : StoneCech ↑X
⊢ Continuous ((fun f => ContinuousMap.mk (⇑f ∘ stoneCechUnit)) (ContinuousMap.mk f)).toFun

Next tactic:
apply congr_fun (stoneCechExtend_extends (hf.comp _)) y