Skip to content

Commit 1b576ba

Browse files
feat(Order/Filter): Add lemmas about Filter.curry (#12435)
`Filter.curry` is a useful definition for reasoning about Fubini-type theorems, but there are almost no lemmas about it. This PR adds some in preparation for an upcomming PR on the Kuratowski-Ulam theorem.
1 parent 11731ee commit 1b576ba

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

Mathlib/Order/Filter/CountableInter.lean

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2020 Yury G. Kudryashov. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Yury G. Kudryashov
55
-/
6-
import Mathlib.Order.Filter.Basic
6+
import Mathlib.Order.Filter.Curry
77
import Mathlib.Data.Set.Countable
88

99
#align_import order.filter.countable_Inter from "leanprover-community/mathlib"@"b9e46fe101fc897fb2e7edaf0bf1f09ea49eb81a"
@@ -229,6 +229,13 @@ instance countableInterFilter_sup (l₁ l₂ : Filter α) [CountableInterFilter
229229
exacts [(hS s hs).1, (hS s hs).2]
230230
#align countable_Inter_filter_sup countableInterFilter_sup
231231

232+
instance CountableInterFilter.curry {α β : Type*} {l : Filter α} {m : Filter β}
233+
[CountableInterFilter l] [CountableInterFilter m] : CountableInterFilter (l.curry m) := ⟨by
234+
intro S Sct hS
235+
simp_rw [mem_curry_iff, mem_sInter, eventually_countable_ball (p := fun _ _ _ => (_ ,_) ∈ _) Sct,
236+
eventually_countable_ball (p := fun _ _ _ => ∀ᶠ (_ : β) in m, _) Sct, ← mem_curry_iff]
237+
exact hS⟩
238+
232239
namespace Filter
233240

234241
variable (g : Set (Set α))

Mathlib/Order/Filter/Curry.lean

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ theorem eventually_curry_iff {f : Filter α} {g : Filter β} {p : α × β → P
6464
Iff.rfl
6565
#align filter.eventually_curry_iff Filter.eventually_curry_iff
6666

67+
theorem frequently_curry_iff {α β : Type*} {l : Filter α} {m : Filter β}
68+
(p : (α × β) → Prop) : (∃ᶠ x in l.curry m, p x) ↔ ∃ᶠ x in l, ∃ᶠ y in m, p (x, y) := by
69+
simp_rw [Filter.Frequently, not_iff_not, not_not, eventually_curry_iff]
70+
71+
theorem mem_curry_iff {f : Filter α} {g : Filter β} {s : Set (α × β)} :
72+
s ∈ f.curry g ↔ ∀ᶠ x : α in f, ∀ᶠ y : β in g, (x, y) ∈ s := Iff.rfl
73+
6774
theorem curry_le_prod {f : Filter α} {g : Filter β} : f.curry g ≤ f.prod g :=
6875
fun _ => Eventually.curry
6976
#align filter.curry_le_prod Filter.curry_le_prod
@@ -73,4 +80,26 @@ theorem Tendsto.curry {f : α → β → γ} {la : Filter α} {lb : Filter β} {
7380
fun _s hs => h.mono fun _a ha => ha hs
7481
#align filter.tendsto.curry Filter.Tendsto.curry
7582

83+
theorem frequently_curry_prod_iff {α β : Type*} {l : Filter α} {m : Filter β}
84+
(s : Set α) (t : Set β) : (∃ᶠ x in l.curry m, x ∈ s ×ˢ t) ↔ sᶜ ∉ l ∧ tᶜ ∉ m := by
85+
refine ⟨fun h => ?_, fun ⟨hs, ht⟩ => ?_⟩
86+
· exact frequently_prod_and.mp (Frequently.filter_mono h curry_le_prod)
87+
rw [frequently_curry_iff]
88+
exact Frequently.mono hs $ fun x hx => Frequently.mono ht (by simp[hx])
89+
90+
theorem prod_mem_curry {α β : Type*} {l : Filter α} {m : Filter β} {s : Set α} {t : Set β}
91+
(hs : s ∈ l) (ht : t ∈ m) : s ×ˢ t ∈ l.curry m :=
92+
curry_le_prod $ prod_mem_prod hs ht
93+
94+
theorem eventually_curry_prod_iff {α β : Type*} {l : Filter α} {m : Filter β}
95+
[NeBot l] [NeBot m] (s : Set α) (t : Set β) :
96+
(∀ᶠ x in l.curry m, x ∈ s ×ˢ t) ↔ s ∈ l ∧ t ∈ m := by
97+
refine ⟨fun h => ⟨?_, ?_⟩, fun ⟨hs, ht⟩ => prod_mem_curry hs ht⟩ <;>
98+
rw [eventually_curry_iff] at h
99+
· apply mem_of_superset h
100+
simp
101+
rcases h.exists with ⟨_, hx⟩
102+
apply mem_of_superset hx
103+
exact fun _ hy => hy.2
104+
76105
end Filter

0 commit comments

Comments
 (0)