Theorem: hasSum_nat_jacobiTheta
File: Mathlib/NumberTheory/ModularForms/JacobiTheta/OneVariable.lean

Proof steps:
state_before: τ : ℂ
hτ : 0 < τ.im
⊢ HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2)
state_after: τ : ℂ
hτ : 0 < τ.im
this : HasSum (fun n => jacobiTheta₂_term n 0 τ) (jacobiTheta₂ 0 τ)
⊢ HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2)
tactic: have := hasSum_jacobiTheta₂_term 0 hτ
state_before: τ : ℂ
hτ : 0 < τ.im
this : HasSum (fun n => jacobiTheta₂_term n 0 τ) (jacobiTheta₂ 0 τ)
⊢ HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2)
state_after: τ : ℂ
hτ : 0 < τ.im
this : HasSum (fun n => cexp (↑π * I * ↑n ^ 2 * τ)) (jacobiTheta τ)
⊢ HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2)
tactic: simp_rw [jacobiTheta₂_term, mul_zero, zero_add, ← jacobiTheta_eq_jacobiTheta₂] at this
state_before: τ : ℂ
hτ : 0 < τ.im
this : HasSum (fun n => cexp (↑π * I * ↑n ^ 2 * τ)) (jacobiTheta τ)
⊢ HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2)
state_after: τ : ℂ
hτ : 0 < τ.im
this✝ : HasSum (fun n => cexp (↑π * I * ↑n ^ 2 * τ)) (jacobiTheta τ)
this :
  HasSum (fun n => cexp (↑π * I * ↑↑n ^ 2 * τ) + cexp (↑π * I * ↑(-↑n) ^ 2 * τ))
    (jacobiTheta τ + cexp (↑π * I * ↑0 ^ 2 * τ))
⊢ HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2)
tactic: have := this.nat_add_neg
state_before: τ : ℂ
hτ : 0 < τ.im
this✝ : HasSum (fun n => cexp (↑π * I * ↑n ^ 2 * τ)) (jacobiTheta τ)
this :
  HasSum (fun n => cexp (↑π * I * ↑↑n ^ 2 * τ) + cexp (↑π * I * ↑(-↑n) ^ 2 * τ))
    (jacobiTheta τ + cexp (↑π * I * ↑0 ^ 2 * τ))
⊢ HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2)
state_after: τ : ℂ
hτ : 0 < τ.im
this✝ : HasSum (fun n => cexp (↑π * I * ↑n ^ 2 * τ)) (jacobiTheta τ)
this :
  HasSum (fun n => cexp (↑π * I * ↑↑(n + 1) ^ 2 * τ) + cexp (↑π * I * ↑(-↑(n + 1)) ^ 2 * τ))
    (jacobiTheta τ + cexp (↑π * I * ↑0 ^ 2 * τ) -
      ∑ i ∈ Finset.range 1, (cexp (↑π * I * ↑↑i ^ 2 * τ) + cexp (↑π * I * ↑(-↑i) ^ 2 * τ)))
⊢ HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2)
tactic: rw [← hasSum_nat_add_iff' 1] at this
state_before: τ : ℂ
hτ : 0 < τ.im
this✝ : HasSum (fun n => cexp (↑π * I * ↑n ^ 2 * τ)) (jacobiTheta τ)
this :
  HasSum (fun n => cexp (↑π * I * ↑↑(n + 1) ^ 2 * τ) + cexp (↑π * I * ↑(-↑(n + 1)) ^ 2 * τ))
    (jacobiTheta τ + cexp (↑π * I * ↑0 ^ 2 * τ) -
      ∑ i ∈ Finset.range 1, (cexp (↑π * I * ↑↑i ^ 2 * τ) + cexp (↑π * I * ↑(-↑i) ^ 2 * τ)))
⊢ HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2)
state_after: τ : ℂ
hτ : 0 < τ.im
this✝ : HasSum (fun n => cexp (↑π * I * ↑n ^ 2 * τ)) (jacobiTheta τ)
this : HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ) * 2) (jacobiTheta τ - 1)
⊢ HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2)
tactic: simp_rw [Finset.sum_range_one, Int.cast_neg, Int.cast_natCast, Nat.cast_zero, neg_zero,
    Int.cast_zero, sq (0 : ℂ), mul_zero, zero_mul, neg_sq, ← mul_two,
    Complex.exp_zero, add_sub_assoc, (by norm_num : (1 : ℂ) - 1 * 2 = -1), ← sub_eq_add_neg,
    Nat.cast_add, Nat.cast_one] at this
state_before: τ : ℂ
hτ : 0 < τ.im
this✝ : HasSum (fun n => cexp (↑π * I * ↑n ^ 2 * τ)) (jacobiTheta τ)
this : HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ) * 2) (jacobiTheta τ - 1)
⊢ HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ)) ((jacobiTheta τ - 1) / 2)
state_after: case h.e'_5
τ : ℂ
hτ : 0 < τ.im
this✝ : HasSum (fun n => cexp (↑π * I * ↑n ^ 2 * τ)) (jacobiTheta τ)
this : HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ) * 2) (jacobiTheta τ - 1)
⊢ (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ)) = fun i => cexp (↑π * I * (↑i + 1) ^ 2 * τ) * 2 / 2
tactic: convert this.div_const 2 using 1
state_before: case h.e'_5
τ : ℂ
hτ : 0 < τ.im
this✝ : HasSum (fun n => cexp (↑π * I * ↑n ^ 2 * τ)) (jacobiTheta τ)
this : HasSum (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ) * 2) (jacobiTheta τ - 1)
⊢ (fun n => cexp (↑π * I * (↑n + 1) ^ 2 * τ)) = fun i => cexp (↑π * I * (↑i + 1) ^ 2 * τ) * 2 / 2
state_after: no goals
tactic: simp_rw [mul_div_cancel_right₀ _ (two_ne_zero' ℂ)]