Theorem: Complex.exp_bound
File: Mathlib/Data/Complex/Exponential.lean

tactic: rw [← lim_const (abv := Complex.abs) (∑ m ∈ range n, _), exp, sub_eq_add_neg,
  ← lim_neg, lim_add, ← lim_abs]
state_before: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
⊢ abs (cexp x - ∑ m ∈ range n, x ^ m / ↑m.factorial) ≤ abs x ^ n * (↑n.succ * (↑n.factorial * ↑n)⁻¹)
state_after: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
⊢ (cauSeqAbs (exp' x + -const (⇑abs) (∑ m ∈ range n, x ^ m / ↑m.factorial))).lim ≤
    abs x ^ n * (↑n.succ * (↑n.factorial * ↑n)⁻¹)

tactic: refine lim_le (CauSeq.le_of_exists ⟨n, fun j hj => ?_⟩)
state_before: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
⊢ (cauSeqAbs (exp' x + -const (⇑abs) (∑ m ∈ range n, x ^ m / ↑m.factorial))).lim ≤
    abs x ^ n * (↑n.succ * (↑n.factorial * ↑n)⁻¹)
state_after: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ ↑(cauSeqAbs (exp' x + -const (⇑abs) (∑ m ∈ range n, x ^ m / ↑m.factorial))) j ≤
    ↑(const _root_.abs (abs x ^ n * (↑n.succ * (↑n.factorial * ↑n)⁻¹))) j

tactic: simp_rw [← sub_eq_add_neg]
state_before: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ ↑(cauSeqAbs (exp' x + -const (⇑abs) (∑ m ∈ range n, x ^ m / ↑m.factorial))) j ≤
    ↑(const _root_.abs (abs x ^ n * (↑n.succ * (↑n.factorial * ↑n)⁻¹))) j
state_after: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ ↑(cauSeqAbs (exp' x - const (⇑abs) (∑ m ∈ range n, x ^ m / ↑m.factorial))) j ≤
    ↑(const _root_.abs (abs x ^ n * (↑n.succ * (↑n.factorial * ↑n)⁻¹))) j

tactic: show
  abs ((∑ m ∈ range j, x ^ m / m.factorial) - ∑ m ∈ range n, x ^ m / m.factorial) ≤
    abs x ^ n * ((n.succ : ℝ) * (n.factorial * n : ℝ)⁻¹)
state_before: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ ↑(cauSeqAbs (exp' x - const (⇑abs) (∑ m ∈ range n, x ^ m / ↑m.factorial))) j ≤
    ↑(const _root_.abs (abs x ^ n * (↑n.succ * (↑n.factorial * ↑n)⁻¹))) j
state_after: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ abs (∑ m ∈ range j, x ^ m / ↑m.factorial - ∑ m ∈ range n, x ^ m / ↑m.factorial) ≤
    abs x ^ n * (↑n.succ * (↑n.factorial * ↑n)⁻¹)

tactic: rw [sum_range_sub_sum_range hj]
state_before: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ abs (∑ m ∈ range j, x ^ m / ↑m.factorial - ∑ m ∈ range n, x ^ m / ↑m.factorial) ≤
    abs x ^ n * (↑n.succ * (↑n.factorial * ↑n)⁻¹)
state_after: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ abs (∑ k ∈ filter (fun k => n ≤ k) (range j), x ^ k / ↑k.factorial) ≤ abs x ^ n * (↑n.succ * (↑n.factorial * ↑n)⁻¹)

tactic: calc
  abs (∑ m ∈ (range j).filter fun k => n ≤ k, (x ^ m / m.factorial : ℂ)) =
    abs (∑ m ∈ (range j).filter fun k => n ≤ k,
      (x ^ n * (x ^ (m - n) / m.factorial) : ℂ)) := by
    refine congr_arg abs (sum_congr rfl fun m hm => ?_)
    rw [mem_filter, mem_range] at hm
    rw [← mul_div_assoc, ← pow_add, add_tsub_cancel_of_le hm.2]
  _ ≤ ∑ m ∈ filter (fun k => n ≤ k) (range j), abs (x ^ n * (x ^ (m - n) / m.factorial)) :=
    (IsAbsoluteValue.abv_sum Complex.abs _ _)
  _ ≤ ∑ m ∈ filter (fun k => n ≤ k) (range j), abs x ^ n * (1 / m.factorial) := by
    simp_rw [map_mul, map_pow, map_div₀, abs_natCast]
    gcongr
    rw [abv_pow abs]
    exact pow_le_one _ (abs.nonneg _) hx
  _ = abs x ^ n * ∑ m ∈ (range j).filter fun k => n ≤ k, (1 / m.factorial : ℝ) := by
    simp [abs_mul, abv_pow abs, abs_div, ← mul_sum]
  _ ≤ abs x ^ n * (n.succ * (n.factorial * n : ℝ)⁻¹) := by
    gcongr
    exact sum_div_factorial_le _ _ hn
state_before: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ abs (∑ k ∈ filter (fun k => n ≤ k) (range j), x ^ k / ↑k.factorial) ≤ abs x ^ n * (↑n.succ * (↑n.factorial * ↑n)⁻¹)
state_after: no goals

tactic: refine congr_arg abs (sum_congr rfl fun m hm => ?_)
state_before: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ abs (∑ m ∈ filter (fun k => n ≤ k) (range j), x ^ m / ↑m.factorial) =
    abs (∑ m ∈ filter (fun k => n ≤ k) (range j), x ^ n * (x ^ (m - n) / ↑m.factorial))
state_after: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
m : ℕ
hm : m ∈ filter (fun k => n ≤ k) (range j)
⊢ x ^ m / ↑m.factorial = x ^ n * (x ^ (m - n) / ↑m.factorial)

tactic: rw [mem_filter, mem_range] at hm
state_before: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
m : ℕ
hm : m ∈ filter (fun k => n ≤ k) (range j)
⊢ x ^ m / ↑m.factorial = x ^ n * (x ^ (m - n) / ↑m.factorial)
state_after: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
m : ℕ
hm : m < j ∧ n ≤ m
⊢ x ^ m / ↑m.factorial = x ^ n * (x ^ (m - n) / ↑m.factorial)

tactic: rw [← mul_div_assoc, ← pow_add, add_tsub_cancel_of_le hm.2]
state_before: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
m : ℕ
hm : m < j ∧ n ≤ m
⊢ x ^ m / ↑m.factorial = x ^ n * (x ^ (m - n) / ↑m.factorial)
state_after: no goals

tactic: simp_rw [map_mul, map_pow, map_div₀, abs_natCast]
state_before: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ ∑ m ∈ filter (fun k => n ≤ k) (range j), abs (x ^ n * (x ^ (m - n) / ↑m.factorial)) ≤
    ∑ m ∈ filter (fun k => n ≤ k) (range j), abs x ^ n * (1 / ↑m.factorial)
state_after: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ ∑ x_1 ∈ filter (fun k => n ≤ k) (range j), abs x ^ n * (abs (x ^ (x_1 - n)) / ↑x_1.factorial) ≤
    ∑ m ∈ filter (fun k => n ≤ k) (range j), abs x ^ n * (1 / ↑m.factorial)

tactic: gcongr
state_before: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ ∑ x_1 ∈ filter (fun k => n ≤ k) (range j), abs x ^ n * (abs (x ^ (x_1 - n)) / ↑x_1.factorial) ≤
    ∑ m ∈ filter (fun k => n ≤ k) (range j), abs x ^ n * (1 / ↑m.factorial)
state_after: case h.h.hab
x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
i✝ : ℕ
a✝ : i✝ ∈ filter (fun k => n ≤ k) (range j)
⊢ abs (x ^ (i✝ - n)) ≤ 1

tactic: rw [abv_pow abs]
state_before: case h.h.hab
x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
i✝ : ℕ
a✝ : i✝ ∈ filter (fun k => n ≤ k) (range j)
⊢ abs (x ^ (i✝ - n)) ≤ 1
state_after: case h.h.hab
x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
i✝ : ℕ
a✝ : i✝ ∈ filter (fun k => n ≤ k) (range j)
⊢ abs x ^ (i✝ - n) ≤ 1

tactic: exact pow_le_one _ (abs.nonneg _) hx
state_before: case h.h.hab
x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
i✝ : ℕ
a✝ : i✝ ∈ filter (fun k => n ≤ k) (range j)
⊢ abs x ^ (i✝ - n) ≤ 1
state_after: no goals

tactic: simp [abs_mul, abv_pow abs, abs_div, ← mul_sum]
state_before: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ ∑ m ∈ filter (fun k => n ≤ k) (range j), abs x ^ n * (1 / ↑m.factorial) =
    abs x ^ n * ∑ m ∈ filter (fun k => n ≤ k) (range j), 1 / ↑m.factorial
state_after: no goals

tactic: gcongr
state_before: x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ abs x ^ n * ∑ m ∈ filter (fun k => n ≤ k) (range j), 1 / ↑m.factorial ≤ abs x ^ n * (↑n.succ * (↑n.factorial * ↑n)⁻¹)
state_after: case h
x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ ∑ m ∈ filter (fun k => n ≤ k) (range j), 1 / ↑m.factorial ≤ ↑n.succ * (↑n.factorial * ↑n)⁻¹

tactic: exact sum_div_factorial_le _ _ hn
state_before: case h
x : ℂ
hx : abs x ≤ 1
n : ℕ
hn : 0 < n
j : ℕ
hj : j ≥ n
⊢ ∑ m ∈ filter (fun k => n ≤ k) (range j), 1 / ↑m.factorial ≤ ↑n.succ * (↑n.factorial * ↑n)⁻¹
state_after: no goals