65 by (simp add: complex_zero_def) |
65 by (simp add: complex_zero_def) |
66 |
66 |
67 lemma complex_Im_zero [simp]: "Im 0 = 0" |
67 lemma complex_Im_zero [simp]: "Im 0 = 0" |
68 by (simp add: complex_zero_def) |
68 by (simp add: complex_zero_def) |
69 |
69 |
70 lemma complex_zero_iff [simp]: "(Complex x y = 0) = (x = 0 \<and> y = 0)" |
70 lemma Complex_eq_0 [simp]: "(Complex x y = 0) = (x = 0 \<and> y = 0)" |
71 unfolding complex_zero_def by simp |
71 by (simp add: complex_zero_def) |
72 |
72 |
73 lemma complex_Re_one [simp]: "Re 1 = 1" |
73 lemma complex_Re_one [simp]: "Re 1 = 1" |
74 by (simp add: complex_one_def) |
74 by (simp add: complex_one_def) |
75 |
75 |
76 lemma complex_Im_one [simp]: "Im 1 = 0" |
76 lemma complex_Im_one [simp]: "Im 1 = 0" |
77 by (simp add: complex_one_def) |
77 by (simp add: complex_one_def) |
78 |
78 |
|
79 lemma Complex_eq_1 [simp]: "(Complex x y = 1) = (x = 1 \<and> y = 0)" |
|
80 by (simp add: complex_one_def) |
|
81 |
79 lemma complex_Re_i [simp]: "Re(ii) = 0" |
82 lemma complex_Re_i [simp]: "Re(ii) = 0" |
80 by (simp add: i_def) |
83 by (simp add: i_def) |
81 |
84 |
82 lemma complex_Im_i [simp]: "Im(ii) = 1" |
85 lemma complex_Im_i [simp]: "Im(ii) = 1" |
|
86 by (simp add: i_def) |
|
87 |
|
88 lemma Complex_eq_i [simp]: "(Complex x y = ii) = (x = 0 \<and> y = 1)" |
83 by (simp add: i_def) |
89 by (simp add: i_def) |
84 |
90 |
85 |
91 |
86 subsection{*Unary Minus*} |
92 subsection{*Unary Minus*} |
87 |
93 |
154 |
160 |
155 |
161 |
156 subsection{*Inverse*} |
162 subsection{*Inverse*} |
157 |
163 |
158 lemma complex_inverse [simp]: |
164 lemma complex_inverse [simp]: |
159 "inverse (Complex x y) = Complex (x/(x ^ 2 + y ^ 2)) (-y/(x ^ 2 + y ^ 2))" |
165 "inverse (Complex x y) = Complex (x / (x\<twosuperior> + y\<twosuperior>)) (- y / (x\<twosuperior> + y\<twosuperior>))" |
160 by (simp add: complex_inverse_def) |
166 by (simp add: complex_inverse_def) |
161 |
167 |
162 lemma complex_mult_inv_left: "z \<noteq> (0::complex) ==> inverse(z) * z = 1" |
168 lemma complex_mult_inv_left: "z \<noteq> (0::complex) ==> inverse(z) * z = 1" |
163 apply (induct z) |
169 apply (induct z) |
164 apply (rename_tac x y) |
170 apply (simp add: power2_eq_square [symmetric] add_divide_distrib [symmetric]) |
165 apply (auto simp add: |
|
166 complex_one_def complex_zero_def add_divide_distrib [symmetric] |
|
167 power2_eq_square mult_ac) |
|
168 apply (simp_all add: real_sum_squares_not_zero real_sum_squares_not_zero2) |
|
169 done |
171 done |
170 |
172 |
171 |
173 |
172 subsection {* The field of complex numbers *} |
174 subsection {* The field of complex numbers *} |
173 |
175 |
508 |
510 |
509 lemma complex_eq_cancel_iff2 [simp]: |
511 lemma complex_eq_cancel_iff2 [simp]: |
510 "(Complex x y = complex_of_real xa) = (x = xa & y = 0)" |
512 "(Complex x y = complex_of_real xa) = (x = xa & y = 0)" |
511 by (simp add: complex_of_real_def) |
513 by (simp add: complex_of_real_def) |
512 |
514 |
513 lemma Complex_eq_0 [simp]: "(Complex x y = 0) = (x = 0 & y = 0)" |
|
514 by (simp add: complex_zero_def) |
|
515 |
|
516 lemma Complex_eq_1 [simp]: "(Complex x y = 1) = (x = 1 & y = 0)" |
|
517 by (simp add: complex_one_def) |
|
518 |
|
519 lemma Complex_eq_i [simp]: "(Complex x y = ii) = (x = 0 & y = 1)" |
|
520 by (simp add: i_def) |
|
521 |
|
522 |
|
523 |
|
524 lemma Re_sgn [simp]: "Re(sgn z) = Re(z)/cmod z" |
515 lemma Re_sgn [simp]: "Re(sgn z) = Re(z)/cmod z" |
525 proof (induct z) |
516 proof (induct z) |
526 case (Complex x y) |
517 case (Complex x y) |
527 have "sqrt (x\<twosuperior> + y\<twosuperior>) * inverse (x\<twosuperior> + y\<twosuperior>) = inverse (sqrt (x\<twosuperior> + y\<twosuperior>))" |
518 have "sqrt (x\<twosuperior> + y\<twosuperior>) * inverse (x\<twosuperior> + y\<twosuperior>) = inverse (sqrt (x\<twosuperior> + y\<twosuperior>))" |
528 by (simp add: divide_inverse [symmetric] sqrt_divide_self_eq) |
519 by (simp add: divide_inverse [symmetric] sqrt_divide_self_eq) |