Skip to content

Commit afa82c7

Browse files
committed
feat: Add Filter.frequently_exists and Filter.frequently_exists_finite (#31527)
These are dual to Filter.eventually_all and Filter.eventually_all_finite
1 parent 6490098 commit afa82c7

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

Mathlib/Order/Filter/Finite.lean

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ theorem iInf_principal_finite {ι : Type w} {s : Set ι} (hs : s.Finite) (f : ι
258258

259259
end Lattice
260260

261-
/-! ### Eventually -/
261+
/-! ### Eventually and Frequently -/
262262

263263
@[simp]
264264
theorem eventually_all {ι : Sort*} [Finite ι] {l} {p : ι → α → Prop} :
@@ -278,6 +278,26 @@ protected alias _root_.Set.Finite.eventually_all := eventually_all_finite
278278

279279
protected alias _root_.Finset.eventually_all := eventually_all_finset
280280

281+
@[simp]
282+
theorem frequently_exists {ι : Sort*} [Finite ι] {l} {p : ι → α → Prop} :
283+
(∃ᶠ x in l, ∃ i, p i x) ↔ ∃ i, ∃ᶠ x in l, p i x := by
284+
rw [← not_iff_not]
285+
simp
286+
287+
@[simp]
288+
theorem frequently_exists_finite {ι} {I : Set ι} (hI : I.Finite) {l} {p : ι → α → Prop} :
289+
(∃ᶠ x in l, ∃ i ∈ I, p i x) ↔ ∃ i ∈ I, ∃ᶠ x in l, p i x := by
290+
rw [← not_iff_not]
291+
simp [hI]
292+
293+
protected alias _root_.Set.Finite.frequently_exists := frequently_exists_finite
294+
295+
@[simp] theorem frequently_exists_finset {ι} (I : Finset ι) {l} {p : ι → α → Prop} :
296+
(∃ᶠ x in l, ∃ i ∈ I, p i x) ↔ ∃ i ∈ I, ∃ᶠ x in l, p i x :=
297+
I.finite_toSet.frequently_exists
298+
299+
protected alias _root_.Finset.frequently_exists := frequently_exists_finset
300+
281301
lemma eventually_subset_of_finite {ι : Type*} {f : Filter ι} {s : ι → Set α} {t : Set α}
282302
(ht : t.Finite) (hs : ∀ a ∈ t, ∀ᶠ i in f, a ∈ s i) : ∀ᶠ i in f, t ⊆ s i := by
283303
simpa [Set.subset_def, eventually_all_finite ht] using hs

0 commit comments

Comments
 (0)