Theorem: summable_jacobiTheta₂_term_iff
File: Mathlib/NumberTheory/ModularForms/JacobiTheta/TwoVariable.lean

tactic: refine Iff.symm ⟨fun hτ ↦ ?_, fun h ↦ ?_⟩
state_before: z τ : ℂ
⊢ (Summable fun x => jacobiTheta₂_term x z τ) ↔ 0 < τ.im
state_after: case refine_1
z τ : ℂ
hτ : 0 < τ.im
⊢ Summable fun x => jacobiTheta₂_term x z τ

case refine_2
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
⊢ 0 < τ.im

tactic: refine (summable_pow_mul_jacobiTheta₂_term_bound |im z| hτ 0).of_norm_bounded _ ?_
state_before: case refine_1
z τ : ℂ
hτ : 0 < τ.im
⊢ Summable fun x => jacobiTheta₂_term x z τ
state_after: case refine_1
z τ : ℂ
hτ : 0 < τ.im
⊢ ∀ (i : ℤ), ‖jacobiTheta₂_term i z τ‖ ≤ ↑|i| ^ 0 * rexp (-π * (τ.im * ↑i ^ 2 - 2 * |z.im| * ↑|i|))

tactic: simpa only [pow_zero, one_mul] using norm_jacobiTheta₂_term_le hτ le_rfl le_rfl
state_before: case refine_1
z τ : ℂ
hτ : 0 < τ.im
⊢ ∀ (i : ℤ), ‖jacobiTheta₂_term i z τ‖ ≤ ↑|i| ^ 0 * rexp (-π * (τ.im * ↑i ^ 2 - 2 * |z.im| * ↑|i|))
state_after: no goals

tactic: by_contra! hτ
state_before: case refine_2
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
⊢ 0 < τ.im
state_after: case refine_2
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ : τ.im ≤ 0
⊢ False

tactic: rcases lt_or_eq_of_le hτ with hτ | hτ
state_before: case refine_2
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ : τ.im ≤ 0
⊢ False
state_after: case refine_2.inl
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ✝ : τ.im ≤ 0
hτ : τ.im < 0
⊢ False

case refine_2.inr
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
⊢ False

tactic: suffices Tendsto (fun n : ℕ ↦ ‖jacobiTheta₂_term ↑n z τ‖) atTop atTop by
  replace h := (h.comp_injective (fun a b ↦ Int.ofNat_inj.mp)).tendsto_atTop_zero.norm
  exact atTop_neBot.ne (disjoint_self.mp <| h.disjoint (disjoint_nhds_atTop _) this)
state_before: case refine_2.inl
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ✝ : τ.im ≤ 0
hτ : τ.im < 0
⊢ False
state_after: case refine_2.inl
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ✝ : τ.im ≤ 0
hτ : τ.im < 0
⊢ Tendsto (fun n => ‖jacobiTheta₂_term (↑n) z τ‖) atTop atTop

tactic: simp only [norm_zero, Function.comp_def, norm_jacobiTheta₂_term, Int.cast_natCast]
state_before: case refine_2.inl
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ✝ : τ.im ≤ 0
hτ : τ.im < 0
⊢ Tendsto (fun n => ‖jacobiTheta₂_term (↑n) z τ‖) atTop atTop
state_after: case refine_2.inl
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ✝ : τ.im ≤ 0
hτ : τ.im < 0
⊢ Tendsto (fun n => rexp (-π * ↑n ^ 2 * τ.im - 2 * π * ↑n * z.im)) atTop atTop

tactic: conv =>
  enter [1, n]
  rw [show -π * n ^ 2 * τ.im - 2 * π * n * z.im =
        n * (n * (-π * τ.im) - 2 * π * z.im) by ring]
state_before: case refine_2.inl
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ✝ : τ.im ≤ 0
hτ : τ.im < 0
⊢ Tendsto (fun n => rexp (-π * ↑n ^ 2 * τ.im - 2 * π * ↑n * z.im)) atTop atTop
state_after: case refine_2.inl
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ✝ : τ.im ≤ 0
hτ : τ.im < 0
⊢ Tendsto (fun n => rexp (↑n * (↑n * (-π * τ.im) - 2 * π * z.im))) atTop atTop

tactic: refine tendsto_exp_atTop.comp (tendsto_natCast_atTop_atTop.atTop_mul_atTop ?_)
state_before: case refine_2.inl
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ✝ : τ.im ≤ 0
hτ : τ.im < 0
⊢ Tendsto (fun n => rexp (↑n * (↑n * (-π * τ.im) - 2 * π * z.im))) atTop atTop
state_after: case refine_2.inl
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ✝ : τ.im ≤ 0
hτ : τ.im < 0
⊢ Tendsto (fun n => ↑n * (-π * τ.im) - 2 * π * z.im) atTop atTop

tactic: exact tendsto_atTop_add_const_right _ _ (tendsto_natCast_atTop_atTop.atTop_mul_const
  (mul_pos_of_neg_of_neg (neg_lt_zero.mpr pi_pos) hτ))
