Theorem: Real.BohrMollerup.tendsto_logGammaSeq_of_le_one
File: Mathlib/Analysis/SpecialFunctions/Gamma/BohrMollerup.lean

tactic: refine tendsto_of_tendsto_of_tendsto_of_le_of_le' (f := logGammaSeq x)
  (g := fun n ↦ f x - f 1 - x * (log (n + 1) - log n)) ?_ tendsto_const_nhds ?_ ?_
state_before: f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ Tendsto (logGammaSeq x) atTop (𝓝 (f x - f 1))
state_after: case refine_1
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ Tendsto (fun n => f x - f 1 - x * (log (↑n + 1) - log ↑n)) atTop (𝓝 (f x - f 1))

case refine_2
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ∀ᶠ (b : ℕ) in atTop, (fun n => f x - f 1 - x * (log (↑n + 1) - log ↑n)) b ≤ logGammaSeq x b

case refine_3
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ∀ᶠ (b : ℕ) in atTop, logGammaSeq x b ≤ f x - f 1

tactic: have : f x - f 1 = f x - f 1 - x * 0 := by ring
state_before: case refine_1
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ Tendsto (fun n => f x - f 1 - x * (log (↑n + 1) - log ↑n)) atTop (𝓝 (f x - f 1))
state_after: case refine_1
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
this : f x - f 1 = f x - f 1 - x * 0
⊢ Tendsto (fun n => f x - f 1 - x * (log (↑n + 1) - log ↑n)) atTop (𝓝 (f x - f 1))

tactic: nth_rw 2 [this]
state_before: case refine_1
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
this : f x - f 1 = f x - f 1 - x * 0
⊢ Tendsto (fun n => f x - f 1 - x * (log (↑n + 1) - log ↑n)) atTop (𝓝 (f x - f 1))
state_after: case refine_1
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
this : f x - f 1 = f x - f 1 - x * 0
⊢ Tendsto (fun n => f x - f 1 - x * (log (↑n + 1) - log ↑n)) atTop (𝓝 (f x - f 1 - x * 0))

tactic: exact Tendsto.sub tendsto_const_nhds (tendsto_log_nat_add_one_sub_log.const_mul _)
state_before: case refine_1
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
this : f x - f 1 = f x - f 1 - x * 0
⊢ Tendsto (fun n => f x - f 1 - x * (log (↑n + 1) - log ↑n)) atTop (𝓝 (f x - f 1 - x * 0))
state_after: no goals

tactic: ring
state_before: f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ f x - f 1 = f x - f 1 - x * 0
state_after: no goals

tactic: filter_upwards with n
state_before: case refine_2
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ∀ᶠ (b : ℕ) in atTop, (fun n => f x - f 1 - x * (log (↑n + 1) - log ↑n)) b ≤ logGammaSeq x b
state_after: case refine_2.h
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
⊢ f x - f 1 - x * (log (↑n + 1) - log ↑n) ≤ logGammaSeq x n

tactic: rw [sub_le_iff_le_add', sub_le_iff_le_add']
state_before: case refine_2.h
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
⊢ f x - f 1 - x * (log (↑n + 1) - log ↑n) ≤ logGammaSeq x n
state_after: case refine_2.h
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
⊢ f x ≤ f 1 + (x * (log (↑n + 1) - log ↑n) + logGammaSeq x n)

tactic: convert le_logGammaSeq hf_conv (@hf_feq) hx hx' n using 1
state_before: case refine_2.h
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
⊢ f x ≤ f 1 + (x * (log (↑n + 1) - log ↑n) + logGammaSeq x n)
state_after: case h.e'_4
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
⊢ f 1 + (x * (log (↑n + 1) - log ↑n) + logGammaSeq x n) = f 1 + x * log (↑n + 1) - x * log ↑n + logGammaSeq x n

tactic: ring
state_before: case h.e'_4
f : ℝ → ℝ
x : ℝ
n✝ : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
n : ℕ
⊢ f 1 + (x * (log (↑n + 1) - log ↑n) + logGammaSeq x n) = f 1 + x * log (↑n + 1) - x * log ↑n + logGammaSeq x n
state_after: no goals

tactic: show ∀ᶠ n : ℕ in atTop, logGammaSeq x n ≤ f x - f 1
state_before: case refine_3
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ∀ᶠ (b : ℕ) in atTop, logGammaSeq x b ≤ f x - f 1
state_after: case refine_3
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ∀ᶠ (n : ℕ) in atTop, logGammaSeq x n ≤ f x - f 1

tactic: filter_upwards [eventually_ne_atTop 0] with n hn using
  le_sub_iff_add_le'.mpr (ge_logGammaSeq hf_conv hf_feq hx hn)
state_before: case refine_3
f : ℝ → ℝ
x : ℝ
n : ℕ
hf_conv : ConvexOn ℝ (Ioi 0) f
hf_feq : ∀ {y : ℝ}, 0 < y → f (y + 1) = f y + log y
hx : 0 < x
hx' : x ≤ 1
⊢ ∀ᶠ (n : ℕ) in atTop, logGammaSeq x n ≤ f x - f 1
state_after: no goals