l3lab/ntp-mathlib huggingface dataset:
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
⊢ NormalSpace X

Next tactic:
have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      intro x hx
      rcases (isBasis_countableBasis X).exists_closure_subset (hc.compl_mem_nhds (hd hx))
        with ⟨u, hu, hxu, hut⟩
      exact ⟨u, hu, hxu, disjoint_left.2 hut⟩
    choose! U hu hxu hd using this
    set V : s → countableBasis X := MapsTo.restrict _ _ _ hu
    refine' ⟨range V, _, forall_range_iff.2 <| Subtype.forall.2 hd, fun n => _⟩
    · rw [biUnion_range]
      exact fun x hx => mem_iUnion.2 ⟨⟨x, hx⟩, hxu x hx⟩
    · simp only [← iSup_eq_iUnion, iSup_and']
      exact (((finite_le_nat n).preimage_embedding (Encodable.encode' _)).subset <|
        inter_subset_right _ _).isClosed_biUnion fun u _ => isClosed_closure
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    

Proof state:
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
⊢ ∀ {s t : Set X},
    IsClosed t →
      Disjoint s t →
        ∃ U,
          s ⊆ ⋃ u ∈ U, ↑u ∧
            (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
              ∀ (n : ℕ), IsClosed (⋃ u ∈ U, ⋃ (_ : Encodable.encode u ≤ n), closure ↑u)

Next tactic:
intro s t hc hd
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    

Proof state:
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
s t : Set X
hc : IsClosed t
hd : Disjoint s t
⊢ ∃ U,
    s ⊆ ⋃ u ∈ U, ↑u ∧
      (∀ u ∈ U, Disjoint (closure ↑u) t) ∧ ∀ (n : ℕ), IsClosed (⋃ u ∈ U, ⋃ (_ : Encodable.encode u ≤ n), closure ↑u)

Next tactic:
rw [disjoint_left] at hd
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    

Proof state:
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
s t : Set X
hc : IsClosed t
hd : ∀ ⦃a : X⦄, a ∈ s → a ∉ t
⊢ ∃ U,
    s ⊆ ⋃ u ∈ U, ↑u ∧
      (∀ u ∈ U, Disjoint (closure ↑u) t) ∧ ∀ (n : ℕ), IsClosed (⋃ u ∈ U, ⋃ (_ : Encodable.encode u ≤ n), closure ↑u)

Next tactic:
have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      intro x hx
      rcases (isBasis_countableBasis X).exists_closure_subset (hc.compl_mem_nhds (hd hx))
        with ⟨u, hu, hxu, hut⟩
      exact ⟨u, hu, hxu, disjoint_left.2 hut⟩
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      

Proof state:
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
s t : Set X
hc : IsClosed t
hd : ∀ ⦃a : X⦄, a ∈ s → a ∉ t
⊢ ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t

Next tactic:
intro x hx
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      intro x hx
      

Proof state:
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
s t : Set X
hc : IsClosed t
hd : ∀ ⦃a : X⦄, a ∈ s → a ∉ t
x : X
hx : x ∈ s
⊢ ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t

Next tactic:
rcases (isBasis_countableBasis X).exists_closure_subset (hc.compl_mem_nhds (hd hx))
        with ⟨u, hu, hxu, hut⟩
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      intro x hx
      rcases (isBasis_countableBasis X).exists_closure_subset (hc.compl_mem_nhds (hd hx))
        with ⟨u, hu, hxu, hut⟩
      

Proof state:
case intro.intro.intro
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
s t : Set X
hc : IsClosed t
hd : ∀ ⦃a : X⦄, a ∈ s → a ∉ t
x : X
hx : x ∈ s
u : Set X
hu : u ∈ countableBasis X
hxu : x ∈ u
hut : closure u ⊆ tᶜ
⊢ ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t

Next tactic:
exact ⟨u, hu, hxu, disjoint_left.2 hut⟩
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      intro x hx
      rcases (isBasis_countableBasis X).exists_closure_subset (hc.compl_mem_nhds (hd hx))
        with ⟨u, hu, hxu, hut⟩
      exact ⟨u, hu, hxu, disjoint_left.2 hut⟩
    

Proof state:
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
s t : Set X
hc : IsClosed t
hd : ∀ ⦃a : X⦄, a ∈ s → a ∉ t
this : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t
⊢ ∃ U,
    s ⊆ ⋃ u ∈ U, ↑u ∧
      (∀ u ∈ U, Disjoint (closure ↑u) t) ∧ ∀ (n : ℕ), IsClosed (⋃ u ∈ U, ⋃ (_ : Encodable.encode u ≤ n), closure ↑u)

Next tactic:
choose! U hu hxu hd using this
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      intro x hx
      rcases (isBasis_countableBasis X).exists_closure_subset (hc.compl_mem_nhds (hd hx))
        with ⟨u, hu, hxu, hut⟩
      exact ⟨u, hu, hxu, disjoint_left.2 hut⟩
    choose! U hu hxu hd using this
    

Proof state:
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
s t : Set X
hc : IsClosed t
hd✝ : ∀ ⦃a : X⦄, a ∈ s → a ∉ t
U : X → Set X
hu : ∀ x ∈ s, U x ∈ countableBasis X
hxu : ∀ x ∈ s, x ∈ U x
hd : ∀ x ∈ s, Disjoint (closure (U x)) t
⊢ ∃ U,
    s ⊆ ⋃ u ∈ U, ↑u ∧
      (∀ u ∈ U, Disjoint (closure ↑u) t) ∧ ∀ (n : ℕ), IsClosed (⋃ u ∈ U, ⋃ (_ : Encodable.encode u ≤ n), closure ↑u)

Next tactic:
set V : s → countableBasis X := MapsTo.restrict _ _ _ hu
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      intro x hx
      rcases (isBasis_countableBasis X).exists_closure_subset (hc.compl_mem_nhds (hd hx))
        with ⟨u, hu, hxu, hut⟩
      exact ⟨u, hu, hxu, disjoint_left.2 hut⟩
    choose! U hu hxu hd using this
    set V : s → countableBasis X := MapsTo.restrict _ _ _ hu
    

Proof state:
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
s t : Set X
hc : IsClosed t
hd✝ : ∀ ⦃a : X⦄, a ∈ s → a ∉ t
U : X → Set X
hu : ∀ x ∈ s, U x ∈ countableBasis X
hxu : ∀ x ∈ s, x ∈ U x
hd : ∀ x ∈ s, Disjoint (closure (U x)) t
V : ↑s → ↑(countableBasis X) := MapsTo.restrict (fun x => U x) s (countableBasis X) hu
⊢ ∃ U,
    s ⊆ ⋃ u ∈ U, ↑u ∧
      (∀ u ∈ U, Disjoint (closure ↑u) t) ∧ ∀ (n : ℕ), IsClosed (⋃ u ∈ U, ⋃ (_ : Encodable.encode u ≤ n), closure ↑u)

Next tactic:
refine' ⟨range V, _, forall_range_iff.2 <| Subtype.forall.2 hd, fun n => _⟩
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      intro x hx
      rcases (isBasis_countableBasis X).exists_closure_subset (hc.compl_mem_nhds (hd hx))
        with ⟨u, hu, hxu, hut⟩
      exact ⟨u, hu, hxu, disjoint_left.2 hut⟩
    choose! U hu hxu hd using this
    set V : s → countableBasis X := MapsTo.restrict _ _ _ hu
    refine' ⟨range V, _, forall_range_iff.2 <| Subtype.forall.2 hd, fun n => _⟩
    · 

Proof state:
case refine'_1
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
s t : Set X
hc : IsClosed t
hd✝ : ∀ ⦃a : X⦄, a ∈ s → a ∉ t
U : X → Set X
hu : ∀ x ∈ s, U x ∈ countableBasis X
hxu : ∀ x ∈ s, x ∈ U x
hd : ∀ x ∈ s, Disjoint (closure (U x)) t
V : ↑s → ↑(countableBasis X) := MapsTo.restrict (fun x => U x) s (countableBasis X) hu
⊢ s ⊆ ⋃ u ∈ range V, ↑u

Next tactic:
rw [biUnion_range]
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      intro x hx
      rcases (isBasis_countableBasis X).exists_closure_subset (hc.compl_mem_nhds (hd hx))
        with ⟨u, hu, hxu, hut⟩
      exact ⟨u, hu, hxu, disjoint_left.2 hut⟩
    choose! U hu hxu hd using this
    set V : s → countableBasis X := MapsTo.restrict _ _ _ hu
    refine' ⟨range V, _, forall_range_iff.2 <| Subtype.forall.2 hd, fun n => _⟩
    · rw [biUnion_range]
      

Proof state:
case refine'_1
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
s t : Set X
hc : IsClosed t
hd✝ : ∀ ⦃a : X⦄, a ∈ s → a ∉ t
U : X → Set X
hu : ∀ x ∈ s, U x ∈ countableBasis X
hxu : ∀ x ∈ s, x ∈ U x
hd : ∀ x ∈ s, Disjoint (closure (U x)) t
V : ↑s → ↑(countableBasis X) := MapsTo.restrict (fun x => U x) s (countableBasis X) hu
⊢ s ⊆ ⋃ y, ↑(V y)

Next tactic:
exact fun x hx => mem_iUnion.2 ⟨⟨x, hx⟩, hxu x hx⟩
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      intro x hx
      rcases (isBasis_countableBasis X).exists_closure_subset (hc.compl_mem_nhds (hd hx))
        with ⟨u, hu, hxu, hut⟩
      exact ⟨u, hu, hxu, disjoint_left.2 hut⟩
    choose! U hu hxu hd using this
    set V : s → countableBasis X := MapsTo.restrict _ _ _ hu
    refine' ⟨range V, _, forall_range_iff.2 <| Subtype.forall.2 hd, fun n => _⟩
    · rw [biUnion_range]
      exact fun x hx => mem_iUnion.2 ⟨⟨x, hx⟩, hxu x hx⟩
    · 

Proof state:
case refine'_2
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
s t : Set X
hc : IsClosed t
hd✝ : ∀ ⦃a : X⦄, a ∈ s → a ∉ t
U : X → Set X
hu : ∀ x ∈ s, U x ∈ countableBasis X
hxu : ∀ x ∈ s, x ∈ U x
hd : ∀ x ∈ s, Disjoint (closure (U x)) t
V : ↑s → ↑(countableBasis X) := MapsTo.restrict (fun x => U x) s (countableBasis X) hu
n : ℕ
⊢ IsClosed (⋃ u ∈ range V, ⋃ (_ : Encodable.encode u ≤ n), closure ↑u)

Next tactic:
simp only [← iSup_eq_iUnion, iSup_and']
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      intro x hx
      rcases (isBasis_countableBasis X).exists_closure_subset (hc.compl_mem_nhds (hd hx))
        with ⟨u, hu, hxu, hut⟩
      exact ⟨u, hu, hxu, disjoint_left.2 hut⟩
    choose! U hu hxu hd using this
    set V : s → countableBasis X := MapsTo.restrict _ _ _ hu
    refine' ⟨range V, _, forall_range_iff.2 <| Subtype.forall.2 hd, fun n => _⟩
    · rw [biUnion_range]
      exact fun x hx => mem_iUnion.2 ⟨⟨x, hx⟩, hxu x hx⟩
    · simp only [← iSup_eq_iUnion, iSup_and']
      

Proof state:
case refine'_2
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
s t : Set X
hc : IsClosed t
hd✝ : ∀ ⦃a : X⦄, a ∈ s → a ∉ t
U : X → Set X
hu : ∀ x ∈ s, U x ∈ countableBasis X
hxu : ∀ x ∈ s, x ∈ U x
hd : ∀ x ∈ s, Disjoint (closure (U x)) t
V : ↑s → ↑(countableBasis X) := MapsTo.restrict (fun x => U x) s (countableBasis X) hu
n : ℕ
⊢ IsClosed
    (⨆ u,
      ⨆ (_ : u ∈ range (MapsTo.restrict (fun x => U x) s (countableBasis X) hu) ∧ Encodable.encode u ≤ n), closure ↑u)

Next tactic:
exact (((finite_le_nat n).preimage_embedding (Encodable.encode' _)).subset <|
        inter_subset_right _ _).isClosed_biUnion fun u _ => isClosed_closure
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      intro x hx
      rcases (isBasis_countableBasis X).exists_closure_subset (hc.compl_mem_nhds (hd hx))
        with ⟨u, hu, hxu, hut⟩
      exact ⟨u, hu, hxu, disjoint_left.2 hut⟩
    choose! U hu hxu hd using this
    set V : s → countableBasis X := MapsTo.restrict _ _ _ hu
    refine' ⟨range V, _, forall_range_iff.2 <| Subtype.forall.2 hd, fun n => _⟩
    · rw [biUnion_range]
      exact fun x hx => mem_iUnion.2 ⟨⟨x, hx⟩, hxu x hx⟩
    · simp only [← iSup_eq_iUnion, iSup_and']
      exact (((finite_le_nat n).preimage_embedding (Encodable.encode' _)).subset <|
        inter_subset_right _ _).isClosed_biUnion fun u _ => isClosed_closure
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
key :
  ∀ {s t : Set X},
    IsClosed t →
      Disjoint s t →
        ∃ U,
          s ⊆ ⋃ u ∈ U, ↑u ∧
            (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
              ∀ (n : ℕ), IsClosed (⋃ u ∈ U, ⋃ (_ : Encodable.encode u ≤ n), closure ↑u)
⊢ NormalSpace X

Next tactic:
refine' { normal := fun s t hs ht hd => _ }
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      intro x hx
      rcases (isBasis_countableBasis X).exists_closure_subset (hc.compl_mem_nhds (hd hx))
        with ⟨u, hu, hxu, hut⟩
      exact ⟨u, hu, hxu, disjoint_left.2 hut⟩
    choose! U hu hxu hd using this
    set V : s → countableBasis X := MapsTo.restrict _ _ _ hu
    refine' ⟨range V, _, forall_range_iff.2 <| Subtype.forall.2 hd, fun n => _⟩
    · rw [biUnion_range]
      exact fun x hx => mem_iUnion.2 ⟨⟨x, hx⟩, hxu x hx⟩
    · simp only [← iSup_eq_iUnion, iSup_and']
      exact (((finite_le_nat n).preimage_embedding (Encodable.encode' _)).subset <|
        inter_subset_right _ _).isClosed_biUnion fun u _ => isClosed_closure
  refine' { normal := fun s t hs ht hd => _ }
  

Proof state:
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
key :
  ∀ {s t : Set X},
    IsClosed t →
      Disjoint s t →
        ∃ U,
          s ⊆ ⋃ u ∈ U, ↑u ∧
            (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
              ∀ (n : ℕ), IsClosed (⋃ u ∈ U, ⋃ (_ : Encodable.encode u ≤ n), closure ↑u)
s t : Set X
hs : IsClosed s
ht : IsClosed t
hd : Disjoint s t
⊢ SeparatedNhds s t

Next tactic:
rcases key ht hd with ⟨U, hsU, hUd, hUc⟩
/-- A regular topological space with second countable topology is a normal space. -/
instance (priority := 100) NormalSpace.of_regularSpace_secondCountableTopology
    [RegularSpace X] [SecondCountableTopology X] : NormalSpace X := by
  have key : ∀ {s t : Set X}, IsClosed t → Disjoint s t →
    ∃ U : Set (countableBasis X), (s ⊆ ⋃ u ∈ U, ↑u) ∧ (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
      ∀ n : ℕ, IsClosed (⋃ (u ∈ U) (_ : Encodable.encode u ≤ n), closure (u : Set X)) := by
    intro s t hc hd
    rw [disjoint_left] at hd
    have : ∀ x ∈ s, ∃ U ∈ countableBasis X, x ∈ U ∧ Disjoint (closure U) t := by
      intro x hx
      rcases (isBasis_countableBasis X).exists_closure_subset (hc.compl_mem_nhds (hd hx))
        with ⟨u, hu, hxu, hut⟩
      exact ⟨u, hu, hxu, disjoint_left.2 hut⟩
    choose! U hu hxu hd using this
    set V : s → countableBasis X := MapsTo.restrict _ _ _ hu
    refine' ⟨range V, _, forall_range_iff.2 <| Subtype.forall.2 hd, fun n => _⟩
    · rw [biUnion_range]
      exact fun x hx => mem_iUnion.2 ⟨⟨x, hx⟩, hxu x hx⟩
    · simp only [← iSup_eq_iUnion, iSup_and']
      exact (((finite_le_nat n).preimage_embedding (Encodable.encode' _)).subset <|
        inter_subset_right _ _).isClosed_biUnion fun u _ => isClosed_closure
  refine' { normal := fun s t hs ht hd => _ }
  rcases key ht hd with ⟨U, hsU, hUd, hUc⟩
  

Proof state:
case intro.intro.intro
X : Type u_1
Y : Type u_2
inst✝² : TopologicalSpace X
inst✝¹ : RegularSpace X
inst✝ : SecondCountableTopology X
key :
  ∀ {s t : Set X},
    IsClosed t →
      Disjoint s t →
        ∃ U,
          s ⊆ ⋃ u ∈ U, ↑u ∧
            (∀ u ∈ U, Disjoint (closure ↑u) t) ∧
              ∀ (n : ℕ), IsClosed (⋃ u ∈ U, ⋃ (_ : Encodable.encode u ≤ n), closure ↑u)
s t : Set X
hs : IsClosed s
ht : IsClosed t
hd : Disjoint s t
U : Set ↑(countableBasis X)
hsU : s ⊆ ⋃ u ∈ U, ↑u
hUd : ∀ u ∈ U, Disjoint (closure ↑u) t
hUc : ∀ (n : ℕ), IsClosed (⋃ u ∈ U, ⋃ (_ : Encodable.encode u ≤ n), closure ↑u)
⊢ SeparatedNhds s t

Next tactic:
rcases key hs hd.symm with ⟨V, htV, hVd, hVc⟩