Skip to content

Commit 203cf53

Browse files
committed
refactor: generalize unbounded_of_tendsto_atTop (#23531)
1 parent 40300dd commit 203cf53

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

Mathlib/Order/Filter/AtTopBot/Basic.lean

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -445,33 +445,33 @@ theorem map_div_atTop_eq_nat (k : ℕ) (hk : 0 < k) : map (fun a => a / k) atTop
445445
(fun a b _ => by rw [Nat.div_le_iff_le_mul_add_pred hk])
446446
fun b _ => by rw [Nat.mul_add_div hk, Nat.div_eq_of_lt, Nat.add_zero]; omega
447447

448-
section IsDirected
449-
variable [Nonempty α] [Preorder α] [IsDirected α (· ≤ ·)] [Preorder β] {f : α → β}
448+
section NeBot
449+
variable [Preorder β] {l : Filter α} [NeBot l] {f : α → β}
450450

451-
theorem unbounded_of_tendsto_atTop [NoMaxOrder β] (h : Tendsto f atTop atTop) :
451+
theorem not_bddAbove_of_tendsto_atTop [NoMaxOrder β] (h : Tendsto f l atTop) :
452452
¬BddAbove (range f) := by
453453
rintro ⟨M, hM⟩
454-
obtain ⟨a, ha⟩ := mem_atTop_sets.mp (h <| Ioi_mem_atTop M)
455-
apply lt_irrefl M
456-
calc
457-
M < f a := ha a le_rfl
458-
_ ≤ M := hM (Set.mem_range_self a)
454+
have : ∀ x, f x ≤ M := by aesop
455+
have : ∅ = f ⁻¹' Ioi M := by aesop (add forward safe not_le_of_lt)
456+
apply Filter.empty_not_mem l
457+
aesop (add safe Ioi_mem_atTop)
459458

460-
theorem unbounded_of_tendsto_atBot [NoMinOrder β] (h : Tendsto f atTop atBot) :
461-
¬BddBelow (range f) := unbounded_of_tendsto_atTop (β := βᵒᵈ) h
459+
theorem not_bddBelow_of_tendsto_atBot [NoMinOrder β] (h : Tendsto f l atBot) :
460+
¬BddBelow (range f) := not_bddAbove_of_tendsto_atTop (β := βᵒᵈ) h
462461

463-
end IsDirected
462+
@[deprecated (since := "2025-04-28")]
463+
alias unbounded_of_tendsto_atTop := not_bddAbove_of_tendsto_atTop
464464

465-
section IsCodirected
466-
variable [Nonempty α] [Preorder α] [IsDirected α (· ≥ ·)] [Preorder β] {f : α → β}
465+
@[deprecated (since := "2025-04-28")]
466+
alias unbounded_of_tendsto_atBot := not_bddBelow_of_tendsto_atBot
467467

468-
theorem unbounded_of_tendsto_atTop' [NoMaxOrder β] (h : Tendsto f atBot atTop) :
469-
¬BddAbove (range f) := unbounded_of_tendsto_atTop:= αᵒᵈ) h
468+
@[deprecated (since := "2025-04-28")]
469+
alias unbounded_of_tendsto_atTop' := not_bddAbove_of_tendsto_atTop
470470

471-
theorem unbounded_of_tendsto_atBot' [NoMinOrder β] (h : Tendsto f atBot atBot) :
472-
¬BddBelow (range f) := unbounded_of_tendsto_atTop (α := αᵒᵈ) (β := βᵒᵈ) h
471+
@[deprecated (since := "2025-04-28")]
472+
alias unbounded_of_tendsto_atBot' := not_bddBelow_of_tendsto_atBot
473473

474-
end IsCodirected
474+
end NeBot
475475

476476
theorem HasAntitoneBasis.eventually_subset [Preorder ι] {l : Filter α} {s : ι → Set α}
477477
(hl : l.HasAntitoneBasis s) {t : Set α} (ht : t ∈ l) : ∀ᶠ i in atTop, s i ⊆ t :=

Mathlib/Probability/Martingale/BorelCantelli.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,13 @@ theorem Martingale.ae_not_tendsto_atTop_atTop [IsFiniteMeasure μ] (hf : Marting
249249
(hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) :
250250
∀ᵐ ω ∂μ, ¬Tendsto (fun n => f n ω) atTop atTop := by
251251
filter_upwards [hf.bddAbove_range_iff_bddBelow_range hbdd] with ω hω htop using
252-
unbounded_of_tendsto_atTop htop (hω.2 <| bddBelow_range_of_tendsto_atTop_atTop htop)
252+
not_bddAbove_of_tendsto_atTop htop (hω.2 <| bddBelow_range_of_tendsto_atTop_atTop htop)
253253

254254
theorem Martingale.ae_not_tendsto_atTop_atBot [IsFiniteMeasure μ] (hf : Martingale f ℱ μ)
255255
(hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) :
256256
∀ᵐ ω ∂μ, ¬Tendsto (fun n => f n ω) atTop atBot := by
257257
filter_upwards [hf.bddAbove_range_iff_bddBelow_range hbdd] with ω hω htop using
258-
unbounded_of_tendsto_atBot htop (hω.1 <| bddAbove_range_of_tendsto_atTop_atBot htop)
258+
not_bddBelow_of_tendsto_atBot htop (hω.1 <| bddAbove_range_of_tendsto_atTop_atBot htop)
259259

260260
namespace BorelCantelli
261261

0 commit comments

Comments
 (0)