Theorem: HurwitzKernelBounds.isBigO_atTop_F_nat_one
File: Mathlib/NumberTheory/ModularForms/JacobiTheta/Bounds.lean

tactic: suffices ∃ p, 0 < p ∧ (fun t ↦ rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2
    + a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop] fun t ↦ exp (-p * t) by
  let ⟨p, hp, hp'⟩ := this
  refine ⟨p, hp, (Eventually.isBigO ?_).trans hp'⟩
  filter_upwards [eventually_gt_atTop 0] with t ht
  exact F_nat_one_le ha ht
state_before: a : ℝ
ha : 0 ≤ a
⊢ ∃ p, 0 < p ∧ F_nat 1 a =O[atTop] fun t => rexp (-p * t)
state_after: a : ℝ
ha : 0 ≤ a
⊢ ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)

tactic: have aux' : IsBigO atTop (fun t : ℝ ↦ ((1 - rexp (-π * t)) ^ 2)⁻¹) (fun _ ↦ (1 : ℝ)) := by
  simpa only [inv_pow, one_pow] using isBigO_one_aux.pow 2
state_before: a : ℝ
ha : 0 ≤ a
⊢ ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)
state_after: a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
⊢ ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)

tactic: rcases eq_or_lt_of_le ha with rfl | ha'
state_before: a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
⊢ ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)
state_after: case inl
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha : 0 ≤ 0
⊢ ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (0 ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            0 * rexp (-π * 0 ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)

case inr
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
⊢ ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)

tactic: let ⟨p, hp, hp'⟩ := this
state_before: a : ℝ
ha : 0 ≤ a
this :
  ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)
⊢ ∃ p, 0 < p ∧ F_nat 1 a =O[atTop] fun t => rexp (-p * t)
state_after: a : ℝ
ha : 0 ≤ a
this :
  ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)
p : ℝ
hp : 0 < p
hp' :
  (fun t =>
      rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 + a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
    fun t => rexp (-p * t)
⊢ ∃ p, 0 < p ∧ F_nat 1 a =O[atTop] fun t => rexp (-p * t)

tactic: refine ⟨p, hp, (Eventually.isBigO ?_).trans hp'⟩
state_before: a : ℝ
ha : 0 ≤ a
this :
  ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)
p : ℝ
hp : 0 < p
hp' :
  (fun t =>
      rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 + a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
    fun t => rexp (-p * t)
⊢ ∃ p, 0 < p ∧ F_nat 1 a =O[atTop] fun t => rexp (-p * t)
state_after: a : ℝ
ha : 0 ≤ a
this :
  ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)
p : ℝ
hp : 0 < p
hp' :
  (fun t =>
      rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 + a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
    fun t => rexp (-p * t)
⊢ ∀ᶠ (x : ℝ) in atTop,
    ‖F_nat 1 a x‖ ≤
      rexp (-π * (a ^ 2 + 1) * x) / (1 - rexp (-π * x)) ^ 2 + a * rexp (-π * a ^ 2 * x) / (1 - rexp (-π * x))

tactic: filter_upwards [eventually_gt_atTop 0] with t ht
state_before: a : ℝ
ha : 0 ≤ a
this :
  ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)
p : ℝ
hp : 0 < p
hp' :
  (fun t =>
      rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 + a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
    fun t => rexp (-p * t)
⊢ ∀ᶠ (x : ℝ) in atTop,
    ‖F_nat 1 a x‖ ≤
      rexp (-π * (a ^ 2 + 1) * x) / (1 - rexp (-π * x)) ^ 2 + a * rexp (-π * a ^ 2 * x) / (1 - rexp (-π * x))
state_after: case h
a : ℝ
ha : 0 ≤ a
this :
  ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)
p : ℝ
hp : 0 < p
hp' :
  (fun t =>
      rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 + a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
    fun t => rexp (-p * t)
t : ℝ
ht : 0 < t
⊢ ‖F_nat 1 a t‖ ≤
    rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 + a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))

tactic: exact F_nat_one_le ha ht
state_before: case h
a : ℝ
ha : 0 ≤ a
this :
  ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)
p : ℝ
hp : 0 < p
hp' :
  (fun t =>
      rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 + a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
    fun t => rexp (-p * t)
t : ℝ
ht : 0 < t
⊢ ‖F_nat 1 a t‖ ≤
    rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 + a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))
state_after: no goals

