Theorem: Quaternion.hasSum_expSeries_of_imaginary
File: Mathlib/Analysis/NormedSpace/QuaternionExponential.lean

tactic: replace hc := hasSum_coe.mpr hc
state_before: q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun n => (-1) ^ n * ‖q‖ ^ (2 * n) / ↑(2 * n)!) c
hs : HasSum (fun n => (-1) ^ n * ‖q‖ ^ (2 * n + 1) / ↑(2 * n + 1)!) s
⊢ HasSum (fun n => ↑(expSeries ℝ ℍ n) fun x => q) (↑c + (s / ‖q‖) • q)

tactic: replace hs := (hs.div_const ‖q‖).smul_const q
state_before: q : ℍ
hq : q.re = 0
c s : ℝ
hs : HasSum (fun n => (-1) ^ n * ‖q‖ ^ (2 * n + 1) / ↑(2 * n + 1)!) s
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
⊢ HasSum (fun n => ↑(expSeries ℝ ℍ n) fun x => q) (↑c + (s / ‖q‖) • q)

tactic: obtain rfl | hq0 := eq_or_ne q 0
state_before: q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
⊢ HasSum (fun n => ↑(expSeries ℝ ℍ n) fun x => q) (↑c + (s / ‖q‖) • q)

tactic: simp_rw [expSeries_apply_eq]
state_before: case inr
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
⊢ HasSum (fun n => ↑(expSeries ℝ ℍ n) fun x => q) (↑c + (s / ‖q‖) • q)

tactic: have hq2 : q ^ 2 = -normSq q := sq_eq_neg_normSq.mpr hq
state_before: case inr
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
⊢ HasSum (fun n => (↑n !)⁻¹ • q ^ n) (↑c + (s / ‖q‖) • q)

tactic: have hqn := norm_ne_zero_iff.mpr hq0
state_before: case inr
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
⊢ HasSum (fun n => (↑n !)⁻¹ • q ^ n) (↑c + (s / ‖q‖) • q)

tactic: refine' HasSum.even_add_odd _ _
state_before: case inr
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
⊢ HasSum (fun n => (↑n !)⁻¹ • q ^ n) (↑c + (s / ‖q‖) • q)

tactic: simp_rw [expSeries_apply_zero, norm_zero, div_zero, zero_smul, add_zero]
state_before: case inl
c s : ℝ
hq : 0.re = 0
hc : HasSum (fun a => ↑((-1) ^ a * ‖0‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖0‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖0‖) • 0) ((s / ‖0‖) • 0)
⊢ HasSum (fun n => ↑(expSeries ℝ ℍ n) fun x => 0) (↑c + (s / ‖0‖) • 0)

tactic: simp_rw [norm_zero] at hc
state_before: case inl
c s : ℝ
hq : 0.re = 0
hc : HasSum (fun a => ↑((-1) ^ a * ‖0‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖0‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖0‖) • 0) ((s / ‖0‖) • 0)
⊢ HasSum (fun n => Pi.single 0 1 n) ↑c

tactic: convert hc using 1
state_before: case inl
c s : ℝ
hq : 0.re = 0
hs : HasSum (fun z => ((-1) ^ z * ‖0‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖0‖) • 0) ((s / ‖0‖) • 0)
hc : HasSum (fun a => ↑((-1) ^ a * 0 ^ (2 * a) / ↑(2 * a)!)) ↑c
⊢ HasSum (fun n => Pi.single 0 1 n) ↑c

tactic: ext (_ | n) : 1
state_before: case h.e'_5
c s : ℝ
hq : 0.re = 0
hs : HasSum (fun z => ((-1) ^ z * ‖0‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖0‖) • 0) ((s / ‖0‖) • 0)
hc : HasSum (fun a => ↑((-1) ^ a * 0 ^ (2 * a) / ↑(2 * a)!)) ↑c
⊢ (fun n => Pi.single 0 1 n) = fun a => ↑((-1) ^ a * 0 ^ (2 * a) / ↑(2 * a)!)

tactic: rw [pow_zero, Nat.zero_eq, MulZeroClass.mul_zero, pow_zero, Nat.factorial_zero, Nat.cast_one,
  div_one, one_mul, Pi.single_eq_same, coe_one]
state_before: case h.e'_5.h.zero
c s : ℝ
hq : 0.re = 0
hs : HasSum (fun z => ((-1) ^ z * ‖0‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖0‖) • 0) ((s / ‖0‖) • 0)
hc : HasSum (fun a => ↑((-1) ^ a * 0 ^ (2 * a) / ↑(2 * a)!)) ↑c
⊢ Pi.single 0 1 Nat.zero = ↑((-1) ^ Nat.zero * 0 ^ (2 * Nat.zero) / ↑(2 * Nat.zero)!)

