l3lab/ntp-mathlib huggingface dataset:
/-- A set is dense iff it has non-trivial intersection with all basis sets. -/
theorem IsTopologicalBasis.dense_iff {b : Set (Set α)} (hb : IsTopologicalBasis b) {s : Set α} :
    Dense s ↔ ∀ o ∈ b, Set.Nonempty o → (o ∩ s).Nonempty := by
  simp only [Dense, hb.mem_closure_iff]
  

Proof state:
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s✝ : Set α
b : Set (Set α)
hb : IsTopologicalBasis b
s : Set α
⊢ (∀ (x : α), ∀ o ∈ b, x ∈ o → Set.Nonempty (o ∩ s)) ↔ ∀ o ∈ b, Set.Nonempty o → Set.Nonempty (o ∩ s)

Next tactic:
exact ⟨fun h o hb ⟨a, ha⟩ => h a o hb ha, fun h a o hb ha => h o hb ⟨a, ha⟩⟩
theorem IsTopologicalBasis.isOpenMap_iff {β} [TopologicalSpace β] {B : Set (Set α)}
    (hB : IsTopologicalBasis B) {f : α → β} : IsOpenMap f ↔ ∀ s ∈ B, IsOpen (f '' s) := by
  

Proof state:
α : Type u
t : TopologicalSpace α
B✝ : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
B : Set (Set α)
hB : IsTopologicalBasis B
f : α → β
⊢ IsOpenMap f ↔ ∀ s ∈ B, IsOpen (f '' s)

Next tactic:
refine' ⟨fun H o ho => H _ (hB.isOpen ho), fun hf o ho => _⟩
theorem IsTopologicalBasis.isOpenMap_iff {β} [TopologicalSpace β] {B : Set (Set α)}
    (hB : IsTopologicalBasis B) {f : α → β} : IsOpenMap f ↔ ∀ s ∈ B, IsOpen (f '' s) := by
  refine' ⟨fun H o ho => H _ (hB.isOpen ho), fun hf o ho => _⟩
  

Proof state:
α : Type u
t : TopologicalSpace α
B✝ : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
B : Set (Set α)
hB : IsTopologicalBasis B
f : α → β
hf : ∀ s ∈ B, IsOpen (f '' s)
o : Set α
ho : IsOpen o
⊢ IsOpen (f '' o)

