Theorem: exists_countable_union_perfect_of_isClosed
File: Mathlib/Topology/Perfect.lean

tactic: obtain ⟨b, bct, _, bbasis⟩ := TopologicalSpace.exists_countable_basis α
state_before: α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
⊢ ∃ V D, Set.Countable V ∧ Perfect D ∧ C = V ∪ D

tactic: let v := { U ∈ b | (U ∩ C).Countable }
state_before: case intro.intro.intro
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
⊢ ∃ V D, Set.Countable V ∧ Perfect D ∧ C = V ∪ D

tactic: let V := ⋃ U ∈ v, U
state_before: case intro.intro.intro
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
⊢ ∃ V D, Set.Countable V ∧ Perfect D ∧ C = V ∪ D

tactic: let D := C \ V
state_before: case intro.intro.intro
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
⊢ ∃ V D, Set.Countable V ∧ Perfect D ∧ C = V ∪ D

tactic: refine' ⟨V ∩ C, D, Vct, ⟨_, _⟩, _⟩
state_before: case intro.intro.intro
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
⊢ ∃ V D, Set.Countable V ∧ Perfect D ∧ C = V ∪ D

tactic: simp only [iUnion_inter, mem_sep_iff]
state_before: α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
⊢ Set.Countable (V ∩ C)

tactic: apply Countable.biUnion
state_before: α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
⊢ Set.Countable (⋃ (i : Set α) (_ : i ∈ b ∧ Set.Countable (i ∩ C)), i ∩ C)

tactic: exact Countable.mono (inter_subset_left _ _) bct
state_before: case hs
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
⊢ Set.Countable fun a => a ∈ b ∧ Set.Countable (a ∩ C)

tactic: exact inter_subset_right _ _
state_before: case a
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
⊢ ∀ (a : Set α), (a ∈ fun a => a ∈ b ∧ Set.Countable (a ∩ C)) → Set.Countable (a ∩ C)

tactic: refine' hclosed.sdiff (isOpen_biUnion fun _ ↦ _)
state_before: case intro.intro.intro.refine'_1
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
⊢ IsClosed D

tactic: exact fun ⟨Ub, _⟩ ↦ IsTopologicalBasis.isOpen bbasis Ub
state_before: case intro.intro.intro.refine'_1
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x✝ : Set α
⊢ x✝ ∈ v → IsOpen x✝

tactic: rw [preperfect_iff_nhds]
state_before: case intro.intro.intro.refine'_2
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
⊢ Preperfect D

tactic: intro x xD E xE
state_before: case intro.intro.intro.refine'_2
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
⊢ ∀ (x : α), x ∈ D → ∀ (U : Set α), U ∈ 𝓝 x → ∃ y, y ∈ U ∩ D ∧ y ≠ x

tactic: by_contra h
state_before: case intro.intro.intro.refine'_2
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
this : ¬Set.Countable (E ∩ D)
⊢ ∃ y, y ∈ E ∩ D ∧ y ≠ x

tactic: rw [not_exists] at h
state_before: case intro.intro.intro.refine'_2
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
this : ¬Set.Countable (E ∩ D)
h : ¬∃ y, y ∈ E ∩ D ∧ y ≠ x
⊢ False

tactic: push_neg at h
state_before: case intro.intro.intro.refine'_2
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
this : ¬Set.Countable (E ∩ D)
h : ∀ (x_1 : α), ¬(x_1 ∈ E ∩ D ∧ x_1 ≠ x)
⊢ False

tactic: exact absurd (Countable.mono h (Set.countable_singleton _)) this
state_before: case intro.intro.intro.refine'_2
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
this : ¬Set.Countable (E ∩ D)
h : ∀ (x_1 : α), x_1 ∈ E ∩ (C \ V) → x_1 = x
⊢ False

tactic: intro h
state_before: α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
⊢ ¬Set.Countable (E ∩ D)

