equal
deleted
inserted
replaced
4171 qed |
4171 qed |
4172 |
4172 |
4173 lemma cos_zero_iff_int: "cos x = 0 \<longleftrightarrow> (\<exists>n. odd n \<and> x = of_int n * (pi/2))" |
4173 lemma cos_zero_iff_int: "cos x = 0 \<longleftrightarrow> (\<exists>n. odd n \<and> x = of_int n * (pi/2))" |
4174 proof safe |
4174 proof safe |
4175 assume "cos x = 0" |
4175 assume "cos x = 0" |
4176 then show "\<exists>n. odd n \<and> x = of_int n * (pi/2)" |
4176 then show "\<exists>n. odd n \<and> x = of_int n * (pi / 2)" |
4177 apply (simp add: cos_zero_iff) |
4177 unfolding cos_zero_iff |
4178 apply safe |
4178 apply (auto simp add: cos_zero_iff) |
4179 apply (metis even_int_iff of_int_of_nat_eq) |
4179 apply (metis even_of_nat of_int_of_nat_eq) |
4180 apply (rule_tac x="- (int n)" in exI) |
4180 apply (rule_tac x="- (int n)" in exI) |
4181 apply simp |
4181 apply simp |
4182 done |
4182 done |
4183 next |
4183 next |
4184 fix n :: int |
4184 fix n :: int |
4194 proof safe |
4194 proof safe |
4195 assume "sin x = 0" |
4195 assume "sin x = 0" |
4196 then show "\<exists>n. even n \<and> x = of_int n * (pi / 2)" |
4196 then show "\<exists>n. even n \<and> x = of_int n * (pi / 2)" |
4197 apply (simp add: sin_zero_iff) |
4197 apply (simp add: sin_zero_iff) |
4198 apply safe |
4198 apply safe |
4199 apply (metis even_int_iff of_int_of_nat_eq) |
4199 apply (metis even_of_nat of_int_of_nat_eq) |
4200 apply (rule_tac x="- (int n)" in exI) |
4200 apply (rule_tac x="- (int n)" in exI) |
4201 apply simp |
4201 apply simp |
4202 done |
4202 done |
4203 next |
4203 next |
4204 fix n :: int |
4204 fix n :: int |