Theorem: AkraBazziRecurrence.growsPolynomially_deriv_rpow_p_mul_one_add_smoothingFn
File: Mathlib/Computability/AkraBazzi/AkraBazzi.lean

tactic: cases eq_or_ne p 0 with
| inl hp => have h₁ : (fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖)
      =ᶠ[atTop] fun z => z⁻¹ / (log z ^ 2) := by
    filter_upwards [eventually_deriv_one_add_smoothingFn, eventually_gt_atTop 1] with x hx hx_pos
    have : 0 ≤ x⁻¹ / (log x ^ 2) := by
      have hlog : 0 < log x := Real.log_pos hx_pos
      positivity
    simp only [neg_div, norm_neg, hp, Real.rpow_zero,
      one_mul, differentiableAt_const, hx, Real.norm_of_nonneg this]
  refine GrowsPolynomially.congr_of_eventuallyEq h₁ ?_
  refine GrowsPolynomially.div (GrowsPolynomially.inv growsPolynomially_id)
    (GrowsPolynomially.pow 2 growsPolynomially_log ?_)
  filter_upwards [eventually_ge_atTop 1] with x hx
  exact log_nonneg hx
| inr hp => refine GrowsPolynomially.of_isTheta (growsPolynomially_rpow (p-1))
    (isTheta_deriv_rpow_p_mul_one_add_smoothingFn hp) ?_
  filter_upwards [eventually_gt_atTop 0] with _ _
  positivity
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
⊢ GrowsPolynomially fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖
state_after: no goals

tactic: have h₁ : (fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖)
    =ᶠ[atTop] fun z => z⁻¹ / (log z ^ 2) := by
  filter_upwards [eventually_deriv_one_add_smoothingFn, eventually_gt_atTop 1] with x hx hx_pos
  have : 0 ≤ x⁻¹ / (log x ^ 2) := by
    have hlog : 0 < log x := Real.log_pos hx_pos
    positivity
  simp only [neg_div, norm_neg, hp, Real.rpow_zero,
    one_mul, differentiableAt_const, hx, Real.norm_of_nonneg this]
state_before: case inl
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
⊢ GrowsPolynomially fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖
state_after: case inl
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
h₁ : (fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖) =ᶠ[atTop] fun z => z⁻¹ / log z ^ 2
⊢ GrowsPolynomially fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖

tactic: refine GrowsPolynomially.congr_of_eventuallyEq h₁ ?_
state_before: case inl
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
h₁ : (fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖) =ᶠ[atTop] fun z => z⁻¹ / log z ^ 2
⊢ GrowsPolynomially fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖
state_after: case inl
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
h₁ : (fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖) =ᶠ[atTop] fun z => z⁻¹ / log z ^ 2
⊢ GrowsPolynomially fun z => z⁻¹ / log z ^ 2

tactic: refine GrowsPolynomially.div (GrowsPolynomially.inv growsPolynomially_id)
  (GrowsPolynomially.pow 2 growsPolynomially_log ?_)
state_before: case inl
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
h₁ : (fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖) =ᶠ[atTop] fun z => z⁻¹ / log z ^ 2
⊢ GrowsPolynomially fun z => z⁻¹ / log z ^ 2
state_after: case inl
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
h₁ : (fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖) =ᶠ[atTop] fun z => z⁻¹ / log z ^ 2
⊢ ∀ᶠ (x : ℝ) in atTop, 0 ≤ log x

tactic: filter_upwards [eventually_ge_atTop 1] with x hx
state_before: case inl
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
h₁ : (fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖) =ᶠ[atTop] fun z => z⁻¹ / log z ^ 2
⊢ ∀ᶠ (x : ℝ) in atTop, 0 ≤ log x
state_after: case h
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
h₁ : (fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖) =ᶠ[atTop] fun z => z⁻¹ / log z ^ 2
x : ℝ
hx : 1 ≤ x
⊢ 0 ≤ log x

tactic: exact log_nonneg hx
state_before: case h
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
h₁ : (fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖) =ᶠ[atTop] fun z => z⁻¹ / log z ^ 2
x : ℝ
hx : 1 ≤ x
⊢ 0 ≤ log x
state_after: no goals

