l3lab/ntp-mathlib huggingface dataset:
protected theorem push_pull (f : α → β) (F : Filter α) (G : Filter β) :
    map f (F ⊓ comap f G) = map f F ⊓ G := by
  apply le_antisymm
  · calc
      map f (F ⊓ comap f G) ≤ map f F ⊓ (map f <| comap f G) := map_inf_le
      _ ≤ map f F ⊓ G := inf_le_inf_left (map f F) map_comap_le

  · rintro U ⟨V, V_in, W, ⟨Z, Z_in, hZ⟩, h⟩
    apply mem_inf_of_inter (image_mem_map V_in) Z_in
    calc
      f '' V ∩ Z = f '' (V ∩ f ⁻¹' Z) := by rw [image_inter_preimage]
      _ ⊆ f '' (V ∩ W) := image_subset _ (inter_subset_inter_right _ ‹_›)
      _ = f '' (f ⁻¹' U) := by 

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : α → β
F : Filter α
G : Filter β
U : Set β
V : Set α
V_in : V ∈ F
W : Set α
h : f ⁻¹' U = V ∩ W
Z : Set β
Z_in : Z ∈ G
hZ : f ⁻¹' Z ⊆ W
⊢ f '' (V ∩ W) = f '' (f ⁻¹' U)

Next tactic:
rw [h]
protected theorem push_pull' (f : α → β) (F : Filter α) (G : Filter β) :
    map f (comap f G ⊓ F) = G ⊓ map f F := by 

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : α → β
F : Filter α
G : Filter β
⊢ map f (comap f G ⊓ F) = G ⊓ map f F

Next tactic:
simp only [Filter.push_pull, inf_comm]
theorem principal_eq_map_coe_top (s : Set α) : 𝓟 s = map ((↑) : s → α) ⊤ := by 

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
s : Set α
⊢ 𝓟 s = map Subtype.val ⊤

Next tactic:
simp
theorem inf_principal_eq_bot_iff_comap {F : Filter α} {s : Set α} :
    F ⊓ 𝓟 s = ⊥ ↔ comap ((↑) : s → α) F = ⊥ := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
F : Filter α
s : Set α
⊢ F ⊓ 𝓟 s = ⊥ ↔ comap Subtype.val F = ⊥

Next tactic:
rw [principal_eq_map_coe_top s, ← Filter.push_pull', inf_top_eq, map_eq_bot_iff]
@[simp]
theorem le_pure_iff {f : Filter α} {a : α} : f ≤ pure a ↔ {a} ∈ f := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter α
a : α
⊢ f ≤ pure a ↔ {a} ∈ f

Next tactic:
rw [← principal_singleton, le_principal_iff]
theorem mem_seq_iff {f : Filter (α → β)} {g : Filter α} {s : Set β} :
    s ∈ f.seq g ↔ ∃ u ∈ f, ∃ t ∈ g, Set.seq u t ⊆ s := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter (α → β)
g : Filter α
s : Set β
⊢ s ∈ seq f g ↔ ∃ u ∈ f, ∃ t ∈ g, Set.seq u t ⊆ s

Next tactic:
simp only [mem_seq_def, seq_subset, exists_prop, iff_self_iff]
@[simp]
theorem pure_seq_eq_map (g : α → β) (f : Filter α) : seq (pure g) f = f.map g := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
g : α → β
f : Filter α
⊢ seq (pure g) f = map g f

Next tactic:
refine' le_antisymm (le_map fun s hs => _) (le_seq fun s hs t ht => _)
@[simp]
theorem pure_seq_eq_map (g : α → β) (f : Filter α) : seq (pure g) f = f.map g := by
  refine' le_antisymm (le_map fun s hs => _) (le_seq fun s hs t ht => _)
  · 

Proof state:
case refine'_1
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
g : α → β
f : Filter α
s : Set α
hs : s ∈ f
⊢ g '' s ∈ seq (pure g) f

Next tactic:
rw [← singleton_seq]
@[simp]
theorem pure_seq_eq_map (g : α → β) (f : Filter α) : seq (pure g) f = f.map g := by
  refine' le_antisymm (le_map fun s hs => _) (le_seq fun s hs t ht => _)
  · rw [← singleton_seq]
    

Proof state:
case refine'_1
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
g : α → β
f : Filter α
s : Set α
hs : s ∈ f
⊢ Set.seq {g} s ∈ seq (pure g) f

Next tactic:
apply seq_mem_seq _ hs
@[simp]
theorem pure_seq_eq_map (g : α → β) (f : Filter α) : seq (pure g) f = f.map g := by
  refine' le_antisymm (le_map fun s hs => _) (le_seq fun s hs t ht => _)
  · rw [← singleton_seq]
    apply seq_mem_seq _ hs
    

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
g : α → β
f : Filter α
s : Set α
hs : s ∈ f
⊢ {g} ∈ pure g

Next tactic:
exact singleton_mem_pure
@[simp]
theorem pure_seq_eq_map (g : α → β) (f : Filter α) : seq (pure g) f = f.map g := by
  refine' le_antisymm (le_map fun s hs => _) (le_seq fun s hs t ht => _)
  · rw [← singleton_seq]
    apply seq_mem_seq _ hs
    exact singleton_mem_pure
  · 

Proof state:
case refine'_2
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
g : α → β
f : Filter α
s : Set (α → β)
hs : s ∈ pure g
t : Set α
ht : t ∈ f
⊢ Set.seq s t ∈ map g f

Next tactic:
refine' sets_of_superset (map g f) (image_mem_map ht) _
@[simp]
theorem pure_seq_eq_map (g : α → β) (f : Filter α) : seq (pure g) f = f.map g := by
  refine' le_antisymm (le_map fun s hs => _) (le_seq fun s hs t ht => _)
  · rw [← singleton_seq]
    apply seq_mem_seq _ hs
    exact singleton_mem_pure
  · refine' sets_of_superset (map g f) (image_mem_map ht) _
    

Proof state:
case refine'_2
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
g : α → β
f : Filter α
s : Set (α → β)
hs : s ∈ pure g
t : Set α
ht : t ∈ f
⊢ g '' t ⊆ Set.seq s t

Next tactic:
rintro b ⟨a, ha, rfl⟩
@[simp]
theorem pure_seq_eq_map (g : α → β) (f : Filter α) : seq (pure g) f = f.map g := by
  refine' le_antisymm (le_map fun s hs => _) (le_seq fun s hs t ht => _)
  · rw [← singleton_seq]
    apply seq_mem_seq _ hs
    exact singleton_mem_pure
  · refine' sets_of_superset (map g f) (image_mem_map ht) _
    rintro b ⟨a, ha, rfl⟩
    

Proof state:
case refine'_2.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
g : α → β
f : Filter α
s : Set (α → β)
hs : s ∈ pure g
t : Set α
ht : t ∈ f
a : α
ha : a ∈ t
⊢ g a ∈ Set.seq s t

Next tactic:
exact ⟨g, hs, a, ha, rfl⟩
@[simp]
theorem seq_pure (f : Filter (α → β)) (a : α) : seq f (pure a) = map (fun g : α → β => g a) f := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter (α → β)
a : α
⊢ seq f (pure a) = map (fun g => g a) f

Next tactic:
refine' le_antisymm (le_map fun s hs => _) (le_seq fun s hs t ht => _)
@[simp]
theorem seq_pure (f : Filter (α → β)) (a : α) : seq f (pure a) = map (fun g : α → β => g a) f := by
  refine' le_antisymm (le_map fun s hs => _) (le_seq fun s hs t ht => _)
  · 

Proof state:
case refine'_1
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter (α → β)
a : α
s : Set (α → β)
hs : s ∈ f
⊢ (fun g => g a) '' s ∈ seq f (pure a)

Next tactic:
rw [← seq_singleton]
@[simp]
theorem seq_pure (f : Filter (α → β)) (a : α) : seq f (pure a) = map (fun g : α → β => g a) f := by
  refine' le_antisymm (le_map fun s hs => _) (le_seq fun s hs t ht => _)
  · rw [← seq_singleton]
    

Proof state:
case refine'_1
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter (α → β)
a : α
s : Set (α → β)
hs : s ∈ f
⊢ Set.seq s {a} ∈ seq f (pure a)

Next tactic:
exact seq_mem_seq hs singleton_mem_pure
@[simp]
theorem seq_pure (f : Filter (α → β)) (a : α) : seq f (pure a) = map (fun g : α → β => g a) f := by
  refine' le_antisymm (le_map fun s hs => _) (le_seq fun s hs t ht => _)
  · rw [← seq_singleton]
    exact seq_mem_seq hs singleton_mem_pure
  · 

Proof state:
case refine'_2
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter (α → β)
a : α
s : Set (α → β)
hs : s ∈ f
t : Set α
ht : t ∈ pure a
⊢ Set.seq s t ∈ map (fun g => g a) f

Next tactic:
refine' sets_of_superset (map (fun g : α → β => g a) f) (image_mem_map hs) _
@[simp]
theorem seq_pure (f : Filter (α → β)) (a : α) : seq f (pure a) = map (fun g : α → β => g a) f := by
  refine' le_antisymm (le_map fun s hs => _) (le_seq fun s hs t ht => _)
  · rw [← seq_singleton]
    exact seq_mem_seq hs singleton_mem_pure
  · refine' sets_of_superset (map (fun g : α → β => g a) f) (image_mem_map hs) _
    

Proof state:
case refine'_2
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter (α → β)
a : α
s : Set (α → β)
hs : s ∈ f
t : Set α
ht : t ∈ pure a
⊢ (fun g => g a) '' s ⊆ Set.seq s t

Next tactic:
rintro b ⟨g, hg, rfl⟩
@[simp]
theorem seq_pure (f : Filter (α → β)) (a : α) : seq f (pure a) = map (fun g : α → β => g a) f := by
  refine' le_antisymm (le_map fun s hs => _) (le_seq fun s hs t ht => _)
  · rw [← seq_singleton]
    exact seq_mem_seq hs singleton_mem_pure
  · refine' sets_of_superset (map (fun g : α → β => g a) f) (image_mem_map hs) _
    rintro b ⟨g, hg, rfl⟩
    

Proof state:
case refine'_2.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter (α → β)
a : α
s : Set (α → β)
hs : s ∈ f
t : Set α
ht : t ∈ pure a
g : α → β
hg : g ∈ s
⊢ (fun g => g a) g ∈ Set.seq s t

Next tactic:
exact ⟨g, hg, a, ht, rfl⟩
@[simp]
theorem seq_assoc (x : Filter α) (g : Filter (α → β)) (h : Filter (β → γ)) :
    seq h (seq g x) = seq (seq (map (· ∘ ·) h) g) x := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
x : Filter α
g : Filter (α → β)
h : Filter (β → γ)
⊢ seq h (seq g x) = seq (seq (map (fun x x_1 => x ∘ x_1) h) g) x

Next tactic:
refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
@[simp]
theorem seq_assoc (x : Filter α) (g : Filter (α → β)) (h : Filter (β → γ)) :
    seq h (seq g x) = seq (seq (map (· ∘ ·) h) g) x := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · 

Proof state:
case refine'_1
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
x : Filter α
g : Filter (α → β)
h : Filter (β → γ)
s : Set (α → γ)
hs : s ∈ seq (map (fun x x_1 => x ∘ x_1) h) g
t : Set α
ht : t ∈ x
⊢ Set.seq s t ∈ seq h (seq g x)

Next tactic:
rcases mem_seq_iff.1 hs with ⟨u, hu, v, hv, hs⟩
@[simp]
theorem seq_assoc (x : Filter α) (g : Filter (α → β)) (h : Filter (β → γ)) :
    seq h (seq g x) = seq (seq (map (· ∘ ·) h) g) x := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_seq_iff.1 hs with ⟨u, hu, v, hv, hs⟩
    

Proof state:
case refine'_1.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
x : Filter α
g : Filter (α → β)
h : Filter (β → γ)
s : Set (α → γ)
hs✝ : s ∈ seq (map (fun x x_1 => x ∘ x_1) h) g
t : Set α
ht : t ∈ x
u : Set ((α → β) → α → γ)
hu : u ∈ map (fun x x_1 => x ∘ x_1) h
v : Set (α → β)
hv : v ∈ g
hs : Set.seq u v ⊆ s
⊢ Set.seq s t ∈ seq h (seq g x)

Next tactic:
rcases mem_map_iff_exists_image.1 hu with ⟨w, hw, hu⟩
@[simp]
theorem seq_assoc (x : Filter α) (g : Filter (α → β)) (h : Filter (β → γ)) :
    seq h (seq g x) = seq (seq (map (· ∘ ·) h) g) x := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_seq_iff.1 hs with ⟨u, hu, v, hv, hs⟩
    rcases mem_map_iff_exists_image.1 hu with ⟨w, hw, hu⟩
    

Proof state:
case refine'_1.intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
x : Filter α
g : Filter (α → β)
h : Filter (β → γ)
s : Set (α → γ)
hs✝ : s ∈ seq (map (fun x x_1 => x ∘ x_1) h) g
t : Set α
ht : t ∈ x
u : Set ((α → β) → α → γ)
hu✝ : u ∈ map (fun x x_1 => x ∘ x_1) h
v : Set (α → β)
hv : v ∈ g
hs : Set.seq u v ⊆ s
w : Set (β → γ)
hw : w ∈ h
hu : (fun x x_1 => x ∘ x_1) '' w ⊆ u
⊢ Set.seq s t ∈ seq h (seq g x)

Next tactic:
refine' mem_of_superset _ (Set.seq_mono ((Set.seq_mono hu Subset.rfl).trans hs) Subset.rfl)
@[simp]
theorem seq_assoc (x : Filter α) (g : Filter (α → β)) (h : Filter (β → γ)) :
    seq h (seq g x) = seq (seq (map (· ∘ ·) h) g) x := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_seq_iff.1 hs with ⟨u, hu, v, hv, hs⟩
    rcases mem_map_iff_exists_image.1 hu with ⟨w, hw, hu⟩
    refine' mem_of_superset _ (Set.seq_mono ((Set.seq_mono hu Subset.rfl).trans hs) Subset.rfl)
    

Proof state:
case refine'_1.intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
x : Filter α
g : Filter (α → β)
h : Filter (β → γ)
s : Set (α → γ)
hs✝ : s ∈ seq (map (fun x x_1 => x ∘ x_1) h) g
t : Set α
ht : t ∈ x
u : Set ((α → β) → α → γ)
hu✝ : u ∈ map (fun x x_1 => x ∘ x_1) h
v : Set (α → β)
hv : v ∈ g
hs : Set.seq u v ⊆ s
w : Set (β → γ)
hw : w ∈ h
hu : (fun x x_1 => x ∘ x_1) '' w ⊆ u
⊢ Set.seq (Set.seq ((fun x x_1 => x ∘ x_1) '' w) v) t ∈ seq h (seq g x)

Next tactic:
rw [← Set.seq_seq]
@[simp]
theorem seq_assoc (x : Filter α) (g : Filter (α → β)) (h : Filter (β → γ)) :
    seq h (seq g x) = seq (seq (map (· ∘ ·) h) g) x := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_seq_iff.1 hs with ⟨u, hu, v, hv, hs⟩
    rcases mem_map_iff_exists_image.1 hu with ⟨w, hw, hu⟩
    refine' mem_of_superset _ (Set.seq_mono ((Set.seq_mono hu Subset.rfl).trans hs) Subset.rfl)
    rw [← Set.seq_seq]
    

Proof state:
case refine'_1.intro.intro.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
x : Filter α
g : Filter (α → β)
h : Filter (β → γ)
s : Set (α → γ)
hs✝ : s ∈ seq (map (fun x x_1 => x ∘ x_1) h) g
t : Set α
ht : t ∈ x
u : Set ((α → β) → α → γ)
hu✝ : u ∈ map (fun x x_1 => x ∘ x_1) h
v : Set (α → β)
hv : v ∈ g
hs : Set.seq u v ⊆ s
w : Set (β → γ)
hw : w ∈ h
hu : (fun x x_1 => x ∘ x_1) '' w ⊆ u
⊢ Set.seq w (Set.seq v t) ∈ seq h (seq g x)

Next tactic:
exact seq_mem_seq hw (seq_mem_seq hv ht)
@[simp]
theorem seq_assoc (x : Filter α) (g : Filter (α → β)) (h : Filter (β → γ)) :
    seq h (seq g x) = seq (seq (map (· ∘ ·) h) g) x := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_seq_iff.1 hs with ⟨u, hu, v, hv, hs⟩
    rcases mem_map_iff_exists_image.1 hu with ⟨w, hw, hu⟩
    refine' mem_of_superset _ (Set.seq_mono ((Set.seq_mono hu Subset.rfl).trans hs) Subset.rfl)
    rw [← Set.seq_seq]
    exact seq_mem_seq hw (seq_mem_seq hv ht)
  · 

Proof state:
case refine'_2
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
x : Filter α
g : Filter (α → β)
h : Filter (β → γ)
s : Set (β → γ)
hs : s ∈ h
t : Set β
ht : t ∈ seq g x
⊢ Set.seq s t ∈ seq (seq (map (fun x x_1 => x ∘ x_1) h) g) x

Next tactic:
rcases mem_seq_iff.1 ht with ⟨u, hu, v, hv, ht⟩
@[simp]
theorem seq_assoc (x : Filter α) (g : Filter (α → β)) (h : Filter (β → γ)) :
    seq h (seq g x) = seq (seq (map (· ∘ ·) h) g) x := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_seq_iff.1 hs with ⟨u, hu, v, hv, hs⟩
    rcases mem_map_iff_exists_image.1 hu with ⟨w, hw, hu⟩
    refine' mem_of_superset _ (Set.seq_mono ((Set.seq_mono hu Subset.rfl).trans hs) Subset.rfl)
    rw [← Set.seq_seq]
    exact seq_mem_seq hw (seq_mem_seq hv ht)
  · rcases mem_seq_iff.1 ht with ⟨u, hu, v, hv, ht⟩
    

Proof state:
case refine'_2.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
x : Filter α
g : Filter (α → β)
h : Filter (β → γ)
s : Set (β → γ)
hs : s ∈ h
t : Set β
ht✝ : t ∈ seq g x
u : Set (α → β)
hu : u ∈ g
v : Set α
hv : v ∈ x
ht : Set.seq u v ⊆ t
⊢ Set.seq s t ∈ seq (seq (map (fun x x_1 => x ∘ x_1) h) g) x

Next tactic:
refine' mem_of_superset _ (Set.seq_mono Subset.rfl ht)
@[simp]
theorem seq_assoc (x : Filter α) (g : Filter (α → β)) (h : Filter (β → γ)) :
    seq h (seq g x) = seq (seq (map (· ∘ ·) h) g) x := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_seq_iff.1 hs with ⟨u, hu, v, hv, hs⟩
    rcases mem_map_iff_exists_image.1 hu with ⟨w, hw, hu⟩
    refine' mem_of_superset _ (Set.seq_mono ((Set.seq_mono hu Subset.rfl).trans hs) Subset.rfl)
    rw [← Set.seq_seq]
    exact seq_mem_seq hw (seq_mem_seq hv ht)
  · rcases mem_seq_iff.1 ht with ⟨u, hu, v, hv, ht⟩
    refine' mem_of_superset _ (Set.seq_mono Subset.rfl ht)
    

Proof state:
case refine'_2.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
x : Filter α
g : Filter (α → β)
h : Filter (β → γ)
s : Set (β → γ)
hs : s ∈ h
t : Set β
ht✝ : t ∈ seq g x
u : Set (α → β)
hu : u ∈ g
v : Set α
hv : v ∈ x
ht : Set.seq u v ⊆ t
⊢ Set.seq s (Set.seq u v) ∈ seq (seq (map (fun x x_1 => x ∘ x_1) h) g) x

Next tactic:
rw [Set.seq_seq]
@[simp]
theorem seq_assoc (x : Filter α) (g : Filter (α → β)) (h : Filter (β → γ)) :
    seq h (seq g x) = seq (seq (map (· ∘ ·) h) g) x := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_seq_iff.1 hs with ⟨u, hu, v, hv, hs⟩
    rcases mem_map_iff_exists_image.1 hu with ⟨w, hw, hu⟩
    refine' mem_of_superset _ (Set.seq_mono ((Set.seq_mono hu Subset.rfl).trans hs) Subset.rfl)
    rw [← Set.seq_seq]
    exact seq_mem_seq hw (seq_mem_seq hv ht)
  · rcases mem_seq_iff.1 ht with ⟨u, hu, v, hv, ht⟩
    refine' mem_of_superset _ (Set.seq_mono Subset.rfl ht)
    rw [Set.seq_seq]
    

Proof state:
case refine'_2.intro.intro.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
x : Filter α
g : Filter (α → β)
h : Filter (β → γ)
s : Set (β → γ)
hs : s ∈ h
t : Set β
ht✝ : t ∈ seq g x
u : Set (α → β)
hu : u ∈ g
v : Set α
hv : v ∈ x
ht : Set.seq u v ⊆ t
⊢ Set.seq (Set.seq ((fun x x_1 => x ∘ x_1) '' s) u) v ∈ seq (seq (map (fun x x_1 => x ∘ x_1) h) g) x

Next tactic:
exact seq_mem_seq (seq_mem_seq (image_mem_map hs) hu) hv
theorem prod_map_seq_comm (f : Filter α) (g : Filter β) :
    (map Prod.mk f).seq g = seq (map (fun b a => (a, b)) g) f := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter α
g : Filter β
⊢ seq (map Prod.mk f) g = seq (map (fun b a => (a, b)) g) f

Next tactic:
refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
theorem prod_map_seq_comm (f : Filter α) (g : Filter β) :
    (map Prod.mk f).seq g = seq (map (fun b a => (a, b)) g) f := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · 

Proof state:
case refine'_1
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter α
g : Filter β
s : Set (α → α × β)
hs : s ∈ map (fun b a => (a, b)) g
t : Set α
ht : t ∈ f
⊢ Set.seq s t ∈ seq (map Prod.mk f) g

Next tactic:
rcases mem_map_iff_exists_image.1 hs with ⟨u, hu, hs⟩
theorem prod_map_seq_comm (f : Filter α) (g : Filter β) :
    (map Prod.mk f).seq g = seq (map (fun b a => (a, b)) g) f := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_map_iff_exists_image.1 hs with ⟨u, hu, hs⟩
    

Proof state:
case refine'_1.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter α
g : Filter β
s : Set (α → α × β)
hs✝ : s ∈ map (fun b a => (a, b)) g
t : Set α
ht : t ∈ f
u : Set β
hu : u ∈ g
hs : (fun b a => (a, b)) '' u ⊆ s
⊢ Set.seq s t ∈ seq (map Prod.mk f) g

Next tactic:
refine' mem_of_superset _ (Set.seq_mono hs Subset.rfl)
theorem prod_map_seq_comm (f : Filter α) (g : Filter β) :
    (map Prod.mk f).seq g = seq (map (fun b a => (a, b)) g) f := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_map_iff_exists_image.1 hs with ⟨u, hu, hs⟩
    refine' mem_of_superset _ (Set.seq_mono hs Subset.rfl)
    

Proof state:
case refine'_1.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter α
g : Filter β
s : Set (α → α × β)
hs✝ : s ∈ map (fun b a => (a, b)) g
t : Set α
ht : t ∈ f
u : Set β
hu : u ∈ g
hs : (fun b a => (a, b)) '' u ⊆ s
⊢ Set.seq ((fun b a => (a, b)) '' u) t ∈ seq (map Prod.mk f) g

Next tactic:
rw [← Set.prod_image_seq_comm]
theorem prod_map_seq_comm (f : Filter α) (g : Filter β) :
    (map Prod.mk f).seq g = seq (map (fun b a => (a, b)) g) f := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_map_iff_exists_image.1 hs with ⟨u, hu, hs⟩
    refine' mem_of_superset _ (Set.seq_mono hs Subset.rfl)
    rw [← Set.prod_image_seq_comm]
    

Proof state:
case refine'_1.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter α
g : Filter β
s : Set (α → α × β)
hs✝ : s ∈ map (fun b a => (a, b)) g
t : Set α
ht : t ∈ f
u : Set β
hu : u ∈ g
hs : (fun b a => (a, b)) '' u ⊆ s
⊢ Set.seq (Prod.mk '' t) u ∈ seq (map Prod.mk f) g

Next tactic:
exact seq_mem_seq (image_mem_map ht) hu
theorem prod_map_seq_comm (f : Filter α) (g : Filter β) :
    (map Prod.mk f).seq g = seq (map (fun b a => (a, b)) g) f := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_map_iff_exists_image.1 hs with ⟨u, hu, hs⟩
    refine' mem_of_superset _ (Set.seq_mono hs Subset.rfl)
    rw [← Set.prod_image_seq_comm]
    exact seq_mem_seq (image_mem_map ht) hu
  · 

Proof state:
case refine'_2
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter α
g : Filter β
s : Set (β → α × β)
hs : s ∈ map Prod.mk f
t : Set β
ht : t ∈ g
⊢ Set.seq s t ∈ seq (map (fun b a => (a, b)) g) f

Next tactic:
rcases mem_map_iff_exists_image.1 hs with ⟨u, hu, hs⟩
theorem prod_map_seq_comm (f : Filter α) (g : Filter β) :
    (map Prod.mk f).seq g = seq (map (fun b a => (a, b)) g) f := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_map_iff_exists_image.1 hs with ⟨u, hu, hs⟩
    refine' mem_of_superset _ (Set.seq_mono hs Subset.rfl)
    rw [← Set.prod_image_seq_comm]
    exact seq_mem_seq (image_mem_map ht) hu
  · rcases mem_map_iff_exists_image.1 hs with ⟨u, hu, hs⟩
    

Proof state:
case refine'_2.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter α
g : Filter β
s : Set (β → α × β)
hs✝ : s ∈ map Prod.mk f
t : Set β
ht : t ∈ g
u : Set α
hu : u ∈ f
hs : Prod.mk '' u ⊆ s
⊢ Set.seq s t ∈ seq (map (fun b a => (a, b)) g) f

Next tactic:
refine' mem_of_superset _ (Set.seq_mono hs Subset.rfl)
theorem prod_map_seq_comm (f : Filter α) (g : Filter β) :
    (map Prod.mk f).seq g = seq (map (fun b a => (a, b)) g) f := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_map_iff_exists_image.1 hs with ⟨u, hu, hs⟩
    refine' mem_of_superset _ (Set.seq_mono hs Subset.rfl)
    rw [← Set.prod_image_seq_comm]
    exact seq_mem_seq (image_mem_map ht) hu
  · rcases mem_map_iff_exists_image.1 hs with ⟨u, hu, hs⟩
    refine' mem_of_superset _ (Set.seq_mono hs Subset.rfl)
    

Proof state:
case refine'_2.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter α
g : Filter β
s : Set (β → α × β)
hs✝ : s ∈ map Prod.mk f
t : Set β
ht : t ∈ g
u : Set α
hu : u ∈ f
hs : Prod.mk '' u ⊆ s
⊢ Set.seq (Prod.mk '' u) t ∈ seq (map (fun b a => (a, b)) g) f

Next tactic:
rw [Set.prod_image_seq_comm]
theorem prod_map_seq_comm (f : Filter α) (g : Filter β) :
    (map Prod.mk f).seq g = seq (map (fun b a => (a, b)) g) f := by
  refine' le_antisymm (le_seq fun s hs t ht => _) (le_seq fun s hs t ht => _)
  · rcases mem_map_iff_exists_image.1 hs with ⟨u, hu, hs⟩
    refine' mem_of_superset _ (Set.seq_mono hs Subset.rfl)
    rw [← Set.prod_image_seq_comm]
    exact seq_mem_seq (image_mem_map ht) hu
  · rcases mem_map_iff_exists_image.1 hs with ⟨u, hu, hs⟩
    refine' mem_of_superset _ (Set.seq_mono hs Subset.rfl)
    rw [Set.prod_image_seq_comm]
    

Proof state:
case refine'_2.intro.intro
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f : Filter α
g : Filter β
s : Set (β → α × β)
hs✝ : s ∈ map Prod.mk f
t : Set β
ht : t ∈ g
u : Set α
hu : u ∈ f
hs : Prod.mk '' u ⊆ s
⊢ Set.seq ((fun b a => (a, b)) '' t) u ∈ seq (map (fun b a => (a, b)) g) f

Next tactic:
exact seq_mem_seq (image_mem_map ht) hu
@[mono]
theorem bind_mono {f₁ f₂ : Filter α} {g₁ g₂ : α → Filter β} (hf : f₁ ≤ f₂) (hg : g₁ ≤ᶠ[f₁] g₂) :
    bind f₁ g₁ ≤ bind f₂ g₂ := by
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f₁ f₂ : Filter α
g₁ g₂ : α → Filter β
hf : f₁ ≤ f₂
hg : g₁ ≤ᶠ[f₁] g₂
⊢ bind f₁ g₁ ≤ bind f₂ g₂

Next tactic:
refine' le_trans (fun s hs => _) (join_mono <| map_mono hf)
@[mono]
theorem bind_mono {f₁ f₂ : Filter α} {g₁ g₂ : α → Filter β} (hf : f₁ ≤ f₂) (hg : g₁ ≤ᶠ[f₁] g₂) :
    bind f₁ g₁ ≤ bind f₂ g₂ := by
  refine' le_trans (fun s hs => _) (join_mono <| map_mono hf)
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f₁ f₂ : Filter α
g₁ g₂ : α → Filter β
hf : f₁ ≤ f₂
hg : g₁ ≤ᶠ[f₁] g₂
s : Set β
hs : s ∈ join (map g₂ f₁)
⊢ s ∈ bind f₁ g₁

Next tactic:
simp only [mem_join, mem_bind', mem_map] at hs ⊢
@[mono]
theorem bind_mono {f₁ f₂ : Filter α} {g₁ g₂ : α → Filter β} (hf : f₁ ≤ f₂) (hg : g₁ ≤ᶠ[f₁] g₂) :
    bind f₁ g₁ ≤ bind f₂ g₂ := by
  refine' le_trans (fun s hs => _) (join_mono <| map_mono hf)
  simp only [mem_join, mem_bind', mem_map] at hs ⊢
  

Proof state:
α : Type u
β : Type v
γ : Type w
δ : Type u_1
ι : Sort x
f₁ f₂ : Filter α
g₁ g₂ : α → Filter β
hf : f₁ ≤ f₂
hg : g₁ ≤ᶠ[f₁] g₂
s : Set β
hs : g₂ ⁻¹' {t | s ∈ t} ∈ f₁
⊢ {a | s ∈ g₁ a} ∈ f₁

Next tactic:
filter_upwards [hg, hs] with _ hx hs using hx hs