tactic: obtain ⟨U, hUb, xU, hU⟩ : ∃ U ∈ b, x ∈ U ∧ U ⊆ E :=
  (IsTopologicalBasis.mem_nhds_iff bbasis).mp xE
state_before: α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
h : Set.Countable (E ∩ D)
⊢ False

tactic: have : U ∈ v := ⟨hUb, hU_cnt⟩
state_before: case intro.intro.intro
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
h : Set.Countable (E ∩ D)
U : Set α
hUb : U ∈ b
xU : x ∈ U
hU : U ⊆ E
hU_cnt : Set.Countable (U ∩ C)
⊢ False

tactic: apply xD.2
state_before: case intro.intro.intro
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
h : Set.Countable (E ∩ D)
U : Set α
hUb : U ∈ b
xU : x ∈ U
hU : U ⊆ E
hU_cnt : Set.Countable (U ∩ C)
this : U ∈ v
⊢ False

tactic: exact mem_biUnion this xU
state_before: case intro.intro.intro
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
h : Set.Countable (E ∩ D)
U : Set α
hUb : U ∈ b
xU : x ∈ U
hU : U ⊆ E
hU_cnt : Set.Countable (U ∩ C)
this : U ∈ v
⊢ x ∈ V

tactic: apply @Countable.mono _ _ (E ∩ D ∪ V ∩ C)
state_before: α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
h : Set.Countable (E ∩ D)
U : Set α
hUb : U ∈ b
xU : x ∈ U
hU : U ⊆ E
⊢ Set.Countable (U ∩ C)

tactic: exact Countable.union h Vct
state_before: case a
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
h : Set.Countable (E ∩ D)
U : Set α
hUb : U ∈ b
xU : x ∈ U
hU : U ⊆ E
⊢ Set.Countable (E ∩ D ∪ V ∩ C)

tactic: rintro y ⟨yU, yC⟩
state_before: case h
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
h : Set.Countable (E ∩ D)
U : Set α
hUb : U ∈ b
xU : x ∈ U
hU : U ⊆ E
⊢ U ∩ C ⊆ E ∩ D ∪ V ∩ C

tactic: by_cases h : y ∈ V
state_before: case h.intro
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
h : Set.Countable (E ∩ D)
U : Set α
hUb : U ∈ b
xU : x ∈ U
hU : U ⊆ E
y : α
yU : y ∈ U
yC : y ∈ C
⊢ y ∈ E ∩ D ∪ V ∩ C

tactic: exact mem_union_right _ (mem_inter h yC)
state_before: case pos
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
h✝ : Set.Countable (E ∩ D)
U : Set α
hUb : U ∈ b
xU : x ∈ U
hU : U ⊆ E
y : α
yU : y ∈ U
yC : y ∈ C
h : y ∈ V
⊢ y ∈ E ∩ D ∪ V ∩ C

tactic: exact mem_union_left _ (mem_inter (hU yU) ⟨yC, h⟩)
state_before: case neg
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
x : α
xD : x ∈ D
E : Set α
xE : E ∈ 𝓝 x
h✝ : Set.Countable (E ∩ D)
U : Set α
hUb : U ∈ b
xU : x ∈ U
hU : U ⊆ E
y : α
yU : y ∈ U
yC : y ∈ C
h : ¬y ∈ V
⊢ y ∈ E ∩ D ∪ V ∩ C

tactic: rw [inter_comm, inter_union_diff]
state_before: case intro.intro.intro.refine'_3
α : Type u_1
inst✝¹ : TopologicalSpace α
C : Set α
inst✝ : SecondCountableTopology α
hclosed : IsClosed C
b : Set (Set α)
bct : Set.Countable b
left✝ : ¬∅ ∈ b
bbasis : IsTopologicalBasis b
v : Set (Set α) := {U | U ∈ b ∧ Set.Countable (U ∩ C)}
V : Set α := ⋃ (U : Set α) (_ : U ∈ v), U
D : Set α := C \ V
Vct : Set.Countable (V ∩ C)
⊢ C = V ∩ C ∪ D