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

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
⊢ u ∈ {x | (fun y => s ∈ traverse 𝓝 y) x}

Tactic:
have hu := (List.mem_traverse _ _).1 hu

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
⊢ u ∈ {x | (fun y => s ∈ traverse 𝓝 y) x}

Proof state:
α : 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 α)
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
hv : List.Forall₂ (fun s a => IsOpen s ∧ a ∈ s) v l
⊢ List.Forall₂ (flip fun a s => IsOpen s ∧ a ∈ s) v u

Tactic:
simp only [List.forall₂_and_left, Function.flip_def] at hv ⊢

Result:
α : 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 α)
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
hv : (∀ a ∈ v, IsOpen a) ∧ List.Forall₂ Membership.mem v l
⊢ (∀ a ∈ v, IsOpen a) ∧ List.Forall₂ Membership.mem v u

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
⊢ ∀ᶠ (y : List α) in traverse 𝓝 l, s ∈ traverse 𝓝 y

Tactic:
refine mem_of_superset this fun u hu ↦ ?_

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
⊢ u ∈ {x | (fun y => s ∈ traverse 𝓝 y) x}

Proof state:
α : 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.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) l v ∧ sequence v ⊆ s

Tactic:
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:
no goals

Proof state:
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

Tactic:
rcases (mem_traverse_iff _ _).1 hs with ⟨u, hu, hus⟩

Result:
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

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
this : List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) u v
⊢ sequence v ∈ traverse 𝓝 u

Tactic:
exact mem_traverse _ _ (this.imp fun a s ⟨hs, ha⟩ => IsOpen.mem_nhds hs ha)

Result:
no goals

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

Tactic:
simpa only [functor_norm] using this

Result:
no goals

Proof state:
α : 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 α)
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
hv : (∀ a ∈ v, IsOpen a) ∧ List.Forall₂ Membership.mem v l
⊢ (∀ a ∈ v, IsOpen a) ∧ List.Forall₂ Membership.mem v u

Tactic:
exact ⟨hv.1, hu.flip⟩

Result:
no goals

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
this : ∃ v, List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) l v ∧ sequence v ⊆ s
⊢ ∀ᶠ (y : List α) in traverse 𝓝 l, s ∈ traverse 𝓝 y

Tactic:
rcases this with ⟨v, hv, hvs⟩

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
⊢ ∀ᶠ (y : List α) in traverse 𝓝 l, s ∈ traverse 𝓝 y

Proof state:
α : Type u_1
inst✝ : TopologicalSpace α
as : List α
⊢ 𝓝 as = traverse 𝓝 as

Tactic:
refine nhds_mkOfNhds _ _ ?_ ?_

Result:
case refine_1
α : Type u_1
inst✝ : TopologicalSpace α
as : List α
⊢ pure ≤ traverse 𝓝

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

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
this : List.Forall₂ (fun a s => IsOpen s ∧ a ∈ s) u v
⊢ u ∈ {x | (fun y => s ∈ traverse 𝓝 y) x}

Tactic:
refine mem_of_superset ?_ hvs

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
⊢ sequence v ∈ traverse 𝓝 u

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

Tactic:
exists []

Result:
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