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

Proof steps:
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: 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
⊢ (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: refine lim_le (CauSeq.le_of_exists ⟨n, fun j hj => ?_⟩)
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: 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
⊢ abs (∑ m ∈ range j, x ^ m / ↑m.factorial - ∑ m ∈ range n, x ^ m / ↑m.factorial) ≤
    abs x ^ n * (↑n.succ * (↑n.factorial * ↑n)⁻¹)
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
⊢ 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: rw [sum_range_sub_sum_range hj]
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: 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