l3lab/ntp-mathlib huggingface dataset:
/-- If the codomain of a homeomorphism is a locally connected space, then the domain is also
a locally connected space. -/
theorem locallyConnectedSpace [i : LocallyConnectedSpace Y] (h : X ≃ₜ Y) :
    LocallyConnectedSpace X := by
  have : ∀ x, (𝓝 x).HasBasis (fun s ↦ IsOpen s ∧ h x ∈ s ∧ IsConnected s)
      (h.symm '' ·) := fun x ↦ by
    rw [← h.symm_map_nhds_eq]
    exact (i.1 _).map _
  refine locallyConnectedSpace_of_connected_bases _ _ this fun _ _ hs ↦ ?_
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝¹ : TopologicalSpace X'
inst✝ : TopologicalSpace Y'
i : LocallyConnectedSpace Y
h : X ≃ₜ Y
this : ∀ (x : X), HasBasis (𝓝 x) (fun s => IsOpen s ∧ h x ∈ s ∧ IsConnected s) fun x => ⇑(Homeomorph.symm h) '' x
x✝¹ : X
x✝ : Set Y
hs : IsOpen x✝ ∧ h x✝¹ ∈ x✝ ∧ IsConnected x✝
⊢ IsPreconnected (⇑(Homeomorph.symm h) '' x✝)

Next tactic:
exact hs.2.2.2.image _ h.symm.continuous.continuousOn
/-- If a bijective map `e : X ≃ Y` is continuous and open, then it is a homeomorphism. -/
def homeomorphOfContinuousOpen (e : X ≃ Y) (h₁ : Continuous e) (h₂ : IsOpenMap e) : X ≃ₜ Y where
  continuous_toFun := h₁
  continuous_invFun := by
    

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝¹ : TopologicalSpace X'
inst✝ : TopologicalSpace Y'
e : X ≃ Y
h₁ : Continuous ⇑e
h₂ : IsOpenMap ⇑e
⊢ Continuous e.invFun

