Module docstring
{"# Definition of Filter.atTop and Filter.atBot filters
In this file we define the filters
Filter.atTop: corresponds ton → +∞;Filter.atBot: corresponds ton → -∞. "}
{"# Definition of Filter.atTop and Filter.atBot filters
In this file we define the filters
Filter.atTop: corresponds to n → +∞;Filter.atBot: corresponds to n → -∞.
"}Filter.atTop
definition
[Preorder α] : Filter α
/-- `atTop` is the filter representing the limit `→ ∞` on an ordered set.
It is generated by the collection of up-sets `{b | a ≤ b}`.
(The preorder need not have a top element for this to be well defined,
and indeed is trivial when a top element exists.) -/
def atTop [Preorder α] : Filter α :=
⨅ a, 𝓟 (Ici a)
Filter.atBot
definition
[Preorder α] : Filter α
/-- `atBot` is the filter representing the limit `→ -∞` on an ordered set.
It is generated by the collection of down-sets `{b | b ≤ a}`.
(The preorder need not have a bottom element for this to be well defined,
and indeed is trivial when a bottom element exists.) -/
def atBot [Preorder α] : Filter α :=
⨅ a, 𝓟 (Iic a)
Filter.mem_atTop
theorem
[Preorder α] (a : α) : {b : α | a ≤ b} ∈ @atTop α _
theorem mem_atTop [Preorder α] (a : α) : { b : α | a ≤ b }{ b : α | a ≤ b } ∈ @atTop α _ :=
mem_iInf_of_mem a <| Subset.refl _
Filter.Ici_mem_atTop
theorem
[Preorder α] (a : α) : Ici a ∈ (atTop : Filter α)
theorem Ici_mem_atTop [Preorder α] (a : α) : IciIci a ∈ (atTop : Filter α) :=
mem_atTop a
Filter.Ioi_mem_atTop
theorem
[Preorder α] [NoTopOrder α] (x : α) : Ioi x ∈ (atTop : Filter α)
theorem Ioi_mem_atTop [Preorder α] [NoTopOrder α] (x : α) : IoiIoi x ∈ (atTop : Filter α) :=
let ⟨z, hz⟩ := exists_not_le x
mem_of_superset (inter_mem (mem_atTop x) (mem_atTop z))
fun _ ⟨hxy, hzy⟩ => lt_of_le_not_le hxy fun hyx => hz (hzy.trans hyx)
Filter.mem_atBot
theorem
[Preorder α] (a : α) : {b : α | b ≤ a} ∈ @atBot α _
theorem mem_atBot [Preorder α] (a : α) : { b : α | b ≤ a }{ b : α | b ≤ a } ∈ @atBot α _ :=
mem_iInf_of_mem a <| Subset.refl _
Filter.Iic_mem_atBot
theorem
[Preorder α] (a : α) : Iic a ∈ (atBot : Filter α)
theorem Iic_mem_atBot [Preorder α] (a : α) : IicIic a ∈ (atBot : Filter α) :=
mem_atBot a
Filter.Iio_mem_atBot
theorem
[Preorder α] [NoBotOrder α] (x : α) : Iio x ∈ (atBot : Filter α)
theorem Iio_mem_atBot [Preorder α] [NoBotOrder α] (x : α) : IioIio x ∈ (atBot : Filter α) :=
let ⟨z, hz⟩ := exists_not_ge x
mem_of_superset (inter_mem (mem_atBot x) (mem_atBot z))
fun _ ⟨hyx, hyz⟩ => lt_of_le_not_le hyx fun hxy => hz (hxy.trans hyz)
Filter.eventually_ge_atTop
theorem
[Preorder α] (a : α) : ∀ᶠ x in atTop, a ≤ x
theorem eventually_ge_atTop [Preorder α] (a : α) : ∀ᶠ x in atTop, a ≤ x :=
mem_atTop a
Filter.eventually_le_atBot
theorem
[Preorder α] (a : α) : ∀ᶠ x in atBot, x ≤ a
theorem eventually_le_atBot [Preorder α] (a : α) : ∀ᶠ x in atBot, x ≤ a :=
mem_atBot a
Filter.eventually_gt_atTop
theorem
[Preorder α] [NoTopOrder α] (a : α) : ∀ᶠ x in atTop, a < x
theorem eventually_gt_atTop [Preorder α] [NoTopOrder α] (a : α) : ∀ᶠ x in atTop, a < x :=
Ioi_mem_atTop a
Filter.eventually_ne_atTop
theorem
[Preorder α] [NoTopOrder α] (a : α) : ∀ᶠ x in atTop, x ≠ a
theorem eventually_ne_atTop [Preorder α] [NoTopOrder α] (a : α) : ∀ᶠ x in atTop, x ≠ a :=
(eventually_gt_atTop a).mono fun _ => ne_of_gt
Filter.eventually_lt_atBot
theorem
[Preorder α] [NoBotOrder α] (a : α) : ∀ᶠ x in atBot, x < a
theorem eventually_lt_atBot [Preorder α] [NoBotOrder α] (a : α) : ∀ᶠ x in atBot, x < a :=
Iio_mem_atBot a
Filter.eventually_ne_atBot
theorem
[Preorder α] [NoBotOrder α] (a : α) : ∀ᶠ x in atBot, x ≠ a
theorem eventually_ne_atBot [Preorder α] [NoBotOrder α] (a : α) : ∀ᶠ x in atBot, x ≠ a :=
(eventually_lt_atBot a).mono fun _ => ne_of_lt
IsTop.atTop_eq
theorem
[Preorder α] {a : α} (ha : IsTop a) : atTop = 𝓟 (Ici a)
theorem _root_.IsTop.atTop_eq [Preorder α] {a : α} (ha : IsTop a) : atTop = 𝓟 (Ici a) :=
(iInf_le _ _).antisymm <| le_iInf fun b ↦ principal_mono.2 <| Ici_subset_Ici.2 <| ha b
IsBot.atBot_eq
theorem
[Preorder α] {a : α} (ha : IsBot a) : atBot = 𝓟 (Iic a)
Filter.atTop_eq_generate_Ici
theorem
[Preorder α] : atTop = generate (range (Ici (α := α)))
theorem atTop_eq_generate_Ici [Preorder α] : atTop = generate (range (Ici (α := α))) := by
simp only [generate_eq_biInf, atTop, iInf_range]
Filter.Frequently.forall_exists_of_atTop
theorem
[Preorder α] {p : α → Prop} (h : ∃ᶠ x in atTop, p x) (a : α) : ∃ b ≥ a, p b
theorem Frequently.forall_exists_of_atTop [Preorder α] {p : α → Prop}
(h : ∃ᶠ x in atTop, p x) (a : α) : ∃ b ≥ a, p b := by
rw [Filter.Frequently] at h
contrapose! h
exact (eventually_ge_atTop a).mono h
Filter.Frequently.forall_exists_of_atBot
theorem
[Preorder α] {p : α → Prop} (h : ∃ᶠ x in atBot, p x) (a : α) : ∃ b ≤ a, p b
theorem Frequently.forall_exists_of_atBot [Preorder α] {p : α → Prop}
(h : ∃ᶠ x in atBot, p x) (a : α) : ∃ b ≤ a, p b :=
Frequently.forall_exists_of_atTop (α := αᵒᵈ) h _
Filter.atTop_eq_generate_of_forall_exists_le
theorem
[Preorder α] {s : Set α} (hs : ∀ x, ∃ y ∈ s, x ≤ y) : (atTop : Filter α) = generate (Ici '' s)
lemma atTop_eq_generate_of_forall_exists_le [Preorder α] {s : Set α} (hs : ∀ x, ∃ y ∈ s, x ≤ y) :
(atTop : Filter α) = generate (IciIci '' s) := by
rw [atTop_eq_generate_Ici]
apply le_antisymm
· rw [le_generate_iff]
rintro - ⟨y, -, rfl⟩
exact mem_generate_of_mem ⟨y, rfl⟩
· rw [le_generate_iff]
rintro - ⟨x, -, -, rfl⟩
rcases hs x with ⟨y, ys, hy⟩
have A : IciIci y ∈ generate (Ici '' s) := mem_generate_of_mem (mem_image_of_mem _ ys)
have B : IciIci y ⊆ Ici x := Ici_subset_Ici.2 hy
exact sets_of_superset (generate (IciIci '' s)) A B
Filter.atTop_eq_generate_of_not_bddAbove
theorem
[LinearOrder α] {s : Set α} (hs : ¬BddAbove s) : (atTop : Filter α) = generate (Ici '' s)
lemma atTop_eq_generate_of_not_bddAbove [LinearOrder α] {s : Set α} (hs : ¬ BddAbove s) :
(atTop : Filter α) = generate (IciIci '' s) := by
refine atTop_eq_generate_of_forall_exists_le fun x ↦ ?_
obtain ⟨y, hy, hy'⟩ := not_bddAbove_iff.mp hs x
exact ⟨y, hy, hy'.le⟩
Monotone.piecewise_eventually_eq_iUnion
theorem
{β : α → Type*} [Preorder ι] {s : ι → Set α} [∀ i, DecidablePred (· ∈ s i)] [DecidablePred (· ∈ ⋃ i, s i)]
(hs : Monotone s) (f g : (a : α) → β a) (a : α) : ∀ᶠ i in atTop, (s i).piecewise f g a = (⋃ i, s i).piecewise f g a
theorem Monotone.piecewise_eventually_eq_iUnion {β : α → Type*} [Preorder ι] {s : ι → Set α}
[∀ i, DecidablePred (· ∈ s i)] [DecidablePred (· ∈ ⋃ i, s i)]
(hs : Monotone s) (f g : (a : α) → β a) (a : α) :
∀ᶠ i in atTop, (s i).piecewise f g a = (⋃ i, s i).piecewise f g a := by
rcases em (∃ i, a ∈ s i) with ⟨i, hi⟩ | ha
· refine (eventually_ge_atTop i).mono fun j hij ↦ ?_
simp only [Set.piecewise_eq_of_mem, hs hij hi, subset_iUnion _ _ hi]
· filter_upwards with i
simp only [Set.piecewise_eq_of_not_mem, not_exists.1 ha i, mt mem_iUnion.1 ha,
not_false_eq_true, exists_false]
Antitone.piecewise_eventually_eq_iInter
theorem
{β : α → Type*} [Preorder ι] {s : ι → Set α} [∀ i, DecidablePred (· ∈ s i)] [DecidablePred (· ∈ ⋂ i, s i)]
(hs : Antitone s) (f g : (a : α) → β a) (a : α) : ∀ᶠ i in atTop, (s i).piecewise f g a = (⋂ i, s i).piecewise f g a
theorem Antitone.piecewise_eventually_eq_iInter {β : α → Type*} [Preorder ι] {s : ι → Set α}
[∀ i, DecidablePred (· ∈ s i)] [DecidablePred (· ∈ ⋂ i, s i)]
(hs : Antitone s) (f g : (a : α) → β a) (a : α) :
∀ᶠ i in atTop, (s i).piecewise f g a = (⋂ i, s i).piecewise f g a := by
classical
convert ← (compl_anti.comp hs).piecewise_eventually_eq_iUnion g f a using 3
· convert congr_fun (Set.piecewise_compl (s _) g f) a
· simp only [(· ∘ ·), ← compl_iInter, Set.piecewise_compl]