Skip to content

Commit a5ff9c0

Browse files
committed
feat(Mathlib/Analysis/SpecialFunctions/Log/Base): More log asymptotics (leanprover-community#33389)
A common utility in proving asymptotics is `logb b =O[⊤] log` and `(log ∘ (c * ·)) =O[atTop] log` and related lemmas `logb`. This PR fills these in for future use. [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/from-referrer/) Co-authored-by: Kevin H Wilson <khwilson@gmail.com>
1 parent c669683 commit a5ff9c0

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

  • Mathlib/Analysis/SpecialFunctions/Log

Mathlib/Analysis/SpecialFunctions/Log/Base.lean

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ theorem logb_abs_base (b x : ℝ) : logb |b| x = logb b x := by rw [logb, logb,
7474
theorem logb_abs (b x : ℝ) : logb b |x| = logb b x := by rw [logb, logb, log_abs]
7575

7676
@[simp]
77-
theorem logb_neg_base_eq_logb (b x : ℝ) : logb (-b) x = logb b x := by
78-
rw [← logb_abs_base b x, ← logb_abs_base (-b) x, abs_neg]
77+
theorem logb_neg_base_eq_logb (b : ℝ) : logb (-b) = logb b := by
78+
ext x; rw [← logb_abs_base b x, ← logb_abs_base (-b) x, abs_neg]
7979

8080
@[simp]
8181
theorem logb_neg_eq_logb (b x : ℝ) : logb b (-x) = logb b x := by
@@ -523,6 +523,32 @@ theorem isLittleO_const_logb_atTop {c : ℝ} (hb : b ≠ -1 ∧ b ≠ 0 ∧ b
523523
intro hc
524524
exact tendsto_abs_logb_atTop hb
525525

526+
theorem isBigO_logb_log : logb b =O[⊤] log := by
527+
by_cases! h : b = -1 ∨ b = 0 ∨ b = 1
528+
· obtain rfl | rfl | rfl := h
529+
all_goals simpa [-Asymptotics.isBigO_top] using Asymptotics.isBigO_zero log ⊤
530+
· simpa [logb, div_eq_mul_inv, mul_comm]
531+
using (Asymptotics.isBigO_refl log ⊤).const_mul_left (log b)⁻¹
532+
533+
theorem isBigO_log_const_mul_log_atTop (c : ℝ) : (fun x ↦ log (c * x)) =O[atTop] log := by
534+
obtain rfl | hc := eq_or_ne c 0
535+
· simpa using isLittleO_const_log_atTop.isBigO
536+
· calc (fun x ↦ log (c * x))
537+
=ᶠ[atTop] (fun x => log c + log x) := by
538+
filter_upwards [eventually_gt_atTop 0] with a ha using log_mul hc ha.ne'
539+
_ =O[atTop] log :=
540+
isLittleO_const_log_atTop.isBigO.add (Asymptotics.isBigO_refl ..)
541+
542+
theorem isBigO_log_mul_const_log_atTop (c : ℝ) : (fun x ↦ log (x * c)) =O[atTop] log := by
543+
simpa [mul_comm] using isBigO_log_const_mul_log_atTop c
544+
545+
theorem isBigO_logb_const_mul_log_atTop (c : ℝ) : (fun x ↦ logb b (c * x)) =O[atTop] log := by
546+
simpa [logb, div_eq_mul_inv, mul_comm]
547+
using (isBigO_log_const_mul_log_atTop c).const_mul_left (log b)⁻¹
548+
549+
theorem isBigO_logb_mul_const_log_atTop (c : ℝ) : (fun x ↦ logb b (x * c)) =O[atTop] log := by
550+
simpa [mul_comm] using isBigO_logb_const_mul_log_atTop c
551+
526552
end Real
527553

528554
section Continuity

0 commit comments

Comments
 (0)