state_before: case refine_2.inl
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ✝ : τ.im ≤ 0
hτ : τ.im < 0
⊢ Tendsto (fun n => ↑n * (-π * τ.im) - 2 * π * z.im) atTop atTop
state_after: no goals

tactic: replace h := (h.comp_injective (fun a b ↦ Int.ofNat_inj.mp)).tendsto_atTop_zero.norm
state_before: z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ✝ : τ.im ≤ 0
hτ : τ.im < 0
this : Tendsto (fun n => ‖jacobiTheta₂_term (↑n) z τ‖) atTop atTop
⊢ False
state_after: z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im < 0
this : Tendsto (fun n => ‖jacobiTheta₂_term (↑n) z τ‖) atTop atTop
h : Tendsto (fun x => ‖((fun x => jacobiTheta₂_term x z τ) ∘ fun a => ↑a) x‖) atTop (𝓝 ‖0‖)
⊢ False

tactic: exact atTop_neBot.ne (disjoint_self.mp <| h.disjoint (disjoint_nhds_atTop _) this)
state_before: z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im < 0
this : Tendsto (fun n => ‖jacobiTheta₂_term (↑n) z τ‖) atTop atTop
h : Tendsto (fun x => ‖((fun x => jacobiTheta₂_term x z τ) ∘ fun a => ↑a) x‖) atTop (𝓝 ‖0‖)
⊢ False
state_after: no goals

tactic: ring
state_before: z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ✝ : τ.im ≤ 0
hτ : τ.im < 0
n : ℕ
⊢ -π * ↑n ^ 2 * τ.im - 2 * π * ↑n * z.im = ↑n * (↑n * (-π * τ.im) - 2 * π * z.im)
state_after: no goals

tactic: simp_rw [← summable_norm_iff (E := ℂ), norm_jacobiTheta₂_term, hτ, mul_zero, zero_sub] at h
state_before: case refine_2.inr
z τ : ℂ
h : Summable fun x => jacobiTheta₂_term x z τ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
⊢ False
state_after: case refine_2.inr
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
h : Summable fun x => rexp (-(2 * π * ↑x * z.im))
⊢ False

tactic: rcases lt_trichotomy (im z) 0 with hz | hz | hz
state_before: case refine_2.inr
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
h : Summable fun x => rexp (-(2 * π * ↑x * z.im))
⊢ False
state_after: case refine_2.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
h : Summable fun x => rexp (-(2 * π * ↑x * z.im))
hz : z.im < 0
⊢ False

case refine_2.inr.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
h : Summable fun x => rexp (-(2 * π * ↑x * z.im))
hz : z.im = 0
⊢ False

case refine_2.inr.inr.inr
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
h : Summable fun x => rexp (-(2 * π * ↑x * z.im))
hz : 0 < z.im
⊢ False

tactic: replace h := (h.comp_injective (fun a b ↦ Int.ofNat_inj.mp)).tendsto_atTop_zero
state_before: case refine_2.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
h : Summable fun x => rexp (-(2 * π * ↑x * z.im))
hz : z.im < 0
⊢ False
state_after: case refine_2.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : z.im < 0
h : Tendsto ((fun x => rexp (-(2 * π * ↑x * z.im))) ∘ fun a => ↑a) atTop (𝓝 0)
⊢ False

tactic: simp_rw [Function.comp_def, Int.cast_natCast] at h
state_before: case refine_2.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : z.im < 0
h : Tendsto ((fun x => rexp (-(2 * π * ↑x * z.im))) ∘ fun a => ↑a) atTop (𝓝 0)
⊢ False
state_after: case refine_2.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : z.im < 0
h : Tendsto (fun x => rexp (-(2 * π * ↑x * z.im))) atTop (𝓝 0)
⊢ False

tactic: refine atTop_neBot.ne (disjoint_self.mp <| h.disjoint (disjoint_nhds_atTop 0) ?_)
state_before: case refine_2.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : z.im < 0
h : Tendsto (fun x => rexp (-(2 * π * ↑x * z.im))) atTop (𝓝 0)
⊢ False
state_after: case refine_2.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : z.im < 0
h : Tendsto (fun x => rexp (-(2 * π * ↑x * z.im))) atTop (𝓝 0)
⊢ Tendsto (fun x => rexp (-(2 * π * ↑x * z.im))) atTop atTop

tactic: refine tendsto_exp_atTop.comp ?_
state_before: case refine_2.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : z.im < 0
h : Tendsto (fun x => rexp (-(2 * π * ↑x * z.im))) atTop (𝓝 0)
⊢ Tendsto (fun x => rexp (-(2 * π * ↑x * z.im))) atTop atTop
state_after: case refine_2.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : z.im < 0
h : Tendsto (fun x => rexp (-(2 * π * ↑x * z.im))) atTop (𝓝 0)
⊢ Tendsto (fun x => -(2 * π * ↑x * z.im)) atTop atTop

