Skip to content

Commit 216257f

Browse files
committed
chore(Analysis/Asymptotics): remove unnecessary hypothesis from isEquivalent_of_tendsto_one (leanprover-community#34389)
The condition `∀ᶠ x in l, v x = 0 → u x = 0` in `isEquivalent_of_tendsto_one` can be proven from the other assumption, `Tendsto (u / v) l (𝓝 1)`. This PR proves that and removes the former condition.
1 parent e81c1a4 commit 216257f

3 files changed

Lines changed: 22 additions & 23 deletions

File tree

Mathlib/Analysis/Asymptotics/AsymptoticEquivalent.lean

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,17 @@ theorem IsEquivalent.exists_eq_mul (huv : u ~[l] v) :
201201
∃ (φ : α → β) (_ : Tendsto φ l (𝓝 1)), u =ᶠ[l] φ * v :=
202202
isEquivalent_iff_exists_eq_mul.mp huv
203203

204-
theorem isEquivalent_of_tendsto_one (hz : ∀ᶠ x in l, v x = 0 → u x = 0)
205-
(huv : Tendsto (u / v) l (𝓝 1)) : u ~[l] v := by
206-
rw [isEquivalent_iff_exists_eq_mul]
207-
exact ⟨u / v, huv, hz.mono fun x hz' ↦ (div_mul_cancel_of_imp hz').symm⟩
208-
209-
theorem isEquivalent_of_tendsto_one' (hz : ∀ x, v x = 0 → u x = 0) (huv : Tendsto (u / v) l (𝓝 1)) :
210-
u ~[l] v :=
211-
isEquivalent_of_tendsto_one (Eventually.of_forall hz) huv
204+
theorem isEquivalent_of_tendsto_one (huv : Tendsto (u / v) l (𝓝 1)) :
205+
u ~[l] v := by
206+
suffices ∀ᶠ x in l, v x = 0 → u x = 0 by
207+
rw [isEquivalent_iff_exists_eq_mul]
208+
exact ⟨u / v, huv, this.mono fun x hz' ↦ (div_mul_cancel_of_imp hz').symm⟩
209+
by_contra! h
210+
replace h : ∃ᶠ t in l, (u / v) t = 0 := h.mono fun x ⟨hv, hu⟩ ↦ by simp [hv]
211+
simpa using tendsto_nhds_unique_of_frequently_eq (b := 0) huv tendsto_const_nhds h
212+
213+
@[deprecated (since := "2026-01-26")] alias isEquivalent_of_tendsto_one' :=
214+
isEquivalent_of_tendsto_one
212215

213216
theorem isEquivalent_iff_tendsto_one (hz : ∀ᶠ x in l, v x ≠ 0) :
214217
u ~[l] v ↔ Tendsto (u / v) l (𝓝 1) := by
@@ -221,7 +224,7 @@ theorem isEquivalent_iff_tendsto_one (hz : ∀ᶠ x in l, v x ≠ 0) :
221224
convert this.add key
222225
· simp
223226
· simp
224-
· exact isEquivalent_of_tendsto_one (hz.mono fun x hnvz hz ↦ (hnvz hz).elim)
227+
· exact isEquivalent_of_tendsto_one
225228

226229
end NormedField
227230

Mathlib/Analysis/Asymptotics/SpecificAsymptotics.lean

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,11 @@ variable {R : Type*} [NormedField R] [LinearOrder R] [IsStrictOrderedRing R]
181181
[OrderTopology R] [FloorRing R]
182182

183183
theorem Asymptotics.isEquivalent_nat_floor :
184-
(fun (x : R) ↦ ↑⌊x⌋₊) ~[atTop] (fun x ↦ x) := by
185-
refine isEquivalent_of_tendsto_one ?_ tendsto_nat_floor_div_atTop
186-
filter_upwards with x hx using by rw [hx, Nat.floor_zero, Nat.cast_eq_zero]
184+
(fun (x : R) ↦ ↑⌊x⌋₊) ~[atTop] (fun x ↦ x) :=
185+
isEquivalent_of_tendsto_one tendsto_nat_floor_div_atTop
187186

188187
theorem Asymptotics.isEquivalent_nat_ceil :
189-
(fun (x : R) ↦ ↑⌈x⌉₊) ~[atTop] (fun x ↦ x) := by
190-
refine isEquivalent_of_tendsto_one ?_ tendsto_nat_ceil_div_atTop
191-
filter_upwards with x hx using by rw [hx, Nat.ceil_zero, Nat.cast_eq_zero]
188+
(fun (x : R) ↦ ↑⌈x⌉₊) ~[atTop] (fun x ↦ x) :=
189+
isEquivalent_of_tendsto_one tendsto_nat_ceil_div_atTop
192190

193191
end NormedLinearOrderedField

Mathlib/Analysis/SpecialFunctions/Stirling.lean

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,12 @@ theorem tendsto_stirlingSeq_sqrt_pi : Tendsto stirlingSeq atTop (𝓝 (√π)) :
234234
/-- **Stirling's Formula**, formulated in terms of `Asymptotics.IsEquivalent`. -/
235235
lemma factorial_isEquivalent_stirling :
236236
(fun n ↦ n ! : ℕ → ℝ) ~[atTop] fun n ↦ Real.sqrt (2 * n * π) * (n / exp 1) ^ n := by
237-
refine Asymptotics.isEquivalent_of_tendsto_one ?_ ?_
238-
· filter_upwards [eventually_ne_atTop 0] with n hn h
239-
exact absurd h (by positivity)
240-
· have : sqrt π ≠ 0 := by positivity
241-
nth_rewrite 2 [← div_self this]
242-
convert tendsto_stirlingSeq_sqrt_pi.div tendsto_const_nhds this using 1
243-
ext n
244-
simp [field, stirlingSeq, mul_right_comm]
237+
apply Asymptotics.isEquivalent_of_tendsto_one
238+
have : sqrt π ≠ 0 := by positivity
239+
nth_rewrite 2 [← div_self this]
240+
convert tendsto_stirlingSeq_sqrt_pi.div tendsto_const_nhds this using 1
241+
ext n
242+
simp [field, stirlingSeq, mul_right_comm]
245243

246244
/-! ### Global bounds -/
247245

0 commit comments

Comments
 (0)