tactic: simpa only [inv_pow, one_pow] using isBigO_one_aux.pow 2
state_before: a : ℝ
ha : 0 ≤ a
⊢ (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
state_after: no goals

tactic: exact ⟨_, pi_pos, by simpa only [zero_pow two_ne_zero, zero_add, mul_one, zero_mul, zero_div,
  add_zero] using (isBigO_refl _ _).mul aux'⟩
state_before: case inl
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha : 0 ≤ 0
⊢ ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (0 ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            0 * rexp (-π * 0 ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)
state_after: no goals

tactic: simpa only [zero_pow two_ne_zero, zero_add, mul_one, zero_mul, zero_div,
add_zero] using (isBigO_refl _ _).mul aux'
state_before: aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha : 0 ≤ 0
⊢ (fun t =>
      rexp (-π * (0 ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 + 0 * rexp (-π * 0 ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
    fun t => rexp (-π * t)
state_after: no goals

tactic: refine ⟨π * a ^ 2, mul_pos pi_pos <| pow_pos ha' _, IsBigO.add ?_ ?_⟩
state_before: case inr
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
⊢ ∃ p,
    0 < p ∧
      (fun t =>
          rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2 +
            a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop]
        fun t => rexp (-p * t)
state_after: case inr.refine_1
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
⊢ (fun t => rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2) =O[atTop] fun t => rexp (-(π * a ^ 2) * t)

case inr.refine_2
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
⊢ (fun t => a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop] fun t => rexp (-(π * a ^ 2) * t)

tactic: conv_rhs => enter [t]; rw [← mul_one (rexp _)]
state_before: case inr.refine_1
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
⊢ (fun t => rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2) =O[atTop] fun t => rexp (-(π * a ^ 2) * t)
state_after: case inr.refine_1
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
⊢ (fun t => rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2) =O[atTop] fun t => rexp (-(π * a ^ 2) * t) * 1

tactic: refine (Eventually.isBigO ?_).mul aux'
state_before: case inr.refine_1
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
⊢ (fun t => rexp (-π * (a ^ 2 + 1) * t) / (1 - rexp (-π * t)) ^ 2) =O[atTop] fun t => rexp (-(π * a ^ 2) * t) * 1
state_after: case inr.refine_1
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
⊢ ∀ᶠ (x : ℝ) in atTop, ‖rexp (-π * (a ^ 2 + 1) * x)‖ ≤ rexp (-(π * a ^ 2) * x)

tactic: filter_upwards [eventually_gt_atTop 0] with t ht
state_before: case inr.refine_1
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
⊢ ∀ᶠ (x : ℝ) in atTop, ‖rexp (-π * (a ^ 2 + 1) * x)‖ ≤ rexp (-(π * a ^ 2) * x)
state_after: case h
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
t : ℝ
ht : 0 < t
⊢ ‖rexp (-π * (a ^ 2 + 1) * t)‖ ≤ rexp (-(π * a ^ 2) * t)

tactic: rw [norm_of_nonneg (exp_pos _).le, exp_le_exp]
state_before: case h
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
t : ℝ
ht : 0 < t
⊢ ‖rexp (-π * (a ^ 2 + 1) * t)‖ ≤ rexp (-(π * a ^ 2) * t)
state_after: case h
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
t : ℝ
ht : 0 < t
⊢ -π * (a ^ 2 + 1) * t ≤ -(π * a ^ 2) * t

tactic: nlinarith [pi_pos]
state_before: case h
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
t : ℝ
ht : 0 < t
⊢ -π * (a ^ 2 + 1) * t ≤ -(π * a ^ 2) * t
state_after: no goals

tactic: simp_rw [mul_div_assoc, ← neg_mul]
state_before: case inr.refine_2
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
⊢ (fun t => a * rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t))) =O[atTop] fun t => rexp (-(π * a ^ 2) * t)
state_after: case inr.refine_2
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
⊢ (fun t => a * (rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t)))) =O[atTop] fun t => rexp (-π * a ^ 2 * t)

tactic: apply IsBigO.const_mul_left
state_before: case inr.refine_2
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
⊢ (fun t => a * (rexp (-π * a ^ 2 * t) / (1 - rexp (-π * t)))) =O[atTop] fun t => rexp (-π * a ^ 2 * t)
state_after: case inr.refine_2.h
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
⊢ (fun x => rexp (-π * a ^ 2 * x) / (1 - rexp (-π * x))) =O[atTop] fun t => rexp (-π * a ^ 2 * t)

tactic: simpa only [mul_one] using (isBigO_refl _ _).mul isBigO_one_aux
state_before: case inr.refine_2.h
a : ℝ
ha : 0 ≤ a
aux' : (fun t => ((1 - rexp (-π * t)) ^ 2)⁻¹) =O[atTop] fun x => 1
ha' : 0 < a
⊢ (fun x => rexp (-π * a ^ 2 * x) / (1 - rexp (-π * x))) =O[atTop] fun t => rexp (-π * a ^ 2 * t)
state_after: no goals