Next tactic:
rw [continuous_def]
/-- If a bijective map `e : X ≃ Y` is continuous and open, then it is a homeomorphism. -/
def homeomorphOfContinuousOpen (e : X ≃ Y) (h₁ : Continuous e) (h₂ : IsOpenMap e) : X ≃ₜ Y where
  continuous_toFun := h₁
  continuous_invFun := by
    rw [continuous_def]
    

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝¹ : TopologicalSpace X'
inst✝ : TopologicalSpace Y'
e : X ≃ Y
h₁ : Continuous ⇑e
h₂ : IsOpenMap ⇑e
⊢ ∀ (s : Set X), IsOpen s → IsOpen (e.invFun ⁻¹' s)

Next tactic:
intro s hs
/-- If a bijective map `e : X ≃ Y` is continuous and open, then it is a homeomorphism. -/
def homeomorphOfContinuousOpen (e : X ≃ Y) (h₁ : Continuous e) (h₂ : IsOpenMap e) : X ≃ₜ Y where
  continuous_toFun := h₁
  continuous_invFun := by
    rw [continuous_def]
    intro s hs
    

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝¹ : TopologicalSpace X'
inst✝ : TopologicalSpace Y'
e : X ≃ Y
h₁ : Continuous ⇑e
h₂ : IsOpenMap ⇑e
s : Set X
hs : IsOpen s
⊢ IsOpen (e.invFun ⁻¹' s)

Next tactic:
convert ← h₂ s hs using 1
/-- If a bijective map `e : X ≃ Y` is continuous and open, then it is a homeomorphism. -/
def homeomorphOfContinuousOpen (e : X ≃ Y) (h₁ : Continuous e) (h₂ : IsOpenMap e) : X ≃ₜ Y where
  continuous_toFun := h₁
  continuous_invFun := by
    rw [continuous_def]
    intro s hs
    convert ← h₂ s hs using 1
    

Proof state:
case h.e'_3
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝¹ : TopologicalSpace X'
inst✝ : TopologicalSpace Y'
e : X ≃ Y
h₁ : Continuous ⇑e
h₂ : IsOpenMap ⇑e
s : Set X
hs : IsOpen s
⊢ ⇑e '' s = e.invFun ⁻¹' s

Next tactic:
apply e.image_eq_preimage
theorem comp_continuousAt_iff' (h : X ≃ₜ Y) (f : Y → Z) (x : X) :
    ContinuousAt (f ∘ h) x ↔ ContinuousAt f (h x) :=
  h.inducing.continuousAt_iff' (by 

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝¹ : TopologicalSpace X'
inst✝ : TopologicalSpace Y'
h : X ≃ₜ Y
f : Y → Z
x : X
⊢ range ⇑h ∈ 𝓝 (h x)

Next tactic:
simp
@[simp]
theorem comp_isOpenMap_iff (h : X ≃ₜ Y) {f : Z → X} : IsOpenMap (h ∘ f) ↔ IsOpenMap f := by
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝¹ : TopologicalSpace X'
inst✝ : TopologicalSpace Y'
h : X ≃ₜ Y
f : Z → X
⊢ IsOpenMap (⇑h ∘ f) ↔ IsOpenMap f

Next tactic:
refine' ⟨_, fun hf => h.isOpenMap.comp hf⟩
@[simp]
theorem comp_isOpenMap_iff (h : X ≃ₜ Y) {f : Z → X} : IsOpenMap (h ∘ f) ↔ IsOpenMap f := by
  refine' ⟨_, fun hf => h.isOpenMap.comp hf⟩
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝¹ : TopologicalSpace X'
inst✝ : TopologicalSpace Y'
h : X ≃ₜ Y
f : Z → X
⊢ IsOpenMap (⇑h ∘ f) → IsOpenMap f

Next tactic:
intro hf
@[simp]
theorem comp_isOpenMap_iff (h : X ≃ₜ Y) {f : Z → X} : IsOpenMap (h ∘ f) ↔ IsOpenMap f := by
  refine' ⟨_, fun hf => h.isOpenMap.comp hf⟩
  intro hf
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝¹ : TopologicalSpace X'
inst✝ : TopologicalSpace Y'
h : X ≃ₜ Y
f : Z → X
hf : IsOpenMap (⇑h ∘ f)
⊢ IsOpenMap f

Next tactic:
rw [← Function.comp.left_id f, ← h.symm_comp_self, Function.comp.assoc]
@[simp]
theorem comp_isOpenMap_iff (h : X ≃ₜ Y) {f : Z → X} : IsOpenMap (h ∘ f) ↔ IsOpenMap f := by
  refine' ⟨_, fun hf => h.isOpenMap.comp hf⟩
  intro hf
  rw [← Function.comp.left_id f, ← h.symm_comp_self, Function.comp.assoc]
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝¹ : TopologicalSpace X'
inst✝ : TopologicalSpace Y'
h : X ≃ₜ Y
f : Z → X
hf : IsOpenMap (⇑h ∘ f)
⊢ IsOpenMap (⇑(Homeomorph.symm h) ∘ ⇑h ∘ f)

Next tactic:
exact h.symm.isOpenMap.comp hf
@[simp]
theorem comp_isOpenMap_iff' (h : X ≃ₜ Y) {f : Y → Z} : IsOpenMap (f ∘ h) ↔ IsOpenMap f := by
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝¹ : TopologicalSpace X'
inst✝ : TopologicalSpace Y'
h : X ≃ₜ Y
f : Y → Z
⊢ IsOpenMap (f ∘ ⇑h) ↔ IsOpenMap f

Next tactic:
refine' ⟨_, fun hf => hf.comp h.isOpenMap⟩
@[simp]
theorem comp_isOpenMap_iff' (h : X ≃ₜ Y) {f : Y → Z} : IsOpenMap (f ∘ h) ↔ IsOpenMap f := by
  refine' ⟨_, fun hf => hf.comp h.isOpenMap⟩
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝¹ : TopologicalSpace X'
inst✝ : TopologicalSpace Y'
h : X ≃ₜ Y
f : Y → Z
⊢ IsOpenMap (f ∘ ⇑h) → IsOpenMap f

Next tactic:
intro hf
@[simp]
theorem comp_isOpenMap_iff' (h : X ≃ₜ Y) {f : Y → Z} : IsOpenMap (f ∘ h) ↔ IsOpenMap f := by
  refine' ⟨_, fun hf => hf.comp h.isOpenMap⟩
  intro hf
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝¹ : TopologicalSpace X'
inst✝ : TopologicalSpace Y'
h : X ≃ₜ Y
f : Y → Z
hf : IsOpenMap (f ∘ ⇑h)
⊢ IsOpenMap f

Next tactic:
rw [← Function.comp.right_id f, ← h.self_comp_symm, ← Function.comp.assoc]
@[simp]
theorem comp_isOpenMap_iff' (h : X ≃ₜ Y) {f : Y → Z} : IsOpenMap (f ∘ h) ↔ IsOpenMap f := by
  refine' ⟨_, fun hf => hf.comp h.isOpenMap⟩
  intro hf
  rw [← Function.comp.right_id f, ← h.self_comp_symm, ← Function.comp.assoc]
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝⁴ : TopologicalSpace X
inst✝³ : TopologicalSpace Y
inst✝² : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝¹ : TopologicalSpace X'
inst✝ : TopologicalSpace Y'
h : X ≃ₜ Y
f : Y → Z
hf : IsOpenMap (f ∘ ⇑h)
⊢ IsOpenMap ((f ∘ ⇑h) ∘ ⇑(Homeomorph.symm h))

Next tactic:
exact hf.comp h.symm.isOpenMap
/-- `Equiv.piCongrLeft` as a homeomorphism: this is the natural homeomorphism
`Π i, Y (e i) ≃ₜ Π j, Y j` obtained from a bijection `ι ≃ ι'`. -/
@[simps! apply toEquiv]
def piCongrLeft {ι ι' : Type*} {Y : ι' → Type*} [∀ j, TopologicalSpace (Y j)]
    (e : ι ≃ ι') : (∀ i, Y (e i)) ≃ₜ ∀ j, Y j where
  continuous_toFun := continuous_pi <| e.forall_congr_left.mp <| fun i ↦ by
    

Proof state:
X : Type u_1
Y✝ : Type u_2
Z : Type u_3
inst✝⁵ : TopologicalSpace X
inst✝⁴ : TopologicalSpace Y✝
inst✝³ : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝² : TopologicalSpace X'
inst✝¹ : TopologicalSpace Y'
ι : Type u_6
ι' : Type u_7
Y : ι' → Type u_8
inst✝ : (j : ι') → TopologicalSpace (Y j)
e : ι ≃ ι'
i : ι
⊢ Continuous fun a => Equiv.toFun (Equiv.piCongrLeft Y e) a (e i)

Next tactic:
simpa only [Equiv.toFun_as_coe, Equiv.piCongrLeft_apply_apply] using continuous_apply i
/-- The topological space `Π i, Y i` can be split as a product by separating the indices in ι
  depending on whether they satisfy a predicate p or not.-/
@[simps!]
def piEquivPiSubtypeProd (p : ι → Prop) (Y : ι → Type*) [∀ i, TopologicalSpace (Y i)]
    [DecidablePred p] : (∀ i, Y i) ≃ₜ (∀ i : { x // p x }, Y i) × ∀ i : { x // ¬p x }, Y i
    where
  toEquiv := Equiv.piEquivPiSubtypeProd p Y
  continuous_toFun := by
    

Proof state:
X : Type u_1
Y✝ : Type u_2
Z : Type u_3
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y✝
inst✝⁴ : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝³ : TopologicalSpace X'
inst✝² : TopologicalSpace Y'
ι : Type u_6
p : ι → Prop
Y : ι → Type u_7
inst✝¹ : (i : ι) → TopologicalSpace (Y i)
inst✝ : DecidablePred p
⊢ Continuous (Equiv.piEquivPiSubtypeProd p Y).toFun

Next tactic:
apply Continuous.prod_mk
/-- The topological space `Π i, Y i` can be split as a product by separating the indices in ι
  depending on whether they satisfy a predicate p or not.-/
@[simps!]
def piEquivPiSubtypeProd (p : ι → Prop) (Y : ι → Type*) [∀ i, TopologicalSpace (Y i)]
    [DecidablePred p] : (∀ i, Y i) ≃ₜ (∀ i : { x // p x }, Y i) × ∀ i : { x // ¬p x }, Y i
    where
  toEquiv := Equiv.piEquivPiSubtypeProd p Y
  continuous_toFun := by
    apply Continuous.prod_mk <;> 

Proof state:
case hf
X : Type u_1
Y✝ : Type u_2
Z : Type u_3
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y✝
inst✝⁴ : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝³ : TopologicalSpace X'
inst✝² : TopologicalSpace Y'
ι : Type u_6
p : ι → Prop
Y : ι → Type u_7
inst✝¹ : (i : ι) → TopologicalSpace (Y i)
inst✝ : DecidablePred p
⊢ Continuous fun x x_1 => x ↑x_1

Next tactic:
exact continuous_pi fun j => continuous_apply j.1
/-- The topological space `Π i, Y i` can be split as a product by separating the indices in ι
  depending on whether they satisfy a predicate p or not.-/
@[simps!]
def piEquivPiSubtypeProd (p : ι → Prop) (Y : ι → Type*) [∀ i, TopologicalSpace (Y i)]
    [DecidablePred p] : (∀ i, Y i) ≃ₜ (∀ i : { x // p x }, Y i) × ∀ i : { x // ¬p x }, Y i
    where
  toEquiv := Equiv.piEquivPiSubtypeProd p Y
  continuous_toFun := by
    apply Continuous.prod_mk <;> 

Proof state:
case hg
X : Type u_1
Y✝ : Type u_2
Z : Type u_3
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y✝
inst✝⁴ : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝³ : TopologicalSpace X'
inst✝² : TopologicalSpace Y'
ι : Type u_6
p : ι → Prop
Y : ι → Type u_7
inst✝¹ : (i : ι) → TopologicalSpace (Y i)
inst✝ : DecidablePred p
⊢ Continuous fun x x_1 => x ↑x_1

Next tactic:
exact continuous_pi fun j => continuous_apply j.1
/-- The topological space `Π i, Y i` can be split as a product by separating the indices in ι
  depending on whether they satisfy a predicate p or not.-/
@[simps!]
def piEquivPiSubtypeProd (p : ι → Prop) (Y : ι → Type*) [∀ i, TopologicalSpace (Y i)]
    [DecidablePred p] : (∀ i, Y i) ≃ₜ (∀ i : { x // p x }, Y i) × ∀ i : { x // ¬p x }, Y i
    where
  toEquiv := Equiv.piEquivPiSubtypeProd p Y
  continuous_toFun := by
    apply Continuous.prod_mk <;> exact continuous_pi fun j => continuous_apply j.1
  continuous_invFun :=
    continuous_pi fun j => by
      

Proof state:
X : Type u_1
Y✝ : Type u_2
Z : Type u_3
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y✝
inst✝⁴ : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝³ : TopologicalSpace X'
inst✝² : TopologicalSpace Y'
ι : Type u_6
p : ι → Prop
Y : ι → Type u_7
inst✝¹ : (i : ι) → TopologicalSpace (Y i)
inst✝ : DecidablePred p
j : ι
⊢ Continuous fun a => Equiv.invFun (Equiv.piEquivPiSubtypeProd p Y) a j

Next tactic:
dsimp only [Equiv.piEquivPiSubtypeProd]
/-- The topological space `Π i, Y i` can be split as a product by separating the indices in ι
  depending on whether they satisfy a predicate p or not.-/
@[simps!]
def piEquivPiSubtypeProd (p : ι → Prop) (Y : ι → Type*) [∀ i, TopologicalSpace (Y i)]
    [DecidablePred p] : (∀ i, Y i) ≃ₜ (∀ i : { x // p x }, Y i) × ∀ i : { x // ¬p x }, Y i
    where
  toEquiv := Equiv.piEquivPiSubtypeProd p Y
  continuous_toFun := by
    apply Continuous.prod_mk <;> exact continuous_pi fun j => continuous_apply j.1
  continuous_invFun :=
    continuous_pi fun j => by
      dsimp only [Equiv.piEquivPiSubtypeProd]; 

Proof state:
X : Type u_1
Y✝ : Type u_2
Z : Type u_3
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y✝
inst✝⁴ : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝³ : TopologicalSpace X'
inst✝² : TopologicalSpace Y'
ι : Type u_6
p : ι → Prop
Y : ι → Type u_7
inst✝¹ : (i : ι) → TopologicalSpace (Y i)
inst✝ : DecidablePred p
j : ι
⊢ Continuous fun a => if h : p j then a.1 { val := j, property := h } else a.2 { val := j, property := h }

Next tactic:
split_ifs
/-- The topological space `Π i, Y i` can be split as a product by separating the indices in ι
  depending on whether they satisfy a predicate p or not.-/
@[simps!]
def piEquivPiSubtypeProd (p : ι → Prop) (Y : ι → Type*) [∀ i, TopologicalSpace (Y i)]
    [DecidablePred p] : (∀ i, Y i) ≃ₜ (∀ i : { x // p x }, Y i) × ∀ i : { x // ¬p x }, Y i
    where
  toEquiv := Equiv.piEquivPiSubtypeProd p Y
  continuous_toFun := by
    apply Continuous.prod_mk <;> exact continuous_pi fun j => continuous_apply j.1
  continuous_invFun :=
    continuous_pi fun j => by
      dsimp only [Equiv.piEquivPiSubtypeProd]; split_ifs
      

Proof state:
case pos
X : Type u_1
Y✝ : Type u_2
Z : Type u_3
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y✝
inst✝⁴ : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝³ : TopologicalSpace X'
inst✝² : TopologicalSpace Y'
ι : Type u_6
p : ι → Prop
Y : ι → Type u_7
inst✝¹ : (i : ι) → TopologicalSpace (Y i)
inst✝ : DecidablePred p
j : ι
h✝ : p j
⊢ Continuous fun a => a.1 { val := j, property := h✝ }
case neg
X : Type u_1
Y✝ : Type u_2
Z : Type u_3
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y✝
inst✝⁴ : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝³ : TopologicalSpace X'
inst✝² : TopologicalSpace Y'
ι : Type u_6
p : ι → Prop
Y : ι → Type u_7
inst✝¹ : (i : ι) → TopologicalSpace (Y i)
inst✝ : DecidablePred p
j : ι
h✝ : ¬p j
⊢ Continuous fun a => a.2 { val := j, property := h✝ }

Next tactic:
exacts [(continuous_apply _).comp continuous_fst, (continuous_apply _).comp continuous_snd]
/-- A product of topological spaces can be split as the binary product of one of the spaces and
  the product of all the remaining spaces. -/
@[simps!]
def piSplitAt (Y : ι → Type*) [∀ j, TopologicalSpace (Y j)] :
    (∀ j, Y j) ≃ₜ Y i × ∀ j : { j // j ≠ i }, Y j
    where
  toEquiv := Equiv.piSplitAt i Y
  continuous_toFun := (continuous_apply i).prod_mk (continuous_pi fun j => continuous_apply j.1)
  continuous_invFun :=
    continuous_pi fun j => by
      

Proof state:
X : Type u_1
Y✝ : Type u_2
Z : Type u_3
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y✝
inst✝⁴ : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝³ : TopologicalSpace X'
inst✝² : TopologicalSpace Y'
ι : Type u_6
inst✝¹ : DecidableEq ι
i : ι
Y : ι → Type u_7
inst✝ : (j : ι) → TopologicalSpace (Y j)
j : ι
⊢ Continuous fun a => Equiv.invFun (Equiv.piSplitAt i Y) a j

Next tactic:
dsimp only [Equiv.piSplitAt]
/-- A product of topological spaces can be split as the binary product of one of the spaces and
  the product of all the remaining spaces. -/
@[simps!]
def piSplitAt (Y : ι → Type*) [∀ j, TopologicalSpace (Y j)] :
    (∀ j, Y j) ≃ₜ Y i × ∀ j : { j // j ≠ i }, Y j
    where
  toEquiv := Equiv.piSplitAt i Y
  continuous_toFun := (continuous_apply i).prod_mk (continuous_pi fun j => continuous_apply j.1)
  continuous_invFun :=
    continuous_pi fun j => by
      dsimp only [Equiv.piSplitAt]
      

Proof state:
X : Type u_1
Y✝ : Type u_2
Z : Type u_3
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y✝
inst✝⁴ : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝³ : TopologicalSpace X'
inst✝² : TopologicalSpace Y'
ι : Type u_6
inst✝¹ : DecidableEq ι
i : ι
Y : ι → Type u_7
inst✝ : (j : ι) → TopologicalSpace (Y j)
j : ι
⊢ Continuous fun a => if h : j = i then (_ : i = j) ▸ a.1 else a.2 { val := j, property := h }

Next tactic:
split_ifs with h
/-- A product of topological spaces can be split as the binary product of one of the spaces and
  the product of all the remaining spaces. -/
@[simps!]
def piSplitAt (Y : ι → Type*) [∀ j, TopologicalSpace (Y j)] :
    (∀ j, Y j) ≃ₜ Y i × ∀ j : { j // j ≠ i }, Y j
    where
  toEquiv := Equiv.piSplitAt i Y
  continuous_toFun := (continuous_apply i).prod_mk (continuous_pi fun j => continuous_apply j.1)
  continuous_invFun :=
    continuous_pi fun j => by
      dsimp only [Equiv.piSplitAt]
      split_ifs with h
      

Proof state:
case pos
X : Type u_1
Y✝ : Type u_2
Z : Type u_3
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y✝
inst✝⁴ : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝³ : TopologicalSpace X'
inst✝² : TopologicalSpace Y'
ι : Type u_6
inst✝¹ : DecidableEq ι
i : ι
Y : ι → Type u_7
inst✝ : (j : ι) → TopologicalSpace (Y j)
j : ι
h : j = i
⊢ Continuous fun a => (_ : i = j) ▸ a.1
case neg
X : Type u_1
Y✝ : Type u_2
Z : Type u_3
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y✝
inst✝⁴ : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝³ : TopologicalSpace X'
inst✝² : TopologicalSpace Y'
ι : Type u_6
inst✝¹ : DecidableEq ι
i : ι
Y : ι → Type u_7
inst✝ : (j : ι) → TopologicalSpace (Y j)
j : ι
h : ¬j = i
⊢ Continuous fun a => a.2 { val := j, property := h }

Next tactic:
subst h
/-- A product of topological spaces can be split as the binary product of one of the spaces and
  the product of all the remaining spaces. -/
@[simps!]
def piSplitAt (Y : ι → Type*) [∀ j, TopologicalSpace (Y j)] :
    (∀ j, Y j) ≃ₜ Y i × ∀ j : { j // j ≠ i }, Y j
    where
  toEquiv := Equiv.piSplitAt i Y
  continuous_toFun := (continuous_apply i).prod_mk (continuous_pi fun j => continuous_apply j.1)
  continuous_invFun :=
    continuous_pi fun j => by
      dsimp only [Equiv.piSplitAt]
      split_ifs with h
      subst h
      

Proof state:
case pos
X : Type u_1
Y✝ : Type u_2
Z : Type u_3
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y✝
inst✝⁴ : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝³ : TopologicalSpace X'
inst✝² : TopologicalSpace Y'
ι : Type u_6
inst✝¹ : DecidableEq ι
Y : ι → Type u_7
inst✝ : (j : ι) → TopologicalSpace (Y j)
j : ι
⊢ Continuous fun a => (_ : j = j) ▸ a.1
case neg
X : Type u_1
Y✝ : Type u_2
Z : Type u_3
inst✝⁶ : TopologicalSpace X
inst✝⁵ : TopologicalSpace Y✝
inst✝⁴ : TopologicalSpace Z
X' : Type u_4
Y' : Type u_5
inst✝³ : TopologicalSpace X'
inst✝² : TopologicalSpace Y'
ι : Type u_6
inst✝¹ : DecidableEq ι
i : ι
Y : ι → Type u_7
inst✝ : (j : ι) → TopologicalSpace (Y j)
j : ι
h : ¬j = i
⊢ Continuous fun a => a.2 { val := j, property := h }

Next tactic:
exacts [continuous_fst, (continuous_apply _).comp continuous_snd]
/-- An equiv between topological spaces respecting openness is a homeomorphism. -/
@[simps toEquiv]
def toHomeomorph (e : X ≃ Y) (he : ∀ s, IsOpen (e ⁻¹' s) ↔ IsOpen s) : X ≃ₜ Y where
  toEquiv := e
  continuous_toFun := continuous_def.2 λ s ↦ (he _).2
  continuous_invFun := continuous_def.2 λ s ↦ by 

Proof state:
X : Type u_1
Y : Type u_2
Z✝ : Type u_3
Z : Type u_4
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
e : X ≃ Y
he : ∀ (s : Set Y), IsOpen (⇑e ⁻¹' s) ↔ IsOpen s
s : Set X
⊢ IsOpen s → IsOpen (e.invFun ⁻¹' s)

Next tactic:
convert (he _).1
/-- An equiv between topological spaces respecting openness is a homeomorphism. -/
@[simps toEquiv]
def toHomeomorph (e : X ≃ Y) (he : ∀ s, IsOpen (e ⁻¹' s) ↔ IsOpen s) : X ≃ₜ Y where
  toEquiv := e
  continuous_toFun := continuous_def.2 λ s ↦ (he _).2
  continuous_invFun := continuous_def.2 λ s ↦ by convert (he _).1; 

Proof state:
case h.h.e'_3
X : Type u_1
Y : Type u_2
Z✝ : Type u_3
Z : Type u_4
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
e : X ≃ Y
he : ∀ (s : Set Y), IsOpen (⇑e ⁻¹' s) ↔ IsOpen s
s : Set X
⊢ s = ⇑e ⁻¹' (e.invFun ⁻¹' s)

Next tactic:
simp
@[simp] lemma toHomeomorph_symm (e : X ≃ Y) (he) :
  (e.toHomeomorph he).symm = e.symm.toHomeomorph λ s ↦ by 

Proof state:
X : Type u_1
Y : Type u_2
Z✝ : Type u_3
Z : Type u_4
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
e : X ≃ Y
he : ∀ (s : Set Y), IsOpen (⇑e ⁻¹' s) ↔ IsOpen s
s : Set X
⊢ IsOpen (⇑e.symm ⁻¹' s) ↔ IsOpen s

Next tactic:
convert (he _).symm
@[simp] lemma toHomeomorph_symm (e : X ≃ Y) (he) :
  (e.toHomeomorph he).symm = e.symm.toHomeomorph λ s ↦ by convert (he _).symm; 

Proof state:
case h.e'_2.h.e'_3
X : Type u_1
Y : Type u_2
Z✝ : Type u_3
Z : Type u_4
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
e : X ≃ Y
he : ∀ (s : Set Y), IsOpen (⇑e ⁻¹' s) ↔ IsOpen s
s : Set X
⊢ s = ⇑e ⁻¹' (⇑e.symm ⁻¹' s)

Next tactic:
simp
/-- An inducing equiv between topological spaces is a homeomorphism. -/
@[simps toEquiv] -- porting note: TODO: was `@[simps]`
def toHomeomorphOfInducing (f : X ≃ Y) (hf : Inducing f) : X ≃ₜ Y :=
  { f with
    continuous_toFun := hf.continuous
    continuous_invFun := hf.continuous_iff.2 <| by 

Proof state:
X : Type u_1
Y : Type u_2
Z✝ : Type u_3
Z : Type u_4
inst✝² : TopologicalSpace X
inst✝¹ : TopologicalSpace Y
inst✝ : TopologicalSpace Z
f : X ≃ Y
hf : Inducing ⇑f
⊢ Continuous
    (⇑f ∘
      { toFun := f.toFun, invFun := f.invFun, left_inv := (_ : Function.LeftInverse f.invFun f.toFun),
          right_inv := (_ : Function.RightInverse f.invFun f.toFun) }.invFun)

Next tactic:
simpa using continuous_id
theorem continuous_symm_of_equiv_compact_to_t2 [CompactSpace X] [T2Space Y] {f : X ≃ Y}
    (hf : Continuous f) : Continuous f.symm := by
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝³ : TopologicalSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : CompactSpace X
inst✝ : T2Space Y
f : X ≃ Y
hf : Continuous ⇑f
⊢ Continuous ⇑f.symm

Next tactic:
rw [continuous_iff_isClosed]
theorem continuous_symm_of_equiv_compact_to_t2 [CompactSpace X] [T2Space Y] {f : X ≃ Y}
    (hf : Continuous f) : Continuous f.symm := by
  rw [continuous_iff_isClosed]
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝³ : TopologicalSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : CompactSpace X
inst✝ : T2Space Y
f : X ≃ Y
hf : Continuous ⇑f
⊢ ∀ (s : Set X), IsClosed s → IsClosed (⇑f.symm ⁻¹' s)

Next tactic:
intro C hC
theorem continuous_symm_of_equiv_compact_to_t2 [CompactSpace X] [T2Space Y] {f : X ≃ Y}
    (hf : Continuous f) : Continuous f.symm := by
  rw [continuous_iff_isClosed]
  intro C hC
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝³ : TopologicalSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : CompactSpace X
inst✝ : T2Space Y
f : X ≃ Y
hf : Continuous ⇑f
C : Set X
hC : IsClosed C
⊢ IsClosed (⇑f.symm ⁻¹' C)

Next tactic:
have hC' : IsClosed (f '' C) := (hC.isCompact.image hf).isClosed
theorem continuous_symm_of_equiv_compact_to_t2 [CompactSpace X] [T2Space Y] {f : X ≃ Y}
    (hf : Continuous f) : Continuous f.symm := by
  rw [continuous_iff_isClosed]
  intro C hC
  have hC' : IsClosed (f '' C) := (hC.isCompact.image hf).isClosed
  

Proof state:
X : Type u_1
Y : Type u_2
Z : Type u_3
inst✝³ : TopologicalSpace X
inst✝² : TopologicalSpace Y
inst✝¹ : CompactSpace X
inst✝ : T2Space Y
f : X ≃ Y
hf : Continuous ⇑f
C : Set X
hC : IsClosed C
hC' : IsClosed (⇑f '' C)
⊢ IsClosed (⇑f.symm ⁻¹' C)

Next tactic:
rwa [Equiv.image_eq_preimage] at hC'