Skip to content

Commit

Permalink
chore: Golf de Moivre's formula (#21012)
Browse files Browse the repository at this point in the history
Golfs the proof of de Moivre's formula to a single line of rewrites, using a preexisting theorem.
  • Loading branch information
BoltonBailey committed Jan 24, 2025
1 parent 21e96d4 commit 175a60f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Mathlib/Data/Complex/Exponential.lean
Original file line number Diff line number Diff line change
Expand Up @@ -667,10 +667,7 @@ theorem exp_ofReal_mul_I_im (x : ℝ) : (exp (x * I)).im = Real.sin x := by
/-- **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]
· rw [pow_succ, ih, Nat.cast_succ, add_mul, add_mul, one_mul, exp_add]
rw [← exp_mul_I, ← exp_mul_I, ← exp_nat_mul, mul_assoc]

end Complex

Expand Down

0 comments on commit 175a60f

Please sign in to comment.