tactic: simp only [tendsto_neg_atTop_iff, mul_assoc]
state_before: case refine_2.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : z.im < 0
h : Tendsto (fun x => rexp (-(2 * π * ↑x * z.im))) atTop (𝓝 0)
⊢ Tendsto (fun x => -(2 * π * ↑x * z.im)) atTop atTop
state_after: case refine_2.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : z.im < 0
h : Tendsto (fun x => rexp (-(2 * π * ↑x * z.im))) atTop (𝓝 0)
⊢ Tendsto (fun x => 2 * (π * (↑x * z.im))) atTop atBot

tactic: apply Filter.Tendsto.const_mul_atBot two_pos
state_before: case refine_2.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : z.im < 0
h : Tendsto (fun x => rexp (-(2 * π * ↑x * z.im))) atTop (𝓝 0)
⊢ Tendsto (fun x => 2 * (π * (↑x * z.im))) atTop atBot
state_after: case refine_2.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : z.im < 0
h : Tendsto (fun x => rexp (-(2 * π * ↑x * z.im))) atTop (𝓝 0)
⊢ Tendsto (fun x => π * (↑x * z.im)) atTop atBot

tactic: exact (tendsto_natCast_atTop_atTop.atTop_mul_const_of_neg hz).const_mul_atBot pi_pos
state_before: case refine_2.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : z.im < 0
h : Tendsto (fun x => rexp (-(2 * π * ↑x * z.im))) atTop (𝓝 0)
⊢ Tendsto (fun x => π * (↑x * z.im)) atTop atBot
state_after: no goals

tactic: revert h
state_before: case refine_2.inr.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
h : Summable fun x => rexp (-(2 * π * ↑x * z.im))
hz : z.im = 0
⊢ False
state_after: case refine_2.inr.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : z.im = 0
⊢ (Summable fun x => rexp (-(2 * π * ↑x * z.im))) → False

tactic: simpa only [hz, mul_zero, neg_zero, Real.exp_zero, summable_const_iff] using one_ne_zero
state_before: case refine_2.inr.inr.inl
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : z.im = 0
⊢ (Summable fun x => rexp (-(2 * π * ↑x * z.im))) → False
state_after: no goals

tactic: replace h := (h.comp_injective this).tendsto_atTop_zero
state_before: case refine_2.inr.inr.inr
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
h : Summable fun x => rexp (-(2 * π * ↑x * z.im))
hz : 0 < z.im
this : Function.Injective fun x => -↑x
⊢ False
state_after: case refine_2.inr.inr.inr
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : 0 < z.im
this : Function.Injective fun x => -↑x
h : Tendsto ((fun x => rexp (-(2 * π * ↑x * z.im))) ∘ fun x => -↑x) atTop (𝓝 0)
⊢ False

tactic: simp_rw [Function.comp_def, Int.cast_neg, Int.cast_natCast, mul_neg, neg_mul, neg_neg] at h
state_before: case refine_2.inr.inr.inr
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : 0 < z.im
this : Function.Injective fun x => -↑x
h : Tendsto ((fun x => rexp (-(2 * π * ↑x * z.im))) ∘ fun x => -↑x) atTop (𝓝 0)
⊢ False
state_after: case refine_2.inr.inr.inr
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : 0 < z.im
this : Function.Injective fun x => -↑x
h : Tendsto (fun x => rexp (2 * π * ↑x * z.im)) atTop (𝓝 0)
⊢ False

tactic: refine atTop_neBot.ne (disjoint_self.mp <| h.disjoint (disjoint_nhds_atTop 0) ?_)
state_before: case refine_2.inr.inr.inr
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : 0 < z.im
this : Function.Injective fun x => -↑x
h : Tendsto (fun x => rexp (2 * π * ↑x * z.im)) atTop (𝓝 0)
⊢ False
state_after: case refine_2.inr.inr.inr
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : 0 < z.im
this : Function.Injective fun x => -↑x
h : Tendsto (fun x => rexp (2 * π * ↑x * z.im)) atTop (𝓝 0)
⊢ Tendsto (fun x => rexp (2 * π * ↑x * z.im)) atTop atTop

tactic: exact tendsto_exp_atTop.comp ((tendsto_natCast_atTop_atTop.const_mul_atTop
  (mul_pos two_pos pi_pos)).atTop_mul_const hz)
state_before: case refine_2.inr.inr.inr
z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
hz : 0 < z.im
this : Function.Injective fun x => -↑x
h : Tendsto (fun x => rexp (2 * π * ↑x * z.im)) atTop (𝓝 0)
⊢ Tendsto (fun x => rexp (2 * π * ↑x * z.im)) atTop atTop
state_after: no goals

tactic: simp only [neg_inj, Nat.cast_inj, imp_self]
state_before: z τ : ℂ
hτ✝ : τ.im ≤ 0
hτ : τ.im = 0
h : Summable fun x => rexp (-(2 * π * ↑x * z.im))
hz : 0 < z.im
x✝¹ x✝ : ℕ
⊢ (fun x => -↑x) x✝¹ = (fun x => -↑x) x✝ → x✝¹ = x✝
state_after: no goals