tactic: rw [zero_pow (mul_pos two_pos (Nat.succ_pos _)), MulZeroClass.mul_zero, zero_div,
  Pi.single_eq_of_ne n.succ_ne_zero, coe_zero]
state_before: case h.e'_5.h.succ
c s : ℝ
hq : 0.re = 0
hs : HasSum (fun z => ((-1) ^ z * ‖0‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖0‖) • 0) ((s / ‖0‖) • 0)
hc : HasSum (fun a => ↑((-1) ^ a * 0 ^ (2 * a) / ↑(2 * a)!)) ↑c
n : ℕ
⊢ Pi.single 0 1 (Nat.succ n) = ↑((-1) ^ Nat.succ n * 0 ^ (2 * Nat.succ n) / ↑(2 * Nat.succ n)!)

tactic: convert hc using 1
state_before: case inr.refine'_1
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
⊢ HasSum (fun k => (↑(2 * k)!)⁻¹ • q ^ (2 * k)) ↑c

tactic: ext n : 1
state_before: case h.e'_5
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
⊢ (fun k => (↑(2 * k)!)⁻¹ • q ^ (2 * k)) = fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)

tactic: letI k : ℝ := ↑(2 * n)!
state_before: case h.e'_5.h
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
⊢ (↑(2 * n)!)⁻¹ • q ^ (2 * n) = ↑((-1) ^ n * ‖q‖ ^ (2 * n) / ↑(2 * n)!)

tactic: calc
  k⁻¹ • q ^ (2 * n) = k⁻¹ • (-normSq q) ^ n := by rw [pow_mul, hq2]; norm_cast
  _ = k⁻¹ • ↑((-1 : ℝ) ^ n * ‖q‖ ^ (2 * n)) := ?_
  _ = ↑((-1 : ℝ) ^ n * ‖q‖ ^ (2 * n) / k) := ?_
state_before: case h.e'_5.h
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n)!
⊢ (↑(2 * n)!)⁻¹ • q ^ (2 * n) = ↑((-1) ^ n * ‖q‖ ^ (2 * n) / ↑(2 * n)!)

tactic: rw [pow_mul, hq2]
state_before: q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n)!
⊢ k⁻¹ • q ^ (2 * n) = ↑(k⁻¹ • (-↑normSq q) ^ n)

tactic: norm_cast
state_before: q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n)!
⊢ k⁻¹ • (-↑(↑normSq q)) ^ n = ↑(k⁻¹ • (-↑normSq q) ^ n)

tactic: congr 1
state_before: case h.e'_5.h.calc_1
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n)!
⊢ ↑(k⁻¹ • (-↑normSq q) ^ n) = k⁻¹ • ↑((-1) ^ n * ‖q‖ ^ (2 * n))

tactic: rw [neg_pow, normSq_eq_norm_mul_self, pow_mul, sq]
state_before: case h.e'_5.h.calc_1
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n)!
⊢ ↑(k⁻¹ • (-↑normSq q) ^ n) = k⁻¹ • ↑((-1) ^ n * ‖q‖ ^ (2 * n))

tactic: push_cast
state_before: case h.e'_5.h.calc_1
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n)!
⊢ ↑(k⁻¹ • ((-1) ^ n * (‖q‖ * ‖q‖) ^ n)) = k⁻¹ • ↑((-1) ^ n * (‖q‖ * ‖q‖) ^ n)

tactic: rfl
state_before: case h.e'_5.h.calc_1
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n)!
⊢ (↑(2 * n)!)⁻¹ • ((-1) ^ n * (↑‖q‖ * ↑‖q‖) ^ n) = (↑(2 * n)!)⁻¹ • ((-1) ^ n * (↑‖q‖ * ↑‖q‖) ^ n)

tactic: rw [← coe_mul_eq_smul, div_eq_mul_inv]
state_before: case h.e'_5.h.calc_2
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n)!
⊢ k⁻¹ • ↑((-1) ^ n * ‖q‖ ^ (2 * n)) = ↑((-1) ^ n * ‖q‖ ^ (2 * n) / k)

tactic: norm_cast
state_before: case h.e'_5.h.calc_2
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n)!
⊢ ↑k⁻¹ * ↑((-1) ^ n * ‖q‖ ^ (2 * n)) = ↑((-1) ^ n * ‖q‖ ^ (2 * n) * k⁻¹)

tactic: ring_nf
state_before: case h.e'_5.h.calc_2
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n)!
⊢ ↑(k⁻¹ * (↑(Int.negSucc 0 ^ n) * ‖q‖ ^ (2 * n))) = ↑(↑(Int.negSucc 0 ^ n) * ‖q‖ ^ (2 * n) * k⁻¹)

