Skip to content

Commit

Permalink
feat(ring_theory/power_series/well_known): Coefficients of sin and cos (
Browse files Browse the repository at this point in the history
#15287)

This PR adds lemmas for the coefficients of sin and cos.
  • Loading branch information
tb65536 committed Jul 15, 2022
1 parent 85cd3e6 commit 8199f67
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/ring_theory/power_series/well_known.lean
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,20 @@ variables {A A'} (n : ℕ) (f : A →+* A')
@[simp] lemma constant_coeff_exp : constant_coeff A (exp A) = 1 :=
by { rw [← coeff_zero_eq_constant_coeff_apply, coeff_exp], simp }

@[simp] lemma coeff_sin_bit0 : coeff A (bit0 n) (sin A) = 0 :=
by rw [sin, coeff_mk, if_pos (even_bit0 n)]

@[simp] lemma coeff_sin_bit1 : coeff A (bit1 n) (sin A) = (-1) ^ n * coeff A (bit1 n) (exp A) :=
by rw [sin, coeff_mk, if_neg n.not_even_bit1, nat.bit1_div_two,
←mul_one_div, map_mul, map_pow, map_neg, map_one, coeff_exp]

@[simp] lemma coeff_cos_bit0 : coeff A (bit0 n) (cos A) = (-1) ^ n * coeff A (bit0 n) (exp A) :=
by rw [cos, coeff_mk, if_pos (even_bit0 n), nat.bit0_div_two,
←mul_one_div, map_mul, map_pow, map_neg, map_one, coeff_exp]

@[simp] lemma coeff_cos_bit1 : coeff A (bit1 n) (cos A) = 0 :=
by rw [cos, coeff_mk, if_neg n.not_even_bit1]

@[simp] lemma map_exp : map (f : A →+* A') (exp A) = exp A' := by { ext, simp }

@[simp] lemma map_sin : map f (sin A) = sin A' := by { ext, simp [sin, apply_ite f] }
Expand Down

0 comments on commit 8199f67

Please sign in to comment.