Next tactic:
rw [hB.open_eq_sUnion' ho, sUnion_eq_iUnion, image_iUnion]
theorem IsTopologicalBasis.isOpenMap_iff {β} [TopologicalSpace β] {B : Set (Set α)}
    (hB : IsTopologicalBasis B) {f : α → β} : IsOpenMap f ↔ ∀ s ∈ B, IsOpen (f '' s) := by
  refine' ⟨fun H o ho => H _ (hB.isOpen ho), fun hf o ho => _⟩
  rw [hB.open_eq_sUnion' ho, sUnion_eq_iUnion, image_iUnion]
  

Proof state:
α : Type u
t : TopologicalSpace α
B✝ : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
B : Set (Set α)
hB : IsTopologicalBasis B
f : α → β
hf : ∀ s ∈ B, IsOpen (f '' s)
o : Set α
ho : IsOpen o
⊢ IsOpen (⋃ i, f '' ↑i)

Next tactic:
exact isOpen_iUnion fun s => hf s s.2.1
theorem isTopologicalBasis_opens : IsTopologicalBasis { U : Set α | IsOpen U } :=
  isTopologicalBasis_of_isOpen_of_nhds (by 

Proof state:
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
⊢ ∀ u ∈ {U | IsOpen U}, IsOpen u

Next tactic:
tauto
theorem isTopologicalBasis_opens : IsTopologicalBasis { U : Set α | IsOpen U } :=
  isTopologicalBasis_of_isOpen_of_nhds (by tauto) (by 

Proof state:
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
⊢ ∀ (a : α) (u : Set α), a ∈ u → IsOpen u → ∃ v ∈ {U | IsOpen U}, a ∈ v ∧ v ⊆ u

Next tactic:
tauto
protected theorem IsTopologicalBasis.prod {β} [TopologicalSpace β] {B₁ : Set (Set α)}
    {B₂ : Set (Set β)} (h₁ : IsTopologicalBasis B₁) (h₂ : IsTopologicalBasis B₂) :
    IsTopologicalBasis (image2 (· ×ˢ ·) B₁ B₂) := by
  

Proof state:
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
B₁ : Set (Set α)
B₂ : Set (Set β)
h₁ : IsTopologicalBasis B₁
h₂ : IsTopologicalBasis B₂
⊢ IsTopologicalBasis (image2 (fun x x_1 => x ×ˢ x_1) B₁ B₂)

Next tactic:
refine' isTopologicalBasis_of_isOpen_of_nhds _ _
protected theorem IsTopologicalBasis.prod {β} [TopologicalSpace β] {B₁ : Set (Set α)}
    {B₂ : Set (Set β)} (h₁ : IsTopologicalBasis B₁) (h₂ : IsTopologicalBasis B₂) :
    IsTopologicalBasis (image2 (· ×ˢ ·) B₁ B₂) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds _ _
  · 

Proof state:
case refine'_1
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
B₁ : Set (Set α)
B₂ : Set (Set β)
h₁ : IsTopologicalBasis B₁
h₂ : IsTopologicalBasis B₂
⊢ ∀ u ∈ image2 (fun x x_1 => x ×ˢ x_1) B₁ B₂, IsOpen u

Next tactic:
rintro _ ⟨u₁, u₂, hu₁, hu₂, rfl⟩
protected theorem IsTopologicalBasis.prod {β} [TopologicalSpace β] {B₁ : Set (Set α)}
    {B₂ : Set (Set β)} (h₁ : IsTopologicalBasis B₁) (h₂ : IsTopologicalBasis B₂) :
    IsTopologicalBasis (image2 (· ×ˢ ·) B₁ B₂) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds _ _
  · rintro _ ⟨u₁, u₂, hu₁, hu₂, rfl⟩
    

Proof state:
case refine'_1.intro.intro.intro.intro
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
B₁ : Set (Set α)
B₂ : Set (Set β)
h₁ : IsTopologicalBasis B₁
h₂ : IsTopologicalBasis B₂
u₁ : Set α
u₂ : Set β
hu₁ : u₁ ∈ B₁
hu₂ : u₂ ∈ B₂
⊢ IsOpen ((fun x x_1 => x ×ˢ x_1) u₁ u₂)

Next tactic:
exact (h₁.isOpen hu₁).prod (h₂.isOpen hu₂)
protected theorem IsTopologicalBasis.prod {β} [TopologicalSpace β] {B₁ : Set (Set α)}
    {B₂ : Set (Set β)} (h₁ : IsTopologicalBasis B₁) (h₂ : IsTopologicalBasis B₂) :
    IsTopologicalBasis (image2 (· ×ˢ ·) B₁ B₂) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds _ _
  · rintro _ ⟨u₁, u₂, hu₁, hu₂, rfl⟩
    exact (h₁.isOpen hu₁).prod (h₂.isOpen hu₂)
  · 

Proof state:
case refine'_2
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
B₁ : Set (Set α)
B₂ : Set (Set β)
h₁ : IsTopologicalBasis B₁
h₂ : IsTopologicalBasis B₂
⊢ ∀ (a : α × β) (u : Set (α × β)), a ∈ u → IsOpen u → ∃ v ∈ image2 (fun x x_1 => x ×ˢ x_1) B₁ B₂, a ∈ v ∧ v ⊆ u

Next tactic:
rintro ⟨a, b⟩ u hu uo
protected theorem IsTopologicalBasis.prod {β} [TopologicalSpace β] {B₁ : Set (Set α)}
    {B₂ : Set (Set β)} (h₁ : IsTopologicalBasis B₁) (h₂ : IsTopologicalBasis B₂) :
    IsTopologicalBasis (image2 (· ×ˢ ·) B₁ B₂) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds _ _
  · rintro _ ⟨u₁, u₂, hu₁, hu₂, rfl⟩
    exact (h₁.isOpen hu₁).prod (h₂.isOpen hu₂)
  · rintro ⟨a, b⟩ u hu uo
    

Proof state:
case refine'_2.mk
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
B₁ : Set (Set α)
B₂ : Set (Set β)
h₁ : IsTopologicalBasis B₁
h₂ : IsTopologicalBasis B₂
a : α
b : β
u : Set (α × β)
hu : (a, b) ∈ u
uo : IsOpen u
⊢ ∃ v ∈ image2 (fun x x_1 => x ×ˢ x_1) B₁ B₂, (a, b) ∈ v ∧ v ⊆ u

Next tactic:
rcases (h₁.nhds_hasBasis.prod_nhds h₂.nhds_hasBasis).mem_iff.1 (IsOpen.mem_nhds uo hu) with
      ⟨⟨s, t⟩, ⟨⟨hs, ha⟩, ht, hb⟩, hu⟩
protected theorem IsTopologicalBasis.prod {β} [TopologicalSpace β] {B₁ : Set (Set α)}
    {B₂ : Set (Set β)} (h₁ : IsTopologicalBasis B₁) (h₂ : IsTopologicalBasis B₂) :
    IsTopologicalBasis (image2 (· ×ˢ ·) B₁ B₂) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds _ _
  · rintro _ ⟨u₁, u₂, hu₁, hu₂, rfl⟩
    exact (h₁.isOpen hu₁).prod (h₂.isOpen hu₂)
  · rintro ⟨a, b⟩ u hu uo
    rcases (h₁.nhds_hasBasis.prod_nhds h₂.nhds_hasBasis).mem_iff.1 (IsOpen.mem_nhds uo hu) with
      ⟨⟨s, t⟩, ⟨⟨hs, ha⟩, ht, hb⟩, hu⟩
    

Proof state:
case refine'_2.mk.intro.mk.intro.intro.intro.intro
α : Type u
t✝ : TopologicalSpace α
B : Set (Set α)
s✝ : Set α
β : Type u_1
inst✝ : TopologicalSpace β
B₁ : Set (Set α)
B₂ : Set (Set β)
h₁ : IsTopologicalBasis B₁
h₂ : IsTopologicalBasis B₂
a : α
b : β
u : Set (α × β)
hu✝ : (a, b) ∈ u
uo : IsOpen u
s : Set α
t : Set β
hu : (s, t).1 ×ˢ (s, t).2 ⊆ u
hs : (s, t).1 ∈ B₁
ha : a ∈ (s, t).1
ht : (s, t).2 ∈ B₂
hb : b ∈ (s, t).2
⊢ ∃ v ∈ image2 (fun x x_1 => x ×ˢ x_1) B₁ B₂, (a, b) ∈ v ∧ v ⊆ u

Next tactic:
exact ⟨s ×ˢ t, mem_image2_of_mem hs ht, ⟨ha, hb⟩, hu⟩
protected theorem IsTopologicalBasis.inducing {β} [TopologicalSpace β] {f : α → β} {T : Set (Set β)}
    (hf : Inducing f) (h : IsTopologicalBasis T) : IsTopologicalBasis ((preimage f) '' T) := by
  

Proof state:
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
f : α → β
T : Set (Set β)
hf : Inducing f
h : IsTopologicalBasis T
⊢ IsTopologicalBasis (preimage f '' T)

Next tactic:
refine' isTopologicalBasis_of_isOpen_of_nhds _ _
protected theorem IsTopologicalBasis.inducing {β} [TopologicalSpace β] {f : α → β} {T : Set (Set β)}
    (hf : Inducing f) (h : IsTopologicalBasis T) : IsTopologicalBasis ((preimage f) '' T) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds _ _
  · 

Proof state:
case refine'_1
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
f : α → β
T : Set (Set β)
hf : Inducing f
h : IsTopologicalBasis T
⊢ ∀ u ∈ preimage f '' T, IsOpen u

Next tactic:
rintro _ ⟨V, hV, rfl⟩
protected theorem IsTopologicalBasis.inducing {β} [TopologicalSpace β] {f : α → β} {T : Set (Set β)}
    (hf : Inducing f) (h : IsTopologicalBasis T) : IsTopologicalBasis ((preimage f) '' T) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds _ _
  · rintro _ ⟨V, hV, rfl⟩
    

Proof state:
case refine'_1.intro.intro
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
f : α → β
T : Set (Set β)
hf : Inducing f
h : IsTopologicalBasis T
V : Set β
hV : V ∈ T
⊢ IsOpen (f ⁻¹' V)

Next tactic:
rw [hf.isOpen_iff]
protected theorem IsTopologicalBasis.inducing {β} [TopologicalSpace β] {f : α → β} {T : Set (Set β)}
    (hf : Inducing f) (h : IsTopologicalBasis T) : IsTopologicalBasis ((preimage f) '' T) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds _ _
  · rintro _ ⟨V, hV, rfl⟩
    rw [hf.isOpen_iff]
    

Proof state:
case refine'_1.intro.intro
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
f : α → β
T : Set (Set β)
hf : Inducing f
h : IsTopologicalBasis T
V : Set β
hV : V ∈ T
⊢ ∃ t, IsOpen t ∧ f ⁻¹' t = f ⁻¹' V

Next tactic:
refine' ⟨V, h.isOpen hV, rfl⟩
protected theorem IsTopologicalBasis.inducing {β} [TopologicalSpace β] {f : α → β} {T : Set (Set β)}
    (hf : Inducing f) (h : IsTopologicalBasis T) : IsTopologicalBasis ((preimage f) '' T) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds _ _
  · rintro _ ⟨V, hV, rfl⟩
    rw [hf.isOpen_iff]
    refine' ⟨V, h.isOpen hV, rfl⟩
  · 

Proof state:
case refine'_2
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
f : α → β
T : Set (Set β)
hf : Inducing f
h : IsTopologicalBasis T
⊢ ∀ (a : α) (u : Set α), a ∈ u → IsOpen u → ∃ v ∈ preimage f '' T, a ∈ v ∧ v ⊆ u

Next tactic:
intro a U ha hU
protected theorem IsTopologicalBasis.inducing {β} [TopologicalSpace β] {f : α → β} {T : Set (Set β)}
    (hf : Inducing f) (h : IsTopologicalBasis T) : IsTopologicalBasis ((preimage f) '' T) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds _ _
  · rintro _ ⟨V, hV, rfl⟩
    rw [hf.isOpen_iff]
    refine' ⟨V, h.isOpen hV, rfl⟩
  · intro a U ha hU
    

Proof state:
case refine'_2
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
f : α → β
T : Set (Set β)
hf : Inducing f
h : IsTopologicalBasis T
a : α
U : Set α
ha : a ∈ U
hU : IsOpen U
⊢ ∃ v ∈ preimage f '' T, a ∈ v ∧ v ⊆ U

Next tactic:
rw [hf.isOpen_iff] at hU
protected theorem IsTopologicalBasis.inducing {β} [TopologicalSpace β] {f : α → β} {T : Set (Set β)}
    (hf : Inducing f) (h : IsTopologicalBasis T) : IsTopologicalBasis ((preimage f) '' T) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds _ _
  · rintro _ ⟨V, hV, rfl⟩
    rw [hf.isOpen_iff]
    refine' ⟨V, h.isOpen hV, rfl⟩
  · intro a U ha hU
    rw [hf.isOpen_iff] at hU
    

Proof state:
case refine'_2
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
f : α → β
T : Set (Set β)
hf : Inducing f
h : IsTopologicalBasis T
a : α
U : Set α
ha : a ∈ U
hU : ∃ t, IsOpen t ∧ f ⁻¹' t = U
⊢ ∃ v ∈ preimage f '' T, a ∈ v ∧ v ⊆ U

Next tactic:
obtain ⟨V, hV, rfl⟩ := hU
protected theorem IsTopologicalBasis.inducing {β} [TopologicalSpace β] {f : α → β} {T : Set (Set β)}
    (hf : Inducing f) (h : IsTopologicalBasis T) : IsTopologicalBasis ((preimage f) '' T) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds _ _
  · rintro _ ⟨V, hV, rfl⟩
    rw [hf.isOpen_iff]
    refine' ⟨V, h.isOpen hV, rfl⟩
  · intro a U ha hU
    rw [hf.isOpen_iff] at hU
    obtain ⟨V, hV, rfl⟩ := hU
    

Proof state:
case refine'_2.intro.intro
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
f : α → β
T : Set (Set β)
hf : Inducing f
h : IsTopologicalBasis T
a : α
V : Set β
hV : IsOpen V
ha : a ∈ f ⁻¹' V
⊢ ∃ v ∈ preimage f '' T, a ∈ v ∧ v ⊆ f ⁻¹' V

Next tactic:
obtain ⟨S, hS, rfl⟩ := h.open_eq_sUnion hV
protected theorem IsTopologicalBasis.inducing {β} [TopologicalSpace β] {f : α → β} {T : Set (Set β)}
    (hf : Inducing f) (h : IsTopologicalBasis T) : IsTopologicalBasis ((preimage f) '' T) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds _ _
  · rintro _ ⟨V, hV, rfl⟩
    rw [hf.isOpen_iff]
    refine' ⟨V, h.isOpen hV, rfl⟩
  · intro a U ha hU
    rw [hf.isOpen_iff] at hU
    obtain ⟨V, hV, rfl⟩ := hU
    obtain ⟨S, hS, rfl⟩ := h.open_eq_sUnion hV
    

Proof state:
case refine'_2.intro.intro.intro.intro
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
f : α → β
T : Set (Set β)
hf : Inducing f
h : IsTopologicalBasis T
a : α
S : Set (Set β)
hS : S ⊆ T
hV : IsOpen (⋃₀ S)
ha : a ∈ f ⁻¹' ⋃₀ S
⊢ ∃ v ∈ preimage f '' T, a ∈ v ∧ v ⊆ f ⁻¹' ⋃₀ S

Next tactic:
obtain ⟨W, hW, ha⟩ := ha
protected theorem IsTopologicalBasis.inducing {β} [TopologicalSpace β] {f : α → β} {T : Set (Set β)}
    (hf : Inducing f) (h : IsTopologicalBasis T) : IsTopologicalBasis ((preimage f) '' T) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds _ _
  · rintro _ ⟨V, hV, rfl⟩
    rw [hf.isOpen_iff]
    refine' ⟨V, h.isOpen hV, rfl⟩
  · intro a U ha hU
    rw [hf.isOpen_iff] at hU
    obtain ⟨V, hV, rfl⟩ := hU
    obtain ⟨S, hS, rfl⟩ := h.open_eq_sUnion hV
    obtain ⟨W, hW, ha⟩ := ha
    

Proof state:
case refine'_2.intro.intro.intro.intro.intro.intro
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
f : α → β
T : Set (Set β)
hf : Inducing f
h : IsTopologicalBasis T
a : α
S : Set (Set β)
hS : S ⊆ T
hV : IsOpen (⋃₀ S)
W : Set β
hW : W ∈ S
ha : f a ∈ W
⊢ ∃ v ∈ preimage f '' T, a ∈ v ∧ v ⊆ f ⁻¹' ⋃₀ S

Next tactic:
refine' ⟨f ⁻¹' W, ⟨_, hS hW, rfl⟩, ha, Set.preimage_mono <| Set.subset_sUnion_of_mem hW⟩
theorem isTopologicalBasis_of_cover {ι} {U : ι → Set α} (Uo : ∀ i, IsOpen (U i))
    (Uc : ⋃ i, U i = univ) {b : ∀ i, Set (Set (U i))} (hb : ∀ i, IsTopologicalBasis (b i)) :
    IsTopologicalBasis (⋃ i : ι, image ((↑) : U i → α) '' b i) := by
  

Proof state:
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
ι : Sort u_1
U : ι → Set α
Uo : ∀ (i : ι), IsOpen (U i)
Uc : ⋃ i, U i = univ
b : (i : ι) → Set (Set ↑(U i))
hb : ∀ (i : ι), IsTopologicalBasis (b i)
⊢ IsTopologicalBasis (⋃ i, image Subtype.val '' b i)

Next tactic:
refine' isTopologicalBasis_of_isOpen_of_nhds (fun u hu => _) _
theorem isTopologicalBasis_of_cover {ι} {U : ι → Set α} (Uo : ∀ i, IsOpen (U i))
    (Uc : ⋃ i, U i = univ) {b : ∀ i, Set (Set (U i))} (hb : ∀ i, IsTopologicalBasis (b i)) :
    IsTopologicalBasis (⋃ i : ι, image ((↑) : U i → α) '' b i) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds (fun u hu => _) _
  · 

Proof state:
case refine'_1
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
ι : Sort u_1
U : ι → Set α
Uo : ∀ (i : ι), IsOpen (U i)
Uc : ⋃ i, U i = univ
b : (i : ι) → Set (Set ↑(U i))
hb : ∀ (i : ι), IsTopologicalBasis (b i)
u : Set α
hu : u ∈ ⋃ i, image Subtype.val '' b i
⊢ IsOpen u

Next tactic:
simp only [mem_iUnion, mem_image] at hu
theorem isTopologicalBasis_of_cover {ι} {U : ι → Set α} (Uo : ∀ i, IsOpen (U i))
    (Uc : ⋃ i, U i = univ) {b : ∀ i, Set (Set (U i))} (hb : ∀ i, IsTopologicalBasis (b i)) :
    IsTopologicalBasis (⋃ i : ι, image ((↑) : U i → α) '' b i) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds (fun u hu => _) _
  · simp only [mem_iUnion, mem_image] at hu
    

Proof state:
case refine'_1
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
ι : Sort u_1
U : ι → Set α
Uo : ∀ (i : ι), IsOpen (U i)
Uc : ⋃ i, U i = univ
b : (i : ι) → Set (Set ↑(U i))
hb : ∀ (i : ι), IsTopologicalBasis (b i)
u : Set α
hu : ∃ i, ∃ x ∈ b i, Subtype.val '' x = u
⊢ IsOpen u

Next tactic:
rcases hu with ⟨i, s, sb, rfl⟩
theorem isTopologicalBasis_of_cover {ι} {U : ι → Set α} (Uo : ∀ i, IsOpen (U i))
    (Uc : ⋃ i, U i = univ) {b : ∀ i, Set (Set (U i))} (hb : ∀ i, IsTopologicalBasis (b i)) :
    IsTopologicalBasis (⋃ i : ι, image ((↑) : U i → α) '' b i) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds (fun u hu => _) _
  · simp only [mem_iUnion, mem_image] at hu
    rcases hu with ⟨i, s, sb, rfl⟩
    

Proof state:
case refine'_1.intro.intro.intro
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s✝ : Set α
ι : Sort u_1
U : ι → Set α
Uo : ∀ (i : ι), IsOpen (U i)
Uc : ⋃ i, U i = univ
b : (i : ι) → Set (Set ↑(U i))
hb : ∀ (i : ι), IsTopologicalBasis (b i)
i : ι
s : Set { x // x ∈ U i }
sb : s ∈ b i
⊢ IsOpen (Subtype.val '' s)

Next tactic:
exact (Uo i).isOpenMap_subtype_val _ ((hb i).isOpen sb)
theorem isTopologicalBasis_of_cover {ι} {U : ι → Set α} (Uo : ∀ i, IsOpen (U i))
    (Uc : ⋃ i, U i = univ) {b : ∀ i, Set (Set (U i))} (hb : ∀ i, IsTopologicalBasis (b i)) :
    IsTopologicalBasis (⋃ i : ι, image ((↑) : U i → α) '' b i) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds (fun u hu => _) _
  · simp only [mem_iUnion, mem_image] at hu
    rcases hu with ⟨i, s, sb, rfl⟩
    exact (Uo i).isOpenMap_subtype_val _ ((hb i).isOpen sb)
  · 

Proof state:
case refine'_2
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
ι : Sort u_1
U : ι → Set α
Uo : ∀ (i : ι), IsOpen (U i)
Uc : ⋃ i, U i = univ
b : (i : ι) → Set (Set ↑(U i))
hb : ∀ (i : ι), IsTopologicalBasis (b i)
⊢ ∀ (a : α) (u : Set α), a ∈ u → IsOpen u → ∃ v ∈ ⋃ i, image Subtype.val '' b i, a ∈ v ∧ v ⊆ u

Next tactic:
intro a u ha uo
theorem isTopologicalBasis_of_cover {ι} {U : ι → Set α} (Uo : ∀ i, IsOpen (U i))
    (Uc : ⋃ i, U i = univ) {b : ∀ i, Set (Set (U i))} (hb : ∀ i, IsTopologicalBasis (b i)) :
    IsTopologicalBasis (⋃ i : ι, image ((↑) : U i → α) '' b i) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds (fun u hu => _) _
  · simp only [mem_iUnion, mem_image] at hu
    rcases hu with ⟨i, s, sb, rfl⟩
    exact (Uo i).isOpenMap_subtype_val _ ((hb i).isOpen sb)
  · intro a u ha uo
    

Proof state:
case refine'_2
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
ι : Sort u_1
U : ι → Set α
Uo : ∀ (i : ι), IsOpen (U i)
Uc : ⋃ i, U i = univ
b : (i : ι) → Set (Set ↑(U i))
hb : ∀ (i : ι), IsTopologicalBasis (b i)
a : α
u : Set α
ha : a ∈ u
uo : IsOpen u
⊢ ∃ v ∈ ⋃ i, image Subtype.val '' b i, a ∈ v ∧ v ⊆ u

Next tactic:
rcases iUnion_eq_univ_iff.1 Uc a with ⟨i, hi⟩
theorem isTopologicalBasis_of_cover {ι} {U : ι → Set α} (Uo : ∀ i, IsOpen (U i))
    (Uc : ⋃ i, U i = univ) {b : ∀ i, Set (Set (U i))} (hb : ∀ i, IsTopologicalBasis (b i)) :
    IsTopologicalBasis (⋃ i : ι, image ((↑) : U i → α) '' b i) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds (fun u hu => _) _
  · simp only [mem_iUnion, mem_image] at hu
    rcases hu with ⟨i, s, sb, rfl⟩
    exact (Uo i).isOpenMap_subtype_val _ ((hb i).isOpen sb)
  · intro a u ha uo
    rcases iUnion_eq_univ_iff.1 Uc a with ⟨i, hi⟩
    

Proof state:
case refine'_2.intro
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
ι : Sort u_1
U : ι → Set α
Uo : ∀ (i : ι), IsOpen (U i)
Uc : ⋃ i, U i = univ
b : (i : ι) → Set (Set ↑(U i))
hb : ∀ (i : ι), IsTopologicalBasis (b i)
a : α
u : Set α
ha : a ∈ u
uo : IsOpen u
i : ι
hi : a ∈ U i
⊢ ∃ v ∈ ⋃ i, image Subtype.val '' b i, a ∈ v ∧ v ⊆ u

Next tactic:
lift a to ↥(U i) using hi
theorem isTopologicalBasis_of_cover {ι} {U : ι → Set α} (Uo : ∀ i, IsOpen (U i))
    (Uc : ⋃ i, U i = univ) {b : ∀ i, Set (Set (U i))} (hb : ∀ i, IsTopologicalBasis (b i)) :
    IsTopologicalBasis (⋃ i : ι, image ((↑) : U i → α) '' b i) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds (fun u hu => _) _
  · simp only [mem_iUnion, mem_image] at hu
    rcases hu with ⟨i, s, sb, rfl⟩
    exact (Uo i).isOpenMap_subtype_val _ ((hb i).isOpen sb)
  · intro a u ha uo
    rcases iUnion_eq_univ_iff.1 Uc a with ⟨i, hi⟩
    lift a to ↥(U i) using hi
    

Proof state:
case refine'_2.intro.intro
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
ι : Sort u_1
U : ι → Set α
Uo : ∀ (i : ι), IsOpen (U i)
Uc : ⋃ i, U i = univ
b : (i : ι) → Set (Set ↑(U i))
hb : ∀ (i : ι), IsTopologicalBasis (b i)
u : Set α
uo : IsOpen u
i : ι
a : { x // x ∈ U i }
ha : ↑a ∈ u
⊢ ∃ v ∈ ⋃ i, image Subtype.val '' b i, ↑a ∈ v ∧ v ⊆ u

Next tactic:
rcases (hb i).exists_subset_of_mem_open ha (uo.preimage continuous_subtype_val) with
      ⟨v, hvb, hav, hvu⟩
theorem isTopologicalBasis_of_cover {ι} {U : ι → Set α} (Uo : ∀ i, IsOpen (U i))
    (Uc : ⋃ i, U i = univ) {b : ∀ i, Set (Set (U i))} (hb : ∀ i, IsTopologicalBasis (b i)) :
    IsTopologicalBasis (⋃ i : ι, image ((↑) : U i → α) '' b i) := by
  refine' isTopologicalBasis_of_isOpen_of_nhds (fun u hu => _) _
  · simp only [mem_iUnion, mem_image] at hu
    rcases hu with ⟨i, s, sb, rfl⟩
    exact (Uo i).isOpenMap_subtype_val _ ((hb i).isOpen sb)
  · intro a u ha uo
    rcases iUnion_eq_univ_iff.1 Uc a with ⟨i, hi⟩
    lift a to ↥(U i) using hi
    rcases (hb i).exists_subset_of_mem_open ha (uo.preimage continuous_subtype_val) with
      ⟨v, hvb, hav, hvu⟩
    

Proof state:
case refine'_2.intro.intro.intro.intro.intro
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
ι : Sort u_1
U : ι → Set α
Uo : ∀ (i : ι), IsOpen (U i)
Uc : ⋃ i, U i = univ
b : (i : ι) → Set (Set ↑(U i))
hb : ∀ (i : ι), IsTopologicalBasis (b i)
u : Set α
uo : IsOpen u
i : ι
a : { x // x ∈ U i }
ha : ↑a ∈ u
v : Set ↑(U i)
hvb : v ∈ b i
hav : a ∈ v
hvu : v ⊆ Subtype.val ⁻¹' u
⊢ ∃ v ∈ ⋃ i, image Subtype.val '' b i, ↑a ∈ v ∧ v ⊆ u

Next tactic:
exact ⟨(↑) '' v, mem_iUnion.2 ⟨i, mem_image_of_mem _ hvb⟩, mem_image_of_mem _ hav,
      image_subset_iff.2 hvu⟩
protected theorem IsTopologicalBasis.continuous {β : Type*} [TopologicalSpace β] {B : Set (Set β)}
    (hB : IsTopologicalBasis B) (f : α → β) (hf : ∀ s ∈ B, IsOpen (f ⁻¹' s)) : Continuous f := by
  

Proof state:
α : Type u
t : TopologicalSpace α
B✝ : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
B : Set (Set β)
hB : IsTopologicalBasis B
f : α → β
hf : ∀ s ∈ B, IsOpen (f ⁻¹' s)
⊢ Continuous f

Next tactic:
rw [hB.eq_generateFrom]
protected theorem IsTopologicalBasis.continuous {β : Type*} [TopologicalSpace β] {B : Set (Set β)}
    (hB : IsTopologicalBasis B) (f : α → β) (hf : ∀ s ∈ B, IsOpen (f ⁻¹' s)) : Continuous f := by
  rw [hB.eq_generateFrom]; 

Proof state:
α : Type u
t : TopologicalSpace α
B✝ : Set (Set α)
s : Set α
β : Type u_1
inst✝ : TopologicalSpace β
B : Set (Set β)
hB : IsTopologicalBasis B
f : α → β
hf : ∀ s ∈ B, IsOpen (f ⁻¹' s)
⊢ Continuous f

Next tactic:
exact continuous_generateFrom hf
/-- A nonempty separable space admits a sequence with dense range. Instead of running `cases` on the
conclusion of this lemma, you might want to use `TopologicalSpace.denseSeq` and
`TopologicalSpace.denseRange_denseSeq`.

If `α` might be empty, then `TopologicalSpace.exists_countable_dense` is the main way to use
separability of `α`. -/
theorem exists_dense_seq [SeparableSpace α] [Nonempty α] : ∃ u : ℕ → α, DenseRange u := by
  

Proof state:
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s : Set α
inst✝¹ : SeparableSpace α
inst✝ : Nonempty α
⊢ ∃ u, DenseRange u

Next tactic:
obtain ⟨s : Set α, hs, s_dense⟩ := exists_countable_dense α
/-- A nonempty separable space admits a sequence with dense range. Instead of running `cases` on the
conclusion of this lemma, you might want to use `TopologicalSpace.denseSeq` and
`TopologicalSpace.denseRange_denseSeq`.

If `α` might be empty, then `TopologicalSpace.exists_countable_dense` is the main way to use
separability of `α`. -/
theorem exists_dense_seq [SeparableSpace α] [Nonempty α] : ∃ u : ℕ → α, DenseRange u := by
  obtain ⟨s : Set α, hs, s_dense⟩ := exists_countable_dense α
  

Proof state:
case intro.intro
α : Type u
t : TopologicalSpace α
B : Set (Set α)
s✝ : Set α
inst✝¹ : SeparableSpace α
inst✝ : Nonempty α
s : Set α
hs : Set.Countable s
s_dense : Dense s
⊢ ∃ u, DenseRange u

Next tactic:
cases' Set.countable_iff_exists_subset_range.mp hs with u hu