Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 8c36b32

Browse files
committed
feat(order/filter/basic): add eventually.curry (#2807)
I'm not sure that this is a good name. Suggestions of better names are welcome.
1 parent 597946d commit 8c36b32

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/order/filter/basic.lean

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,11 @@ begin
17931793
⟨prod.fst ⁻¹' t₁, ⟨t₁, ht₁, subset.refl _⟩, prod.snd ⁻¹' t₂, ⟨t₂, ht₂, subset.refl _⟩, h⟩
17941794
end
17951795

1796+
lemma eventually_prod_iff {p : α × β → Prop} {f : filter α} {g : filter β} :
1797+
(∀ᶠ x in f ×ᶠ g, p x) ↔ ∃ (pa : α → Prop) (ha : ∀ᶠ x in f, pa x)
1798+
(pb : β → Prop) (hb : ∀ᶠ y in g, pb y), ∀ {x}, pa x → ∀ {y}, pb y → p (x, y) :=
1799+
by simpa only [set.prod_subset_iff] using @mem_prod_iff α β p f g
1800+
17961801
lemma tendsto_fst {f : filter α} {g : filter β} : tendsto prod.fst (f ×ᶠ g) f :=
17971802
tendsto_inf_left tendsto_comap
17981803

@@ -1816,6 +1821,14 @@ lemma eventually.prod_mk {la : filter α} {pa : α → Prop} (ha : ∀ᶠ x in l
18161821
∀ᶠ p in la ×ᶠ lb, pa (p : α × β).1 ∧ pb p.2 :=
18171822
(ha.prod_inl lb).and (hb.prod_inr la)
18181823

1824+
lemma eventually.curry {la : filter α} {lb : filter β} {p : α × β → Prop}
1825+
(h : ∀ᶠ x in la.prod lb, p x) :
1826+
∀ᶠ x in la, ∀ᶠ y in lb, p (x, y) :=
1827+
begin
1828+
rcases eventually_prod_iff.1 h with ⟨pa, ha, pb, hb, h⟩,
1829+
exact ha.mono (λ a ha, hb.mono $ λ b hb, h ha hb)
1830+
end
1831+
18191832
lemma prod_infi_left {f : ι → filter α} {g : filter β} (i : ι) :
18201833
(⨅i, f i) ×ᶠ g = (⨅i, (f i) ×ᶠ g) :=
18211834
by rw [filter.prod, comap_infi, infi_inf i]; simp only [filter.prod, eq_self_iff_true]

src/topology/constructions.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ lemma filter.tendsto.prod_mk_nhds {γ} {a : α} {b : β} {f : filter γ} {ma :
174174
tendsto (λc, (ma c, mb c)) f (𝓝 (a, b)) :=
175175
by rw [nhds_prod_eq]; exact filter.tendsto.prod_mk ha hb
176176

177+
lemma filter.eventually.curry_nhds {p : α × β → Prop} {x : α} {y : β} (h : ∀ᶠ x in 𝓝 (x, y), p x) :
178+
∀ᶠ x' in 𝓝 x, ∀ᶠ y' in 𝓝 y, p (x', y') :=
179+
by { rw [nhds_prod_eq] at h, exact h.curry }
180+
177181
lemma continuous_at.prod {f : α → β} {g : α → γ} {x : α}
178182
(hf : continuous_at f x) (hg : continuous_at g x) : continuous_at (λx, (f x, g x)) x :=
179183
hf.prod_mk_nhds hg

0 commit comments

Comments
 (0)