-- Mathlib/Topology/List.lean
theorem nhds_list (as : List α) : 𝓝 as = traverse 𝓝 as

Proof state:
case cons
α : Type u_1
inst✝ : TopologicalSpace α
l : List α
u : List (Set α)
a✝¹ : α
b✝ : Set α
l₁✝ : List α
l₂✝ : List (Set α)
ht : b✝ ∈ 𝓝 a✝¹
a✝ : List.Forall₂ (fun b s => s ∈ 𝓝 b) l₁✝ l₂✝
ih : ∀ (s : Set (List α)), sequence l₂✝ ⊆ s → ∃ v, List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) l₁✝ v ∧ sequence v ⊆ s
s : Set (List α)
hus : sequence (b✝ :: l₂✝) ⊆ s
⊢ ∃ v, List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) (a✝¹ :: l₁✝) v ∧ sequence v ⊆ s

Tactic:
rcases mem_nhds_iff.1 ht with ⟨u, hut, hu⟩

Result:
case cons.intro.intro
α : Type u_1
inst✝ : TopologicalSpace α
l : List α
u✝ : List (Set α)
a✝¹ : α
b✝ : Set α
l₁✝ : List α
l₂✝ : List (Set α)
ht : b✝ ∈ 𝓝 a✝¹
a✝ : List.Forall₂ (fun b s => s ∈ 𝓝 b) l₁✝ l₂✝
ih : ∀ (s : Set (List α)), sequence l₂✝ ⊆ s → ∃ v, List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) l₁✝ v ∧ sequence v ⊆ s
s : Set (List α)
hus : sequence (b✝ :: l₂✝) ⊆ s
u : Set α
hut : u ⊆ b✝
hu : IsOpen u ∧ a✝¹ ∈ u
⊢ ∃ v, List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) (a✝¹ :: l₁✝) v ∧ sequence v ⊆ s

Proof state:
case refine_2.intro.intro.intro.intro
α : Type u_1
inst✝ : TopologicalSpace α
l : List α
s : Set (List α)
u✝ : List (Set α)
hu✝¹ : List.Forall₂ (fun b s => s ∈ 𝓝 b) l u✝
hus : sequence u✝ ⊆ s
v : List (Set α)
hv : List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) l v
hvs : sequence v ⊆ s
this : sequence v ∈ traverse 𝓝 l
u : List α
hu✝ : u ∈ sequence v
hu : List.Forall₂ (fun b a => b ∈ id a) u v
⊢ u ∈ {x | (fun y => s ∈ traverse 𝓝 y) x}

Tactic:
have : List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) u v := by
  refine List.Forall₂.flip ?_
  replace hv := hv.flip
  simp only [List.forall₂_and_left, Function.flip_def] at hv ⊢
  exact ⟨hv.1, hu.flip⟩

Result:
case refine_2.intro.intro.intro.intro
α : Type u_1
inst✝ : TopologicalSpace α
l : List α
s : Set (List α)
u✝ : List (Set α)
hu✝¹ : List.Forall₂ (fun b s => s ∈ 𝓝 b) l u✝
hus : sequence u✝ ⊆ s
v : List (Set α)
hv : List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) l v
hvs : sequence v ⊆ s
this✝ : sequence v ∈ traverse 𝓝 l
u : List α
hu✝ : u ∈ sequence v
hu : List.Forall₂ (fun b a => b ∈ id a) u v
this : List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) u v
⊢ u ∈ {x | (fun y => s ∈ traverse 𝓝 y) x}

Proof state:
case nil
α : Type u_1
inst✝ : TopologicalSpace α
l : List α
u : List (Set α)
s : Set (List α)
hus : sequence [] ⊆ s
⊢ List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) [] [] ∧ sequence [] ⊆ s

Tactic:
simp only [List.forall₂_nil_left_iff, exists_eq_left]

Result:
case nil
α : Type u_1
inst✝ : TopologicalSpace α
l : List α
u : List (Set α)
s : Set (List α)
hus : sequence [] ⊆ s
⊢ True ∧ sequence [] ⊆ s

Proof state:
case refine_2.intro.intro
α : Type u_1
inst✝ : TopologicalSpace α
l : List α
s : Set (List α)
u : List (Set α)
hu : List.Forall₂ (fun b s => s ∈ 𝓝 b) l u
hus : sequence u ⊆ s
⊢ ∀ᶠ (y : List α) in traverse 𝓝 l, s ∈ traverse 𝓝 y

Tactic:
have : ∃ v : List (Set α), l.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) v ∧ sequence v ⊆ s := by
  induction hu generalizing s with
  | nil =>
    exists []
    simp only [List.forall₂_nil_left_iff, exists_eq_left]
    exact ⟨trivial, hus⟩
  | cons ht _ ih =>
    rcases mem_nhds_iff.1 ht with ⟨u, hut, hu⟩
    rcases ih _ Subset.rfl with ⟨v, hv, hvss⟩
    exact
      ⟨u::v, List.Forall₂.cons hu hv,
        Subset.trans (Set.seq_mono (Set.image_subset _ hut) hvss) hus⟩

Result:
case refine_2.intro.intro
α : Type u_1
inst✝ : TopologicalSpace α
l : List α
s : Set (List α)
u : List (Set α)
hu : List.Forall₂ (fun b s => s ∈ 𝓝 b) l u
hus : sequence u ⊆ s
this : ∃ v, List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) l v ∧ sequence v ⊆ s
⊢ ∀ᶠ (y : List α) in traverse 𝓝 l, s ∈ traverse 𝓝 y

