Theorem: Real.cos_bound
File: Mathlib/Data/Complex/Exponential.lean

tactic: rw [← abs_ofReal]
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ abs' (cos x - (1 - x ^ 2 / 2)) = ↑Complex.abs (Complex.cos ↑x - (1 - ↑x ^ 2 / 2))

tactic: simp
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ ↑Complex.abs ↑(cos x - (1 - x ^ 2 / 2)) = ↑Complex.abs (Complex.cos ↑x - (1 - ↑x ^ 2 / 2))

tactic: simp [Complex.cos, sub_div, add_div, neg_div, div_self (two_ne_zero' ℂ)]
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ ↑Complex.abs (Complex.cos ↑x - (1 - ↑x ^ 2 / 2)) =
    ↑Complex.abs ((Complex.exp (↑x * I) + Complex.exp (-↑x * I) - (2 - ↑x ^ 2)) / 2)

tactic: simp only [sum_range_succ]
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ Complex.exp (↑x * I) + Complex.exp (-↑x * I) - (2 - ↑x ^ 2) =
    Complex.exp (↑x * I) - ∑ m in range 4, (↑x * I) ^ m / ↑(Nat.factorial m) +
      (Complex.exp (-↑x * I) - ∑ m in range 4, (-↑x * I) ^ m / ↑(Nat.factorial m))

tactic: simp [pow_succ]
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ Complex.exp (↑x * I) + Complex.exp (-↑x * I) - (2 - ↑x ^ 2) =
    Complex.exp (↑x * I) -
        (∑ m in range 0, (↑x * I) ^ m / ↑(Nat.factorial m) + (↑x * I) ^ 0 / ↑(Nat.factorial 0) +
              (↑x * I) ^ 1 / ↑(Nat.factorial 1) +
            (↑x * I) ^ 2 / ↑(Nat.factorial 2) +
          (↑x * I) ^ 3 / ↑(Nat.factorial 3)) +
      (Complex.exp (-↑x * I) -
        (∑ m in range 0, (-↑x * I) ^ m / ↑(Nat.factorial m) + (-↑x * I) ^ 0 / ↑(Nat.factorial 0) +
              (-↑x * I) ^ 1 / ↑(Nat.factorial 1) +
            (-↑x * I) ^ 2 / ↑(Nat.factorial 2) +
          (-↑x * I) ^ 3 / ↑(Nat.factorial 3)))

tactic: apply Complex.ext <;> simp [div_eq_mul_inv, normSq] <;> ring_nf
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ Complex.exp (↑x * I) + Complex.exp (-(↑x * I)) - (2 - ↑x * ↑x) =
    Complex.exp (↑x * I) -
        (1 + ↑x * I + ↑x * I * (↑x * I) / (1 + 1) + ↑x * I * (↑x * I * (↑x * I)) / ((2 + 1) * (1 + 1))) +
      (Complex.exp (-(↑x * I)) -
        (1 + -(↑x * I) + ↑x * I * (↑x * I) / (1 + 1) + -(↑x * I * (↑x * I * (↑x * I))) / ((2 + 1) * (1 + 1))))

tactic: rw [add_div]
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ ↑Complex.abs
      ((Complex.exp (↑x * I) - ∑ m in range 4, (↑x * I) ^ m / ↑(Nat.factorial m) +
          (Complex.exp (-↑x * I) - ∑ m in range 4, (-↑x * I) ^ m / ↑(Nat.factorial m))) /
        2) ≤
    ↑Complex.abs ((Complex.exp (↑x * I) - ∑ m in range 4, (↑x * I) ^ m / ↑(Nat.factorial m)) / 2) +
      ↑Complex.abs ((Complex.exp (-↑x * I) - ∑ m in range 4, (-↑x * I) ^ m / ↑(Nat.factorial m)) / 2)

tactic: exact Complex.abs.add_le _ _
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ ↑Complex.abs
      ((Complex.exp (↑x * I) - ∑ m in range 4, (↑x * I) ^ m / ↑(Nat.factorial m)) / 2 +
        (Complex.exp (-↑x * I) - ∑ m in range 4, (-↑x * I) ^ m / ↑(Nat.factorial m)) / 2) ≤
    ↑Complex.abs ((Complex.exp (↑x * I) - ∑ m in range 4, (↑x * I) ^ m / ↑(Nat.factorial m)) / 2) +
      ↑Complex.abs ((Complex.exp (-↑x * I) - ∑ m in range 4, (-↑x * I) ^ m / ↑(Nat.factorial m)) / 2)

tactic: simp [map_div₀]
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ ↑Complex.abs ((Complex.exp (↑x * I) - ∑ m in range 4, (↑x * I) ^ m / ↑(Nat.factorial m)) / 2) +
      ↑Complex.abs ((Complex.exp (-↑x * I) - ∑ m in range 4, (-↑x * I) ^ m / ↑(Nat.factorial m)) / 2) =
    ↑Complex.abs (Complex.exp (↑x * I) - ∑ m in range 4, (↑x * I) ^ m / ↑(Nat.factorial m)) / 2 +
      ↑Complex.abs (Complex.exp (-↑x * I) - ∑ m in range 4, (-↑x * I) ^ m / ↑(Nat.factorial m)) / 2

tactic: gcongr
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ ↑Complex.abs (Complex.exp (↑x * I) - ∑ m in range 4, (↑x * I) ^ m / ↑(Nat.factorial m)) / 2 +
      ↑Complex.abs (Complex.exp (-↑x * I) - ∑ m in range 4, (-↑x * I) ^ m / ↑(Nat.factorial m)) / 2 ≤
    ↑Complex.abs (↑x * I) ^ 4 * (↑(Nat.succ 4) * (↑(Nat.factorial 4) * ↑4)⁻¹) / 2 +
      ↑Complex.abs (-↑x * I) ^ 4 * (↑(Nat.succ 4) * (↑(Nat.factorial 4) * ↑4)⁻¹) / 2

tactic: exact Complex.exp_bound (by simpa) (by decide)
state_before: case h₁.h
x : ℝ
hx : abs' x ≤ 1
⊢ ↑Complex.abs (Complex.exp (↑x * I) - ∑ m in range 4, (↑x * I) ^ m / ↑(Nat.factorial m)) ≤
    ↑Complex.abs (↑x * I) ^ 4 * (↑(Nat.succ 4) * (↑(Nat.factorial 4) * ↑4)⁻¹)

tactic: simpa
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ ↑Complex.abs (↑x * I) ≤ 1

tactic: decide
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ 0 < 4

tactic: exact Complex.exp_bound (by simpa) (by decide)
state_before: case h₂.h
x : ℝ
hx : abs' x ≤ 1
⊢ ↑Complex.abs (Complex.exp (-↑x * I) - ∑ m in range 4, (-↑x * I) ^ m / ↑(Nat.factorial m)) ≤
    ↑Complex.abs (-↑x * I) ^ 4 * (↑(Nat.succ 4) * (↑(Nat.factorial 4) * ↑4)⁻¹)

tactic: simpa
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ ↑Complex.abs (-↑x * I) ≤ 1

tactic: decide
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ 0 < 4

tactic: norm_num
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ ↑Complex.abs (↑x * I) ^ 4 * (↑(Nat.succ 4) * (↑(Nat.factorial 4) * ↑4)⁻¹) / 2 +
      ↑Complex.abs (-↑x * I) ^ 4 * (↑(Nat.succ 4) * (↑(Nat.factorial 4) * ↑4)⁻¹) / 2 ≤
    abs' x ^ 4 * (5 / 96)