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 : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
⊢ abs (cexp x - ∑ m ∈ range n, x ^ m / ↑m.factorial) ≤ abs x ^ n / ↑n.factorial * 2
state_after: x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
⊢ (cauSeqAbs (exp' x + -const (⇑abs) (∑ m ∈ range n, x ^ m / ↑m.factorial))).lim ≤ abs x ^ n / ↑n.factorial * 2

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

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

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

tactic: let k := j - n
state_before: x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj : j ≥ n
⊢ abs (∑ m ∈ range j, x ^ m / ↑m.factorial - ∑ m ∈ range n, x ^ m / ↑m.factorial) ≤ abs x ^ n / ↑n.factorial * 2
state_after: x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj : j ≥ n
k : ℕ := j - n
⊢ abs (∑ m ∈ range j, x ^ m / ↑m.factorial - ∑ m ∈ range n, x ^ m / ↑m.factorial) ≤ abs x ^ n / ↑n.factorial * 2

tactic: have hj : j = n + k := (add_tsub_cancel_of_le hj).symm
state_before: x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj : j ≥ n
k : ℕ := j - n
⊢ abs (∑ m ∈ range j, x ^ m / ↑m.factorial - ∑ m ∈ range n, x ^ m / ↑m.factorial) ≤ abs x ^ n / ↑n.factorial * 2
state_after: x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ abs (∑ m ∈ range j, x ^ m / ↑m.factorial - ∑ m ∈ range n, x ^ m / ↑m.factorial) ≤ abs x ^ n / ↑n.factorial * 2

tactic: rw [hj, sum_range_add_sub_sum_range]
state_before: x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ abs (∑ m ∈ range j, x ^ m / ↑m.factorial - ∑ m ∈ range n, x ^ m / ↑m.factorial) ≤ abs x ^ n / ↑n.factorial * 2
state_after: x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ abs (∑ k ∈ range k, x ^ (n + k) / ↑(n + k).factorial) ≤ abs x ^ n / ↑n.factorial * 2

tactic: calc
  abs (∑ i ∈ range k, x ^ (n + i) / ((n + i).factorial : ℂ)) ≤
      ∑ i ∈ range k, abs (x ^ (n + i) / ((n + i).factorial : ℂ)) :=
    IsAbsoluteValue.abv_sum _ _ _
  _ ≤ ∑ i ∈ range k, abs x ^ (n + i) / (n + i).factorial := by
    simp [Complex.abs_natCast, map_div₀, abv_pow abs]
  _ ≤ ∑ i ∈ range k, abs x ^ (n + i) / ((n.factorial : ℝ) * (n.succ : ℝ) ^ i) := ?_
  _ = ∑ i ∈ range k, abs x ^ n / n.factorial * (abs x ^ i / (n.succ : ℝ) ^ i) := ?_
  _ ≤ abs x ^ n / ↑n.factorial * 2 := ?_
state_before: x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ abs (∑ k ∈ range k, x ^ (n + k) / ↑(n + k).factorial) ≤ abs x ^ n / ↑n.factorial * 2
state_after: case calc_1
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ ∑ i ∈ range k, abs x ^ (n + i) / ↑(n + i).factorial ≤ ∑ i ∈ range k, abs x ^ (n + i) / (↑n.factorial * ↑n.succ ^ i)

case calc_2
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ ∑ i ∈ range k, abs x ^ (n + i) / (↑n.factorial * ↑n.succ ^ i) =
    ∑ i ∈ range k, abs x ^ n / ↑n.factorial * (abs x ^ i / ↑n.succ ^ i)

case calc_3
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ ∑ i ∈ range k, abs x ^ n / ↑n.factorial * (abs x ^ i / ↑n.succ ^ i) ≤ abs x ^ n / ↑n.factorial * 2

tactic: simp [Complex.abs_natCast, map_div₀, abv_pow abs]
state_before: x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ ∑ i ∈ range k, abs (x ^ (n + i) / ↑(n + i).factorial) ≤ ∑ i ∈ range k, abs x ^ (n + i) / ↑(n + i).factorial
state_after: no goals

tactic: gcongr
state_before: case calc_1
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ ∑ i ∈ range k, abs x ^ (n + i) / ↑(n + i).factorial ≤ ∑ i ∈ range k, abs x ^ (n + i) / (↑n.factorial * ↑n.succ ^ i)
state_after: case calc_1.h.h
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
i✝ : ℕ
a✝ : i✝ ∈ range k
⊢ ↑n.factorial * ↑n.succ ^ i✝ ≤ ↑(n + i✝).factorial

tactic: exact mod_cast Nat.factorial_mul_pow_le_factorial
state_before: case calc_1.h.h
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
i✝ : ℕ
a✝ : i✝ ∈ range k
⊢ ↑n.factorial * ↑n.succ ^ i✝ ≤ ↑(n + i✝).factorial
state_after: no goals

tactic: refine Finset.sum_congr rfl fun _ _ => ?_
state_before: case calc_2
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ ∑ i ∈ range k, abs x ^ (n + i) / (↑n.factorial * ↑n.succ ^ i) =
    ∑ i ∈ range k, abs x ^ n / ↑n.factorial * (abs x ^ i / ↑n.succ ^ i)
state_after: case calc_2
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
x✝¹ : ℕ
x✝ : x✝¹ ∈ range k
⊢ abs x ^ (n + x✝¹) / (↑n.factorial * ↑n.succ ^ x✝¹) = abs x ^ n / ↑n.factorial * (abs x ^ x✝¹ / ↑n.succ ^ x✝¹)

tactic: simp only [pow_add, div_eq_inv_mul, mul_inv, mul_left_comm, mul_assoc]
state_before: case calc_2
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
x✝¹ : ℕ
x✝ : x✝¹ ∈ range k
⊢ abs x ^ (n + x✝¹) / (↑n.factorial * ↑n.succ ^ x✝¹) = abs x ^ n / ↑n.factorial * (abs x ^ x✝¹ / ↑n.succ ^ x✝¹)
state_after: no goals

tactic: rw [← mul_sum]
state_before: case calc_3
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ ∑ i ∈ range k, abs x ^ n / ↑n.factorial * (abs x ^ i / ↑n.succ ^ i) ≤ abs x ^ n / ↑n.factorial * 2
state_after: case calc_3
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ abs x ^ n / ↑n.factorial * ∑ i ∈ range k, abs x ^ i / ↑n.succ ^ i ≤ abs x ^ n / ↑n.factorial * 2

tactic: gcongr
state_before: case calc_3
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ abs x ^ n / ↑n.factorial * ∑ i ∈ range k, abs x ^ i / ↑n.succ ^ i ≤ abs x ^ n / ↑n.factorial * 2
state_after: case calc_3.h
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ ∑ i ∈ range k, abs x ^ i / ↑n.succ ^ i ≤ 2

tactic: simp_rw [← div_pow]
state_before: case calc_3.h
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ ∑ i ∈ range k, abs x ^ i / ↑n.succ ^ i ≤ 2
state_after: case calc_3.h
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ ∑ x_1 ∈ range k, (abs x / ↑n.succ) ^ x_1 ≤ 2

tactic: rw [geom_sum_eq, div_le_iff_of_neg]
state_before: case calc_3.h
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ ∑ x_1 ∈ range k, (abs x / ↑n.succ) ^ x_1 ≤ 2
state_after: case calc_3.h
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ 2 * (abs x / ↑n.succ - 1) ≤ (abs x / ↑n.succ) ^ k - 1

case calc_3.h
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ abs x / ↑n.succ - 1 < 0

case calc_3.h.h
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ abs x / ↑n.succ ≠ 1

tactic: trans (-1 : ℝ)
state_before: case calc_3.h
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ 2 * (abs x / ↑n.succ - 1) ≤ (abs x / ↑n.succ) ^ k - 1
state_after: x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ 2 * (abs x / ↑n.succ - 1) ≤ -1

x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ -1 ≤ (abs x / ↑n.succ) ^ k - 1

tactic: linarith
state_before: x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ 2 * (abs x / ↑n.succ - 1) ≤ -1
state_after: no goals

tactic: simp only [neg_le_sub_iff_le_add, div_pow, Nat.cast_succ, le_add_iff_nonneg_left]
state_before: x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ -1 ≤ (abs x / ↑n.succ) ^ k - 1
state_after: x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ 0 ≤ abs x ^ k / (↑n + 1) ^ k

tactic: positivity
state_before: x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ 0 ≤ abs x ^ k / (↑n + 1) ^ k
state_after: no goals

tactic: linarith
state_before: case calc_3.h
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ abs x / ↑n.succ - 1 < 0
state_after: no goals

tactic: linarith
state_before: case calc_3.h.h
x : ℂ
n : ℕ
hx : abs x / ↑n.succ ≤ 1 / 2
j : ℕ
hj✝ : j ≥ n
k : ℕ := j - n
hj : j = n + k
⊢ abs x / ↑n.succ ≠ 1
state_after: no goals