l3lab/ntp-mathlib huggingface dataset:
theorem sin_three_mul : sin (3 * x) = 3 * sin x - 4 * sin x ^ 3 := by
  have h1 : x + 2 * x = 3 * x := by ring
  rw [← h1, sin_add x (2 * x)]
  simp only [cos_two_mul, sin_two_mul, cos_sq']
  have h2 : cos x * (2 * sin x * cos x) = 2 * sin x * cos x ^ 2 := by ring
  rw [h2, cos_sq']
  

Proof state:
x y : ℂ
h1 : x + 2 * x = 3 * x
h2 : cos x * (2 * sin x * cos x) = 2 * sin x * cos x ^ 2
⊢ sin x * (2 * (1 - sin x ^ 2) - 1) + 2 * sin x * (1 - sin x ^ 2) = 3 * sin x - 4 * sin x ^ 3

Next tactic:
ring
theorem exp_add_mul_I : exp (x + y * I) = exp x * (cos y + sin y * I) := by 

Proof state:
x y : ℂ
⊢ cexp (x + y * I) = cexp x * (cos y + sin y * I)

Next tactic:
rw [exp_add, exp_mul_I]
theorem exp_eq_exp_re_mul_sin_add_cos : exp x = exp x.re * (cos x.im + sin x.im * I) := by
  

Proof state:
x y : ℂ
⊢ cexp x = cexp ↑x.re * (cos ↑x.im + sin ↑x.im * I)

Next tactic:
rw [← exp_add_mul_I, re_add_im]
theorem exp_re : (exp x).re = Real.exp x.re * Real.cos x.im := by
  

Proof state:
x y : ℂ
⊢ (cexp x).re = Real.exp x.re * Real.cos x.im

Next tactic:
rw [exp_eq_exp_re_mul_sin_add_cos]
theorem exp_re : (exp x).re = Real.exp x.re * Real.cos x.im := by
  rw [exp_eq_exp_re_mul_sin_add_cos]
  

Proof state:
x y : ℂ
⊢ (cexp ↑x.re * (cos ↑x.im + sin ↑x.im * I)).re = Real.exp x.re * Real.cos x.im

Next tactic:
simp [exp_ofReal_re, cos_ofReal_re]
theorem exp_im : (exp x).im = Real.exp x.re * Real.sin x.im := by
  

Proof state:
x y : ℂ
⊢ (cexp x).im = Real.exp x.re * Real.sin x.im

Next tactic:
rw [exp_eq_exp_re_mul_sin_add_cos]
theorem exp_im : (exp x).im = Real.exp x.re * Real.sin x.im := by
  rw [exp_eq_exp_re_mul_sin_add_cos]
  

Proof state:
x y : ℂ
⊢ (cexp ↑x.re * (cos ↑x.im + sin ↑x.im * I)).im = Real.exp x.re * Real.sin x.im

Next tactic:
simp [exp_ofReal_re, sin_ofReal_re]
@[simp]
theorem exp_ofReal_mul_I_re (x : ℝ) : (exp (x * I)).re = Real.cos x := by
  

Proof state:
x✝ y : ℂ
x : ℝ
⊢ (cexp (↑x * I)).re = Real.cos x

Next tactic:
simp [exp_mul_I, cos_ofReal_re]
@[simp]
theorem exp_ofReal_mul_I_im (x : ℝ) : (exp (x * I)).im = Real.sin x := by
  

Proof state:
x✝ y : ℂ
x : ℝ
⊢ (cexp (↑x * I)).im = Real.sin x

Next tactic:
simp [exp_mul_I, sin_ofReal_re]
/-- **De Moivre's formula** -/
theorem cos_add_sin_mul_I_pow (n : ℕ) (z : ℂ) :
    (cos z + sin z * I) ^ n = cos (↑n * z) + sin (↑n * z) * I := by
  

Proof state:
x y : ℂ
n : ℕ
z : ℂ
⊢ (cos z + sin z * I) ^ n = cos (↑n * z) + sin (↑n * z) * I

Next tactic:
rw [← exp_mul_I, ← exp_mul_I]
/-- **De Moivre's formula** -/
theorem cos_add_sin_mul_I_pow (n : ℕ) (z : ℂ) :
    (cos z + sin z * I) ^ n = cos (↑n * z) + sin (↑n * z) * I := by
  rw [← exp_mul_I, ← exp_mul_I]
  

Proof state:
x y : ℂ
n : ℕ
z : ℂ
⊢ cexp (z * I) ^ n = cexp (↑n * z * I)

Next tactic:
induction' n with n ih
/-- **De Moivre's formula** -/
theorem cos_add_sin_mul_I_pow (n : ℕ) (z : ℂ) :
    (cos z + sin z * I) ^ n = cos (↑n * z) + sin (↑n * z) * I := by
  rw [← exp_mul_I, ← exp_mul_I]
  induction' n with n ih
  · 

Proof state:
case zero
x y z : ℂ
⊢ cexp (z * I) ^ Nat.zero = cexp (↑Nat.zero * z * I)

Next tactic:
rw [pow_zero, Nat.cast_zero, zero_mul, zero_mul, exp_zero]
/-- **De Moivre's formula** -/
theorem cos_add_sin_mul_I_pow (n : ℕ) (z : ℂ) :
    (cos z + sin z * I) ^ n = cos (↑n * z) + sin (↑n * z) * I := by
  rw [← exp_mul_I, ← exp_mul_I]
  induction' n with n ih
  · rw [pow_zero, Nat.cast_zero, zero_mul, zero_mul, exp_zero]
  · 

Proof state:
case succ
x y z : ℂ
n : ℕ
ih : cexp (z * I) ^ n = cexp (↑n * z * I)
⊢ cexp (z * I) ^ Nat.succ n = cexp (↑(Nat.succ n) * z * I)

Next tactic:
rw [pow_succ', ih, Nat.cast_succ, add_mul, add_mul, one_mul, exp_add]
@[simp]
theorem exp_zero : exp 0 = 1 := by 

Proof state:
x y : ℝ
⊢ rexp 0 = 1

Next tactic:
simp [Real.exp]
nonrec theorem exp_add : exp (x + y) = exp x * exp y := by 

Proof state:
x y : ℝ
⊢ rexp (x + y) = rexp x * rexp y

Next tactic:
simp [exp_add, exp]
/-- the exponential function as a monoid hom from `Multiplicative ℝ` to `ℝ` -/
noncomputable def expMonoidHom : MonoidHom (Multiplicative ℝ) ℝ :=
  { toFun := fun x => exp (Multiplicative.toAdd x),
    map_one' := by 

Proof state:
x y : ℝ
⊢ (fun x => rexp (Multiplicative.toAdd x)) 1 = 1

Next tactic:
simp
/-- the exponential function as a monoid hom from `Multiplicative ℝ` to `ℝ` -/
noncomputable def expMonoidHom : MonoidHom (Multiplicative ℝ) ℝ :=
  { toFun := fun x => exp (Multiplicative.toAdd x),
    map_one' := by simp,
    map_mul' := by 

Proof state:
x y : ℝ
⊢ ∀ (x y : Multiplicative ℝ),
    OneHom.toFun { toFun := fun x => rexp (Multiplicative.toAdd x), map_one' := (_ : rexp 0 = 1) } (x * y) =
      OneHom.toFun { toFun := fun x => rexp (Multiplicative.toAdd x), map_one' := (_ : rexp 0 = 1) } x *
        OneHom.toFun { toFun := fun x => rexp (Multiplicative.toAdd x), map_one' := (_ : rexp 0 = 1) } y

Next tactic:
simp [exp_add]
nonrec theorem exp_nat_mul (x : ℝ) (n : ℕ) : exp (n * x) = exp x ^ n :=
  ofReal_injective (by 

Proof state:
x✝ y x : ℝ
n : ℕ
⊢ ↑(rexp (↑n * x)) = ↑(rexp x ^ n)

Next tactic:
simp [exp_nat_mul]
nonrec theorem exp_ne_zero : exp x ≠ 0 := fun h =>
  exp_ne_zero x <| by 

Proof state:
x y : ℝ
h : rexp x = 0
⊢ cexp ↑x = 0

Next tactic:
rw [exp, ← ofReal_inj] at h
nonrec theorem exp_ne_zero : exp x ≠ 0 := fun h =>
  exp_ne_zero x <| by rw [exp, ← ofReal_inj] at h; 

Proof state:
x y : ℝ
h : ↑(cexp ↑x).re = ↑0
⊢ cexp ↑x = 0

Next tactic:
simp_all
nonrec theorem exp_neg : exp (-x) = (exp x)⁻¹ :=
  ofReal_injective <| by 

Proof state:
x y : ℝ
⊢ ↑(rexp (-x)) = ↑(rexp x)⁻¹

Next tactic:
simp [exp_neg]
theorem exp_sub : exp (x - y) = exp x / exp y := by
  

Proof state:
x y : ℝ
⊢ rexp (x - y) = rexp x / rexp y

Next tactic:
simp [sub_eq_add_neg, exp_add, exp_neg, div_eq_mul_inv]
@[simp]
theorem sin_zero : sin 0 = 0 := by 

Proof state:
x y : ℝ
⊢ sin 0 = 0

Next tactic:
simp [sin]
@[simp]
theorem sin_neg : sin (-x) = -sin x := by 

Proof state:
x y : ℝ
⊢ sin (-x) = -sin x

Next tactic:
simp [sin, exp_neg, (neg_div _ _).symm, add_mul]
nonrec theorem sin_add : sin (x + y) = sin x * cos y + cos x * sin y :=
  ofReal_injective <| by 

Proof state:
x y : ℝ
⊢ ↑(sin (x + y)) = ↑(sin x * cos y + cos x * sin y)

Next tactic:
simp [sin_add]
@[simp]
theorem cos_zero : cos 0 = 1 := by 

Proof state:
x y : ℝ
⊢ cos 0 = 1

Next tactic:
simp [cos]
@[simp]
theorem cos_neg : cos (-x) = cos x := by 

Proof state:
x y : ℝ
⊢ cos (-x) = cos x

Next tactic:
simp [cos, exp_neg]
@[simp]
theorem cos_abs : cos |x| = cos x := by
  

Proof state:
x y : ℝ
⊢ cos (abs' x) = cos x

Next tactic:
cases le_total x 0
@[simp]
theorem cos_abs : cos |x| = cos x := by
  cases le_total x 0 <;> 

Proof state:
case inl
x y : ℝ
h✝ : x ≤ 0
⊢ cos (abs' x) = cos x

Next tactic:
simp only [*, _root_.abs_of_nonneg, abs_of_nonpos, cos_neg]
@[simp]
theorem cos_abs : cos |x| = cos x := by
  cases le_total x 0 <;> 

Proof state:
case inr
x y : ℝ
h✝ : 0 ≤ x
⊢ cos (abs' x) = cos x

Next tactic:
simp only [*, _root_.abs_of_nonneg, abs_of_nonpos, cos_neg]
nonrec theorem cos_add : cos (x + y) = cos x * cos y - sin x * sin y :=
  ofReal_injective <| by 

Proof state:
x y : ℝ
⊢ ↑(cos (x + y)) = ↑(cos x * cos y - sin x * sin y)

Next tactic:
simp [cos_add]
theorem sin_sub : sin (x - y) = sin x * cos y - cos x * sin y := by
  

Proof state:
x y : ℝ
⊢ sin (x - y) = sin x * cos y - cos x * sin y

Next tactic:
simp [sub_eq_add_neg, sin_add, sin_neg, cos_neg]
theorem cos_sub : cos (x - y) = cos x * cos y + sin x * sin y := by
  

Proof state:
x y : ℝ
⊢ cos (x - y) = cos x * cos y + sin x * sin y

Next tactic:
simp [sub_eq_add_neg, cos_add, sin_neg, cos_neg]
nonrec theorem sin_sub_sin : sin x - sin y = 2 * sin ((x - y) / 2) * cos ((x + y) / 2) :=
  ofReal_injective <| by 

Proof state:
x y : ℝ
⊢ ↑(sin x - sin y) = ↑(2 * sin ((x - y) / 2) * cos ((x + y) / 2))

Next tactic:
simp [sin_sub_sin]
nonrec theorem cos_sub_cos : cos x - cos y = -2 * sin ((x + y) / 2) * sin ((x - y) / 2) :=
  ofReal_injective <| by 

Proof state:
x y : ℝ
⊢ ↑(cos x - cos y) = ↑(-2 * sin ((x + y) / 2) * sin ((x - y) / 2))

Next tactic:
simp [cos_sub_cos]
nonrec theorem cos_add_cos : cos x + cos y = 2 * cos ((x + y) / 2) * cos ((x - y) / 2) :=
  ofReal_injective <| by 

Proof state:
x y : ℝ
⊢ ↑(cos x + cos y) = ↑(2 * cos ((x + y) / 2) * cos ((x - y) / 2))

Next tactic:
simp [cos_add_cos]
nonrec theorem tan_eq_sin_div_cos : tan x = sin x / cos x :=
  ofReal_injective <| by 

Proof state:
x y : ℝ
⊢ ↑(tan x) = ↑(sin x / cos x)

Next tactic:
simp [tan_eq_sin_div_cos]
theorem tan_mul_cos {x : ℝ} (hx : cos x ≠ 0) : tan x * cos x = sin x := by
  

Proof state:
x✝ y x : ℝ
hx : cos x ≠ 0
⊢ tan x * cos x = sin x

Next tactic:
rw [tan_eq_sin_div_cos, div_mul_cancel _ hx]
@[simp]
theorem tan_zero : tan 0 = 0 := by 

Proof state:
x y : ℝ
⊢ tan 0 = 0

Next tactic:
simp [tan]
@[simp]
theorem tan_neg : tan (-x) = -tan x := by 

Proof state:
x y : ℝ
⊢ tan (-x) = -tan x

Next tactic:
simp [tan, neg_div]
@[simp]
nonrec theorem sin_sq_add_cos_sq : sin x ^ 2 + cos x ^ 2 = 1 :=
  ofReal_injective (by 

Proof state:
x y : ℝ
⊢ ↑(sin x ^ 2 + cos x ^ 2) = ↑1

Next tactic:
simp [sin_sq_add_cos_sq]
@[simp]
theorem cos_sq_add_sin_sq : cos x ^ 2 + sin x ^ 2 = 1 := by 

Proof state:
x y : ℝ
⊢ cos x ^ 2 + sin x ^ 2 = 1

Next tactic:
rw [add_comm, sin_sq_add_cos_sq]
theorem sin_sq_le_one : sin x ^ 2 ≤ 1 := by
  

Proof state:
x y : ℝ
⊢ sin x ^ 2 ≤ 1

Next tactic:
rw [← sin_sq_add_cos_sq x]
theorem sin_sq_le_one : sin x ^ 2 ≤ 1 := by
  rw [← sin_sq_add_cos_sq x]; 

Proof state:
x y : ℝ
⊢ sin x ^ 2 ≤ sin x ^ 2 + cos x ^ 2

Next tactic:
exact le_add_of_nonneg_right (sq_nonneg _)
theorem cos_sq_le_one : cos x ^ 2 ≤ 1 := by
  

Proof state:
x y : ℝ
⊢ cos x ^ 2 ≤ 1

Next tactic:
rw [← sin_sq_add_cos_sq x]
theorem cos_sq_le_one : cos x ^ 2 ≤ 1 := by
  rw [← sin_sq_add_cos_sq x]; 

Proof state:
x y : ℝ
⊢ cos x ^ 2 ≤ sin x ^ 2 + cos x ^ 2

Next tactic:
exact le_add_of_nonneg_left (sq_nonneg _)
theorem abs_sin_le_one : |sin x| ≤ 1 :=
  abs_le_one_iff_mul_self_le_one.2 <| by 

Proof state:
x y : ℝ
⊢ sin x * sin x ≤ 1

Next tactic:
simp only [← sq, sin_sq_le_one]
theorem abs_cos_le_one : |cos x| ≤ 1 :=
  abs_le_one_iff_mul_self_le_one.2 <| by 

Proof state:
x y : ℝ
⊢ cos x * cos x ≤ 1

Next tactic:
simp only [← sq, cos_sq_le_one]
nonrec theorem cos_two_mul : cos (2 * x) = 2 * cos x ^ 2 - 1 :=
  ofReal_injective <| by 

Proof state:
x y : ℝ
⊢ ↑(cos (2 * x)) = ↑(2 * cos x ^ 2 - 1)

Next tactic:
simp [cos_two_mul]
nonrec theorem cos_two_mul' : cos (2 * x) = cos x ^ 2 - sin x ^ 2 :=
  ofReal_injective <| by 

Proof state:
x y : ℝ
⊢ ↑(cos (2 * x)) = ↑(cos x ^ 2 - sin x ^ 2)

Next tactic:
simp [cos_two_mul']
nonrec theorem sin_two_mul : sin (2 * x) = 2 * sin x * cos x :=
  ofReal_injective <| by 

Proof state:
x y : ℝ
⊢ ↑(sin (2 * x)) = ↑(2 * sin x * cos x)

Next tactic:
simp [sin_two_mul]
nonrec theorem cos_sq : cos x ^ 2 = 1 / 2 + cos (2 * x) / 2 :=
  ofReal_injective <| by 

Proof state:
x y : ℝ
⊢ ↑(cos x ^ 2) = ↑(1 / 2 + cos (2 * x) / 2)

Next tactic:
simp [cos_sq]
theorem cos_sq' : cos x ^ 2 = 1 - sin x ^ 2 := by 

Proof state:
x y : ℝ
⊢ cos x ^ 2 = 1 - sin x ^ 2

Next tactic:
rw [← sin_sq_add_cos_sq x, add_sub_cancel']
lemma sin_sq_eq_half_sub : sin x ^ 2 = 1 / 2 - cos (2 * x) / 2 := by
  

Proof state:
x y : ℝ
⊢ sin x ^ 2 = 1 / 2 - cos (2 * x) / 2

Next tactic:
rw [sin_sq, cos_sq, ← sub_sub, sub_half]
theorem abs_sin_eq_sqrt_one_sub_cos_sq (x : ℝ) : |sin x| = sqrt (1 - cos x ^ 2) := by
  

Proof state:
x✝ y x : ℝ
⊢ abs' (sin x) = sqrt (1 - cos x ^ 2)

Next tactic:
rw [← sin_sq, sqrt_sq_eq_abs]
theorem abs_cos_eq_sqrt_one_sub_sin_sq (x : ℝ) : |cos x| = sqrt (1 - sin x ^ 2) := by
  

Proof state:
x✝ y x : ℝ
⊢ abs' (cos x) = sqrt (1 - sin x ^ 2)

Next tactic:
rw [← cos_sq', sqrt_sq_eq_abs]
theorem inv_one_add_tan_sq {x : ℝ} (hx : cos x ≠ 0) : (1 + tan x ^ 2)⁻¹ = cos x ^ 2 :=
  have : Complex.cos x ≠ 0 := mt (congr_arg re) hx
  ofReal_inj.1 <| by 

Proof state:
x✝ y x : ℝ
hx : cos x ≠ 0
this : Complex.cos ↑x ≠ 0
⊢ ↑(1 + tan x ^ 2)⁻¹ = ↑(cos x ^ 2)

Next tactic:
simpa using Complex.inv_one_add_tan_sq this
theorem tan_sq_div_one_add_tan_sq {x : ℝ} (hx : cos x ≠ 0) :
    tan x ^ 2 / (1 + tan x ^ 2) = sin x ^ 2 := by
  

Proof state:
x✝ y x : ℝ
hx : cos x ≠ 0
⊢ tan x ^ 2 / (1 + tan x ^ 2) = sin x ^ 2

Next tactic:
simp only [← tan_mul_cos hx, mul_pow, ← inv_one_add_tan_sq hx, div_eq_mul_inv, one_mul]
theorem inv_sqrt_one_add_tan_sq {x : ℝ} (hx : 0 < cos x) : (sqrt (1 + tan x ^ 2))⁻¹ = cos x := by
  

Proof state:
x✝ y x : ℝ
hx : 0 < cos x
⊢ (sqrt (1 + tan x ^ 2))⁻¹ = cos x

Next tactic:
rw [← sqrt_sq hx.le, ← sqrt_inv, inv_one_add_tan_sq hx.ne']
theorem tan_div_sqrt_one_add_tan_sq {x : ℝ} (hx : 0 < cos x) :
    tan x / sqrt (1 + tan x ^ 2) = sin x := by
  

Proof state:
x✝ y x : ℝ
hx : 0 < cos x
⊢ tan x / sqrt (1 + tan x ^ 2) = sin x

Next tactic:
rw [← tan_mul_cos hx.ne', ← inv_sqrt_one_add_tan_sq hx, div_eq_mul_inv]
nonrec theorem cos_three_mul : cos (3 * x) = 4 * cos x ^ 3 - 3 * cos x := by
  

Proof state:
x y : ℝ
⊢ cos (3 * x) = 4 * cos x ^ 3 - 3 * cos x

Next tactic:
rw [← ofReal_inj]
nonrec theorem cos_three_mul : cos (3 * x) = 4 * cos x ^ 3 - 3 * cos x := by
  rw [← ofReal_inj]; 

Proof state:
x y : ℝ
⊢ ↑(cos (3 * x)) = ↑(4 * cos x ^ 3 - 3 * cos x)

Next tactic:
simp [cos_three_mul]
nonrec theorem sin_three_mul : sin (3 * x) = 3 * sin x - 4 * sin x ^ 3 := by
  

Proof state:
x y : ℝ
⊢ sin (3 * x) = 3 * sin x - 4 * sin x ^ 3

Next tactic:
rw [← ofReal_inj]
nonrec theorem sin_three_mul : sin (3 * x) = 3 * sin x - 4 * sin x ^ 3 := by
  rw [← ofReal_inj]; 

Proof state:
x y : ℝ
⊢ ↑(sin (3 * x)) = ↑(3 * sin x - 4 * sin x ^ 3)

Next tactic:
simp [sin_three_mul]
/-- The definition of `sinh` in terms of `exp`. -/
nonrec theorem sinh_eq (x : ℝ) : sinh x = (exp x - exp (-x)) / 2 :=
  ofReal_injective <| by 

Proof state:
x✝ y x : ℝ
⊢ ↑(sinh x) = ↑((rexp x - rexp (-x)) / 2)

Next tactic:
simp [Complex.sinh]
@[simp]
theorem sinh_zero : sinh 0 = 0 := by 

Proof state:
x y : ℝ
⊢ sinh 0 = 0

Next tactic:
simp [sinh]
@[simp]
theorem sinh_neg : sinh (-x) = -sinh x := by 

Proof state:
x y : ℝ
⊢ sinh (-x) = -sinh x

Next tactic:
simp [sinh, exp_neg, (neg_div _ _).symm, add_mul]
nonrec theorem sinh_add : sinh (x + y) = sinh x * cosh y + cosh x * sinh y := by
  

Proof state:
x y : ℝ
⊢ sinh (x + y) = sinh x * cosh y + cosh x * sinh y

Next tactic:
rw [← ofReal_inj]
nonrec theorem sinh_add : sinh (x + y) = sinh x * cosh y + cosh x * sinh y := by
  rw [← ofReal_inj]; 

Proof state:
x y : ℝ
⊢ ↑(sinh (x + y)) = ↑(sinh x * cosh y + cosh x * sinh y)

Next tactic:
simp [sinh_add]
/-- The definition of `cosh` in terms of `exp`. -/
theorem cosh_eq (x : ℝ) : cosh x = (exp x + exp (-x)) / 2 :=
  eq_div_of_mul_eq two_ne_zero <| by
    

Proof state:
x✝ y x : ℝ
⊢ cosh x * 2 = rexp x + rexp (-x)

Next tactic:
rw [cosh, exp, exp, Complex.ofReal_neg, Complex.cosh, mul_two, ← Complex.add_re, ← mul_two,
      div_mul_cancel _ (two_ne_zero' ℂ), Complex.add_re]
@[simp]
theorem cosh_zero : cosh 0 = 1 := by 

Proof state:
x y : ℝ
⊢ cosh 0 = 1

Next tactic:
simp [cosh]
@[simp]
theorem cosh_neg : cosh (-x) = cosh x :=
  ofReal_inj.1 <| by 

Proof state:
x y : ℝ
⊢ ↑(cosh (-x)) = ↑(cosh x)

Next tactic:
simp
@[simp]
theorem cosh_abs : cosh |x| = cosh x := by
  

Proof state:
x y : ℝ
⊢ cosh (abs' x) = cosh x

Next tactic:
cases le_total x 0
@[simp]
theorem cosh_abs : cosh |x| = cosh x := by
  cases le_total x 0 <;> 

Proof state:
case inl
x y : ℝ
h✝ : x ≤ 0
⊢ cosh (abs' x) = cosh x

Next tactic:
simp [*, _root_.abs_of_nonneg, abs_of_nonpos]
@[simp]
theorem cosh_abs : cosh |x| = cosh x := by
  cases le_total x 0 <;> 

Proof state:
case inr
x y : ℝ
h✝ : 0 ≤ x
⊢ cosh (abs' x) = cosh x

Next tactic:
simp [*, _root_.abs_of_nonneg, abs_of_nonpos]
nonrec theorem cosh_add : cosh (x + y) = cosh x * cosh y + sinh x * sinh y := by
  

Proof state:
x y : ℝ
⊢ cosh (x + y) = cosh x * cosh y + sinh x * sinh y

Next tactic:
rw [← ofReal_inj]
nonrec theorem cosh_add : cosh (x + y) = cosh x * cosh y + sinh x * sinh y := by
  rw [← ofReal_inj]; 

Proof state:
x y : ℝ
⊢ ↑(cosh (x + y)) = ↑(cosh x * cosh y + sinh x * sinh y)

Next tactic:
simp [cosh_add]
theorem sinh_sub : sinh (x - y) = sinh x * cosh y - cosh x * sinh y := by
  

Proof state:
x y : ℝ
⊢ sinh (x - y) = sinh x * cosh y - cosh x * sinh y

Next tactic:
simp [sub_eq_add_neg, sinh_add, sinh_neg, cosh_neg]
theorem cosh_sub : cosh (x - y) = cosh x * cosh y - sinh x * sinh y := by
  

Proof state:
x y : ℝ
⊢ cosh (x - y) = cosh x * cosh y - sinh x * sinh y

Next tactic:
simp [sub_eq_add_neg, cosh_add, sinh_neg, cosh_neg]
nonrec theorem tanh_eq_sinh_div_cosh : tanh x = sinh x / cosh x :=
  ofReal_inj.1 <| by 

Proof state:
x y : ℝ
⊢ ↑(tanh x) = ↑(sinh x / cosh x)

Next tactic:
simp [tanh_eq_sinh_div_cosh]
@[simp]
theorem tanh_zero : tanh 0 = 0 := by 

Proof state:
x y : ℝ
⊢ tanh 0 = 0

Next tactic:
simp [tanh]
@[simp]
theorem tanh_neg : tanh (-x) = -tanh x := by 

Proof state:
x y : ℝ
⊢ tanh (-x) = -tanh x

Next tactic:
simp [tanh, neg_div]
@[simp]
theorem cosh_add_sinh : cosh x + sinh x = exp x := by 

Proof state:
x y : ℝ
⊢ cosh x + sinh x = rexp x

Next tactic:
rw [← ofReal_inj]
@[simp]
theorem cosh_add_sinh : cosh x + sinh x = exp x := by rw [← ofReal_inj]; 

Proof state:
x y : ℝ
⊢ ↑(cosh x + sinh x) = ↑(rexp x)

Next tactic:
simp
@[simp]
theorem sinh_add_cosh : sinh x + cosh x = exp x := by 

Proof state:
x y : ℝ
⊢ sinh x + cosh x = rexp x

Next tactic:
rw [add_comm, cosh_add_sinh]
@[simp]
theorem cosh_sub_sinh : cosh x - sinh x = exp (-x) := by
  

Proof state:
x y : ℝ
⊢ cosh x - sinh x = rexp (-x)

Next tactic:
rw [← ofReal_inj]
@[simp]
theorem cosh_sub_sinh : cosh x - sinh x = exp (-x) := by
  rw [← ofReal_inj]
  

Proof state:
x y : ℝ
⊢ ↑(cosh x - sinh x) = ↑(rexp (-x))

Next tactic:
simp
@[simp]
theorem sinh_sub_cosh : sinh x - cosh x = -exp (-x) := by 

Proof state:
x y : ℝ
⊢ sinh x - cosh x = -rexp (-x)

Next tactic:
rw [← neg_sub, cosh_sub_sinh]
@[simp]
theorem cosh_sq_sub_sinh_sq (x : ℝ) : cosh x ^ 2 - sinh x ^ 2 = 1 := by 

Proof state:
x✝ y x : ℝ
⊢ cosh x ^ 2 - sinh x ^ 2 = 1

Next tactic:
rw [← ofReal_inj]
@[simp]
theorem cosh_sq_sub_sinh_sq (x : ℝ) : cosh x ^ 2 - sinh x ^ 2 = 1 := by rw [← ofReal_inj]; 

Proof state:
x✝ y x : ℝ
⊢ ↑(cosh x ^ 2 - sinh x ^ 2) = ↑1

Next tactic:
simp
nonrec theorem cosh_sq : cosh x ^ 2 = sinh x ^ 2 + 1 := by 

Proof state:
x y : ℝ
⊢ cosh x ^ 2 = sinh x ^ 2 + 1

Next tactic:
rw [← ofReal_inj]
nonrec theorem cosh_sq : cosh x ^ 2 = sinh x ^ 2 + 1 := by rw [← ofReal_inj]; 

Proof state:
x y : ℝ
⊢ ↑(cosh x ^ 2) = ↑(sinh x ^ 2 + 1)

Next tactic:
simp [cosh_sq]
nonrec theorem sinh_sq : sinh x ^ 2 = cosh x ^ 2 - 1 := by 

Proof state:
x y : ℝ
⊢ sinh x ^ 2 = cosh x ^ 2 - 1

Next tactic:
rw [← ofReal_inj]
nonrec theorem sinh_sq : sinh x ^ 2 = cosh x ^ 2 - 1 := by rw [← ofReal_inj]; 

Proof state:
x y : ℝ
⊢ ↑(sinh x ^ 2) = ↑(cosh x ^ 2 - 1)

Next tactic:
simp [sinh_sq]
nonrec theorem cosh_two_mul : cosh (2 * x) = cosh x ^ 2 + sinh x ^ 2 := by
  

Proof state:
x y : ℝ
⊢ cosh (2 * x) = cosh x ^ 2 + sinh x ^ 2

Next tactic:
rw [← ofReal_inj]
nonrec theorem cosh_two_mul : cosh (2 * x) = cosh x ^ 2 + sinh x ^ 2 := by
  rw [← ofReal_inj]; 

Proof state:
x y : ℝ
⊢ ↑(cosh (2 * x)) = ↑(cosh x ^ 2 + sinh x ^ 2)

Next tactic:
simp [cosh_two_mul]
nonrec theorem sinh_two_mul : sinh (2 * x) = 2 * sinh x * cosh x := by
  

Proof state:
x y : ℝ
⊢ sinh (2 * x) = 2 * sinh x * cosh x

Next tactic:
rw [← ofReal_inj]
nonrec theorem sinh_two_mul : sinh (2 * x) = 2 * sinh x * cosh x := by
  rw [← ofReal_inj]; 

Proof state:
x y : ℝ
⊢ ↑(sinh (2 * x)) = ↑(2 * sinh x * cosh x)

Next tactic:
simp [sinh_two_mul]
nonrec theorem cosh_three_mul : cosh (3 * x) = 4 * cosh x ^ 3 - 3 * cosh x := by
  

Proof state:
x y : ℝ
⊢ cosh (3 * x) = 4 * cosh x ^ 3 - 3 * cosh x

Next tactic:
rw [← ofReal_inj]
nonrec theorem cosh_three_mul : cosh (3 * x) = 4 * cosh x ^ 3 - 3 * cosh x := by
  rw [← ofReal_inj]; 

Proof state:
x y : ℝ
⊢ ↑(cosh (3 * x)) = ↑(4 * cosh x ^ 3 - 3 * cosh x)

Next tactic:
simp [cosh_three_mul]
nonrec theorem sinh_three_mul : sinh (3 * x) = 4 * sinh x ^ 3 + 3 * sinh x := by
  

Proof state:
x y : ℝ
⊢ sinh (3 * x) = 4 * sinh x ^ 3 + 3 * sinh x

Next tactic:
rw [← ofReal_inj]
nonrec theorem sinh_three_mul : sinh (3 * x) = 4 * sinh x ^ 3 + 3 * sinh x := by
  rw [← ofReal_inj]; 

Proof state:
x y : ℝ
⊢ ↑(sinh (3 * x)) = ↑(4 * sinh x ^ 3 + 3 * sinh x)

Next tactic:
simp [sinh_three_mul]
theorem sum_le_exp_of_nonneg {x : ℝ} (hx : 0 ≤ x) (n : ℕ) : ∑ i in range n, x ^ i / i ! ≤ exp x :=
  calc
    ∑ i in range n, x ^ i / i ! ≤ lim (⟨_, isCauSeq_re (exp' x)⟩ : CauSeq ℝ Abs.abs) := by
      

Proof state:
x✝ y x : ℝ
hx : 0 ≤ x
n : ℕ
⊢ ∑ i in range n, x ^ i / ↑i ! ≤
    CauSeq.lim { val := fun n => (↑(exp' ↑x) n).re, property := (_ : IsCauSeq abs' fun n => (↑(exp' ↑x) n).re) }

Next tactic:
refine' le_lim (CauSeq.le_of_exists ⟨n, fun j hj => _⟩)
theorem sum_le_exp_of_nonneg {x : ℝ} (hx : 0 ≤ x) (n : ℕ) : ∑ i in range n, x ^ i / i ! ≤ exp x :=
  calc
    ∑ i in range n, x ^ i / i ! ≤ lim (⟨_, isCauSeq_re (exp' x)⟩ : CauSeq ℝ Abs.abs) := by
      refine' le_lim (CauSeq.le_of_exists ⟨n, fun j hj => _⟩)
      

Proof state:
x✝ y x : ℝ
hx : 0 ≤ x
n j : ℕ
hj : j ≥ n
⊢ ↑(const abs' (∑ i in range n, x ^ i / ↑i !)) j ≤
    ↑{ val := fun n => (↑(exp' ↑x) n).re, property := (_ : IsCauSeq abs' fun n => (↑(exp' ↑x) n).re) } j

Next tactic:
simp only [exp', const_apply, re_sum]
theorem sum_le_exp_of_nonneg {x : ℝ} (hx : 0 ≤ x) (n : ℕ) : ∑ i in range n, x ^ i / i ! ≤ exp x :=
  calc
    ∑ i in range n, x ^ i / i ! ≤ lim (⟨_, isCauSeq_re (exp' x)⟩ : CauSeq ℝ Abs.abs) := by
      refine' le_lim (CauSeq.le_of_exists ⟨n, fun j hj => _⟩)
      simp only [exp', const_apply, re_sum]
      

Proof state:
x✝ y x : ℝ
hx : 0 ≤ x
n j : ℕ
hj : j ≥ n
⊢ ∑ i in range n, x ^ i / ↑i ! ≤ ∑ i in range j, (↑x ^ i / ↑i !).re

Next tactic:
norm_cast
theorem sum_le_exp_of_nonneg {x : ℝ} (hx : 0 ≤ x) (n : ℕ) : ∑ i in range n, x ^ i / i ! ≤ exp x :=
  calc
    ∑ i in range n, x ^ i / i ! ≤ lim (⟨_, isCauSeq_re (exp' x)⟩ : CauSeq ℝ Abs.abs) := by
      refine' le_lim (CauSeq.le_of_exists ⟨n, fun j hj => _⟩)
      simp only [exp', const_apply, re_sum]
      norm_cast
      

Proof state:
x✝ y x : ℝ
hx : 0 ≤ x
n j : ℕ
hj : j ≥ n
⊢ ∑ i in range n, x ^ i / ↑i ! ≤ ∑ i in range j, x ^ i / ↑i !

Next tactic:
refine sum_le_sum_of_subset_of_nonneg (range_mono hj) fun _ _ _ ↦ ?_
theorem sum_le_exp_of_nonneg {x : ℝ} (hx : 0 ≤ x) (n : ℕ) : ∑ i in range n, x ^ i / i ! ≤ exp x :=
  calc
    ∑ i in range n, x ^ i / i ! ≤ lim (⟨_, isCauSeq_re (exp' x)⟩ : CauSeq ℝ Abs.abs) := by
      refine' le_lim (CauSeq.le_of_exists ⟨n, fun j hj => _⟩)
      simp only [exp', const_apply, re_sum]
      norm_cast
      refine sum_le_sum_of_subset_of_nonneg (range_mono hj) fun _ _ _ ↦ ?_
      

Proof state:
x✝³ y x : ℝ
hx : 0 ≤ x
n j : ℕ
hj : j ≥ n
x✝² : ℕ
x✝¹ : x✝² ∈ range j
x✝ : x✝² ∉ range n
⊢ 0 ≤ x ^ x✝² / ↑x✝²!

Next tactic:
positivity
theorem sum_le_exp_of_nonneg {x : ℝ} (hx : 0 ≤ x) (n : ℕ) : ∑ i in range n, x ^ i / i ! ≤ exp x :=
  calc
    ∑ i in range n, x ^ i / i ! ≤ lim (⟨_, isCauSeq_re (exp' x)⟩ : CauSeq ℝ Abs.abs) := by
      refine' le_lim (CauSeq.le_of_exists ⟨n, fun j hj => _⟩)
      simp only [exp', const_apply, re_sum]
      norm_cast
      refine sum_le_sum_of_subset_of_nonneg (range_mono hj) fun _ _ _ ↦ ?_
      positivity
    _ = exp x := by 

Proof state:
x✝ y x : ℝ
hx : 0 ≤ x
n : ℕ
⊢ CauSeq.lim { val := fun n => (↑(exp' ↑x) n).re, property := (_ : IsCauSeq abs' fun n => (↑(exp' ↑x) n).re) } = rexp x

Next tactic:
rw [exp, Complex.exp, ← cauSeqRe, lim_re]
lemma pow_div_factorial_le_exp (hx : 0 ≤ x) (n : ℕ) : x ^ n / n ! ≤ exp x :=
  calc
    x ^ n / n ! ≤ ∑ k in range (n + 1), x ^ k / k ! :=
        single_le_sum (f := fun k ↦ x ^ k / k !) (fun k _ ↦ by 

Proof state:
x y : ℝ
hx : 0 ≤ x
n k : ℕ
x✝ : k ∈ range (n + 1)
⊢ 0 ≤ (fun k => x ^ k / ↑k !) k

Next tactic:
positivity
theorem quadratic_le_exp_of_nonneg {x : ℝ} (hx : 0 ≤ x) : 1 + x + x ^ 2 / 2 ≤ exp x :=
  calc
    1 + x + x ^ 2 / 2 = ∑ i in range 3, x ^ i / i ! := by
        

Proof state:
x✝ y x : ℝ
hx : 0 ≤ x
⊢ 1 + x + x ^ 2 / 2 = ∑ i in range 3, x ^ i / ↑i !

Next tactic:
simp only [sum_range_succ, range_one, sum_singleton, _root_.pow_zero, factorial, cast_one,
          ne_eq, one_ne_zero, not_false_eq_true, div_self, pow_one, mul_one, div_one, Nat.mul_one,
          cast_succ, add_right_inj]