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

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

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

tactic: simp [Complex.sin, sub_div, add_div, neg_div, mul_div_cancel_left _ (two_ne_zero' ℂ), div_div,
  show (3 : ℂ) * 2 = 6 by norm_num]
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ ↑Complex.abs (Complex.sin ↑x - ↑(x - x ^ 3 / 6)) =
    ↑Complex.abs (((Complex.exp (-↑x * I) - Complex.exp (↑x * I)) * I - ↑(2 * x - x ^ 3 / 3)) / 2)

tactic: norm_num
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ 3 * 2 = 6

tactic: simp only [sum_range_succ]
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ (Complex.exp (-↑x * I) - Complex.exp (↑x * I)) * I - ↑(2 * x - x ^ 3 / 3) =
    (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))) *
      I

tactic: simp [pow_succ]
state_before: x : ℝ
hx : abs' x ≤ 1
⊢ (Complex.exp (-↑x * I) - Complex.exp (↑x * I)) * I - ↑(2 * x - x ^ 3 / 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)) -
        (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)))) *
      I

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

tactic: ring
state_before: case a
x : ℝ
hx : abs' x ≤ 1
⊢ sin x - (Complex.exp (-(↑x * I))).im - (2 * x - x * (x * x) * 3⁻¹) =
    sin x - (x + -(x * (x * x) * ((1 + 1)⁻¹ * ((2 + 1) * ((2 + 1)⁻¹ * (2 + 1)⁻¹))))) -
      ((Complex.exp (-(↑x * I))).im - (-x + x * (x * x) * ((1 + 1)⁻¹ * ((2 + 1) * ((2 + 1)⁻¹ * (2 + 1)⁻¹)))))

tactic: rw [sub_mul, sub_eq_add_neg, 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))) *
          I /
        2) ≤
    ↑Complex.abs ((Complex.exp (-↑x * I) - ∑ m in range 4, (-↑x * I) ^ m / ↑(Nat.factorial m)) * I / 2) +
      ↑Complex.abs (-((Complex.exp (↑x * I) - ∑ m in range 4, (↑x * I) ^ m / ↑(Nat.factorial m)) * I) / 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)) * I / 2 +
        -((Complex.exp (↑x * I) - ∑ m in range 4, (↑x * I) ^ m / ↑(Nat.factorial m)) * I) / 2) ≤
    ↑Complex.abs ((Complex.exp (-↑x * I) - ∑ m in range 4, (-↑x * I) ^ m / ↑(Nat.factorial m)) * I / 2) +
      ↑Complex.abs (-((Complex.exp (↑x * I) - ∑ m in range 4, (↑x * I) ^ m / ↑(Nat.factorial m)) * I) / 2)

tactic: simp [add_comm, 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)) * I / 2) +
      ↑Complex.abs (-((Complex.exp (↑x * I) - ∑ m in range 4, (↑x * I) ^ m / ↑(Nat.factorial m)) * I) / 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)