l3lab/ntp-mathlib huggingface dataset:
theorem nhds_mkOfNhds (n : α → Filter α) (a : α) (h₀ : pure ≤ n)
    (h₁ : ∀ a s, s ∈ n a → ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a') :
    @nhds α (TopologicalSpace.mkOfNhds n) a = n a := by
  letI := TopologicalSpace.mkOfNhds n
  apply le_antisymm <;> intros s hs
  · 

Proof state:
case a
α : Type u
n : α → Filter α
a : α
h₀ : pure ≤ n
h₁ : ∀ (a : α), ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a'
this : TopologicalSpace α := TopologicalSpace.mkOfNhds n
s : Set α
hs : s ∈ n a
⊢ s ∈ 𝓝 a

Next tactic:
have h₀ : { b | s ∈ n b } ⊆ s := fun b hb => mem_pure.1 <| h₀ b hb
theorem nhds_mkOfNhds (n : α → Filter α) (a : α) (h₀ : pure ≤ n)
    (h₁ : ∀ a s, s ∈ n a → ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a') :
    @nhds α (TopologicalSpace.mkOfNhds n) a = n a := by
  letI := TopologicalSpace.mkOfNhds n
  apply le_antisymm <;> intros s hs
  · have h₀ : { b | s ∈ n b } ⊆ s := fun b hb => mem_pure.1 <| h₀ b hb
    

Proof state:
case a
α : Type u
n : α → Filter α
a : α
h₀✝ : pure ≤ n
h₁ : ∀ (a : α), ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a'
this : TopologicalSpace α := TopologicalSpace.mkOfNhds n
s : Set α
hs : s ∈ n a
h₀ : {b | s ∈ n b} ⊆ s
⊢ s ∈ 𝓝 a

Next tactic:
have h₁ : { b | s ∈ n b } ∈ 𝓝 a := by
      refine' IsOpen.mem_nhds (fun b (hb : s ∈ n b) => _) hs
      rcases h₁ _ _ hb with ⟨t, ht, -, h⟩
      exact mem_of_superset ht h
theorem nhds_mkOfNhds (n : α → Filter α) (a : α) (h₀ : pure ≤ n)
    (h₁ : ∀ a s, s ∈ n a → ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a') :
    @nhds α (TopologicalSpace.mkOfNhds n) a = n a := by
  letI := TopologicalSpace.mkOfNhds n
  apply le_antisymm <;> intros s hs
  · have h₀ : { b | s ∈ n b } ⊆ s := fun b hb => mem_pure.1 <| h₀ b hb
    have h₁ : { b | s ∈ n b } ∈ 𝓝 a := by
      

Proof state:
α : Type u
n : α → Filter α
a : α
h₀✝ : pure ≤ n
h₁ : ∀ (a : α), ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a'
this : TopologicalSpace α := TopologicalSpace.mkOfNhds n
s : Set α
hs : s ∈ n a
h₀ : {b | s ∈ n b} ⊆ s
⊢ {b | s ∈ n b} ∈ 𝓝 a

Next tactic:
refine' IsOpen.mem_nhds (fun b (hb : s ∈ n b) => _) hs
theorem nhds_mkOfNhds (n : α → Filter α) (a : α) (h₀ : pure ≤ n)
    (h₁ : ∀ a s, s ∈ n a → ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a') :
    @nhds α (TopologicalSpace.mkOfNhds n) a = n a := by
  letI := TopologicalSpace.mkOfNhds n
  apply le_antisymm <;> intros s hs
  · have h₀ : { b | s ∈ n b } ⊆ s := fun b hb => mem_pure.1 <| h₀ b hb
    have h₁ : { b | s ∈ n b } ∈ 𝓝 a := by
      refine' IsOpen.mem_nhds (fun b (hb : s ∈ n b) => _) hs
      

Proof state:
α : Type u
n : α → Filter α
a : α
h₀✝ : pure ≤ n
h₁ : ∀ (a : α), ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a'
this : TopologicalSpace α := TopologicalSpace.mkOfNhds n
s : Set α
hs : s ∈ n a
h₀ : {b | s ∈ n b} ⊆ s
b : α
hb : s ∈ n b
⊢ {b | s ∈ n b} ∈ n b

Next tactic:
rcases h₁ _ _ hb with ⟨t, ht, -, h⟩
theorem nhds_mkOfNhds (n : α → Filter α) (a : α) (h₀ : pure ≤ n)
    (h₁ : ∀ a s, s ∈ n a → ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a') :
    @nhds α (TopologicalSpace.mkOfNhds n) a = n a := by
  letI := TopologicalSpace.mkOfNhds n
  apply le_antisymm <;> intros s hs
  · have h₀ : { b | s ∈ n b } ⊆ s := fun b hb => mem_pure.1 <| h₀ b hb
    have h₁ : { b | s ∈ n b } ∈ 𝓝 a := by
      refine' IsOpen.mem_nhds (fun b (hb : s ∈ n b) => _) hs
      rcases h₁ _ _ hb with ⟨t, ht, -, h⟩
      

Proof state:
case intro.intro.intro
α : Type u
n : α → Filter α
a : α
h₀✝ : pure ≤ n
h₁ : ∀ (a : α), ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a'
this : TopologicalSpace α := TopologicalSpace.mkOfNhds n
s : Set α
hs : s ∈ n a
h₀ : {b | s ∈ n b} ⊆ s
b : α
hb : s ∈ n b
t : Set α
ht : t ∈ n b
h : ∀ a' ∈ t, s ∈ n a'
⊢ {b | s ∈ n b} ∈ n b

Next tactic:
exact mem_of_superset ht h
theorem nhds_mkOfNhds (n : α → Filter α) (a : α) (h₀ : pure ≤ n)
    (h₁ : ∀ a s, s ∈ n a → ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a') :
    @nhds α (TopologicalSpace.mkOfNhds n) a = n a := by
  letI := TopologicalSpace.mkOfNhds n
  apply le_antisymm <;> intros s hs
  · have h₀ : { b | s ∈ n b } ⊆ s := fun b hb => mem_pure.1 <| h₀ b hb
    have h₁ : { b | s ∈ n b } ∈ 𝓝 a := by
      refine' IsOpen.mem_nhds (fun b (hb : s ∈ n b) => _) hs
      rcases h₁ _ _ hb with ⟨t, ht, -, h⟩
      exact mem_of_superset ht h
    

Proof state:
case a
α : Type u
n : α → Filter α
a : α
h₀✝ : pure ≤ n
h₁✝ : ∀ (a : α), ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a'
this : TopologicalSpace α := TopologicalSpace.mkOfNhds n
s : Set α
hs : s ∈ n a
h₀ : {b | s ∈ n b} ⊆ s
h₁ : {b | s ∈ n b} ∈ 𝓝 a
⊢ s ∈ 𝓝 a

Next tactic:
exact mem_of_superset h₁ h₀
theorem nhds_mkOfNhds (n : α → Filter α) (a : α) (h₀ : pure ≤ n)
    (h₁ : ∀ a s, s ∈ n a → ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a') :
    @nhds α (TopologicalSpace.mkOfNhds n) a = n a := by
  letI := TopologicalSpace.mkOfNhds n
  apply le_antisymm <;> intros s hs
  · have h₀ : { b | s ∈ n b } ⊆ s := fun b hb => mem_pure.1 <| h₀ b hb
    have h₁ : { b | s ∈ n b } ∈ 𝓝 a := by
      refine' IsOpen.mem_nhds (fun b (hb : s ∈ n b) => _) hs
      rcases h₁ _ _ hb with ⟨t, ht, -, h⟩
      exact mem_of_superset ht h
    exact mem_of_superset h₁ h₀
  · 

Proof state:
case a
α : Type u
n : α → Filter α
a : α
h₀ : pure ≤ n
h₁ : ∀ (a : α), ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a'
this : TopologicalSpace α := TopologicalSpace.mkOfNhds n
s : Set α
hs : s ∈ 𝓝 a
⊢ s ∈ n a

Next tactic:
rcases mem_nhds_iff.1 hs with ⟨t, hts, ht, hat⟩
theorem nhds_mkOfNhds (n : α → Filter α) (a : α) (h₀ : pure ≤ n)
    (h₁ : ∀ a s, s ∈ n a → ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a') :
    @nhds α (TopologicalSpace.mkOfNhds n) a = n a := by
  letI := TopologicalSpace.mkOfNhds n
  apply le_antisymm <;> intros s hs
  · have h₀ : { b | s ∈ n b } ⊆ s := fun b hb => mem_pure.1 <| h₀ b hb
    have h₁ : { b | s ∈ n b } ∈ 𝓝 a := by
      refine' IsOpen.mem_nhds (fun b (hb : s ∈ n b) => _) hs
      rcases h₁ _ _ hb with ⟨t, ht, -, h⟩
      exact mem_of_superset ht h
    exact mem_of_superset h₁ h₀
  · rcases mem_nhds_iff.1 hs with ⟨t, hts, ht, hat⟩
    

Proof state:
case a.intro.intro.intro
α : Type u
n : α → Filter α
a : α
h₀ : pure ≤ n
h₁ : ∀ (a : α), ∀ s ∈ n a, ∃ t ∈ n a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ n a'
this : TopologicalSpace α := TopologicalSpace.mkOfNhds n
s : Set α
hs : s ∈ 𝓝 a
t : Set α
hts : t ⊆ s
ht : IsOpen t
hat : a ∈ t
⊢ s ∈ n a

Next tactic:
exact (n a).sets_of_superset (ht _ hat) hts
theorem nhds_mkOfNhds_single [DecidableEq α] {a₀ : α} {l : Filter α} (h : pure a₀ ≤ l) (b : α) :
    @nhds α (TopologicalSpace.mkOfNhds (update pure a₀ l)) b =
      (update pure a₀ l : α → Filter α) b := by
  

Proof state:
α : Type u
inst✝ : DecidableEq α
a₀ : α
l : Filter α
h : pure a₀ ≤ l
b : α
⊢ 𝓝 b = update pure a₀ l b

Next tactic:
refine' nhds_mkOfNhds _ _ (le_update_iff.mpr ⟨h, fun _ _ => le_rfl⟩) fun a s hs => _
theorem nhds_mkOfNhds_single [DecidableEq α] {a₀ : α} {l : Filter α} (h : pure a₀ ≤ l) (b : α) :
    @nhds α (TopologicalSpace.mkOfNhds (update pure a₀ l)) b =
      (update pure a₀ l : α → Filter α) b := by
  refine' nhds_mkOfNhds _ _ (le_update_iff.mpr ⟨h, fun _ _ => le_rfl⟩) fun a s hs => _
  

Proof state:
α : Type u
inst✝ : DecidableEq α
a₀ : α
l : Filter α
h : pure a₀ ≤ l
b a : α
s : Set α
hs : s ∈ update pure a₀ l a
⊢ ∃ t ∈ update pure a₀ l a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ update pure a₀ l a'

Next tactic:
rcases eq_or_ne a a₀ with (rfl | ha)
theorem nhds_mkOfNhds_single [DecidableEq α] {a₀ : α} {l : Filter α} (h : pure a₀ ≤ l) (b : α) :
    @nhds α (TopologicalSpace.mkOfNhds (update pure a₀ l)) b =
      (update pure a₀ l : α → Filter α) b := by
  refine' nhds_mkOfNhds _ _ (le_update_iff.mpr ⟨h, fun _ _ => le_rfl⟩) fun a s hs => _
  rcases eq_or_ne a a₀ with (rfl | ha)
  · 

Proof state:
case inl
α : Type u
inst✝ : DecidableEq α
l : Filter α
b a : α
s : Set α
h : pure a ≤ l
hs : s ∈ update pure a l a
⊢ ∃ t ∈ update pure a l a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ update pure a l a'

Next tactic:
refine' ⟨s, hs, Subset.rfl, fun b hb => _⟩
theorem nhds_mkOfNhds_single [DecidableEq α] {a₀ : α} {l : Filter α} (h : pure a₀ ≤ l) (b : α) :
    @nhds α (TopologicalSpace.mkOfNhds (update pure a₀ l)) b =
      (update pure a₀ l : α → Filter α) b := by
  refine' nhds_mkOfNhds _ _ (le_update_iff.mpr ⟨h, fun _ _ => le_rfl⟩) fun a s hs => _
  rcases eq_or_ne a a₀ with (rfl | ha)
  · refine' ⟨s, hs, Subset.rfl, fun b hb => _⟩
    

Proof state:
case inl
α : Type u
inst✝ : DecidableEq α
l : Filter α
b✝ a : α
s : Set α
h : pure a ≤ l
hs : s ∈ update pure a l a
b : α
hb : b ∈ s
⊢ s ∈ update pure a l b

Next tactic:
rcases eq_or_ne b a with (rfl | hb)
theorem nhds_mkOfNhds_single [DecidableEq α] {a₀ : α} {l : Filter α} (h : pure a₀ ≤ l) (b : α) :
    @nhds α (TopologicalSpace.mkOfNhds (update pure a₀ l)) b =
      (update pure a₀ l : α → Filter α) b := by
  refine' nhds_mkOfNhds _ _ (le_update_iff.mpr ⟨h, fun _ _ => le_rfl⟩) fun a s hs => _
  rcases eq_or_ne a a₀ with (rfl | ha)
  · refine' ⟨s, hs, Subset.rfl, fun b hb => _⟩
    rcases eq_or_ne b a with (rfl | hb)
    · 

Proof state:
case inl.inl
α : Type u
inst✝ : DecidableEq α
l : Filter α
b✝ : α
s : Set α
b : α
hb : b ∈ s
h : pure b ≤ l
hs : s ∈ update pure b l b
⊢ s ∈ update pure b l b

Next tactic:
exact hs
theorem nhds_mkOfNhds_single [DecidableEq α] {a₀ : α} {l : Filter α} (h : pure a₀ ≤ l) (b : α) :
    @nhds α (TopologicalSpace.mkOfNhds (update pure a₀ l)) b =
      (update pure a₀ l : α → Filter α) b := by
  refine' nhds_mkOfNhds _ _ (le_update_iff.mpr ⟨h, fun _ _ => le_rfl⟩) fun a s hs => _
  rcases eq_or_ne a a₀ with (rfl | ha)
  · refine' ⟨s, hs, Subset.rfl, fun b hb => _⟩
    rcases eq_or_ne b a with (rfl | hb)
    · exact hs
    · 

Proof state:
case inl.inr
α : Type u
inst✝ : DecidableEq α
l : Filter α
b✝ a : α
s : Set α
h : pure a ≤ l
hs : s ∈ update pure a l a
b : α
hb✝ : b ∈ s
hb : b ≠ a
⊢ s ∈ update pure a l b

Next tactic:
rwa [update_noteq hb]
theorem nhds_mkOfNhds_single [DecidableEq α] {a₀ : α} {l : Filter α} (h : pure a₀ ≤ l) (b : α) :
    @nhds α (TopologicalSpace.mkOfNhds (update pure a₀ l)) b =
      (update pure a₀ l : α → Filter α) b := by
  refine' nhds_mkOfNhds _ _ (le_update_iff.mpr ⟨h, fun _ _ => le_rfl⟩) fun a s hs => _
  rcases eq_or_ne a a₀ with (rfl | ha)
  · refine' ⟨s, hs, Subset.rfl, fun b hb => _⟩
    rcases eq_or_ne b a with (rfl | hb)
    · exact hs
    · rwa [update_noteq hb]
  · 

Proof state:
case inr
α : Type u
inst✝ : DecidableEq α
a₀ : α
l : Filter α
h : pure a₀ ≤ l
b a : α
s : Set α
hs : s ∈ update pure a₀ l a
ha : a ≠ a₀
⊢ ∃ t ∈ update pure a₀ l a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ update pure a₀ l a'

Next tactic:
have hs' := hs
theorem nhds_mkOfNhds_single [DecidableEq α] {a₀ : α} {l : Filter α} (h : pure a₀ ≤ l) (b : α) :
    @nhds α (TopologicalSpace.mkOfNhds (update pure a₀ l)) b =
      (update pure a₀ l : α → Filter α) b := by
  refine' nhds_mkOfNhds _ _ (le_update_iff.mpr ⟨h, fun _ _ => le_rfl⟩) fun a s hs => _
  rcases eq_or_ne a a₀ with (rfl | ha)
  · refine' ⟨s, hs, Subset.rfl, fun b hb => _⟩
    rcases eq_or_ne b a with (rfl | hb)
    · exact hs
    · rwa [update_noteq hb]
  · have hs' := hs
    

Proof state:
case inr
α : Type u
inst✝ : DecidableEq α
a₀ : α
l : Filter α
h : pure a₀ ≤ l
b a : α
s : Set α
hs : s ∈ update pure a₀ l a
ha : a ≠ a₀
hs' : s ∈ update pure a₀ l a
⊢ ∃ t ∈ update pure a₀ l a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ update pure a₀ l a'

Next tactic:
rw [update_noteq ha] at hs ⊢
theorem nhds_mkOfNhds_single [DecidableEq α] {a₀ : α} {l : Filter α} (h : pure a₀ ≤ l) (b : α) :
    @nhds α (TopologicalSpace.mkOfNhds (update pure a₀ l)) b =
      (update pure a₀ l : α → Filter α) b := by
  refine' nhds_mkOfNhds _ _ (le_update_iff.mpr ⟨h, fun _ _ => le_rfl⟩) fun a s hs => _
  rcases eq_or_ne a a₀ with (rfl | ha)
  · refine' ⟨s, hs, Subset.rfl, fun b hb => _⟩
    rcases eq_or_ne b a with (rfl | hb)
    · exact hs
    · rwa [update_noteq hb]
  · have hs' := hs
    rw [update_noteq ha] at hs ⊢
    

Proof state:
case inr
α : Type u
inst✝ : DecidableEq α
a₀ : α
l : Filter α
h : pure a₀ ≤ l
b a : α
s : Set α
hs : s ∈ pure a
ha : a ≠ a₀
hs' : s ∈ update pure a₀ l a
⊢ ∃ t ∈ pure a, t ⊆ s ∧ ∀ a' ∈ t, s ∈ update pure a₀ l a'

Next tactic:
exact ⟨{a}, rfl, singleton_subset_iff.mpr hs, forall_eq.2 hs'⟩
theorem nhds_mkOfNhds_filterBasis (B : α → FilterBasis α) (a : α) (h₀ : ∀ (x), ∀ n ∈ B x, x ∈ n)
    (h₁ : ∀ (x), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n) :
    @nhds α (TopologicalSpace.mkOfNhds fun x => (B x).filter) a = (B a).filter := by
  

Proof state:
α : Type u
B : α → FilterBasis α
a : α
h₀ : ∀ (x : α), ∀ n ∈ B x, x ∈ n
h₁ : ∀ (x : α), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n
⊢ 𝓝 a = FilterBasis.filter (B a)

Next tactic:
rw [TopologicalSpace.nhds_mkOfNhds]
theorem nhds_mkOfNhds_filterBasis (B : α → FilterBasis α) (a : α) (h₀ : ∀ (x), ∀ n ∈ B x, x ∈ n)
    (h₁ : ∀ (x), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n) :
    @nhds α (TopologicalSpace.mkOfNhds fun x => (B x).filter) a = (B a).filter := by
  rw [TopologicalSpace.nhds_mkOfNhds] <;> 

Proof state:
case h₀
α : Type u
B : α → FilterBasis α
a : α
h₀ : ∀ (x : α), ∀ n ∈ B x, x ∈ n
h₁ : ∀ (x : α), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n
⊢ pure ≤ fun x => FilterBasis.filter (B x)

Next tactic:
intro x n hn
theorem nhds_mkOfNhds_filterBasis (B : α → FilterBasis α) (a : α) (h₀ : ∀ (x), ∀ n ∈ B x, x ∈ n)
    (h₁ : ∀ (x), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n) :
    @nhds α (TopologicalSpace.mkOfNhds fun x => (B x).filter) a = (B a).filter := by
  rw [TopologicalSpace.nhds_mkOfNhds] <;> 

Proof state:
case h₁
α : Type u
B : α → FilterBasis α
a : α
h₀ : ∀ (x : α), ∀ n ∈ B x, x ∈ n
h₁ : ∀ (x : α), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n
⊢ ∀ (a : α),
    ∀ s ∈ FilterBasis.filter (B a), ∃ t ∈ FilterBasis.filter (B a), t ⊆ s ∧ ∀ a' ∈ t, s ∈ FilterBasis.filter (B a')

Next tactic:
intro x n hn
theorem nhds_mkOfNhds_filterBasis (B : α → FilterBasis α) (a : α) (h₀ : ∀ (x), ∀ n ∈ B x, x ∈ n)
    (h₁ : ∀ (x), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n) :
    @nhds α (TopologicalSpace.mkOfNhds fun x => (B x).filter) a = (B a).filter := by
  rw [TopologicalSpace.nhds_mkOfNhds] <;> intro x n hn <;>
    

Proof state:
case h₀
α : Type u
B : α → FilterBasis α
a : α
h₀ : ∀ (x : α), ∀ n ∈ B x, x ∈ n
h₁ : ∀ (x : α), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n
x : α
n : Set α
hn : n ∈ (fun x => FilterBasis.filter (B x)) x
⊢ n ∈ pure x

Next tactic:
obtain ⟨m, hm₁, hm₂⟩ := (B x).mem_filter_iff.mp hn
theorem nhds_mkOfNhds_filterBasis (B : α → FilterBasis α) (a : α) (h₀ : ∀ (x), ∀ n ∈ B x, x ∈ n)
    (h₁ : ∀ (x), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n) :
    @nhds α (TopologicalSpace.mkOfNhds fun x => (B x).filter) a = (B a).filter := by
  rw [TopologicalSpace.nhds_mkOfNhds] <;> intro x n hn <;>
    

Proof state:
case h₁
α : Type u
B : α → FilterBasis α
a : α
h₀ : ∀ (x : α), ∀ n ∈ B x, x ∈ n
h₁ : ∀ (x : α), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n
x : α
n : Set α
hn : n ∈ FilterBasis.filter (B x)
⊢ ∃ t ∈ FilterBasis.filter (B x), t ⊆ n ∧ ∀ a' ∈ t, n ∈ FilterBasis.filter (B a')

Next tactic:
obtain ⟨m, hm₁, hm₂⟩ := (B x).mem_filter_iff.mp hn
theorem nhds_mkOfNhds_filterBasis (B : α → FilterBasis α) (a : α) (h₀ : ∀ (x), ∀ n ∈ B x, x ∈ n)
    (h₁ : ∀ (x), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n) :
    @nhds α (TopologicalSpace.mkOfNhds fun x => (B x).filter) a = (B a).filter := by
  rw [TopologicalSpace.nhds_mkOfNhds] <;> intro x n hn <;>
    obtain ⟨m, hm₁, hm₂⟩ := (B x).mem_filter_iff.mp hn
  · 

Proof state:
case h₀.intro.intro
α : Type u
B : α → FilterBasis α
a : α
h₀ : ∀ (x : α), ∀ n ∈ B x, x ∈ n
h₁ : ∀ (x : α), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n
x : α
n : Set α
hn : n ∈ (fun x => FilterBasis.filter (B x)) x
m : Set α
hm₁ : m ∈ B x
hm₂ : m ⊆ n
⊢ n ∈ pure x

Next tactic:
exact hm₂ (h₀ _ _ hm₁)
theorem nhds_mkOfNhds_filterBasis (B : α → FilterBasis α) (a : α) (h₀ : ∀ (x), ∀ n ∈ B x, x ∈ n)
    (h₁ : ∀ (x), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n) :
    @nhds α (TopologicalSpace.mkOfNhds fun x => (B x).filter) a = (B a).filter := by
  rw [TopologicalSpace.nhds_mkOfNhds] <;> intro x n hn <;>
    obtain ⟨m, hm₁, hm₂⟩ := (B x).mem_filter_iff.mp hn
  · exact hm₂ (h₀ _ _ hm₁)
  · 

Proof state:
case h₁.intro.intro
α : Type u
B : α → FilterBasis α
a : α
h₀ : ∀ (x : α), ∀ n ∈ B x, x ∈ n
h₁ : ∀ (x : α), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n
x : α
n : Set α
hn : n ∈ FilterBasis.filter (B x)
m : Set α
hm₁ : m ∈ B x
hm₂ : m ⊆ n
⊢ ∃ t ∈ FilterBasis.filter (B x), t ⊆ n ∧ ∀ a' ∈ t, n ∈ FilterBasis.filter (B a')

Next tactic:
obtain ⟨n₁, hn₁, hn₂, hn₃⟩ := h₁ x m hm₁
theorem nhds_mkOfNhds_filterBasis (B : α → FilterBasis α) (a : α) (h₀ : ∀ (x), ∀ n ∈ B x, x ∈ n)
    (h₁ : ∀ (x), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n) :
    @nhds α (TopologicalSpace.mkOfNhds fun x => (B x).filter) a = (B a).filter := by
  rw [TopologicalSpace.nhds_mkOfNhds] <;> intro x n hn <;>
    obtain ⟨m, hm₁, hm₂⟩ := (B x).mem_filter_iff.mp hn
  · exact hm₂ (h₀ _ _ hm₁)
  · obtain ⟨n₁, hn₁, hn₂, hn₃⟩ := h₁ x m hm₁
    

Proof state:
case h₁.intro.intro.intro.intro.intro
α : Type u
B : α → FilterBasis α
a : α
h₀ : ∀ (x : α), ∀ n ∈ B x, x ∈ n
h₁ : ∀ (x : α), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n
x : α
n : Set α
hn : n ∈ FilterBasis.filter (B x)
m : Set α
hm₁ : m ∈ B x
hm₂ : m ⊆ n
n₁ : Set α
hn₁ : n₁ ∈ B x
hn₂ : n₁ ⊆ m
hn₃ : ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ m
⊢ ∃ t ∈ FilterBasis.filter (B x), t ⊆ n ∧ ∀ a' ∈ t, n ∈ FilterBasis.filter (B a')

Next tactic:
refine'
      ⟨n₁, (B x).mem_filter_of_mem hn₁, hn₂.trans hm₂, fun x' hx' => (B x').mem_filter_iff.mp _⟩
theorem nhds_mkOfNhds_filterBasis (B : α → FilterBasis α) (a : α) (h₀ : ∀ (x), ∀ n ∈ B x, x ∈ n)
    (h₁ : ∀ (x), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n) :
    @nhds α (TopologicalSpace.mkOfNhds fun x => (B x).filter) a = (B a).filter := by
  rw [TopologicalSpace.nhds_mkOfNhds] <;> intro x n hn <;>
    obtain ⟨m, hm₁, hm₂⟩ := (B x).mem_filter_iff.mp hn
  · exact hm₂ (h₀ _ _ hm₁)
  · obtain ⟨n₁, hn₁, hn₂, hn₃⟩ := h₁ x m hm₁
    refine'
      ⟨n₁, (B x).mem_filter_of_mem hn₁, hn₂.trans hm₂, fun x' hx' => (B x').mem_filter_iff.mp _⟩
    

Proof state:
case h₁.intro.intro.intro.intro.intro
α : Type u
B : α → FilterBasis α
a : α
h₀ : ∀ (x : α), ∀ n ∈ B x, x ∈ n
h₁ : ∀ (x : α), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n
x : α
n : Set α
hn : n ∈ FilterBasis.filter (B x)
m : Set α
hm₁ : m ∈ B x
hm₂ : m ⊆ n
n₁ : Set α
hn₁ : n₁ ∈ B x
hn₂ : n₁ ⊆ m
hn₃ : ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ m
x' : α
hx' : x' ∈ n₁
⊢ n ∈ FilterBasis.filter (B x')

Next tactic:
obtain ⟨n₂, hn₄, hn₅⟩ := hn₃ x' hx'
theorem nhds_mkOfNhds_filterBasis (B : α → FilterBasis α) (a : α) (h₀ : ∀ (x), ∀ n ∈ B x, x ∈ n)
    (h₁ : ∀ (x), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n) :
    @nhds α (TopologicalSpace.mkOfNhds fun x => (B x).filter) a = (B a).filter := by
  rw [TopologicalSpace.nhds_mkOfNhds] <;> intro x n hn <;>
    obtain ⟨m, hm₁, hm₂⟩ := (B x).mem_filter_iff.mp hn
  · exact hm₂ (h₀ _ _ hm₁)
  · obtain ⟨n₁, hn₁, hn₂, hn₃⟩ := h₁ x m hm₁
    refine'
      ⟨n₁, (B x).mem_filter_of_mem hn₁, hn₂.trans hm₂, fun x' hx' => (B x').mem_filter_iff.mp _⟩
    obtain ⟨n₂, hn₄, hn₅⟩ := hn₃ x' hx'
    

Proof state:
case h₁.intro.intro.intro.intro.intro.intro.intro
α : Type u
B : α → FilterBasis α
a : α
h₀ : ∀ (x : α), ∀ n ∈ B x, x ∈ n
h₁ : ∀ (x : α), ∀ n ∈ B x, ∃ n₁ ∈ B x, n₁ ⊆ n ∧ ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ n
x : α
n : Set α
hn : n ∈ FilterBasis.filter (B x)
m : Set α
hm₁ : m ∈ B x
hm₂ : m ⊆ n
n₁ : Set α
hn₁ : n₁ ∈ B x
hn₂ : n₁ ⊆ m
hn₃ : ∀ x' ∈ n₁, ∃ n₂ ∈ B x', n₂ ⊆ m
x' : α
hx' : x' ∈ n₁
n₂ : Set α
hn₄ : n₂ ∈ B x'
hn₅ : n₂ ⊆ m
⊢ n ∈ FilterBasis.filter (B x')

Next tactic:
exact ⟨n₂, hn₄, hn₅.trans hm₂⟩
/-- The only open sets in the indiscrete topology are the empty set and the whole space. -/
theorem TopologicalSpace.isOpen_top_iff {α} (U : Set α) : IsOpen[⊤] U ↔ U = ∅ ∨ U = univ :=
  ⟨fun h => by
    

Proof state:
α✝ : Type ?u.12870
t t₁ t₂ : TopologicalSpace α✝
s : Set α✝
α : Type u_1
U : Set α
h : IsOpen U
⊢ U = ∅ ∨ U = univ

Next tactic:
induction h with
    | basic _ h => exact False.elim h
    | univ => exact .inr rfl
    | inter _ _ _ _ h₁ h₂ =>
      rcases h₁ with (rfl | rfl) <;> rcases h₂ with (rfl | rfl) <;> simp
    | sUnion _ _ ih => exact sUnion_mem_empty_univ ih
/-- The only open sets in the indiscrete topology are the empty set and the whole space. -/
theorem TopologicalSpace.isOpen_top_iff {α} (U : Set α) : IsOpen[⊤] U ↔ U = ∅ ∨ U = univ :=
  ⟨fun h => by
    induction h with
    

Proof state:
case basic
α✝ : Type ?u.12870
t t₁ t₂ : TopologicalSpace α✝
s : Set α✝
α : Type u_1
U s✝ : Set α
h : s✝ ∈ OrderDual.ofDual (OrderDual.ofDual ⊥)
⊢ s✝ = ∅ ∨ s✝ = univ

Next tactic:
| basic _ h => exact False.elim h
/-- The only open sets in the indiscrete topology are the empty set and the whole space. -/
theorem TopologicalSpace.isOpen_top_iff {α} (U : Set α) : IsOpen[⊤] U ↔ U = ∅ ∨ U = univ :=
  ⟨fun h => by
    induction h with
    | basic _ h => 

Proof state:
case basic
α✝ : Type ?u.12870
t t₁ t₂ : TopologicalSpace α✝
s : Set α✝
α : Type u_1
U s✝ : Set α
h : s✝ ∈ OrderDual.ofDual (OrderDual.ofDual ⊥)
⊢ s✝ = ∅ ∨ s✝ = univ

Next tactic:
exact False.elim h
/-- The only open sets in the indiscrete topology are the empty set and the whole space. -/
theorem TopologicalSpace.isOpen_top_iff {α} (U : Set α) : IsOpen[⊤] U ↔ U = ∅ ∨ U = univ :=
  ⟨fun h => by
    induction h with
    | basic _ h => exact False.elim h
    

Proof state:
case univ
α✝ : Type ?u.12870
t t₁ t₂ : TopologicalSpace α✝
s : Set α✝
α : Type u_1
U : Set α
⊢ univ = ∅ ∨ univ = univ

Next tactic:
| univ => exact .inr rfl
/-- The only open sets in the indiscrete topology are the empty set and the whole space. -/
theorem TopologicalSpace.isOpen_top_iff {α} (U : Set α) : IsOpen[⊤] U ↔ U = ∅ ∨ U = univ :=
  ⟨fun h => by
    induction h with
    | basic _ h => exact False.elim h
    | univ => 

Proof state:
case univ
α✝ : Type ?u.12870
t t₁ t₂ : TopologicalSpace α✝
s : Set α✝
α : Type u_1
U : Set α
⊢ univ = ∅ ∨ univ = univ

Next tactic:
exact .inr rfl
/-- The only open sets in the indiscrete topology are the empty set and the whole space. -/
theorem TopologicalSpace.isOpen_top_iff {α} (U : Set α) : IsOpen[⊤] U ↔ U = ∅ ∨ U = univ :=
  ⟨fun h => by
    induction h with
    | basic _ h => exact False.elim h
    | univ => exact .inr rfl
    

Proof state:
case inter
α✝ : Type ?u.12870
t t₁ t₂ : TopologicalSpace α✝
s : Set α✝
α : Type u_1
U s✝ t✝ : Set α
a✝¹ : GenerateOpen (OrderDual.ofDual (OrderDual.ofDual ⊥)) s✝
a✝ : GenerateOpen (OrderDual.ofDual (OrderDual.ofDual ⊥)) t✝
h₁ : s✝ = ∅ ∨ s✝ = univ
h₂ : t✝ = ∅ ∨ t✝ = univ
⊢ s✝ ∩ t✝ = ∅ ∨ s✝ ∩ t✝ = univ

Next tactic:
| inter _ _ _ _ h₁ h₂ =>
      rcases h₁ with (rfl | rfl) <;> rcases h₂ with (rfl | rfl) <;> simp
/-- The only open sets in the indiscrete topology are the empty set and the whole space. -/
theorem TopologicalSpace.isOpen_top_iff {α} (U : Set α) : IsOpen[⊤] U ↔ U = ∅ ∨ U = univ :=
  ⟨fun h => by
    induction h with
    | basic _ h => exact False.elim h
    | univ => exact .inr rfl
    | inter _ _ _ _ h₁ h₂ =>
      

Proof state:
case inter
α✝ : Type ?u.12870
t t₁ t₂ : TopologicalSpace α✝
s : Set α✝
α : Type u_1
U s✝ t✝ : Set α
a✝¹ : GenerateOpen (OrderDual.ofDual (OrderDual.ofDual ⊥)) s✝
a✝ : GenerateOpen (OrderDual.ofDual (OrderDual.ofDual ⊥)) t✝
h₁ : s✝ = ∅ ∨ s✝ = univ
h₂ : t✝ = ∅ ∨ t✝ = univ
⊢ s✝ ∩ t✝ = ∅ ∨ s✝ ∩ t✝ = univ

Next tactic:
rcases h₁ with (rfl | rfl)
/-- The only open sets in the indiscrete topology are the empty set and the whole space. -/
theorem TopologicalSpace.isOpen_top_iff {α} (U : Set α) : IsOpen[⊤] U ↔ U = ∅ ∨ U = univ :=
  ⟨fun h => by
    induction h with
    | basic _ h => exact False.elim h
    | univ => exact .inr rfl
    | inter _ _ _ _ h₁ h₂ =>
      rcases h₁ with (rfl | rfl) <;> 

Proof state:
case inter.inl
α✝ : Type ?u.12870
t t₁ t₂ : TopologicalSpace α✝
s : Set α✝
α : Type u_1
U t✝ : Set α
a✝¹ : GenerateOpen (OrderDual.ofDual (OrderDual.ofDual ⊥)) t✝
h₂ : t✝ = ∅ ∨ t✝ = univ
a✝ : GenerateOpen (OrderDual.ofDual (OrderDual.ofDual ⊥)) ∅
⊢ ∅ ∩ t✝ = ∅ ∨ ∅ ∩ t✝ = univ

Next tactic:
rcases h₂ with (rfl | rfl)