author | huffman |
Mon, 14 May 2007 18:03:25 +0200 | |
changeset 22968 | 7134874437ac |
parent 22956 | 617140080e6a |
child 22972 | 3e96b98d37c6 |
permissions | -rw-r--r-- |
13957 | 1 |
(* Title: Complex.thy |
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
2 |
ID: $Id$ |
13957 | 3 |
Author: Jacques D. Fleuriot |
4 |
Copyright: 2001 University of Edinburgh |
|
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
5 |
Conversion to Isar and new proofs by Lawrence C Paulson, 2003/4 |
13957 | 6 |
*) |
7 |
||
14377 | 8 |
header {* Complex Numbers: Rectangular and Polar Representations *} |
14373 | 9 |
|
15131 | 10 |
theory Complex |
22655 | 11 |
imports "../Hyperreal/Transcendental" |
15131 | 12 |
begin |
13957 | 13 |
|
14373 | 14 |
datatype complex = Complex real real |
13957 | 15 |
|
14691 | 16 |
instance complex :: "{zero, one, plus, times, minus, inverse, power}" .. |
13957 | 17 |
|
18 |
consts |
|
14373 | 19 |
"ii" :: complex ("\<i>") |
20 |
||
21 |
consts Re :: "complex => real" |
|
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
22 |
primrec Re: "Re (Complex x y) = x" |
14373 | 23 |
|
24 |
consts Im :: "complex => real" |
|
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
25 |
primrec Im: "Im (Complex x y) = y" |
14373 | 26 |
|
27 |
lemma complex_surj [simp]: "Complex (Re z) (Im z) = z" |
|
28 |
by (induct z) simp |
|
13957 | 29 |
|
14323 | 30 |
defs (overloaded) |
31 |
||
32 |
complex_zero_def: |
|
14373 | 33 |
"0 == Complex 0 0" |
13957 | 34 |
|
14323 | 35 |
complex_one_def: |
14373 | 36 |
"1 == Complex 1 0" |
14323 | 37 |
|
14373 | 38 |
i_def: "ii == Complex 0 1" |
14323 | 39 |
|
14373 | 40 |
complex_minus_def: "- z == Complex (- Re z) (- Im z)" |
14323 | 41 |
|
42 |
complex_inverse_def: |
|
14373 | 43 |
"inverse z == |
44 |
Complex (Re z / ((Re z)\<twosuperior> + (Im z)\<twosuperior>)) (- Im z / ((Re z)\<twosuperior> + (Im z)\<twosuperior>))" |
|
13957 | 45 |
|
14323 | 46 |
complex_add_def: |
14373 | 47 |
"z + w == Complex (Re z + Re w) (Im z + Im w)" |
13957 | 48 |
|
14323 | 49 |
complex_diff_def: |
14373 | 50 |
"z - w == z + - (w::complex)" |
13957 | 51 |
|
14374 | 52 |
complex_mult_def: |
14373 | 53 |
"z * w == Complex (Re z * Re w - Im z * Im w) (Re z * Im w + Im z * Re w)" |
13957 | 54 |
|
14373 | 55 |
complex_divide_def: "w / (z::complex) == w * inverse z" |
14323 | 56 |
|
13957 | 57 |
|
14373 | 58 |
lemma complex_equality [intro?]: "Re z = Re w ==> Im z = Im w ==> z = w" |
59 |
by (induct z, induct w) simp |
|
14323 | 60 |
|
61 |
lemma complex_Re_Im_cancel_iff: "(w=z) = (Re(w) = Re(z) & Im(w) = Im(z))" |
|
14373 | 62 |
by (induct w, induct z, simp) |
14323 | 63 |
|
14374 | 64 |
lemma complex_Re_zero [simp]: "Re 0 = 0" |
65 |
by (simp add: complex_zero_def) |
|
66 |
||
67 |
lemma complex_Im_zero [simp]: "Im 0 = 0" |
|
14373 | 68 |
by (simp add: complex_zero_def) |
14323 | 69 |
|
22968 | 70 |
lemma Complex_eq_0 [simp]: "(Complex x y = 0) = (x = 0 \<and> y = 0)" |
71 |
by (simp add: complex_zero_def) |
|
22861
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
72 |
|
14374 | 73 |
lemma complex_Re_one [simp]: "Re 1 = 1" |
74 |
by (simp add: complex_one_def) |
|
14323 | 75 |
|
14374 | 76 |
lemma complex_Im_one [simp]: "Im 1 = 0" |
14373 | 77 |
by (simp add: complex_one_def) |
14323 | 78 |
|
22968 | 79 |
lemma Complex_eq_1 [simp]: "(Complex x y = 1) = (x = 1 \<and> y = 0)" |
80 |
by (simp add: complex_one_def) |
|
81 |
||
14374 | 82 |
lemma complex_Re_i [simp]: "Re(ii) = 0" |
14373 | 83 |
by (simp add: i_def) |
14323 | 84 |
|
14374 | 85 |
lemma complex_Im_i [simp]: "Im(ii) = 1" |
14373 | 86 |
by (simp add: i_def) |
14323 | 87 |
|
22968 | 88 |
lemma Complex_eq_i [simp]: "(Complex x y = ii) = (x = 0 \<and> y = 1)" |
89 |
by (simp add: i_def) |
|
90 |
||
14323 | 91 |
|
14374 | 92 |
subsection{*Unary Minus*} |
14323 | 93 |
|
14377 | 94 |
lemma complex_minus [simp]: "- (Complex x y) = Complex (-x) (-y)" |
14373 | 95 |
by (simp add: complex_minus_def) |
14323 | 96 |
|
14374 | 97 |
lemma complex_Re_minus [simp]: "Re (-z) = - Re z" |
14373 | 98 |
by (simp add: complex_minus_def) |
14323 | 99 |
|
14374 | 100 |
lemma complex_Im_minus [simp]: "Im (-z) = - Im z" |
101 |
by (simp add: complex_minus_def) |
|
14323 | 102 |
|
103 |
||
104 |
subsection{*Addition*} |
|
105 |
||
14377 | 106 |
lemma complex_add [simp]: |
107 |
"Complex x1 y1 + Complex x2 y2 = Complex (x1+x2) (y1+y2)" |
|
14373 | 108 |
by (simp add: complex_add_def) |
14323 | 109 |
|
14374 | 110 |
lemma complex_Re_add [simp]: "Re(x + y) = Re(x) + Re(y)" |
14373 | 111 |
by (simp add: complex_add_def) |
14323 | 112 |
|
14374 | 113 |
lemma complex_Im_add [simp]: "Im(x + y) = Im(x) + Im(y)" |
14373 | 114 |
by (simp add: complex_add_def) |
14323 | 115 |
|
116 |
lemma complex_add_commute: "(u::complex) + v = v + u" |
|
14373 | 117 |
by (simp add: complex_add_def add_commute) |
14323 | 118 |
|
119 |
lemma complex_add_assoc: "((u::complex) + v) + w = u + (v + w)" |
|
14373 | 120 |
by (simp add: complex_add_def add_assoc) |
14323 | 121 |
|
122 |
lemma complex_add_zero_left: "(0::complex) + z = z" |
|
14373 | 123 |
by (simp add: complex_add_def complex_zero_def) |
14323 | 124 |
|
125 |
lemma complex_add_zero_right: "z + (0::complex) = z" |
|
14373 | 126 |
by (simp add: complex_add_def complex_zero_def) |
14323 | 127 |
|
14373 | 128 |
lemma complex_add_minus_left: "-z + z = (0::complex)" |
129 |
by (simp add: complex_add_def complex_minus_def complex_zero_def) |
|
14323 | 130 |
|
131 |
lemma complex_diff: |
|
14373 | 132 |
"Complex x1 y1 - Complex x2 y2 = Complex (x1-x2) (y1-y2)" |
133 |
by (simp add: complex_add_def complex_minus_def complex_diff_def) |
|
14323 | 134 |
|
14374 | 135 |
lemma complex_Re_diff [simp]: "Re(x - y) = Re(x) - Re(y)" |
136 |
by (simp add: complex_diff_def) |
|
137 |
||
138 |
lemma complex_Im_diff [simp]: "Im(x - y) = Im(x) - Im(y)" |
|
139 |
by (simp add: complex_diff_def) |
|
140 |
||
141 |
||
14323 | 142 |
subsection{*Multiplication*} |
143 |
||
14377 | 144 |
lemma complex_mult [simp]: |
14373 | 145 |
"Complex x1 y1 * Complex x2 y2 = Complex (x1*x2 - y1*y2) (x1*y2 + y1*x2)" |
146 |
by (simp add: complex_mult_def) |
|
14323 | 147 |
|
148 |
lemma complex_mult_commute: "(w::complex) * z = z * w" |
|
14373 | 149 |
by (simp add: complex_mult_def mult_commute add_commute) |
14323 | 150 |
|
151 |
lemma complex_mult_assoc: "((u::complex) * v) * w = u * (v * w)" |
|
14374 | 152 |
by (simp add: complex_mult_def mult_ac add_ac |
14373 | 153 |
right_diff_distrib right_distrib left_diff_distrib left_distrib) |
14323 | 154 |
|
155 |
lemma complex_mult_one_left: "(1::complex) * z = z" |
|
14373 | 156 |
by (simp add: complex_mult_def complex_one_def) |
14323 | 157 |
|
158 |
lemma complex_mult_one_right: "z * (1::complex) = z" |
|
14373 | 159 |
by (simp add: complex_mult_def complex_one_def) |
14323 | 160 |
|
161 |
||
162 |
subsection{*Inverse*} |
|
163 |
||
14377 | 164 |
lemma complex_inverse [simp]: |
22968 | 165 |
"inverse (Complex x y) = Complex (x / (x\<twosuperior> + y\<twosuperior>)) (- y / (x\<twosuperior> + y\<twosuperior>))" |
14373 | 166 |
by (simp add: complex_inverse_def) |
14335 | 167 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
168 |
lemma complex_mult_inv_left: "z \<noteq> (0::complex) ==> inverse(z) * z = 1" |
14374 | 169 |
apply (induct z) |
22968 | 170 |
apply (simp add: power2_eq_square [symmetric] add_divide_distrib [symmetric]) |
14323 | 171 |
done |
172 |
||
14335 | 173 |
|
174 |
subsection {* The field of complex numbers *} |
|
175 |
||
176 |
instance complex :: field |
|
177 |
proof |
|
178 |
fix z u v w :: complex |
|
179 |
show "(u + v) + w = u + (v + w)" |
|
14374 | 180 |
by (rule complex_add_assoc) |
14335 | 181 |
show "z + w = w + z" |
14374 | 182 |
by (rule complex_add_commute) |
14335 | 183 |
show "0 + z = z" |
14374 | 184 |
by (rule complex_add_zero_left) |
14335 | 185 |
show "-z + z = 0" |
14374 | 186 |
by (rule complex_add_minus_left) |
14335 | 187 |
show "z - w = z + -w" |
188 |
by (simp add: complex_diff_def) |
|
189 |
show "(u * v) * w = u * (v * w)" |
|
14374 | 190 |
by (rule complex_mult_assoc) |
14335 | 191 |
show "z * w = w * z" |
14374 | 192 |
by (rule complex_mult_commute) |
14335 | 193 |
show "1 * z = z" |
14374 | 194 |
by (rule complex_mult_one_left) |
14341
a09441bd4f1e
Ring_and_Field now requires axiom add_left_imp_eq for semirings.
paulson
parents:
14335
diff
changeset
|
195 |
show "0 \<noteq> (1::complex)" |
14373 | 196 |
by (simp add: complex_zero_def complex_one_def) |
14335 | 197 |
show "(u + v) * w = u * w + v * w" |
14421
ee97b6463cb4
new Ring_and_Field hierarchy, eliminating redundant axioms
paulson
parents:
14387
diff
changeset
|
198 |
by (simp add: complex_mult_def complex_add_def left_distrib |
ee97b6463cb4
new Ring_and_Field hierarchy, eliminating redundant axioms
paulson
parents:
14387
diff
changeset
|
199 |
diff_minus add_ac) |
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
200 |
show "z / w = z * inverse w" |
14335 | 201 |
by (simp add: complex_divide_def) |
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
202 |
assume "w \<noteq> 0" |
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
203 |
thus "inverse w * w = 1" |
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
204 |
by (simp add: complex_mult_inv_left) |
14335 | 205 |
qed |
206 |
||
14373 | 207 |
instance complex :: division_by_zero |
208 |
proof |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
209 |
show "inverse 0 = (0::complex)" |
14373 | 210 |
by (simp add: complex_inverse_def complex_zero_def) |
211 |
qed |
|
14335 | 212 |
|
14323 | 213 |
|
20556
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
214 |
subsection{*The real algebra of complex numbers*} |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
215 |
|
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
216 |
instance complex :: scaleR .. |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
217 |
|
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
218 |
defs (overloaded) |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
219 |
complex_scaleR_def: "r *# x == Complex r 0 * x" |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
220 |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
221 |
instance complex :: real_field |
20556
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
222 |
proof |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
223 |
fix a b :: real |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
224 |
fix x y :: complex |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
225 |
show "a *# (x + y) = a *# x + a *# y" |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
226 |
by (simp add: complex_scaleR_def right_distrib) |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
227 |
show "(a + b) *# x = a *# x + b *# x" |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
228 |
by (simp add: complex_scaleR_def left_distrib [symmetric]) |
20763 | 229 |
show "a *# b *# x = (a * b) *# x" |
20556
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
230 |
by (simp add: complex_scaleR_def mult_assoc [symmetric]) |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
231 |
show "1 *# x = x" |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
232 |
by (simp add: complex_scaleR_def complex_one_def [symmetric]) |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
233 |
show "a *# x * y = a *# (x * y)" |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
234 |
by (simp add: complex_scaleR_def mult_assoc) |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
235 |
show "x * a *# y = a *# (x * y)" |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
236 |
by (simp add: complex_scaleR_def mult_left_commute) |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
237 |
qed |
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
238 |
|
2e8227b81bf1
add instance for real_algebra_1 and real_normed_div_algebra
huffman
parents:
20485
diff
changeset
|
239 |
|
14323 | 240 |
subsection{*Embedding Properties for @{term complex_of_real} Map*} |
241 |
||
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
242 |
abbreviation |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20763
diff
changeset
|
243 |
complex_of_real :: "real => complex" where |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
244 |
"complex_of_real == of_real" |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
245 |
|
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
246 |
lemma complex_of_real_def: "complex_of_real r = Complex r 0" |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
247 |
by (simp add: of_real_def complex_scaleR_def) |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
248 |
|
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
249 |
lemma Re_complex_of_real [simp]: "Re (complex_of_real z) = z" |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
250 |
by (simp add: complex_of_real_def) |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
251 |
|
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
252 |
lemma Im_complex_of_real [simp]: "Im (complex_of_real z) = 0" |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
253 |
by (simp add: complex_of_real_def) |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
254 |
|
14377 | 255 |
lemma Complex_add_complex_of_real [simp]: |
256 |
"Complex x y + complex_of_real r = Complex (x+r) y" |
|
257 |
by (simp add: complex_of_real_def) |
|
258 |
||
259 |
lemma complex_of_real_add_Complex [simp]: |
|
260 |
"complex_of_real r + Complex x y = Complex (r+x) y" |
|
261 |
by (simp add: i_def complex_of_real_def) |
|
262 |
||
263 |
lemma Complex_mult_complex_of_real: |
|
264 |
"Complex x y * complex_of_real r = Complex (x*r) (y*r)" |
|
265 |
by (simp add: complex_of_real_def) |
|
266 |
||
267 |
lemma complex_of_real_mult_Complex: |
|
268 |
"complex_of_real r * Complex x y = Complex (r*x) (r*y)" |
|
269 |
by (simp add: i_def complex_of_real_def) |
|
270 |
||
271 |
lemma i_complex_of_real [simp]: "ii * complex_of_real r = Complex 0 r" |
|
272 |
by (simp add: i_def complex_of_real_def) |
|
273 |
||
274 |
lemma complex_of_real_i [simp]: "complex_of_real r * ii = Complex 0 r" |
|
275 |
by (simp add: i_def complex_of_real_def) |
|
276 |
||
14323 | 277 |
|
14377 | 278 |
subsection{*The Functions @{term Re} and @{term Im}*} |
279 |
||
280 |
lemma complex_Re_mult_eq: "Re (w * z) = Re w * Re z - Im w * Im z" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
281 |
by (induct z, induct w, simp) |
14377 | 282 |
|
283 |
lemma complex_Im_mult_eq: "Im (w * z) = Re w * Im z + Im w * Re z" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
284 |
by (induct z, induct w, simp) |
14377 | 285 |
|
286 |
lemma Re_i_times [simp]: "Re(ii * z) = - Im z" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
287 |
by (simp add: complex_Re_mult_eq) |
14377 | 288 |
|
289 |
lemma Re_times_i [simp]: "Re(z * ii) = - Im z" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
290 |
by (simp add: complex_Re_mult_eq) |
14377 | 291 |
|
292 |
lemma Im_i_times [simp]: "Im(ii * z) = Re z" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
293 |
by (simp add: complex_Im_mult_eq) |
14377 | 294 |
|
295 |
lemma Im_times_i [simp]: "Im(z * ii) = Re z" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
296 |
by (simp add: complex_Im_mult_eq) |
14377 | 297 |
|
298 |
lemma complex_Re_mult: "[| Im w = 0; Im z = 0 |] ==> Re(w * z) = Re(w) * Re(z)" |
|
299 |
by (simp add: complex_Re_mult_eq) |
|
300 |
||
301 |
lemma complex_Re_mult_complex_of_real [simp]: |
|
302 |
"Re (z * complex_of_real c) = Re(z) * c" |
|
303 |
by (simp add: complex_Re_mult_eq) |
|
304 |
||
305 |
lemma complex_Im_mult_complex_of_real [simp]: |
|
306 |
"Im (z * complex_of_real c) = Im(z) * c" |
|
307 |
by (simp add: complex_Im_mult_eq) |
|
308 |
||
309 |
lemma complex_Re_mult_complex_of_real2 [simp]: |
|
310 |
"Re (complex_of_real c * z) = c * Re(z)" |
|
311 |
by (simp add: complex_Re_mult_eq) |
|
312 |
||
313 |
lemma complex_Im_mult_complex_of_real2 [simp]: |
|
314 |
"Im (complex_of_real c * z) = c * Im(z)" |
|
315 |
by (simp add: complex_Im_mult_eq) |
|
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
316 |
|
14377 | 317 |
|
14323 | 318 |
subsection{*Conjugation is an Automorphism*} |
319 |
||
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
320 |
definition |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20763
diff
changeset
|
321 |
cnj :: "complex => complex" where |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
322 |
"cnj z = Complex (Re z) (-Im z)" |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
323 |
|
14373 | 324 |
lemma complex_cnj: "cnj (Complex x y) = Complex x (-y)" |
325 |
by (simp add: cnj_def) |
|
14323 | 326 |
|
14374 | 327 |
lemma complex_cnj_cancel_iff [simp]: "(cnj x = cnj y) = (x = y)" |
14373 | 328 |
by (simp add: cnj_def complex_Re_Im_cancel_iff) |
14323 | 329 |
|
14374 | 330 |
lemma complex_cnj_cnj [simp]: "cnj (cnj z) = z" |
14373 | 331 |
by (simp add: cnj_def) |
14323 | 332 |
|
14374 | 333 |
lemma complex_cnj_complex_of_real [simp]: |
14373 | 334 |
"cnj (complex_of_real x) = complex_of_real x" |
335 |
by (simp add: complex_of_real_def complex_cnj) |
|
14323 | 336 |
|
337 |
lemma complex_cnj_minus: "cnj (-z) = - cnj z" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
338 |
by (simp add: cnj_def) |
14323 | 339 |
|
340 |
lemma complex_cnj_inverse: "cnj(inverse z) = inverse(cnj z)" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
341 |
by (induct z, simp add: complex_cnj power2_eq_square) |
14323 | 342 |
|
343 |
lemma complex_cnj_add: "cnj(w + z) = cnj(w) + cnj(z)" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
344 |
by (induct w, induct z, simp add: complex_cnj) |
14323 | 345 |
|
346 |
lemma complex_cnj_diff: "cnj(w - z) = cnj(w) - cnj(z)" |
|
15013 | 347 |
by (simp add: diff_minus complex_cnj_add complex_cnj_minus) |
14323 | 348 |
|
349 |
lemma complex_cnj_mult: "cnj(w * z) = cnj(w) * cnj(z)" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
350 |
by (induct w, induct z, simp add: complex_cnj) |
14323 | 351 |
|
352 |
lemma complex_cnj_divide: "cnj(w / z) = (cnj w)/(cnj z)" |
|
14373 | 353 |
by (simp add: complex_divide_def complex_cnj_mult complex_cnj_inverse) |
14323 | 354 |
|
14374 | 355 |
lemma complex_cnj_one [simp]: "cnj 1 = 1" |
14373 | 356 |
by (simp add: cnj_def complex_one_def) |
14323 | 357 |
|
358 |
lemma complex_add_cnj: "z + cnj z = complex_of_real (2 * Re(z))" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
359 |
by (induct z, simp add: complex_cnj complex_of_real_def) |
14323 | 360 |
|
361 |
lemma complex_diff_cnj: "z - cnj z = complex_of_real (2 * Im(z)) * ii" |
|
14373 | 362 |
apply (induct z) |
15013 | 363 |
apply (simp add: complex_add complex_cnj complex_of_real_def diff_minus |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
364 |
complex_minus i_def complex_mult) |
14323 | 365 |
done |
366 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
367 |
lemma complex_cnj_zero [simp]: "cnj 0 = 0" |
14334 | 368 |
by (simp add: cnj_def complex_zero_def) |
14323 | 369 |
|
14374 | 370 |
lemma complex_cnj_zero_iff [iff]: "(cnj z = 0) = (z = 0)" |
14373 | 371 |
by (induct z, simp add: complex_zero_def complex_cnj) |
14323 | 372 |
|
373 |
lemma complex_mult_cnj: "z * cnj z = complex_of_real (Re(z) ^ 2 + Im(z) ^ 2)" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
374 |
by (induct z, simp add: complex_cnj complex_of_real_def power2_eq_square) |
14323 | 375 |
|
376 |
||
377 |
subsection{*Modulus*} |
|
378 |
||
22861
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
379 |
instance complex :: norm |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
380 |
complex_norm_def: "norm z \<equiv> sqrt ((Re z)\<twosuperior> + (Im z)\<twosuperior>)" .. |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
381 |
|
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
382 |
abbreviation |
22861
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
383 |
cmod :: "complex \<Rightarrow> real" where |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
384 |
"cmod \<equiv> norm" |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
385 |
|
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
386 |
lemmas cmod_def = complex_norm_def |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
387 |
|
22861
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
388 |
lemma complex_mod [simp]: "cmod (Complex x y) = sqrt (x\<twosuperior> + y\<twosuperior>)" |
14373 | 389 |
by (simp add: cmod_def) |
14323 | 390 |
|
22861
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
391 |
lemma complex_mod_triangle_ineq [simp]: "cmod (x + y) \<le> cmod x + cmod y" |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
392 |
apply (simp add: cmod_def) |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
393 |
apply (rule real_sqrt_sum_squares_triangle_ineq) |
14323 | 394 |
done |
395 |
||
22861
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
396 |
lemma complex_mod_mult: "cmod (x * y) = cmod x * cmod y" |
14373 | 397 |
apply (induct x, induct y) |
22861
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
398 |
apply (simp add: real_sqrt_mult_distrib [symmetric]) |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
399 |
apply (simp add: power2_sum power2_diff power_mult_distrib ring_distrib) |
14323 | 400 |
done |
401 |
||
22861
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
402 |
lemma complex_mod_complex_of_real: "cmod (complex_of_real x) = \<bar>x\<bar>" |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
403 |
by (simp add: complex_of_real_def) |
14323 | 404 |
|
22852 | 405 |
lemma complex_norm_scaleR: |
406 |
"norm (scaleR a x) = \<bar>a\<bar> * norm (x::complex)" |
|
22861
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
407 |
unfolding scaleR_conv_of_real |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
408 |
by (simp only: complex_mod_mult complex_mod_complex_of_real) |
22852 | 409 |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
410 |
instance complex :: real_normed_field |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
411 |
proof |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
412 |
fix r :: real |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
413 |
fix x y :: complex |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
414 |
show "0 \<le> cmod x" |
22861
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
415 |
by (induct x) simp |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
416 |
show "(cmod x = 0) = (x = 0)" |
22861
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
417 |
by (induct x) simp |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
418 |
show "cmod (x + y) \<le> cmod x + cmod y" |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
419 |
by (rule complex_mod_triangle_ineq) |
22852 | 420 |
show "cmod (scaleR r x) = \<bar>r\<bar> * cmod x" |
421 |
by (rule complex_norm_scaleR) |
|
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
422 |
show "cmod (x * y) = cmod x * cmod y" |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
423 |
by (rule complex_mod_mult) |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
424 |
qed |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
425 |
|
22861
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
426 |
lemma complex_mod_cnj [simp]: "cmod (cnj z) = cmod z" |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
427 |
by (induct z, simp add: complex_cnj) |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
428 |
|
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
429 |
lemma complex_mod_mult_cnj: "cmod (z * cnj z) = (cmod z)\<twosuperior>" |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
430 |
by (simp add: complex_mod_mult power2_eq_square) |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
431 |
|
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
432 |
lemma cmod_unit_one [simp]: "cmod (Complex (cos a) (sin a)) = 1" |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
433 |
by simp |
14323 | 434 |
|
22861
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
435 |
lemma cmod_complex_polar [simp]: |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
436 |
"cmod (complex_of_real r * Complex (cos a) (sin a)) = abs r" |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
437 |
apply (simp only: cmod_unit_one complex_mod_mult) |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
438 |
apply (simp add: complex_mod_complex_of_real) |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
439 |
done |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
440 |
|
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
441 |
lemma complex_Re_le_cmod: "Re x \<le> cmod x" |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
442 |
unfolding complex_norm_def |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
443 |
by (rule real_sqrt_sum_squares_ge1) |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
444 |
|
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
445 |
lemma complex_mod_minus_le_complex_mod [simp]: "- cmod x \<le> cmod x" |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
446 |
by (rule order_trans [OF _ norm_ge_zero], simp) |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
447 |
|
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
448 |
lemma complex_mod_triangle_ineq2 [simp]: "cmod(b + a) - cmod b \<le> cmod a" |
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
449 |
by (rule ord_le_eq_trans [OF norm_triangle_ineq2], simp) |
14323 | 450 |
|
22861
8ec47039614e
clean up complex norm proofs, remove redundant lemmas
huffman
parents:
22852
diff
changeset
|
451 |
lemmas real_sum_squared_expand = power2_sum [where 'a=real] |
14323 | 452 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
453 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
454 |
subsection{*Exponentiation*} |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
455 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
456 |
primrec |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
457 |
complexpow_0: "z ^ 0 = 1" |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
458 |
complexpow_Suc: "z ^ (Suc n) = (z::complex) * (z ^ n)" |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
459 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
460 |
|
15003 | 461 |
instance complex :: recpower |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
462 |
proof |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
463 |
fix z :: complex |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
464 |
fix n :: nat |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
465 |
show "z^0 = 1" by simp |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
466 |
show "z^(Suc n) = z * (z^n)" by simp |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
467 |
qed |
14323 | 468 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
469 |
lemma complex_cnj_pow: "cnj(z ^ n) = cnj(z) ^ n" |
14323 | 470 |
apply (induct_tac "n") |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
471 |
apply (auto simp add: complex_cnj_mult) |
14323 | 472 |
done |
473 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
474 |
lemma complexpow_i_squared [simp]: "ii ^ 2 = -(1::complex)" |
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
475 |
by (simp add: i_def complex_one_def numeral_2_eq_2) |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
476 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
477 |
lemma complex_i_not_zero [simp]: "ii \<noteq> 0" |
14373 | 478 |
by (simp add: i_def complex_zero_def) |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
479 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
480 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
481 |
subsection{*The Function @{term sgn}*} |
14323 | 482 |
|
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
483 |
definition |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
484 |
(*------------ Argand -------------*) |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
485 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20763
diff
changeset
|
486 |
sgn :: "complex => complex" where |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
487 |
"sgn z = z / complex_of_real(cmod z)" |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
488 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20763
diff
changeset
|
489 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20763
diff
changeset
|
490 |
arg :: "complex => real" where |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
491 |
"arg z = (SOME a. Re(sgn z) = cos a & Im(sgn z) = sin a & -pi < a & a \<le> pi)" |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
492 |
|
14374 | 493 |
lemma sgn_zero [simp]: "sgn 0 = 0" |
14373 | 494 |
by (simp add: sgn_def) |
14323 | 495 |
|
14374 | 496 |
lemma sgn_one [simp]: "sgn 1 = 1" |
14373 | 497 |
by (simp add: sgn_def) |
14323 | 498 |
|
499 |
lemma sgn_minus: "sgn (-z) = - sgn(z)" |
|
14373 | 500 |
by (simp add: sgn_def) |
14323 | 501 |
|
14374 | 502 |
lemma sgn_eq: "sgn z = z / complex_of_real (cmod z)" |
14377 | 503 |
by (simp add: sgn_def) |
14323 | 504 |
|
505 |
lemma i_mult_eq: "ii * ii = complex_of_real (-1)" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
506 |
by (simp add: i_def complex_of_real_def) |
14323 | 507 |
|
14374 | 508 |
lemma i_mult_eq2 [simp]: "ii * ii = -(1::complex)" |
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
509 |
by (simp add: i_def complex_one_def) |
14323 | 510 |
|
14374 | 511 |
lemma complex_eq_cancel_iff2 [simp]: |
14377 | 512 |
"(Complex x y = complex_of_real xa) = (x = xa & y = 0)" |
513 |
by (simp add: complex_of_real_def) |
|
14323 | 514 |
|
14374 | 515 |
lemma Re_sgn [simp]: "Re(sgn z) = Re(z)/cmod z" |
15013 | 516 |
proof (induct z) |
517 |
case (Complex x y) |
|
518 |
have "sqrt (x\<twosuperior> + y\<twosuperior>) * inverse (x\<twosuperior> + y\<twosuperior>) = inverse (sqrt (x\<twosuperior> + y\<twosuperior>))" |
|
519 |
by (simp add: divide_inverse [symmetric] sqrt_divide_self_eq) |
|
520 |
thus "Re (sgn (Complex x y)) = Re (Complex x y) /cmod (Complex x y)" |
|
521 |
by (simp add: sgn_def complex_of_real_def divide_inverse) |
|
522 |
qed |
|
523 |
||
14323 | 524 |
|
14374 | 525 |
lemma Im_sgn [simp]: "Im(sgn z) = Im(z)/cmod z" |
15013 | 526 |
proof (induct z) |
527 |
case (Complex x y) |
|
528 |
have "sqrt (x\<twosuperior> + y\<twosuperior>) * inverse (x\<twosuperior> + y\<twosuperior>) = inverse (sqrt (x\<twosuperior> + y\<twosuperior>))" |
|
529 |
by (simp add: divide_inverse [symmetric] sqrt_divide_self_eq) |
|
530 |
thus "Im (sgn (Complex x y)) = Im (Complex x y) /cmod (Complex x y)" |
|
531 |
by (simp add: sgn_def complex_of_real_def divide_inverse) |
|
532 |
qed |
|
14323 | 533 |
|
534 |
lemma complex_inverse_complex_split: |
|
535 |
"inverse(complex_of_real x + ii * complex_of_real y) = |
|
536 |
complex_of_real(x/(x ^ 2 + y ^ 2)) - |
|
537 |
ii * complex_of_real(y/(x ^ 2 + y ^ 2))" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
538 |
by (simp add: complex_of_real_def i_def diff_minus divide_inverse) |
14323 | 539 |
|
540 |
(*----------------------------------------------------------------------------*) |
|
541 |
(* Many of the theorems below need to be moved elsewhere e.g. Transc. Also *) |
|
542 |
(* many of the theorems are not used - so should they be kept? *) |
|
543 |
(*----------------------------------------------------------------------------*) |
|
544 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
545 |
lemma cos_arg_i_mult_zero_pos: |
14377 | 546 |
"0 < y ==> cos (arg(Complex 0 y)) = 0" |
14373 | 547 |
apply (simp add: arg_def abs_if) |
14334 | 548 |
apply (rule_tac a = "pi/2" in someI2, auto) |
549 |
apply (rule order_less_trans [of _ 0], auto) |
|
14323 | 550 |
done |
551 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
552 |
lemma cos_arg_i_mult_zero_neg: |
14377 | 553 |
"y < 0 ==> cos (arg(Complex 0 y)) = 0" |
14373 | 554 |
apply (simp add: arg_def abs_if) |
14334 | 555 |
apply (rule_tac a = "- pi/2" in someI2, auto) |
556 |
apply (rule order_trans [of _ 0], auto) |
|
14323 | 557 |
done |
558 |
||
14374 | 559 |
lemma cos_arg_i_mult_zero [simp]: |
14377 | 560 |
"y \<noteq> 0 ==> cos (arg(Complex 0 y)) = 0" |
561 |
by (auto simp add: linorder_neq_iff cos_arg_i_mult_zero_pos cos_arg_i_mult_zero_neg) |
|
14323 | 562 |
|
563 |
||
564 |
subsection{*Finally! Polar Form for Complex Numbers*} |
|
565 |
||
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
566 |
definition |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
567 |
|
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
568 |
(* abbreviation for (cos a + i sin a) *) |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20763
diff
changeset
|
569 |
cis :: "real => complex" where |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
570 |
"cis a = Complex (cos a) (sin a)" |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
571 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20763
diff
changeset
|
572 |
definition |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
573 |
(* abbreviation for r*(cos a + i sin a) *) |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20763
diff
changeset
|
574 |
rcis :: "[real, real] => complex" where |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
575 |
"rcis r a = complex_of_real r * cis a" |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
576 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20763
diff
changeset
|
577 |
definition |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
578 |
(* e ^ (x + iy) *) |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20763
diff
changeset
|
579 |
expi :: "complex => complex" where |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
580 |
"expi z = complex_of_real(exp (Re z)) * cis (Im z)" |
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
581 |
|
14374 | 582 |
lemma complex_split_polar: |
14377 | 583 |
"\<exists>r a. z = complex_of_real r * (Complex (cos a) (sin a))" |
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
584 |
apply (induct z) |
14377 | 585 |
apply (auto simp add: polar_Ex complex_of_real_mult_Complex) |
14323 | 586 |
done |
587 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
588 |
lemma rcis_Ex: "\<exists>r a. z = rcis r a" |
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
589 |
apply (induct z) |
14377 | 590 |
apply (simp add: rcis_def cis_def polar_Ex complex_of_real_mult_Complex) |
14323 | 591 |
done |
592 |
||
14374 | 593 |
lemma Re_rcis [simp]: "Re(rcis r a) = r * cos a" |
14373 | 594 |
by (simp add: rcis_def cis_def) |
14323 | 595 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14341
diff
changeset
|
596 |
lemma Im_rcis [simp]: "Im(rcis r a) = r * sin a" |
14373 | 597 |
by (simp add: rcis_def cis_def) |
14323 | 598 |
|
14377 | 599 |
lemma sin_cos_squared_add2_mult: "(r * cos a)\<twosuperior> + (r * sin a)\<twosuperior> = r\<twosuperior>" |
600 |
proof - |
|
601 |
have "(r * cos a)\<twosuperior> + (r * sin a)\<twosuperior> = r\<twosuperior> * ((cos a)\<twosuperior> + (sin a)\<twosuperior>)" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
602 |
by (simp only: power_mult_distrib right_distrib) |
14377 | 603 |
thus ?thesis by simp |
604 |
qed |
|
14323 | 605 |
|
14374 | 606 |
lemma complex_mod_rcis [simp]: "cmod(rcis r a) = abs r" |
14377 | 607 |
by (simp add: rcis_def cis_def sin_cos_squared_add2_mult) |
14323 | 608 |
|
609 |
lemma complex_mod_sqrt_Re_mult_cnj: "cmod z = sqrt (Re (z * cnj z))" |
|
14373 | 610 |
apply (simp add: cmod_def) |
22956
617140080e6a
define roots of negative reals so that many lemmas no longer require side conditions; simplification solves more goals than previously
huffman
parents:
22914
diff
changeset
|
611 |
apply (simp add: complex_mult_cnj del: of_real_add) |
14323 | 612 |
done |
613 |
||
14374 | 614 |
lemma complex_Re_cnj [simp]: "Re(cnj z) = Re z" |
14373 | 615 |
by (induct z, simp add: complex_cnj) |
14323 | 616 |
|
14374 | 617 |
lemma complex_Im_cnj [simp]: "Im(cnj z) = - Im z" |
618 |
by (induct z, simp add: complex_cnj) |
|
619 |
||
620 |
lemma complex_In_mult_cnj_zero [simp]: "Im (z * cnj z) = 0" |
|
14373 | 621 |
by (induct z, simp add: complex_cnj complex_mult) |
14323 | 622 |
|
623 |
||
624 |
(*---------------------------------------------------------------------------*) |
|
625 |
(* (r1 * cis a) * (r2 * cis b) = r1 * r2 * cis (a + b) *) |
|
626 |
(*---------------------------------------------------------------------------*) |
|
627 |
||
628 |
lemma cis_rcis_eq: "cis a = rcis 1 a" |
|
14373 | 629 |
by (simp add: rcis_def) |
14323 | 630 |
|
14374 | 631 |
lemma rcis_mult: "rcis r1 a * rcis r2 b = rcis (r1*r2) (a + b)" |
15013 | 632 |
by (simp add: rcis_def cis_def cos_add sin_add right_distrib right_diff_distrib |
633 |
complex_of_real_def) |
|
14323 | 634 |
|
635 |
lemma cis_mult: "cis a * cis b = cis (a + b)" |
|
14373 | 636 |
by (simp add: cis_rcis_eq rcis_mult) |
14323 | 637 |
|
14374 | 638 |
lemma cis_zero [simp]: "cis 0 = 1" |
14377 | 639 |
by (simp add: cis_def complex_one_def) |
14323 | 640 |
|
14374 | 641 |
lemma rcis_zero_mod [simp]: "rcis 0 a = 0" |
14373 | 642 |
by (simp add: rcis_def) |
14323 | 643 |
|
14374 | 644 |
lemma rcis_zero_arg [simp]: "rcis r 0 = complex_of_real r" |
14373 | 645 |
by (simp add: rcis_def) |
14323 | 646 |
|
647 |
lemma complex_of_real_minus_one: |
|
648 |
"complex_of_real (-(1::real)) = -(1::complex)" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
649 |
by (simp add: complex_of_real_def complex_one_def) |
14323 | 650 |
|
14374 | 651 |
lemma complex_i_mult_minus [simp]: "ii * (ii * x) = - x" |
14373 | 652 |
by (simp add: complex_mult_assoc [symmetric]) |
14323 | 653 |
|
654 |
||
655 |
lemma cis_real_of_nat_Suc_mult: |
|
656 |
"cis (real (Suc n) * a) = cis a * cis (real n * a)" |
|
14377 | 657 |
by (simp add: cis_def real_of_nat_Suc left_distrib cos_add sin_add right_distrib) |
14323 | 658 |
|
659 |
lemma DeMoivre: "(cis a) ^ n = cis (real n * a)" |
|
660 |
apply (induct_tac "n") |
|
661 |
apply (auto simp add: cis_real_of_nat_Suc_mult) |
|
662 |
done |
|
663 |
||
14374 | 664 |
lemma DeMoivre2: "(rcis r a) ^ n = rcis (r ^ n) (real n * a)" |
22890 | 665 |
by (simp add: rcis_def power_mult_distrib DeMoivre) |
14323 | 666 |
|
14374 | 667 |
lemma cis_inverse [simp]: "inverse(cis a) = cis (-a)" |
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
668 |
by (simp add: cis_def complex_inverse_complex_split diff_minus) |
14323 | 669 |
|
670 |
lemma rcis_inverse: "inverse(rcis r a) = rcis (1/r) (-a)" |
|
22884 | 671 |
by (simp add: divide_inverse rcis_def) |
14323 | 672 |
|
673 |
lemma cis_divide: "cis a / cis b = cis (a - b)" |
|
14373 | 674 |
by (simp add: complex_divide_def cis_mult real_diff_def) |
14323 | 675 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
676 |
lemma rcis_divide: "rcis r1 a / rcis r2 b = rcis (r1/r2) (a - b)" |
14373 | 677 |
apply (simp add: complex_divide_def) |
678 |
apply (case_tac "r2=0", simp) |
|
679 |
apply (simp add: rcis_inverse rcis_mult real_diff_def) |
|
14323 | 680 |
done |
681 |
||
14374 | 682 |
lemma Re_cis [simp]: "Re(cis a) = cos a" |
14373 | 683 |
by (simp add: cis_def) |
14323 | 684 |
|
14374 | 685 |
lemma Im_cis [simp]: "Im(cis a) = sin a" |
14373 | 686 |
by (simp add: cis_def) |
14323 | 687 |
|
688 |
lemma cos_n_Re_cis_pow_n: "cos (real n * a) = Re(cis a ^ n)" |
|
14334 | 689 |
by (auto simp add: DeMoivre) |
14323 | 690 |
|
691 |
lemma sin_n_Im_cis_pow_n: "sin (real n * a) = Im(cis a ^ n)" |
|
14334 | 692 |
by (auto simp add: DeMoivre) |
14323 | 693 |
|
694 |
lemma expi_add: "expi(a + b) = expi(a) * expi(b)" |
|
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
695 |
by (simp add: expi_def exp_add cis_mult [symmetric] mult_ac) |
14323 | 696 |
|
14374 | 697 |
lemma expi_zero [simp]: "expi (0::complex) = 1" |
14373 | 698 |
by (simp add: expi_def) |
14323 | 699 |
|
14374 | 700 |
lemma complex_expi_Ex: "\<exists>a r. z = complex_of_real r * expi a" |
14373 | 701 |
apply (insert rcis_Ex [of z]) |
22884 | 702 |
apply (auto simp add: expi_def rcis_def complex_mult_assoc [symmetric]) |
14334 | 703 |
apply (rule_tac x = "ii * complex_of_real a" in exI, auto) |
14323 | 704 |
done |
705 |
||
706 |
||
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
707 |
subsection{*Numerals and Arithmetic*} |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
708 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
709 |
instance complex :: number .. |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
710 |
|
15013 | 711 |
defs (overloaded) |
20485 | 712 |
complex_number_of_def: "(number_of w :: complex) == of_int w" |
15013 | 713 |
--{*the type constraint is essential!*} |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
714 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
715 |
instance complex :: number_ring |
20725
72e20198f834
instance complex :: real_normed_field; cleaned up
huffman
parents:
20560
diff
changeset
|
716 |
by (intro_classes, simp add: complex_number_of_def) |
15013 | 717 |
|
22914 | 718 |
lemma complex_number_of: "complex_of_real (number_of w) = number_of w" |
20557
81dd3679f92c
complex_of_real abbreviates of_real::real=>complex;
huffman
parents:
20556
diff
changeset
|
719 |
by (rule of_real_number_of_eq) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
720 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
721 |
lemma complex_number_of_cnj [simp]: "cnj(number_of v :: complex) = number_of v" |
15481 | 722 |
by (simp only: complex_number_of [symmetric] complex_cnj_complex_of_real) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
723 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
724 |
lemma complex_number_of_cmod: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
725 |
"cmod(number_of v :: complex) = abs (number_of v :: real)" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
726 |
by (simp only: complex_number_of [symmetric] complex_mod_complex_of_real) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
727 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
728 |
lemma complex_number_of_Re [simp]: "Re(number_of v :: complex) = number_of v" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
729 |
by (simp only: complex_number_of [symmetric] Re_complex_of_real) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
730 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
731 |
lemma complex_number_of_Im [simp]: "Im(number_of v :: complex) = 0" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
732 |
by (simp only: complex_number_of [symmetric] Im_complex_of_real) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
733 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
734 |
lemma expi_two_pi_i [simp]: "expi((2::complex) * complex_of_real pi * ii) = 1" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
735 |
by (simp add: expi_def complex_Re_mult_eq complex_Im_mult_eq cis_def) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
736 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
737 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
738 |
(*examples: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
739 |
print_depth 22 |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
740 |
set timing; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
741 |
set trace_simp; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
742 |
fun test s = (Goal s, by (Simp_tac 1)); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
743 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
744 |
test "23 * ii + 45 * ii= (x::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
745 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
746 |
test "5 * ii + 12 - 45 * ii= (x::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
747 |
test "5 * ii + 40 - 12 * ii + 9 = (x::complex) + 89 * ii"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
748 |
test "5 * ii + 40 - 12 * ii + 9 - 78 = (x::complex) + 89 * ii"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
749 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
750 |
test "l + 10 * ii + 90 + 3*l + 9 + 45 * ii= (x::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
751 |
test "87 + 10 * ii + 90 + 3*7 + 9 + 45 * ii= (x::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
752 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
753 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
754 |
fun test s = (Goal s; by (Asm_simp_tac 1)); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
755 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
756 |
test "x*k = k*(y::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
757 |
test "k = k*(y::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
758 |
test "a*(b*c) = (b::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
759 |
test "a*(b*c) = d*(b::complex)*(x*a)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
760 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
761 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
762 |
test "(x*k) / (k*(y::complex)) = (uu::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
763 |
test "(k) / (k*(y::complex)) = (uu::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
764 |
test "(a*(b*c)) / ((b::complex)) = (uu::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
765 |
test "(a*(b*c)) / (d*(b::complex)*(x*a)) = (uu::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
766 |
|
15003 | 767 |
FIXME: what do we do about this? |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
768 |
test "a*(b*c)/(y*z) = d*(b::complex)*(x*a)/z"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
769 |
*) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
770 |
|
13957 | 771 |
end |