tactic: filter_upwards [eventually_deriv_one_add_smoothingFn, eventually_gt_atTop 1] with x hx hx_pos
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
⊢ (fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖) =ᶠ[atTop] fun z => z⁻¹ / log z ^ 2
state_after: case h
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
x : ℝ
hx : deriv (fun x => 1 + ε x) x = -x⁻¹ / log x ^ 2
hx_pos : 1 < x
⊢ ‖deriv (fun z => z ^ p * (1 + ε z)) x‖ = x⁻¹ / log x ^ 2

tactic: have : 0 ≤ x⁻¹ / (log x ^ 2) := by
  have hlog : 0 < log x := Real.log_pos hx_pos
  positivity
state_before: case h
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
x : ℝ
hx : deriv (fun x => 1 + ε x) x = -x⁻¹ / log x ^ 2
hx_pos : 1 < x
⊢ ‖deriv (fun z => z ^ p * (1 + ε z)) x‖ = x⁻¹ / log x ^ 2
state_after: case h
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
x : ℝ
hx : deriv (fun x => 1 + ε x) x = -x⁻¹ / log x ^ 2
hx_pos : 1 < x
this : 0 ≤ x⁻¹ / log x ^ 2
⊢ ‖deriv (fun z => z ^ p * (1 + ε z)) x‖ = x⁻¹ / log x ^ 2

tactic: simp only [neg_div, norm_neg, hp, Real.rpow_zero,
  one_mul, differentiableAt_const, hx, Real.norm_of_nonneg this]
state_before: case h
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
x : ℝ
hx : deriv (fun x => 1 + ε x) x = -x⁻¹ / log x ^ 2
hx_pos : 1 < x
this : 0 ≤ x⁻¹ / log x ^ 2
⊢ ‖deriv (fun z => z ^ p * (1 + ε z)) x‖ = x⁻¹ / log x ^ 2
state_after: no goals

tactic: have hlog : 0 < log x := Real.log_pos hx_pos
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
x : ℝ
hx : deriv (fun x => 1 + ε x) x = -x⁻¹ / log x ^ 2
hx_pos : 1 < x
⊢ 0 ≤ x⁻¹ / log x ^ 2
state_after: α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
x : ℝ
hx : deriv (fun x => 1 + ε x) x = -x⁻¹ / log x ^ 2
hx_pos : 1 < x
hlog : 0 < log x
⊢ 0 ≤ x⁻¹ / log x ^ 2

tactic: positivity
state_before: α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p = 0
x : ℝ
hx : deriv (fun x => 1 + ε x) x = -x⁻¹ / log x ^ 2
hx_pos : 1 < x
hlog : 0 < log x
⊢ 0 ≤ x⁻¹ / log x ^ 2
state_after: no goals

tactic: refine GrowsPolynomially.of_isTheta (growsPolynomially_rpow (p-1))
  (isTheta_deriv_rpow_p_mul_one_add_smoothingFn hp) ?_
state_before: case inr
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p ≠ 0
⊢ GrowsPolynomially fun x => ‖deriv (fun z => z ^ p * (1 + ε z)) x‖
state_after: case inr
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p ≠ 0
⊢ ∀ᶠ (x : ℝ) in atTop, 0 ≤ ‖deriv (fun z => z ^ p * (1 + ε z)) x‖

tactic: filter_upwards [eventually_gt_atTop 0] with _ _
state_before: case inr
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p ≠ 0
⊢ ∀ᶠ (x : ℝ) in atTop, 0 ≤ ‖deriv (fun z => z ^ p * (1 + ε z)) x‖
state_after: case h
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p ≠ 0
a✝¹ : ℝ
a✝ : 0 < a✝¹
⊢ 0 ≤ ‖deriv (fun z => z ^ p * (1 + ε z)) a✝¹‖

tactic: positivity
state_before: case h
α : Type u_1
inst✝¹ : Fintype α
inst✝ : Nonempty α
T : ℕ → ℝ
g : ℝ → ℝ
a b : α → ℝ
r : α → ℕ → ℕ
R : AkraBazziRecurrence T g a b r
p : ℝ
hp : p ≠ 0
a✝¹ : ℝ
a✝ : 0 < a✝¹
⊢ 0 ≤ ‖deriv (fun z => z ^ p * (1 + ε z)) a✝¹‖
state_after: no goals