tactic: convert hs using 1
state_before: case inr.refine'_2
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
⊢ HasSum (fun k => (↑(2 * k + 1)!)⁻¹ • q ^ (2 * k + 1)) ((s / ‖q‖) • q)

tactic: ext n : 1
state_before: case h.e'_5
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
⊢ (fun k => (↑(2 * k + 1)!)⁻¹ • q ^ (2 * k + 1)) = fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q

tactic: let k : ℝ := ↑(2 * n + 1)!
state_before: case h.e'_5.h
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
⊢ (↑(2 * n + 1)!)⁻¹ • q ^ (2 * n + 1) = ((-1) ^ n * ‖q‖ ^ (2 * n + 1) / ↑(2 * n + 1)! / ‖q‖) • q

tactic: calc
  k⁻¹ • q ^ (2 * n + 1) = k⁻¹ • ((-normSq q) ^ n * q) := by
    rw [pow_succ', pow_mul, hq2]
    norm_cast
  _ = k⁻¹ • ((-1 : ℝ) ^ n * ‖q‖ ^ (2 * n)) • q := ?_
  _ = ((-1 : ℝ) ^ n * ‖q‖ ^ (2 * n + 1) / k / ‖q‖) • q := ?_
state_before: case h.e'_5.h
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n + 1)!
⊢ (↑(2 * n + 1)!)⁻¹ • q ^ (2 * n + 1) = ((-1) ^ n * ‖q‖ ^ (2 * n + 1) / ↑(2 * n + 1)! / ‖q‖) • q

tactic: rw [pow_succ', pow_mul, hq2]
state_before: q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n + 1)!
⊢ k⁻¹ • q ^ (2 * n + 1) = k⁻¹ • (↑((-↑normSq q) ^ n) * q)

tactic: norm_cast
state_before: q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n + 1)!
⊢ k⁻¹ • ((-↑(↑normSq q)) ^ n * q) = k⁻¹ • (↑((-↑normSq q) ^ n) * q)

tactic: congr 1
state_before: case h.e'_5.h.calc_1
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n + 1)!
⊢ k⁻¹ • (↑((-↑normSq q) ^ n) * q) = k⁻¹ • ((-1) ^ n * ‖q‖ ^ (2 * n)) • q

tactic: rw [neg_pow, normSq_eq_norm_mul_self, pow_mul, sq, ← coe_mul_eq_smul]
state_before: case h.e'_5.h.calc_1.e_a
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n + 1)!
⊢ ↑((-↑normSq q) ^ n) * q = ((-1) ^ n * ‖q‖ ^ (2 * n)) • q

tactic: rw [smul_smul]
state_before: case h.e'_5.h.calc_2
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n + 1)!
⊢ k⁻¹ • ((-1) ^ n * ‖q‖ ^ (2 * n)) • q = ((-1) ^ n * ‖q‖ ^ (2 * n + 1) / k / ‖q‖) • q

tactic: congr 1
state_before: case h.e'_5.h.calc_2
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n + 1)!
⊢ (k⁻¹ * ((-1) ^ n * ‖q‖ ^ (2 * n))) • q = ((-1) ^ n * ‖q‖ ^ (2 * n + 1) / k / ‖q‖) • q

tactic: simp_rw [pow_succ', mul_div_assoc, div_div_cancel_left' hqn]
state_before: case h.e'_5.h.calc_2.e_a
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n + 1)!
⊢ k⁻¹ * ((-1) ^ n * ‖q‖ ^ (2 * n)) = (-1) ^ n * ‖q‖ ^ (2 * n + 1) / k / ‖q‖

tactic: ring
state_before: case h.e'_5.h.calc_2.e_a
q : ℍ
hq : q.re = 0
c s : ℝ
hc : HasSum (fun a => ↑((-1) ^ a * ‖q‖ ^ (2 * a) / ↑(2 * a)!)) ↑c
hs : HasSum (fun z => ((-1) ^ z * ‖q‖ ^ (2 * z + 1) / ↑(2 * z + 1)! / ‖q‖) • q) ((s / ‖q‖) • q)
hq0 : q ≠ 0
hq2 : q ^ 2 = -↑(↑normSq q)
hqn : ‖q‖ ≠ 0
n : ℕ
k : ℝ := ↑(2 * n + 1)!
⊢ (↑(2 * n + 1)!)⁻¹ * ((-1) ^ n * ‖q‖ ^ (2 * n)) = (-1) ^ n * (‖q‖ ^ (2 * n) * (↑(2 * n + 1)!)⁻¹)