-- Mathlib/Topology/Separation/Profinite.lean
theorem loc_compact_Haus_tot_disc_of_zero_dim [TotallyDisconnectedSpace H] :
    IsTopologicalBasis { s : Set H | IsClopen s }

Proof state:
case intro.intro.intro.intro
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
U : Set H
hU : IsOpen U
s : Set H
comp : IsCompact s
sU : s ⊆ U
u : Set ↑s := Subtype.val ⁻¹' interior s
u_open_in_s : IsOpen u
x : { x // x ∈ s }
memU : ↑x ∈ U
xs : ↑x ∈ interior s
⊢ ∃ v ∈ {s | IsClopen s}, ↑x ∈ v ∧ v ⊆ U

Tactic:
haveI : CompactSpace s := isCompact_iff_compactSpace.1 comp

Result:
case intro.intro.intro.intro
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
U : Set H
hU : IsOpen U
s : Set H
comp : IsCompact s
sU : s ⊆ U
u : Set ↑s := Subtype.val ⁻¹' interior s
u_open_in_s : IsOpen u
x : { x // x ∈ s }
memU : ↑x ∈ U
xs : ↑x ∈ interior s
this : CompactSpace ↑s
⊢ ∃ v ∈ {s | IsClopen s}, ↑x ∈ v ∧ v ⊆ U

Proof state:
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
U : Set H
hU : IsOpen U
s : Set H
comp : IsCompact s
sU : s ⊆ U
u : Set ↑s := Subtype.val ⁻¹' interior s
u_open_in_s : IsOpen u
x : { x // x ∈ s }
memU : ↑x ∈ U
xs : ↑x ∈ interior s
this✝ : CompactSpace ↑s
V : Set ↑s
VisClopen : IsClopen V
Vx : x ∈ V
V_sub : V ⊆ u
v : Set ↑u := Subtype.val ⁻¹' V
this : (fun x => ↑↑x) = Subtype.val ∘ Subtype.val
f0 : IsEmbedding fun x => ↑↑x
f1 : IsOpenEmbedding fun x => ↑↑x
f2 : IsOpen v
⊢ Subtype.val '' V = (fun x => ↑↑x) '' v

Tactic:
rw [this, image_comp, Subtype.image_preimage_coe, inter_eq_self_of_subset_right V_sub]

Result:
no goals

Proof state:
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
U : Set H
hU : IsOpen U
s : Set H
comp : IsCompact s
sU : s ⊆ U
u : Set ↑s := Subtype.val ⁻¹' interior s
u_open_in_s : IsOpen u
x : { x // x ∈ s }
memU : ↑x ∈ U
xs : ↑x ∈ interior s
this✝¹ : CompactSpace ↑s
V : Set ↑s
VisClopen : IsClopen V
Vx : x ∈ V
V_sub : V ⊆ u
v : Set ↑u := Subtype.val ⁻¹' V
this✝ : (fun x => ↑↑x) = Subtype.val ∘ Subtype.val
f0 : IsEmbedding fun x => ↑↑x
this : (range fun x => ↑↑x) = interior s
⊢ IsOpen (range fun x => ↑↑x)

Tactic:
rw [this]

Result:
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
U : Set H
hU : IsOpen U
s : Set H
comp : IsCompact s
sU : s ⊆ U
u : Set ↑s := Subtype.val ⁻¹' interior s
u_open_in_s : IsOpen u
x : { x // x ∈ s }
memU : ↑x ∈ U
xs : ↑x ∈ interior s
this✝¹ : CompactSpace ↑s
V : Set ↑s
VisClopen : IsClopen V
Vx : x ∈ V
V_sub : V ⊆ u
v : Set ↑u := Subtype.val ⁻¹' V
this✝ : (fun x => ↑↑x) = Subtype.val ∘ Subtype.val
f0 : IsEmbedding fun x => ↑↑x
this : (range fun x => ↑↑x) = interior s
⊢ IsOpen (interior s)

Proof state:
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
U : Set H
hU : IsOpen U
s : Set H
comp : IsCompact s
sU : s ⊆ U
u : Set ↑s := Subtype.val ⁻¹' interior s
u_open_in_s : IsOpen u
x : { x // x ∈ s }
memU : ↑x ∈ U
xs : ↑x ∈ interior s
this✝ : CompactSpace ↑s
V : Set ↑s
VisClopen : IsClopen V
Vx : x ∈ V
V_sub : V ⊆ u
v : Set ↑u := Subtype.val ⁻¹' V
this : (fun x => ↑↑x) = Subtype.val ∘ Subtype.val
f0 : IsEmbedding fun x => ↑↑x
f1 : IsOpenEmbedding fun x => ↑↑x
⊢ IsOpen (Subtype.val '' V)

Tactic:
have f2 : IsOpen v := VisClopen.2.preimage continuous_subtype_val

Result:
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
U : Set H
hU : IsOpen U
s : Set H
comp : IsCompact s
sU : s ⊆ U
u : Set ↑s := Subtype.val ⁻¹' interior s
u_open_in_s : IsOpen u
x : { x // x ∈ s }
memU : ↑x ∈ U
xs : ↑x ∈ interior s
this✝ : CompactSpace ↑s
V : Set ↑s
VisClopen : IsClopen V
Vx : x ∈ V
V_sub : V ⊆ u
v : Set ↑u := Subtype.val ⁻¹' V
this : (fun x => ↑↑x) = Subtype.val ∘ Subtype.val
f0 : IsEmbedding fun x => ↑↑x
f1 : IsOpenEmbedding fun x => ↑↑x
f2 : IsOpen v
⊢ IsOpen (Subtype.val '' V)

Proof state:
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
⊢ IsTopologicalBasis {s | IsClopen s}

Tactic:
refine isTopologicalBasis_of_isOpen_of_nhds (fun u hu => hu.2) fun x U memU hU => ?_

Result:
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
x : H
U : Set H
memU : x ∈ U
hU : IsOpen U
⊢ ∃ v ∈ {s | IsClopen s}, x ∈ v ∧ v ⊆ U

Proof state:
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
U : Set H
hU : IsOpen U
s : Set H
comp : IsCompact s
sU : s ⊆ U
u : Set ↑s := Subtype.val ⁻¹' interior s
u_open_in_s : IsOpen u
x : { x // x ∈ s }
memU : ↑x ∈ U
xs : ↑x ∈ interior s
this✝ : CompactSpace ↑s
V : Set ↑s
VisClopen : IsClopen V
Vx : x ∈ V
V_sub : V ⊆ u
v : Set ↑u := Subtype.val ⁻¹' V
this : (fun x => ↑↑x) = Subtype.val ∘ Subtype.val
f0 : IsEmbedding fun x => ↑↑x
⊢ s ∩ interior s = interior s

Tactic:
apply Set.inter_eq_self_of_subset_right interior_subset

Result:
no goals

Proof state:
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
U : Set H
hU : IsOpen U
s : Set H
comp : IsCompact s
sU : s ⊆ U
u : Set ↑s := Subtype.val ⁻¹' interior s
u_open_in_s : IsOpen u
x : { x // x ∈ s }
memU : ↑x ∈ U
xs : ↑x ∈ interior s
this : CompactSpace ↑s
V : Set ↑s
VisClopen : IsClopen V
Vx : x ∈ V
V_sub : V ⊆ u
VisClopen' : IsClopen (Subtype.val '' V)
⊢ Subtype.val '' V ⊆ s

Tactic:
simp

Result:
no goals

Proof state:
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
U : Set H
hU : IsOpen U
s : Set H
comp : IsCompact s
sU : s ⊆ U
u : Set ↑s := Subtype.val ⁻¹' interior s
u_open_in_s : IsOpen u
x : { x // x ∈ s }
memU : ↑x ∈ U
xs : ↑x ∈ interior s
this✝ : CompactSpace ↑s
V : Set ↑s
VisClopen : IsClopen V
Vx : x ∈ V
V_sub : V ⊆ u
v : Set ↑u := Subtype.val ⁻¹' V
this : (fun x => ↑↑x) = Subtype.val ∘ Subtype.val
f0 : IsEmbedding fun x => ↑↑x
f1 : IsOpenEmbedding fun x => ↑↑x
f2 : IsOpen v
f3 : Subtype.val '' V = (fun x => ↑↑x) '' v
⊢ IsOpen (Subtype.val '' V)

Tactic:
rw [f3]

Result:
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
U : Set H
hU : IsOpen U
s : Set H
comp : IsCompact s
sU : s ⊆ U
u : Set ↑s := Subtype.val ⁻¹' interior s
u_open_in_s : IsOpen u
x : { x // x ∈ s }
memU : ↑x ∈ U
xs : ↑x ∈ interior s
this✝ : CompactSpace ↑s
V : Set ↑s
VisClopen : IsClopen V
Vx : x ∈ V
V_sub : V ⊆ u
v : Set ↑u := Subtype.val ⁻¹' V
this : (fun x => ↑↑x) = Subtype.val ∘ Subtype.val
f0 : IsEmbedding fun x => ↑↑x
f1 : IsOpenEmbedding fun x => ↑↑x
f2 : IsOpen v
f3 : Subtype.val '' V = (fun x => ↑↑x) '' v
⊢ IsOpen ((fun x => ↑↑x) '' v)

Proof state:
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
x : H
U : Set H
memU : x ∈ U
hU : IsOpen U
⊢ ∃ v ∈ {s | IsClopen s}, x ∈ v ∧ v ⊆ U

Tactic:
obtain ⟨s, comp, xs, sU⟩ := exists_compact_subset hU memU

Result:
case intro.intro.intro
H : Type u_3
inst✝³ : TopologicalSpace H
inst✝² : LocallyCompactSpace H
inst✝¹ : T2Space H
inst✝ : TotallyDisconnectedSpace H
x : H
U : Set H
memU : x ∈ U
hU : IsOpen U
s : Set H
comp : IsCompact s
xs : x ∈ interior s
sU : s ⊆ U
⊢ ∃ v ∈ {s | IsClopen s}, x ∈ v ∧ v ⊆ U