Skip to content

Commit b4de15a

Browse files
committed
refactor(Analysis): golf Mathlib/Analysis/Complex/Trigonometric (leanprover-community#38274)
- rewrites `cos_three_mul` via `cosh_three_mul` and the `cosh_mul_I` conversion - shortens `sin_three_mul` using `sin_add`, double-angle identities, and `grind`
1 parent 4c9893d commit b4de15a

1 file changed

Lines changed: 3 additions & 11 deletions

File tree

Mathlib/Analysis/Complex/Trigonometric.lean

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -501,19 +501,11 @@ theorem tan_sq_div_one_add_tan_sq {x : ℂ} (hx : cos x ≠ 0) :
501501
simp only [← tan_mul_cos hx, mul_pow, ← inv_one_add_tan_sq hx, div_eq_mul_inv]
502502

503503
theorem cos_three_mul : cos (3 * x) = 4 * cos x ^ 3 - 3 * cos x := by
504-
have h1 : x + 2 * x = 3 * x := by ring
505-
rw [← h1, cos_add x (2 * x)]
506-
simp only [cos_two_mul, sin_two_mul, mul_sub, mul_one, sq]
507-
have h2 : 4 * cos x ^ 3 = 2 * cos x * cos x * cos x + 2 * cos x * cos x ^ 2 := by ring
508-
rw [h2, cos_sq']
509-
ring
504+
rw [← cosh_mul_I, mul_assoc, cosh_three_mul, cosh_mul_I]
510505

511506
theorem sin_three_mul : sin (3 * x) = 3 * sin x - 4 * sin x ^ 3 := by
512-
have h1 : x + 2 * x = 3 * x := by ring
513-
rw [← h1, sin_add x (2 * x)]
514-
simp only [cos_two_mul, sin_two_mul, cos_sq']
515-
have h2 : cos x * (2 * sin x * cos x) = 2 * sin x * cos x ^ 2 := by ring
516-
rw [h2, cos_sq']
507+
rw [← two_add_one_eq_three, add_one_mul, sin_add (2 * x) x]
508+
simp only [cos_two_mul, sin_two_mul, cos_sq', mul_assoc, ← sq]
517509
ring
518510

519511
theorem exp_mul_I : exp (x * I) = cos x + sin x * I :=

0 commit comments

Comments
 (0)