Proof state:
case refine_2.intro.intro
α : Type u_1
inst✝ : TopologicalSpace α
as l : List α
s : Set (List α)
hs : s ∈ traverse 𝓝 l
u : List (Set α)
hu : List.Forall₂ (fun b s => s ∈ 𝓝 b) l u
hus : sequence u ⊆ s
⊢ ∀ᶠ (y : List α) in traverse 𝓝 l, s ∈ traverse 𝓝 y

Tactic:
clear as hs

Result:
case refine_2.intro.intro
α : Type u_1
inst✝ : TopologicalSpace α
l : List α
s : Set (List α)
u : List (Set α)
hu : List.Forall₂ (fun b s => s ∈ 𝓝 b) l u
hus : sequence u ⊆ s
⊢ ∀ᶠ (y : List α) in traverse 𝓝 l, s ∈ traverse 𝓝 y

Proof state:
case cons.intro.intro.intro.intro
α : Type u_1
inst✝ : TopologicalSpace α
l : List α
u✝ : List (Set α)
a✝¹ : α
b✝ : Set α
l₁✝ : List α
l₂✝ : List (Set α)
ht : b✝ ∈ 𝓝 a✝¹
a✝ : List.Forall₂ (fun b s => s ∈ 𝓝 b) l₁✝ l₂✝
ih : ∀ (s : Set (List α)), sequence l₂✝ ⊆ s → ∃ v, List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) l₁✝ v ∧ sequence v ⊆ s
s : Set (List α)
hus : sequence (b✝ :: l₂✝) ⊆ s
u : Set α
hut : u ⊆ b✝
hu : IsOpen u ∧ a✝¹ ∈ u
v : List (Set α)
hv : List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) l₁✝ v
hvss : sequence v ⊆ sequence l₂✝
⊢ ∃ v, List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) (a✝¹ :: l₁✝) v ∧ sequence v ⊆ s

Tactic:
exact
  ⟨u::v, List.Forall₂.cons hu hv,
    Subset.trans (Set.seq_mono (Set.image_subset _ hut) hvss) hus⟩

Result:
no goals

Proof state:
case refine_2.intro.intro.intro.intro
α : Type u_1
inst✝ : TopologicalSpace α
l : List α
s : Set (List α)
u : List (Set α)
hu : List.Forall₂ (fun b s => s ∈ 𝓝 b) l u
hus : sequence u ⊆ s
v : List (Set α)
hv : List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) l v
hvs : sequence v ⊆ s
⊢ ∀ᶠ (y : List α) in traverse 𝓝 l, s ∈ traverse 𝓝 y

Tactic:
have : sequence v ∈ traverse 𝓝 l :=
  mem_traverse _ _ <| hv.imp fun a s ⟨hs, ha⟩ => IsOpen.mem_nhds hs ha

Result:
case refine_2.intro.intro.intro.intro
α : Type u_1
inst✝ : TopologicalSpace α
l : List α
s : Set (List α)
u : List (Set α)
hu : List.Forall₂ (fun b s => s ∈ 𝓝 b) l u
hus : sequence u ⊆ s
v : List (Set α)
hv : List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) l v
hvs : sequence v ⊆ s
this : sequence v ∈ traverse 𝓝 l
⊢ ∀ᶠ (y : List α) in traverse 𝓝 l, s ∈ traverse 𝓝 y

Proof state:
case refine_1.cons
α : Type u_1
inst✝ : TopologicalSpace α
as : List α
a : α
l : List α
ih : pure l ≤ traverse 𝓝 l
⊢ List.cons <$> pure a <*> pure l ≤ List.cons <$> 𝓝 a <*> traverse 𝓝 l

Tactic:
exact Filter.seq_mono (Filter.map_mono <| pure_le_nhds a) ih

Result:
no goals

Proof state:
case nil
α : Type u_1
inst✝ : TopologicalSpace α
l : List α
u : List (Set α)
s : Set (List α)
hus : sequence [] ⊆ s
⊢ True ∧ sequence [] ⊆ s

Tactic:
exact ⟨trivial, hus⟩

Result:
no goals

Proof state:
case refine_1.cons
α : Type u_1
inst✝ : TopologicalSpace α
as : List α
a : α
l : List α
ih : pure l ≤ traverse 𝓝 l
⊢ pure (a :: l) ≤ traverse 𝓝 (a :: l)

Tactic:
suffices List.cons <$> pure a <*> pure l ≤ List.cons <$> 𝓝 a <*> traverse 𝓝 l by
  simpa only [functor_norm] using this

Result:
case refine_1.cons
α : Type u_1
inst✝ : TopologicalSpace α
as : List α
a : α
l : List α
ih : pure l ≤ traverse 𝓝 l
⊢ List.cons <$> pure a <*> pure l ≤ List.cons <$> 𝓝 a <*> traverse 𝓝 l

Proof state:
case refine_2
α : Type u_1
inst✝ : TopologicalSpace α
as : List α
⊢ ∀ (a : List α), ∀ s ∈ traverse 𝓝 a, ∀ᶠ (y : List α) in traverse 𝓝 a, s ∈ traverse 𝓝 y

Tactic:
intro l s hs

Result:
case refine_2
α : Type u_1
inst✝ : TopologicalSpace α
as l : List α
s : Set (List α)
hs : s ∈ traverse 𝓝 l
⊢ ∀ᶠ (y : List α) in traverse 𝓝 l, s ∈ traverse 𝓝 y