equal
deleted
inserted
replaced
202 qed |
202 qed |
203 |
203 |
204 lemma complex_Im_fact [simp]: "Im (fact n) = 0" |
204 lemma complex_Im_fact [simp]: "Im (fact n) = 0" |
205 by (subst of_nat_fact [symmetric]) (simp only: complex_Im_of_nat) |
205 by (subst of_nat_fact [symmetric]) (simp only: complex_Im_of_nat) |
206 |
206 |
|
207 lemma Re_prod_Reals: "(\<And>x. x \<in> A \<Longrightarrow> f x \<in> \<real>) \<Longrightarrow> Re (prod f A) = prod (\<lambda>x. Re (f x)) A" |
|
208 proof (induction A rule: infinite_finite_induct) |
|
209 case (insert x A) |
|
210 hence "Re (prod f (insert x A)) = Re (f x) * Re (prod f A) - Im (f x) * Im (prod f A)" |
|
211 by simp |
|
212 also from insert.prems have "f x \<in> \<real>" by simp |
|
213 hence "Im (f x) = 0" by (auto elim!: Reals_cases) |
|
214 also have "Re (prod f A) = (\<Prod>x\<in>A. Re (f x))" |
|
215 by (intro insert.IH insert.prems) auto |
|
216 finally show ?case using insert.hyps by simp |
|
217 qed auto |
|
218 |
207 |
219 |
208 subsection \<open>The Complex Number $i$\<close> |
220 subsection \<open>The Complex Number $i$\<close> |
209 |
221 |
210 primcorec imaginary_unit :: complex ("\<i>") |
222 primcorec imaginary_unit :: complex ("\<i>") |
211 where |
223 where |
508 |
520 |
509 lemma complex_cnj_zero [simp]: "cnj 0 = 0" |
521 lemma complex_cnj_zero [simp]: "cnj 0 = 0" |
510 by (simp add: complex_eq_iff) |
522 by (simp add: complex_eq_iff) |
511 |
523 |
512 lemma complex_cnj_zero_iff [iff]: "cnj z = 0 \<longleftrightarrow> z = 0" |
524 lemma complex_cnj_zero_iff [iff]: "cnj z = 0 \<longleftrightarrow> z = 0" |
|
525 by (simp add: complex_eq_iff) |
|
526 |
|
527 lemma complex_cnj_one_iff [simp]: "cnj z = 1 \<longleftrightarrow> z = 1" |
513 by (simp add: complex_eq_iff) |
528 by (simp add: complex_eq_iff) |
514 |
529 |
515 lemma complex_cnj_add [simp]: "cnj (x + y) = cnj x + cnj y" |
530 lemma complex_cnj_add [simp]: "cnj (x + y) = cnj x + cnj y" |
516 by (simp add: complex_eq_iff) |
531 by (simp add: complex_eq_iff) |
517 |
532 |