Skip to content

Commit c3f00b0

Browse files
feat(Analysis/SpecificLimits/Basic): add lemmas about limits of fractions (#16768)
Used in #15373. Co-authored-by: Floris van Doorn <fpvdoorn@gmail.com>
1 parent d2c8bed commit c3f00b0

File tree

3 files changed

+93
-0
lines changed

3 files changed

+93
-0
lines changed

Mathlib/Analysis/SpecificLimits/Basic.lean

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,53 @@ theorem tendsto_natCast_div_add_atTop {𝕜 : Type*} [DivisionRing 𝕜] [Topolo
114114
intros
115115
simp_all only [comp_apply, map_inv₀, map_natCast]
116116

117+
/-- For any positive `m : ℕ`, `((n % m : ℕ) : ℝ) / (n : ℝ)` tends to `0` as `n` tends to `∞`. -/
118+
theorem tendsto_mod_div_atTop_nhds_zero_nat {m : ℕ} (hm : 0 < m) :
119+
Tendsto (fun n : ℕ => ((n % m : ℕ) : ℝ) / (n : ℝ)) atTop (𝓝 0) := by
120+
have h0 : ∀ᶠ n : ℕ in atTop, 0 ≤ (fun n : ℕ => ((n % m : ℕ) : ℝ)) n := by aesop
121+
exact tendsto_bdd_div_atTop_nhds_zero h0
122+
(.of_forall (fun n ↦ cast_le.mpr (mod_lt n hm).le)) tendsto_natCast_atTop_atTop
123+
124+
theorem Filter.EventuallyEq.div_mul_cancel {α G : Type*} [GroupWithZero G] {f g : α → G}
125+
{l : Filter α} (hg : Tendsto g l (𝓟 {0}ᶜ)) : (fun x ↦ f x / g x * g x) =ᶠ[l] fun x ↦ f x := by
126+
filter_upwards [hg.le_comap <| preimage_mem_comap (m := g) (mem_principal_self {0}ᶜ)] with x hx
127+
aesop
128+
129+
/-- If `g` tends to `∞`, then eventually for all `x` we have `(f x / g x) * g x = f x`. -/
130+
theorem Filter.EventuallyEq.div_mul_cancel_atTop {α K : Type*} [LinearOrderedSemifield K]
131+
{f g : α → K} {l : Filter α} (hg : Tendsto g l atTop) :
132+
(fun x ↦ f x / g x * g x) =ᶠ[l] fun x ↦ f x :=
133+
div_mul_cancel <| hg.mono_right <| le_principal_iff.mpr <|
134+
mem_of_superset (Ioi_mem_atTop 0) <| by aesop
135+
136+
/-- If when `x` tends to `∞`, `g` tends to `∞` and `f x / g x` tends to a positive
137+
constant, then `f` tends to `∞`. -/
138+
theorem Tendsto.num {α K : Type*} [LinearOrderedField K] [TopologicalSpace K] [OrderTopology K]
139+
{f g : α → K} {l : Filter α} (hg : Tendsto g l atTop) {a : K} (ha : 0 < a)
140+
(hlim : Tendsto (fun x => f x / g x) l (𝓝 a)) :
141+
Tendsto f l atTop :=
142+
Tendsto.congr' (EventuallyEq.div_mul_cancel_atTop hg) (Tendsto.mul_atTop ha hlim hg)
143+
144+
/-- If when `x` tends to `∞`, `g` tends to `∞` and `f x / g x` tends to a positive
145+
constant, then `f` tends to `∞`. -/
146+
theorem Tendsto.den {α K : Type*} [LinearOrderedField K] [TopologicalSpace K] [OrderTopology K]
147+
[ContinuousInv K] {f g : α → K} {l : Filter α} (hf : Tendsto f l atTop) {a : K} (ha : 0 < a)
148+
(hlim : Tendsto (fun x => f x / g x) l (𝓝 a)) :
149+
Tendsto g l atTop := by
150+
have hlim' : Tendsto (fun x => g x / f x) l (𝓝 a⁻¹) := by
151+
simp_rw [← inv_div (f _)]
152+
exact Filter.Tendsto.inv (f := fun x => f x / g x) hlim
153+
apply Tendsto.congr' (EventuallyEq.div_mul_cancel_atTop hf)
154+
(Tendsto.mul_atTop (inv_pos_of_pos ha) hlim' hf)
155+
156+
/-- If when `x` tends to `∞`, `f x / g x` tends to a positive constant, then `f` tends to `∞` if
157+
and only if `g` tends to `∞`. -/
158+
theorem Tendsto.num_atTop_iff_den_atTop {α K : Type*} [LinearOrderedField K] [TopologicalSpace K]
159+
[OrderTopology K] [ContinuousInv K] {f g : α → K} {l : Filter α} {a : K} (ha : 0 < a)
160+
(hlim : Tendsto (fun x => f x / g x) l (𝓝 a)) :
161+
Tendsto f l atTop ↔ Tendsto g l atTop :=
162+
fun hf ↦ Tendsto.den hf ha hlim, fun hg ↦ Tendsto.num hg ha hlim⟩
163+
117164
/-! ### Powers -/
118165

119166

Mathlib/Data/Set/Pointwise/Interval.lean

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,6 +670,18 @@ theorem preimage_div_const_uIcc (ha : a ≠ 0) (b c : α) :
670670
(fun x => x / a) ⁻¹' [[b, c]] = [[b * a, c * a]] := by
671671
simp only [div_eq_mul_inv, preimage_mul_const_uIcc (inv_ne_zero ha), inv_inv]
672672

673+
lemma preimage_const_mul_Ioi_or_Iio (hb : a ≠ 0) {U V : Set α}
674+
(hU : U ∈ {s | ∃ a, s = Ioi a ∨ s = Iio a}) (hV : V = HMul.hMul a ⁻¹' U) :
675+
V ∈ {s | ∃ a, s = Ioi a ∨ s = Iio a} := by
676+
obtain ⟨aU, (haU | haU)⟩ := hU <;>
677+
simp only [hV, haU, mem_setOf_eq] <;>
678+
use a⁻¹ * aU <;>
679+
rcases lt_or_gt_of_ne hb with (hb | hb)
680+
· right; rw [Set.preimage_const_mul_Ioi_of_neg _ hb, div_eq_inv_mul]
681+
· left; rw [Set.preimage_const_mul_Ioi _ hb, div_eq_inv_mul]
682+
· left; rw [Set.preimage_const_mul_Iio_of_neg _ hb, div_eq_inv_mul]
683+
· right; rw [Set.preimage_const_mul_Iio _ hb, div_eq_inv_mul]
684+
673685
@[simp]
674686
theorem image_mul_const_uIcc (a b c : α) : (· * a) '' [[b, c]] = [[b * a, c * a]] :=
675687
if ha : a = 0 then by simp [ha]

Mathlib/Topology/Algebra/Order/Field.lean

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,40 @@ theorem Filter.Tendsto.inv_tendsto_atTop (h : Tendsto f l atTop) : Tendsto f⁻
141141
theorem Filter.Tendsto.inv_tendsto_zero (h : Tendsto f l (𝓝[>] 0)) : Tendsto f⁻¹ l atTop :=
142142
tendsto_inv_zero_atTop.comp h
143143

144+
/-- If `g` tends to zero and there exists a constant `C : 𝕜` such that eventually `|f x| ≤ C`,
145+
then the product `f * g` tends to zero. -/
146+
theorem bdd_le_mul_tendsto_zero' {f g : α → 𝕜} (C : 𝕜) (hf : ∀ᶠ x in l, |f x| ≤ C)
147+
(hg : Tendsto g l (𝓝 0)) : Tendsto (fun x ↦ f x * g x) l (𝓝 0) := by
148+
rw [tendsto_zero_iff_abs_tendsto_zero]
149+
have hC : Tendsto (fun x ↦ |C * g x|) l (𝓝 0) := by
150+
convert (hg.const_mul C).abs
151+
simp_rw [mul_zero, abs_zero]
152+
apply tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds hC
153+
· filter_upwards [hf] with x _ using abs_nonneg _
154+
· filter_upwards [hf] with x hx
155+
simp only [comp_apply, abs_mul]
156+
exact mul_le_mul_of_nonneg_right (hx.trans (le_abs_self C)) (abs_nonneg _)
157+
158+
/-- If `g` tends to zero and there exist constants `b B : 𝕜` such that eventually `b ≤ f x| ≤ B`,
159+
then the product `f * g` tends to zero. -/
160+
theorem bdd_le_mul_tendsto_zero {f g : α → 𝕜} {b B : 𝕜} (hb : ∀ᶠ x in l, b ≤ f x)
161+
(hB : ∀ᶠ x in l, f x ≤ B) (hg : Tendsto g l (𝓝 0)) :
162+
Tendsto (fun x ↦ f x * g x) l (𝓝 0) := by
163+
set C := max |b| |B|
164+
have hbC : -C ≤ b := neg_le.mpr (le_max_of_le_left (neg_le_abs b))
165+
have hBC : B ≤ C := le_max_of_le_right (le_abs_self B)
166+
apply bdd_le_mul_tendsto_zero' C _ hg
167+
filter_upwards [hb, hB]
168+
exact fun x hbx hBx ↦ abs_le.mpr ⟨hbC.trans hbx, hBx.trans hBC⟩
169+
170+
/-- If `g` tends to `atTop` and there exist constants `b B : 𝕜` such that eventually
171+
`b ≤ f x| ≤ B`, then the quotient `f / g` tends to zero. -/
172+
theorem tendsto_bdd_div_atTop_nhds_zero {f g : α → 𝕜} {b B : 𝕜}
173+
(hb : ∀ᶠ x in l, b ≤ f x) (hB : ∀ᶠ x in l, f x ≤ B) (hg : Tendsto g l atTop) :
174+
Tendsto (fun x => f x / g x) l (𝓝 0) := by
175+
simp only [div_eq_mul_inv]
176+
exact bdd_le_mul_tendsto_zero hb hB hg.inv_tendsto_atTop
177+
144178
/-- The function `x^(-n)` tends to `0` at `+∞` for any positive natural `n`.
145179
A version for positive real powers exists as `tendsto_rpow_neg_atTop`. -/
146180
theorem tendsto_pow_neg_atTop {n : ℕ} (hn : n ≠ 0) :

0 commit comments

Comments
 (0)