author | paulson |
Thu, 29 Jul 2004 16:14:42 +0200 | |
changeset 15085 | 5693a977a767 |
parent 15013 | 34264f5e4691 |
child 15131 | c69542757a4d |
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 |
|
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15013
diff
changeset
|
10 |
theory Complex = "../Hyperreal/HLog": |
13957 | 11 |
|
14373 | 12 |
datatype complex = Complex real real |
13957 | 13 |
|
14691 | 14 |
instance complex :: "{zero, one, plus, times, minus, inverse, power}" .. |
13957 | 15 |
|
16 |
consts |
|
14373 | 17 |
"ii" :: complex ("\<i>") |
18 |
||
19 |
consts Re :: "complex => real" |
|
20 |
primrec "Re (Complex x y) = x" |
|
21 |
||
22 |
consts Im :: "complex => real" |
|
23 |
primrec "Im (Complex x y) = y" |
|
24 |
||
25 |
lemma complex_surj [simp]: "Complex (Re z) (Im z) = z" |
|
26 |
by (induct z) simp |
|
13957 | 27 |
|
28 |
constdefs |
|
29 |
||
30 |
(*----------- modulus ------------*) |
|
31 |
||
14323 | 32 |
cmod :: "complex => real" |
33 |
"cmod z == sqrt(Re(z) ^ 2 + Im(z) ^ 2)" |
|
13957 | 34 |
|
14323 | 35 |
(*----- injection from reals -----*) |
36 |
||
37 |
complex_of_real :: "real => complex" |
|
14373 | 38 |
"complex_of_real r == Complex r 0" |
14323 | 39 |
|
13957 | 40 |
(*------- complex conjugate ------*) |
41 |
||
14323 | 42 |
cnj :: "complex => complex" |
14373 | 43 |
"cnj z == Complex (Re z) (-Im z)" |
13957 | 44 |
|
14323 | 45 |
(*------------ Argand -------------*) |
13957 | 46 |
|
14323 | 47 |
sgn :: "complex => complex" |
13957 | 48 |
"sgn z == z / complex_of_real(cmod z)" |
49 |
||
14323 | 50 |
arg :: "complex => real" |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
51 |
"arg z == @a. Re(sgn z) = cos a & Im(sgn z) = sin a & -pi < a & a \<le> pi" |
14323 | 52 |
|
13957 | 53 |
|
14323 | 54 |
defs (overloaded) |
55 |
||
56 |
complex_zero_def: |
|
14373 | 57 |
"0 == Complex 0 0" |
13957 | 58 |
|
14323 | 59 |
complex_one_def: |
14373 | 60 |
"1 == Complex 1 0" |
14323 | 61 |
|
14373 | 62 |
i_def: "ii == Complex 0 1" |
14323 | 63 |
|
14373 | 64 |
complex_minus_def: "- z == Complex (- Re z) (- Im z)" |
14323 | 65 |
|
66 |
complex_inverse_def: |
|
14373 | 67 |
"inverse z == |
68 |
Complex (Re z / ((Re z)\<twosuperior> + (Im z)\<twosuperior>)) (- Im z / ((Re z)\<twosuperior> + (Im z)\<twosuperior>))" |
|
13957 | 69 |
|
14323 | 70 |
complex_add_def: |
14373 | 71 |
"z + w == Complex (Re z + Re w) (Im z + Im w)" |
13957 | 72 |
|
14323 | 73 |
complex_diff_def: |
14373 | 74 |
"z - w == z + - (w::complex)" |
13957 | 75 |
|
14374 | 76 |
complex_mult_def: |
14373 | 77 |
"z * w == Complex (Re z * Re w - Im z * Im w) (Re z * Im w + Im z * Re w)" |
13957 | 78 |
|
14373 | 79 |
complex_divide_def: "w / (z::complex) == w * inverse z" |
14323 | 80 |
|
13957 | 81 |
|
82 |
constdefs |
|
83 |
||
84 |
(* abbreviation for (cos a + i sin a) *) |
|
14323 | 85 |
cis :: "real => complex" |
14377 | 86 |
"cis a == Complex (cos a) (sin a)" |
13957 | 87 |
|
88 |
(* abbreviation for r*(cos a + i sin a) *) |
|
14323 | 89 |
rcis :: "[real, real] => complex" |
13957 | 90 |
"rcis r a == complex_of_real r * cis a" |
91 |
||
92 |
(* e ^ (x + iy) *) |
|
14323 | 93 |
expi :: "complex => complex" |
13957 | 94 |
"expi z == complex_of_real(exp (Re z)) * cis (Im z)" |
14323 | 95 |
|
96 |
||
14373 | 97 |
lemma complex_equality [intro?]: "Re z = Re w ==> Im z = Im w ==> z = w" |
98 |
by (induct z, induct w) simp |
|
14323 | 99 |
|
14374 | 100 |
lemma Re [simp]: "Re(Complex x y) = x" |
14373 | 101 |
by simp |
14323 | 102 |
|
14374 | 103 |
lemma Im [simp]: "Im(Complex x y) = y" |
14373 | 104 |
by simp |
14323 | 105 |
|
106 |
lemma complex_Re_Im_cancel_iff: "(w=z) = (Re(w) = Re(z) & Im(w) = Im(z))" |
|
14373 | 107 |
by (induct w, induct z, simp) |
14323 | 108 |
|
14374 | 109 |
lemma complex_Re_zero [simp]: "Re 0 = 0" |
110 |
by (simp add: complex_zero_def) |
|
111 |
||
112 |
lemma complex_Im_zero [simp]: "Im 0 = 0" |
|
14373 | 113 |
by (simp add: complex_zero_def) |
14323 | 114 |
|
14374 | 115 |
lemma complex_Re_one [simp]: "Re 1 = 1" |
116 |
by (simp add: complex_one_def) |
|
14323 | 117 |
|
14374 | 118 |
lemma complex_Im_one [simp]: "Im 1 = 0" |
14373 | 119 |
by (simp add: complex_one_def) |
14323 | 120 |
|
14374 | 121 |
lemma complex_Re_i [simp]: "Re(ii) = 0" |
14373 | 122 |
by (simp add: i_def) |
14323 | 123 |
|
14374 | 124 |
lemma complex_Im_i [simp]: "Im(ii) = 1" |
14373 | 125 |
by (simp add: i_def) |
14323 | 126 |
|
14374 | 127 |
lemma Re_complex_of_real [simp]: "Re(complex_of_real z) = z" |
14373 | 128 |
by (simp add: complex_of_real_def) |
14323 | 129 |
|
14374 | 130 |
lemma Im_complex_of_real [simp]: "Im(complex_of_real z) = 0" |
14373 | 131 |
by (simp add: complex_of_real_def) |
14323 | 132 |
|
133 |
||
14374 | 134 |
subsection{*Unary Minus*} |
14323 | 135 |
|
14377 | 136 |
lemma complex_minus [simp]: "- (Complex x y) = Complex (-x) (-y)" |
14373 | 137 |
by (simp add: complex_minus_def) |
14323 | 138 |
|
14374 | 139 |
lemma complex_Re_minus [simp]: "Re (-z) = - Re z" |
14373 | 140 |
by (simp add: complex_minus_def) |
14323 | 141 |
|
14374 | 142 |
lemma complex_Im_minus [simp]: "Im (-z) = - Im z" |
143 |
by (simp add: complex_minus_def) |
|
14323 | 144 |
|
145 |
||
146 |
subsection{*Addition*} |
|
147 |
||
14377 | 148 |
lemma complex_add [simp]: |
149 |
"Complex x1 y1 + Complex x2 y2 = Complex (x1+x2) (y1+y2)" |
|
14373 | 150 |
by (simp add: complex_add_def) |
14323 | 151 |
|
14374 | 152 |
lemma complex_Re_add [simp]: "Re(x + y) = Re(x) + Re(y)" |
14373 | 153 |
by (simp add: complex_add_def) |
14323 | 154 |
|
14374 | 155 |
lemma complex_Im_add [simp]: "Im(x + y) = Im(x) + Im(y)" |
14373 | 156 |
by (simp add: complex_add_def) |
14323 | 157 |
|
158 |
lemma complex_add_commute: "(u::complex) + v = v + u" |
|
14373 | 159 |
by (simp add: complex_add_def add_commute) |
14323 | 160 |
|
161 |
lemma complex_add_assoc: "((u::complex) + v) + w = u + (v + w)" |
|
14373 | 162 |
by (simp add: complex_add_def add_assoc) |
14323 | 163 |
|
164 |
lemma complex_add_zero_left: "(0::complex) + z = z" |
|
14373 | 165 |
by (simp add: complex_add_def complex_zero_def) |
14323 | 166 |
|
167 |
lemma complex_add_zero_right: "z + (0::complex) = z" |
|
14373 | 168 |
by (simp add: complex_add_def complex_zero_def) |
14323 | 169 |
|
14373 | 170 |
lemma complex_add_minus_left: "-z + z = (0::complex)" |
171 |
by (simp add: complex_add_def complex_minus_def complex_zero_def) |
|
14323 | 172 |
|
173 |
lemma complex_diff: |
|
14373 | 174 |
"Complex x1 y1 - Complex x2 y2 = Complex (x1-x2) (y1-y2)" |
175 |
by (simp add: complex_add_def complex_minus_def complex_diff_def) |
|
14323 | 176 |
|
14374 | 177 |
lemma complex_Re_diff [simp]: "Re(x - y) = Re(x) - Re(y)" |
178 |
by (simp add: complex_diff_def) |
|
179 |
||
180 |
lemma complex_Im_diff [simp]: "Im(x - y) = Im(x) - Im(y)" |
|
181 |
by (simp add: complex_diff_def) |
|
182 |
||
183 |
||
14323 | 184 |
subsection{*Multiplication*} |
185 |
||
14377 | 186 |
lemma complex_mult [simp]: |
14373 | 187 |
"Complex x1 y1 * Complex x2 y2 = Complex (x1*x2 - y1*y2) (x1*y2 + y1*x2)" |
188 |
by (simp add: complex_mult_def) |
|
14323 | 189 |
|
190 |
lemma complex_mult_commute: "(w::complex) * z = z * w" |
|
14373 | 191 |
by (simp add: complex_mult_def mult_commute add_commute) |
14323 | 192 |
|
193 |
lemma complex_mult_assoc: "((u::complex) * v) * w = u * (v * w)" |
|
14374 | 194 |
by (simp add: complex_mult_def mult_ac add_ac |
14373 | 195 |
right_diff_distrib right_distrib left_diff_distrib left_distrib) |
14323 | 196 |
|
197 |
lemma complex_mult_one_left: "(1::complex) * z = z" |
|
14373 | 198 |
by (simp add: complex_mult_def complex_one_def) |
14323 | 199 |
|
200 |
lemma complex_mult_one_right: "z * (1::complex) = z" |
|
14373 | 201 |
by (simp add: complex_mult_def complex_one_def) |
14323 | 202 |
|
203 |
||
204 |
subsection{*Inverse*} |
|
205 |
||
14377 | 206 |
lemma complex_inverse [simp]: |
14373 | 207 |
"inverse (Complex x y) = Complex (x/(x ^ 2 + y ^ 2)) (-y/(x ^ 2 + y ^ 2))" |
208 |
by (simp add: complex_inverse_def) |
|
14335 | 209 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
210 |
lemma complex_mult_inv_left: "z \<noteq> (0::complex) ==> inverse(z) * z = 1" |
14374 | 211 |
apply (induct z) |
212 |
apply (rename_tac x y) |
|
213 |
apply (auto simp add: complex_mult complex_inverse complex_one_def |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
214 |
complex_zero_def add_divide_distrib [symmetric] power2_eq_square mult_ac) |
14334 | 215 |
apply (drule_tac y = y in real_sum_squares_not_zero) |
216 |
apply (drule_tac [2] x = x in real_sum_squares_not_zero2, auto) |
|
14323 | 217 |
done |
218 |
||
14335 | 219 |
|
220 |
subsection {* The field of complex numbers *} |
|
221 |
||
222 |
instance complex :: field |
|
223 |
proof |
|
224 |
fix z u v w :: complex |
|
225 |
show "(u + v) + w = u + (v + w)" |
|
14374 | 226 |
by (rule complex_add_assoc) |
14335 | 227 |
show "z + w = w + z" |
14374 | 228 |
by (rule complex_add_commute) |
14335 | 229 |
show "0 + z = z" |
14374 | 230 |
by (rule complex_add_zero_left) |
14335 | 231 |
show "-z + z = 0" |
14374 | 232 |
by (rule complex_add_minus_left) |
14335 | 233 |
show "z - w = z + -w" |
234 |
by (simp add: complex_diff_def) |
|
235 |
show "(u * v) * w = u * (v * w)" |
|
14374 | 236 |
by (rule complex_mult_assoc) |
14335 | 237 |
show "z * w = w * z" |
14374 | 238 |
by (rule complex_mult_commute) |
14335 | 239 |
show "1 * z = z" |
14374 | 240 |
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
|
241 |
show "0 \<noteq> (1::complex)" |
14373 | 242 |
by (simp add: complex_zero_def complex_one_def) |
14335 | 243 |
show "(u + v) * w = u * w + v * w" |
14421
ee97b6463cb4
new Ring_and_Field hierarchy, eliminating redundant axioms
paulson
parents:
14387
diff
changeset
|
244 |
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
|
245 |
diff_minus add_ac) |
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
246 |
show "z / w = z * inverse w" |
14335 | 247 |
by (simp add: complex_divide_def) |
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
248 |
assume "w \<noteq> 0" |
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
249 |
thus "inverse w * w = 1" |
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
250 |
by (simp add: complex_mult_inv_left) |
14335 | 251 |
qed |
252 |
||
14373 | 253 |
instance complex :: division_by_zero |
254 |
proof |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
255 |
show "inverse 0 = (0::complex)" |
14373 | 256 |
by (simp add: complex_inverse_def complex_zero_def) |
257 |
qed |
|
14335 | 258 |
|
14323 | 259 |
|
260 |
subsection{*Embedding Properties for @{term complex_of_real} Map*} |
|
261 |
||
14377 | 262 |
lemma Complex_add_complex_of_real [simp]: |
263 |
"Complex x y + complex_of_real r = Complex (x+r) y" |
|
264 |
by (simp add: complex_of_real_def) |
|
265 |
||
266 |
lemma complex_of_real_add_Complex [simp]: |
|
267 |
"complex_of_real r + Complex x y = Complex (r+x) y" |
|
268 |
by (simp add: i_def complex_of_real_def) |
|
269 |
||
270 |
lemma Complex_mult_complex_of_real: |
|
271 |
"Complex x y * complex_of_real r = Complex (x*r) (y*r)" |
|
272 |
by (simp add: complex_of_real_def) |
|
273 |
||
274 |
lemma complex_of_real_mult_Complex: |
|
275 |
"complex_of_real r * Complex x y = Complex (r*x) (r*y)" |
|
276 |
by (simp add: i_def complex_of_real_def) |
|
277 |
||
278 |
lemma i_complex_of_real [simp]: "ii * complex_of_real r = Complex 0 r" |
|
279 |
by (simp add: i_def complex_of_real_def) |
|
280 |
||
281 |
lemma complex_of_real_i [simp]: "complex_of_real r * ii = Complex 0 r" |
|
282 |
by (simp add: i_def complex_of_real_def) |
|
283 |
||
14374 | 284 |
lemma complex_of_real_one [simp]: "complex_of_real 1 = 1" |
14373 | 285 |
by (simp add: complex_one_def complex_of_real_def) |
14323 | 286 |
|
14374 | 287 |
lemma complex_of_real_zero [simp]: "complex_of_real 0 = 0" |
14373 | 288 |
by (simp add: complex_zero_def complex_of_real_def) |
14323 | 289 |
|
14374 | 290 |
lemma complex_of_real_eq_iff [iff]: |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14341
diff
changeset
|
291 |
"(complex_of_real x = complex_of_real y) = (x = y)" |
14374 | 292 |
by (simp add: complex_of_real_def) |
14323 | 293 |
|
15013 | 294 |
lemma complex_of_real_minus [simp]: "complex_of_real(-x) = - complex_of_real x" |
14373 | 295 |
by (simp add: complex_of_real_def complex_minus) |
14323 | 296 |
|
15013 | 297 |
lemma complex_of_real_inverse [simp]: |
14374 | 298 |
"complex_of_real(inverse x) = inverse(complex_of_real x)" |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14341
diff
changeset
|
299 |
apply (case_tac "x=0", simp) |
15013 | 300 |
apply (simp add: complex_of_real_def divide_inverse power2_eq_square) |
14323 | 301 |
done |
302 |
||
15013 | 303 |
lemma complex_of_real_add [simp]: |
304 |
"complex_of_real (x + y) = complex_of_real x + complex_of_real y" |
|
14373 | 305 |
by (simp add: complex_add complex_of_real_def) |
14323 | 306 |
|
15013 | 307 |
lemma complex_of_real_diff [simp]: |
308 |
"complex_of_real (x - y) = complex_of_real x - complex_of_real y" |
|
309 |
by (simp add: complex_of_real_minus diff_minus) |
|
14323 | 310 |
|
15013 | 311 |
lemma complex_of_real_mult [simp]: |
312 |
"complex_of_real (x * y) = complex_of_real x * complex_of_real y" |
|
14373 | 313 |
by (simp add: complex_mult complex_of_real_def) |
14323 | 314 |
|
15013 | 315 |
lemma complex_of_real_divide [simp]: |
316 |
"complex_of_real(x/y) = complex_of_real x / complex_of_real y" |
|
14373 | 317 |
apply (simp add: complex_divide_def) |
318 |
apply (case_tac "y=0", simp) |
|
15013 | 319 |
apply (simp add: complex_of_real_mult complex_of_real_inverse |
320 |
divide_inverse) |
|
14323 | 321 |
done |
322 |
||
14377 | 323 |
lemma complex_mod [simp]: "cmod (Complex x y) = sqrt(x ^ 2 + y ^ 2)" |
14373 | 324 |
by (simp add: cmod_def) |
14323 | 325 |
|
14374 | 326 |
lemma complex_mod_zero [simp]: "cmod(0) = 0" |
14373 | 327 |
by (simp add: cmod_def) |
14323 | 328 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14341
diff
changeset
|
329 |
lemma complex_mod_one [simp]: "cmod(1) = 1" |
14353
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14348
diff
changeset
|
330 |
by (simp add: cmod_def power2_eq_square) |
14323 | 331 |
|
14374 | 332 |
lemma complex_mod_complex_of_real [simp]: "cmod(complex_of_real x) = abs x" |
14373 | 333 |
by (simp add: complex_of_real_def power2_eq_square complex_mod) |
14323 | 334 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14341
diff
changeset
|
335 |
lemma complex_of_real_abs: |
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14341
diff
changeset
|
336 |
"complex_of_real (abs x) = complex_of_real(cmod(complex_of_real x))" |
14373 | 337 |
by simp |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14341
diff
changeset
|
338 |
|
14323 | 339 |
|
14377 | 340 |
subsection{*The Functions @{term Re} and @{term Im}*} |
341 |
||
342 |
lemma complex_Re_mult_eq: "Re (w * z) = Re w * Re z - Im w * Im z" |
|
343 |
by (induct z, induct w, simp add: complex_mult) |
|
344 |
||
345 |
lemma complex_Im_mult_eq: "Im (w * z) = Re w * Im z + Im w * Re z" |
|
346 |
by (induct z, induct w, simp add: complex_mult) |
|
347 |
||
348 |
lemma Re_i_times [simp]: "Re(ii * z) = - Im z" |
|
349 |
by (simp add: complex_Re_mult_eq) |
|
350 |
||
351 |
lemma Re_times_i [simp]: "Re(z * ii) = - Im z" |
|
352 |
by (simp add: complex_Re_mult_eq) |
|
353 |
||
354 |
lemma Im_i_times [simp]: "Im(ii * z) = Re z" |
|
355 |
by (simp add: complex_Im_mult_eq) |
|
356 |
||
357 |
lemma Im_times_i [simp]: "Im(z * ii) = Re z" |
|
358 |
by (simp add: complex_Im_mult_eq) |
|
359 |
||
360 |
lemma complex_Re_mult: "[| Im w = 0; Im z = 0 |] ==> Re(w * z) = Re(w) * Re(z)" |
|
361 |
by (simp add: complex_Re_mult_eq) |
|
362 |
||
363 |
lemma complex_Re_mult_complex_of_real [simp]: |
|
364 |
"Re (z * complex_of_real c) = Re(z) * c" |
|
365 |
by (simp add: complex_Re_mult_eq) |
|
366 |
||
367 |
lemma complex_Im_mult_complex_of_real [simp]: |
|
368 |
"Im (z * complex_of_real c) = Im(z) * c" |
|
369 |
by (simp add: complex_Im_mult_eq) |
|
370 |
||
371 |
lemma complex_Re_mult_complex_of_real2 [simp]: |
|
372 |
"Re (complex_of_real c * z) = c * Re(z)" |
|
373 |
by (simp add: complex_Re_mult_eq) |
|
374 |
||
375 |
lemma complex_Im_mult_complex_of_real2 [simp]: |
|
376 |
"Im (complex_of_real c * z) = c * Im(z)" |
|
377 |
by (simp add: complex_Im_mult_eq) |
|
378 |
||
379 |
||
14323 | 380 |
subsection{*Conjugation is an Automorphism*} |
381 |
||
14373 | 382 |
lemma complex_cnj: "cnj (Complex x y) = Complex x (-y)" |
383 |
by (simp add: cnj_def) |
|
14323 | 384 |
|
14374 | 385 |
lemma complex_cnj_cancel_iff [simp]: "(cnj x = cnj y) = (x = y)" |
14373 | 386 |
by (simp add: cnj_def complex_Re_Im_cancel_iff) |
14323 | 387 |
|
14374 | 388 |
lemma complex_cnj_cnj [simp]: "cnj (cnj z) = z" |
14373 | 389 |
by (simp add: cnj_def) |
14323 | 390 |
|
14374 | 391 |
lemma complex_cnj_complex_of_real [simp]: |
14373 | 392 |
"cnj (complex_of_real x) = complex_of_real x" |
393 |
by (simp add: complex_of_real_def complex_cnj) |
|
14323 | 394 |
|
14374 | 395 |
lemma complex_mod_cnj [simp]: "cmod (cnj z) = cmod z" |
14373 | 396 |
by (induct z, simp add: complex_cnj complex_mod power2_eq_square) |
14323 | 397 |
|
398 |
lemma complex_cnj_minus: "cnj (-z) = - cnj z" |
|
14373 | 399 |
by (simp add: cnj_def complex_minus complex_Re_minus complex_Im_minus) |
14323 | 400 |
|
401 |
lemma complex_cnj_inverse: "cnj(inverse z) = inverse(cnj z)" |
|
14373 | 402 |
by (induct z, simp add: complex_cnj complex_inverse power2_eq_square) |
14323 | 403 |
|
404 |
lemma complex_cnj_add: "cnj(w + z) = cnj(w) + cnj(z)" |
|
14373 | 405 |
by (induct w, induct z, simp add: complex_cnj complex_add) |
14323 | 406 |
|
407 |
lemma complex_cnj_diff: "cnj(w - z) = cnj(w) - cnj(z)" |
|
15013 | 408 |
by (simp add: diff_minus complex_cnj_add complex_cnj_minus) |
14323 | 409 |
|
410 |
lemma complex_cnj_mult: "cnj(w * z) = cnj(w) * cnj(z)" |
|
14373 | 411 |
by (induct w, induct z, simp add: complex_cnj complex_mult) |
14323 | 412 |
|
413 |
lemma complex_cnj_divide: "cnj(w / z) = (cnj w)/(cnj z)" |
|
14373 | 414 |
by (simp add: complex_divide_def complex_cnj_mult complex_cnj_inverse) |
14323 | 415 |
|
14374 | 416 |
lemma complex_cnj_one [simp]: "cnj 1 = 1" |
14373 | 417 |
by (simp add: cnj_def complex_one_def) |
14323 | 418 |
|
419 |
lemma complex_add_cnj: "z + cnj z = complex_of_real (2 * Re(z))" |
|
14373 | 420 |
by (induct z, simp add: complex_add complex_cnj complex_of_real_def) |
14323 | 421 |
|
422 |
lemma complex_diff_cnj: "z - cnj z = complex_of_real (2 * Im(z)) * ii" |
|
14373 | 423 |
apply (induct z) |
15013 | 424 |
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
|
425 |
complex_minus i_def complex_mult) |
14323 | 426 |
done |
427 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
428 |
lemma complex_cnj_zero [simp]: "cnj 0 = 0" |
14334 | 429 |
by (simp add: cnj_def complex_zero_def) |
14323 | 430 |
|
14374 | 431 |
lemma complex_cnj_zero_iff [iff]: "(cnj z = 0) = (z = 0)" |
14373 | 432 |
by (induct z, simp add: complex_zero_def complex_cnj) |
14323 | 433 |
|
434 |
lemma complex_mult_cnj: "z * cnj z = complex_of_real (Re(z) ^ 2 + Im(z) ^ 2)" |
|
14374 | 435 |
by (induct z, |
436 |
simp add: complex_cnj complex_mult complex_of_real_def power2_eq_square) |
|
14323 | 437 |
|
438 |
||
439 |
subsection{*Modulus*} |
|
440 |
||
14374 | 441 |
lemma complex_mod_eq_zero_cancel [simp]: "(cmod x = 0) = (x = 0)" |
14373 | 442 |
apply (induct x) |
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15013
diff
changeset
|
443 |
apply (auto iff: real_0_le_add_iff |
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15013
diff
changeset
|
444 |
intro: real_sum_squares_cancel real_sum_squares_cancel2 |
14373 | 445 |
simp add: complex_mod complex_zero_def power2_eq_square) |
14323 | 446 |
done |
447 |
||
14374 | 448 |
lemma complex_mod_complex_of_real_of_nat [simp]: |
14373 | 449 |
"cmod (complex_of_real(real (n::nat))) = real n" |
450 |
by simp |
|
14323 | 451 |
|
14374 | 452 |
lemma complex_mod_minus [simp]: "cmod (-x) = cmod(x)" |
14373 | 453 |
by (induct x, simp add: complex_mod complex_minus power2_eq_square) |
14323 | 454 |
|
455 |
lemma complex_mod_mult_cnj: "cmod(z * cnj(z)) = cmod(z) ^ 2" |
|
14373 | 456 |
apply (induct z, simp add: complex_mod complex_cnj complex_mult) |
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15013
diff
changeset
|
457 |
apply (simp add: power2_eq_square abs_if linorder_not_less real_0_le_add_iff) |
14323 | 458 |
done |
459 |
||
14373 | 460 |
lemma complex_mod_squared: "cmod(Complex x y) ^ 2 = x ^ 2 + y ^ 2" |
461 |
by (simp add: cmod_def) |
|
14323 | 462 |
|
14374 | 463 |
lemma complex_mod_ge_zero [simp]: "0 \<le> cmod x" |
14373 | 464 |
by (simp add: cmod_def) |
14323 | 465 |
|
14374 | 466 |
lemma abs_cmod_cancel [simp]: "abs(cmod x) = cmod x" |
467 |
by (simp add: abs_if linorder_not_less) |
|
14323 | 468 |
|
469 |
lemma complex_mod_mult: "cmod(x*y) = cmod(x) * cmod(y)" |
|
14373 | 470 |
apply (induct x, induct y) |
14377 | 471 |
apply (auto simp add: complex_mult complex_mod real_sqrt_mult_distrib2[symmetric]) |
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14341
diff
changeset
|
472 |
apply (rule_tac n = 1 in power_inject_base) |
14353
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14348
diff
changeset
|
473 |
apply (auto simp add: power2_eq_square [symmetric] simp del: realpow_Suc) |
14374 | 474 |
apply (auto simp add: real_diff_def power2_eq_square right_distrib left_distrib |
475 |
add_ac mult_ac) |
|
14323 | 476 |
done |
477 |
||
14377 | 478 |
lemma cmod_unit_one [simp]: "cmod (Complex (cos a) (sin a)) = 1" |
479 |
by (simp add: cmod_def) |
|
480 |
||
481 |
lemma cmod_complex_polar [simp]: |
|
482 |
"cmod (complex_of_real r * Complex (cos a) (sin a)) = abs r" |
|
483 |
by (simp only: cmod_unit_one complex_mod_mult, simp) |
|
484 |
||
14374 | 485 |
lemma complex_mod_add_squared_eq: |
486 |
"cmod(x + y) ^ 2 = cmod(x) ^ 2 + cmod(y) ^ 2 + 2 * Re(x * cnj y)" |
|
14373 | 487 |
apply (induct x, induct y) |
14323 | 488 |
apply (auto simp add: complex_add complex_mod_squared complex_mult complex_cnj real_diff_def simp del: realpow_Suc) |
14353
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14348
diff
changeset
|
489 |
apply (auto simp add: right_distrib left_distrib power2_eq_square mult_ac add_ac) |
14323 | 490 |
done |
491 |
||
14374 | 492 |
lemma complex_Re_mult_cnj_le_cmod [simp]: "Re(x * cnj y) \<le> cmod(x * cnj y)" |
14373 | 493 |
apply (induct x, induct y) |
14323 | 494 |
apply (auto simp add: complex_mod complex_mult complex_cnj real_diff_def simp del: realpow_Suc) |
495 |
done |
|
496 |
||
14374 | 497 |
lemma complex_Re_mult_cnj_le_cmod2 [simp]: "Re(x * cnj y) \<le> cmod(x * y)" |
14373 | 498 |
by (insert complex_Re_mult_cnj_le_cmod [of x y], simp add: complex_mod_mult) |
14323 | 499 |
|
14374 | 500 |
lemma real_sum_squared_expand: |
501 |
"((x::real) + y) ^ 2 = x ^ 2 + y ^ 2 + 2 * x * y" |
|
14373 | 502 |
by (simp add: left_distrib right_distrib power2_eq_square) |
14323 | 503 |
|
14374 | 504 |
lemma complex_mod_triangle_squared [simp]: |
505 |
"cmod (x + y) ^ 2 \<le> (cmod(x) + cmod(y)) ^ 2" |
|
14373 | 506 |
by (simp add: real_sum_squared_expand complex_mod_add_squared_eq real_mult_assoc complex_mod_mult [symmetric]) |
14323 | 507 |
|
14374 | 508 |
lemma complex_mod_minus_le_complex_mod [simp]: "- cmod x \<le> cmod x" |
14373 | 509 |
by (rule order_trans [OF _ complex_mod_ge_zero], simp) |
14323 | 510 |
|
14374 | 511 |
lemma complex_mod_triangle_ineq [simp]: "cmod (x + y) \<le> cmod(x) + cmod(y)" |
14334 | 512 |
apply (rule_tac n = 1 in realpow_increasing) |
14323 | 513 |
apply (auto intro: order_trans [OF _ complex_mod_ge_zero] |
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15013
diff
changeset
|
514 |
simp add: add_increasing power2_eq_square [symmetric]) |
14323 | 515 |
done |
516 |
||
14374 | 517 |
lemma complex_mod_triangle_ineq2 [simp]: "cmod(b + a) - cmod b \<le> cmod a" |
14373 | 518 |
by (insert complex_mod_triangle_ineq [THEN add_right_mono, of b a"-cmod b"], simp) |
14323 | 519 |
|
520 |
lemma complex_mod_diff_commute: "cmod (x - y) = cmod (y - x)" |
|
14373 | 521 |
apply (induct x, induct y) |
14353
79f9fbef9106
Added lemmas to Ring_and_Field with slightly modified simplification rules
paulson
parents:
14348
diff
changeset
|
522 |
apply (auto simp add: complex_diff complex_mod right_diff_distrib power2_eq_square left_diff_distrib add_ac mult_ac) |
14323 | 523 |
done |
524 |
||
14374 | 525 |
lemma complex_mod_add_less: |
526 |
"[| cmod x < r; cmod y < s |] ==> cmod (x + y) < r + s" |
|
14334 | 527 |
by (auto intro: order_le_less_trans complex_mod_triangle_ineq) |
14323 | 528 |
|
14374 | 529 |
lemma complex_mod_mult_less: |
530 |
"[| cmod x < r; cmod y < s |] ==> cmod (x * y) < r * s" |
|
14334 | 531 |
by (auto intro: real_mult_less_mono' simp add: complex_mod_mult) |
14323 | 532 |
|
14374 | 533 |
lemma complex_mod_diff_ineq [simp]: "cmod(a) - cmod(b) \<le> cmod(a + b)" |
14323 | 534 |
apply (rule linorder_cases [of "cmod(a)" "cmod (b)"]) |
535 |
apply auto |
|
14334 | 536 |
apply (rule order_trans [of _ 0], rule order_less_imp_le) |
14374 | 537 |
apply (simp add: compare_rls, simp) |
14323 | 538 |
apply (simp add: compare_rls) |
539 |
apply (rule complex_mod_minus [THEN subst]) |
|
540 |
apply (rule order_trans) |
|
541 |
apply (rule_tac [2] complex_mod_triangle_ineq) |
|
14373 | 542 |
apply (auto simp add: add_ac) |
14323 | 543 |
done |
544 |
||
14374 | 545 |
lemma complex_Re_le_cmod [simp]: "Re z \<le> cmod z" |
14373 | 546 |
by (induct z, simp add: complex_mod del: realpow_Suc) |
14323 | 547 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
548 |
lemma complex_mod_gt_zero: "z \<noteq> 0 ==> 0 < cmod z" |
14373 | 549 |
apply (insert complex_mod_ge_zero [of z]) |
14334 | 550 |
apply (drule order_le_imp_less_or_eq, auto) |
14323 | 551 |
done |
552 |
||
553 |
||
554 |
subsection{*A Few More Theorems*} |
|
555 |
||
556 |
lemma complex_mod_inverse: "cmod(inverse x) = inverse(cmod x)" |
|
14373 | 557 |
apply (case_tac "x=0", simp) |
14323 | 558 |
apply (rule_tac c1 = "cmod x" in real_mult_left_cancel [THEN iffD1]) |
559 |
apply (auto simp add: complex_mod_mult [symmetric]) |
|
560 |
done |
|
561 |
||
14373 | 562 |
lemma complex_mod_divide: "cmod(x/y) = cmod(x)/(cmod y)" |
15013 | 563 |
by (simp add: complex_divide_def divide_inverse complex_mod_mult complex_mod_inverse) |
14323 | 564 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
565 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
566 |
subsection{*Exponentiation*} |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
567 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
568 |
primrec |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
569 |
complexpow_0: "z ^ 0 = 1" |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
570 |
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
|
571 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
572 |
|
15003 | 573 |
instance complex :: recpower |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
574 |
proof |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
575 |
fix z :: complex |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
576 |
fix n :: nat |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
577 |
show "z^0 = 1" by simp |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
578 |
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
|
579 |
qed |
14323 | 580 |
|
581 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
582 |
lemma complex_of_real_pow: "complex_of_real (x ^ n) = (complex_of_real x) ^ n" |
14323 | 583 |
apply (induct_tac "n") |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
584 |
apply (auto simp add: complex_of_real_mult [symmetric]) |
14323 | 585 |
done |
586 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
587 |
lemma complex_cnj_pow: "cnj(z ^ n) = cnj(z) ^ n" |
14323 | 588 |
apply (induct_tac "n") |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
589 |
apply (auto simp add: complex_cnj_mult) |
14323 | 590 |
done |
591 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
592 |
lemma complex_mod_complexpow: "cmod(x ^ n) = cmod(x) ^ n" |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
593 |
apply (induct_tac "n") |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
594 |
apply (auto simp add: complex_mod_mult) |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
595 |
done |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
596 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
597 |
lemma complexpow_i_squared [simp]: "ii ^ 2 = -(1::complex)" |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
598 |
by (simp add: i_def complex_mult complex_one_def complex_minus numeral_2_eq_2) |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
599 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
600 |
lemma complex_i_not_zero [simp]: "ii \<noteq> 0" |
14373 | 601 |
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
|
602 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
603 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
604 |
subsection{*The Function @{term sgn}*} |
14323 | 605 |
|
14374 | 606 |
lemma sgn_zero [simp]: "sgn 0 = 0" |
14373 | 607 |
by (simp add: sgn_def) |
14323 | 608 |
|
14374 | 609 |
lemma sgn_one [simp]: "sgn 1 = 1" |
14373 | 610 |
by (simp add: sgn_def) |
14323 | 611 |
|
612 |
lemma sgn_minus: "sgn (-z) = - sgn(z)" |
|
14373 | 613 |
by (simp add: sgn_def) |
14323 | 614 |
|
14374 | 615 |
lemma sgn_eq: "sgn z = z / complex_of_real (cmod z)" |
14377 | 616 |
by (simp add: sgn_def) |
14323 | 617 |
|
618 |
lemma i_mult_eq: "ii * ii = complex_of_real (-1)" |
|
14373 | 619 |
by (simp add: i_def complex_of_real_def complex_mult complex_add) |
14323 | 620 |
|
14374 | 621 |
lemma i_mult_eq2 [simp]: "ii * ii = -(1::complex)" |
14373 | 622 |
by (simp add: i_def complex_one_def complex_mult complex_minus) |
14323 | 623 |
|
14374 | 624 |
lemma complex_eq_cancel_iff2 [simp]: |
14377 | 625 |
"(Complex x y = complex_of_real xa) = (x = xa & y = 0)" |
626 |
by (simp add: complex_of_real_def) |
|
14323 | 627 |
|
14374 | 628 |
lemma complex_eq_cancel_iff2a [simp]: |
14377 | 629 |
"(Complex x y = complex_of_real xa) = (x = xa & y = 0)" |
630 |
by (simp add: complex_of_real_def) |
|
14323 | 631 |
|
14377 | 632 |
lemma Complex_eq_0 [simp]: "(Complex x y = 0) = (x = 0 & y = 0)" |
633 |
by (simp add: complex_zero_def) |
|
14323 | 634 |
|
14377 | 635 |
lemma Complex_eq_1 [simp]: "(Complex x y = 1) = (x = 1 & y = 0)" |
636 |
by (simp add: complex_one_def) |
|
14323 | 637 |
|
14377 | 638 |
lemma Complex_eq_i [simp]: "(Complex x y = ii) = (x = 0 & y = 1)" |
639 |
by (simp add: i_def) |
|
14323 | 640 |
|
15013 | 641 |
|
642 |
||
14374 | 643 |
lemma Re_sgn [simp]: "Re(sgn z) = Re(z)/cmod z" |
15013 | 644 |
proof (induct z) |
645 |
case (Complex x y) |
|
646 |
have "sqrt (x\<twosuperior> + y\<twosuperior>) * inverse (x\<twosuperior> + y\<twosuperior>) = inverse (sqrt (x\<twosuperior> + y\<twosuperior>))" |
|
647 |
by (simp add: divide_inverse [symmetric] sqrt_divide_self_eq) |
|
648 |
thus "Re (sgn (Complex x y)) = Re (Complex x y) /cmod (Complex x y)" |
|
649 |
by (simp add: sgn_def complex_of_real_def divide_inverse) |
|
650 |
qed |
|
651 |
||
14323 | 652 |
|
14374 | 653 |
lemma Im_sgn [simp]: "Im(sgn z) = Im(z)/cmod z" |
15013 | 654 |
proof (induct z) |
655 |
case (Complex x y) |
|
656 |
have "sqrt (x\<twosuperior> + y\<twosuperior>) * inverse (x\<twosuperior> + y\<twosuperior>) = inverse (sqrt (x\<twosuperior> + y\<twosuperior>))" |
|
657 |
by (simp add: divide_inverse [symmetric] sqrt_divide_self_eq) |
|
658 |
thus "Im (sgn (Complex x y)) = Im (Complex x y) /cmod (Complex x y)" |
|
659 |
by (simp add: sgn_def complex_of_real_def divide_inverse) |
|
660 |
qed |
|
14323 | 661 |
|
662 |
lemma complex_inverse_complex_split: |
|
663 |
"inverse(complex_of_real x + ii * complex_of_real y) = |
|
664 |
complex_of_real(x/(x ^ 2 + y ^ 2)) - |
|
665 |
ii * complex_of_real(y/(x ^ 2 + y ^ 2))" |
|
14374 | 666 |
by (simp add: complex_of_real_def i_def complex_mult complex_add |
15013 | 667 |
diff_minus complex_minus complex_inverse divide_inverse) |
14323 | 668 |
|
669 |
(*----------------------------------------------------------------------------*) |
|
670 |
(* Many of the theorems below need to be moved elsewhere e.g. Transc. Also *) |
|
671 |
(* many of the theorems are not used - so should they be kept? *) |
|
672 |
(*----------------------------------------------------------------------------*) |
|
673 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
674 |
lemma complex_of_real_zero_iff [simp]: "(complex_of_real y = 0) = (y = 0)" |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
675 |
by (auto simp add: complex_zero_def complex_of_real_def) |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
676 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
677 |
lemma cos_arg_i_mult_zero_pos: |
14377 | 678 |
"0 < y ==> cos (arg(Complex 0 y)) = 0" |
14373 | 679 |
apply (simp add: arg_def abs_if) |
14334 | 680 |
apply (rule_tac a = "pi/2" in someI2, auto) |
681 |
apply (rule order_less_trans [of _ 0], auto) |
|
14323 | 682 |
done |
683 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
684 |
lemma cos_arg_i_mult_zero_neg: |
14377 | 685 |
"y < 0 ==> cos (arg(Complex 0 y)) = 0" |
14373 | 686 |
apply (simp add: arg_def abs_if) |
14334 | 687 |
apply (rule_tac a = "- pi/2" in someI2, auto) |
688 |
apply (rule order_trans [of _ 0], auto) |
|
14323 | 689 |
done |
690 |
||
14374 | 691 |
lemma cos_arg_i_mult_zero [simp]: |
14377 | 692 |
"y \<noteq> 0 ==> cos (arg(Complex 0 y)) = 0" |
693 |
by (auto simp add: linorder_neq_iff cos_arg_i_mult_zero_pos cos_arg_i_mult_zero_neg) |
|
14323 | 694 |
|
695 |
||
696 |
subsection{*Finally! Polar Form for Complex Numbers*} |
|
697 |
||
14374 | 698 |
lemma complex_split_polar: |
14377 | 699 |
"\<exists>r a. z = complex_of_real r * (Complex (cos a) (sin a))" |
700 |
apply (induct z) |
|
701 |
apply (auto simp add: polar_Ex complex_of_real_mult_Complex) |
|
14323 | 702 |
done |
703 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
704 |
lemma rcis_Ex: "\<exists>r a. z = rcis r a" |
14377 | 705 |
apply (induct z) |
706 |
apply (simp add: rcis_def cis_def polar_Ex complex_of_real_mult_Complex) |
|
14323 | 707 |
done |
708 |
||
14374 | 709 |
lemma Re_rcis [simp]: "Re(rcis r a) = r * cos a" |
14373 | 710 |
by (simp add: rcis_def cis_def) |
14323 | 711 |
|
14348
744c868ee0b7
Defining the type class "ringpower" and deleting superseded theorems for
paulson
parents:
14341
diff
changeset
|
712 |
lemma Im_rcis [simp]: "Im(rcis r a) = r * sin a" |
14373 | 713 |
by (simp add: rcis_def cis_def) |
14323 | 714 |
|
14377 | 715 |
lemma sin_cos_squared_add2_mult: "(r * cos a)\<twosuperior> + (r * sin a)\<twosuperior> = r\<twosuperior>" |
716 |
proof - |
|
717 |
have "(r * cos a)\<twosuperior> + (r * sin a)\<twosuperior> = r\<twosuperior> * ((cos a)\<twosuperior> + (sin a)\<twosuperior>)" |
|
718 |
by (simp only: power_mult_distrib right_distrib) |
|
719 |
thus ?thesis by simp |
|
720 |
qed |
|
14323 | 721 |
|
14374 | 722 |
lemma complex_mod_rcis [simp]: "cmod(rcis r a) = abs r" |
14377 | 723 |
by (simp add: rcis_def cis_def sin_cos_squared_add2_mult) |
14323 | 724 |
|
725 |
lemma complex_mod_sqrt_Re_mult_cnj: "cmod z = sqrt (Re (z * cnj z))" |
|
14373 | 726 |
apply (simp add: cmod_def) |
14323 | 727 |
apply (rule real_sqrt_eq_iff [THEN iffD2]) |
728 |
apply (auto simp add: complex_mult_cnj) |
|
729 |
done |
|
730 |
||
14374 | 731 |
lemma complex_Re_cnj [simp]: "Re(cnj z) = Re z" |
14373 | 732 |
by (induct z, simp add: complex_cnj) |
14323 | 733 |
|
14374 | 734 |
lemma complex_Im_cnj [simp]: "Im(cnj z) = - Im z" |
735 |
by (induct z, simp add: complex_cnj) |
|
736 |
||
737 |
lemma complex_In_mult_cnj_zero [simp]: "Im (z * cnj z) = 0" |
|
14373 | 738 |
by (induct z, simp add: complex_cnj complex_mult) |
14323 | 739 |
|
740 |
||
741 |
(*---------------------------------------------------------------------------*) |
|
742 |
(* (r1 * cis a) * (r2 * cis b) = r1 * r2 * cis (a + b) *) |
|
743 |
(*---------------------------------------------------------------------------*) |
|
744 |
||
745 |
lemma cis_rcis_eq: "cis a = rcis 1 a" |
|
14373 | 746 |
by (simp add: rcis_def) |
14323 | 747 |
|
14374 | 748 |
lemma rcis_mult: "rcis r1 a * rcis r2 b = rcis (r1*r2) (a + b)" |
15013 | 749 |
by (simp add: rcis_def cis_def cos_add sin_add right_distrib right_diff_distrib |
750 |
complex_of_real_def) |
|
14323 | 751 |
|
752 |
lemma cis_mult: "cis a * cis b = cis (a + b)" |
|
14373 | 753 |
by (simp add: cis_rcis_eq rcis_mult) |
14323 | 754 |
|
14374 | 755 |
lemma cis_zero [simp]: "cis 0 = 1" |
14377 | 756 |
by (simp add: cis_def complex_one_def) |
14323 | 757 |
|
14374 | 758 |
lemma rcis_zero_mod [simp]: "rcis 0 a = 0" |
14373 | 759 |
by (simp add: rcis_def) |
14323 | 760 |
|
14374 | 761 |
lemma rcis_zero_arg [simp]: "rcis r 0 = complex_of_real r" |
14373 | 762 |
by (simp add: rcis_def) |
14323 | 763 |
|
764 |
lemma complex_of_real_minus_one: |
|
765 |
"complex_of_real (-(1::real)) = -(1::complex)" |
|
14377 | 766 |
by (simp add: complex_of_real_def complex_one_def complex_minus) |
14323 | 767 |
|
14374 | 768 |
lemma complex_i_mult_minus [simp]: "ii * (ii * x) = - x" |
14373 | 769 |
by (simp add: complex_mult_assoc [symmetric]) |
14323 | 770 |
|
771 |
||
772 |
lemma cis_real_of_nat_Suc_mult: |
|
773 |
"cis (real (Suc n) * a) = cis a * cis (real n * a)" |
|
14377 | 774 |
by (simp add: cis_def real_of_nat_Suc left_distrib cos_add sin_add right_distrib) |
14323 | 775 |
|
776 |
lemma DeMoivre: "(cis a) ^ n = cis (real n * a)" |
|
777 |
apply (induct_tac "n") |
|
778 |
apply (auto simp add: cis_real_of_nat_Suc_mult) |
|
779 |
done |
|
780 |
||
14374 | 781 |
lemma DeMoivre2: "(rcis r a) ^ n = rcis (r ^ n) (real n * a)" |
782 |
by (simp add: rcis_def power_mult_distrib DeMoivre complex_of_real_pow) |
|
14323 | 783 |
|
14374 | 784 |
lemma cis_inverse [simp]: "inverse(cis a) = cis (-a)" |
785 |
by (simp add: cis_def complex_inverse_complex_split complex_of_real_minus |
|
15013 | 786 |
diff_minus) |
14323 | 787 |
|
788 |
lemma rcis_inverse: "inverse(rcis r a) = rcis (1/r) (-a)" |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
789 |
by (simp add: divide_inverse rcis_def complex_of_real_inverse) |
14323 | 790 |
|
791 |
lemma cis_divide: "cis a / cis b = cis (a - b)" |
|
14373 | 792 |
by (simp add: complex_divide_def cis_mult real_diff_def) |
14323 | 793 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14353
diff
changeset
|
794 |
lemma rcis_divide: "rcis r1 a / rcis r2 b = rcis (r1/r2) (a - b)" |
14373 | 795 |
apply (simp add: complex_divide_def) |
796 |
apply (case_tac "r2=0", simp) |
|
797 |
apply (simp add: rcis_inverse rcis_mult real_diff_def) |
|
14323 | 798 |
done |
799 |
||
14374 | 800 |
lemma Re_cis [simp]: "Re(cis a) = cos a" |
14373 | 801 |
by (simp add: cis_def) |
14323 | 802 |
|
14374 | 803 |
lemma Im_cis [simp]: "Im(cis a) = sin a" |
14373 | 804 |
by (simp add: cis_def) |
14323 | 805 |
|
806 |
lemma cos_n_Re_cis_pow_n: "cos (real n * a) = Re(cis a ^ n)" |
|
14334 | 807 |
by (auto simp add: DeMoivre) |
14323 | 808 |
|
809 |
lemma sin_n_Im_cis_pow_n: "sin (real n * a) = Im(cis a ^ n)" |
|
14334 | 810 |
by (auto simp add: DeMoivre) |
14323 | 811 |
|
812 |
lemma expi_add: "expi(a + b) = expi(a) * expi(b)" |
|
14374 | 813 |
by (simp add: expi_def complex_Re_add exp_add complex_Im_add |
814 |
cis_mult [symmetric] complex_of_real_mult mult_ac) |
|
14323 | 815 |
|
14374 | 816 |
lemma expi_zero [simp]: "expi (0::complex) = 1" |
14373 | 817 |
by (simp add: expi_def) |
14323 | 818 |
|
14374 | 819 |
lemma complex_expi_Ex: "\<exists>a r. z = complex_of_real r * expi a" |
14373 | 820 |
apply (insert rcis_Ex [of z]) |
14323 | 821 |
apply (auto simp add: expi_def rcis_def complex_mult_assoc [symmetric] complex_of_real_mult) |
14334 | 822 |
apply (rule_tac x = "ii * complex_of_real a" in exI, auto) |
14323 | 823 |
done |
824 |
||
825 |
||
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
826 |
subsection{*Numerals and Arithmetic*} |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
827 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
828 |
instance complex :: number .. |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
829 |
|
15013 | 830 |
defs (overloaded) |
831 |
complex_number_of_def: "(number_of w :: complex) == of_int (Rep_Bin w)" |
|
832 |
--{*the type constraint is essential!*} |
|
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
833 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
834 |
instance complex :: number_ring |
15013 | 835 |
by (intro_classes, simp add: complex_number_of_def) |
836 |
||
837 |
||
838 |
lemma complex_of_real_of_nat [simp]: "complex_of_real (of_nat n) = of_nat n" |
|
839 |
by (induct n, simp_all) |
|
840 |
||
841 |
lemma complex_of_real_of_int [simp]: "complex_of_real (of_int z) = of_int z" |
|
842 |
proof (cases z) |
|
843 |
case (1 n) |
|
844 |
thus ?thesis by simp |
|
845 |
next |
|
846 |
case (2 n) |
|
847 |
thus ?thesis |
|
848 |
by (simp only: of_int_minus complex_of_real_minus, simp) |
|
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
849 |
qed |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
850 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
851 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
852 |
text{*Collapse applications of @{term complex_of_real} to @{term number_of}*} |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
853 |
lemma complex_number_of [simp]: "complex_of_real (number_of w) = number_of w" |
15013 | 854 |
by (simp add: complex_number_of_def real_number_of_def) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
855 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
856 |
text{*This theorem is necessary because theorems such as |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
857 |
@{text iszero_number_of_0} only hold for ordered rings. They cannot |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
858 |
be generalized to fields in general because they fail for finite fields. |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
859 |
They work for type complex because the reals can be embedded in them.*} |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
860 |
lemma iszero_complex_number_of [simp]: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
861 |
"iszero (number_of w :: complex) = iszero (number_of w :: real)" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
862 |
by (simp only: complex_of_real_zero_iff complex_number_of [symmetric] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
863 |
iszero_def) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
864 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
865 |
lemma complex_number_of_cnj [simp]: "cnj(number_of v :: complex) = number_of v" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
866 |
apply (subst complex_number_of [symmetric]) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
867 |
apply (rule complex_cnj_complex_of_real) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
868 |
done |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
869 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
870 |
lemma complex_number_of_cmod: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
871 |
"cmod(number_of v :: complex) = abs (number_of v :: real)" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
872 |
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
|
873 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
874 |
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
|
875 |
by (simp only: complex_number_of [symmetric] Re_complex_of_real) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
876 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
877 |
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
|
878 |
by (simp only: complex_number_of [symmetric] Im_complex_of_real) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
879 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
880 |
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
|
881 |
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
|
882 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
883 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
884 |
(*examples: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
885 |
print_depth 22 |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
886 |
set timing; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
887 |
set trace_simp; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
888 |
fun test s = (Goal s, by (Simp_tac 1)); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
889 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
890 |
test "23 * ii + 45 * ii= (x::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
891 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
892 |
test "5 * ii + 12 - 45 * ii= (x::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
893 |
test "5 * ii + 40 - 12 * ii + 9 = (x::complex) + 89 * ii"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
894 |
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
|
895 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
896 |
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
|
897 |
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
|
898 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
899 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
900 |
fun test s = (Goal s; by (Asm_simp_tac 1)); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
901 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
902 |
test "x*k = k*(y::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
903 |
test "k = k*(y::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
904 |
test "a*(b*c) = (b::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
905 |
test "a*(b*c) = d*(b::complex)*(x*a)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
906 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
907 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
908 |
test "(x*k) / (k*(y::complex)) = (uu::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
909 |
test "(k) / (k*(y::complex)) = (uu::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
910 |
test "(a*(b*c)) / ((b::complex)) = (uu::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
911 |
test "(a*(b*c)) / (d*(b::complex)*(x*a)) = (uu::complex)"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
912 |
|
15003 | 913 |
FIXME: what do we do about this? |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
914 |
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
|
915 |
*) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
916 |
|
14323 | 917 |
|
918 |
ML |
|
919 |
{* |
|
920 |
val complex_zero_def = thm"complex_zero_def"; |
|
921 |
val complex_one_def = thm"complex_one_def"; |
|
922 |
val complex_minus_def = thm"complex_minus_def"; |
|
923 |
val complex_divide_def = thm"complex_divide_def"; |
|
924 |
val complex_mult_def = thm"complex_mult_def"; |
|
925 |
val complex_add_def = thm"complex_add_def"; |
|
926 |
val complex_of_real_def = thm"complex_of_real_def"; |
|
927 |
val i_def = thm"i_def"; |
|
928 |
val expi_def = thm"expi_def"; |
|
929 |
val cis_def = thm"cis_def"; |
|
930 |
val rcis_def = thm"rcis_def"; |
|
931 |
val cmod_def = thm"cmod_def"; |
|
932 |
val cnj_def = thm"cnj_def"; |
|
933 |
val sgn_def = thm"sgn_def"; |
|
934 |
val arg_def = thm"arg_def"; |
|
935 |
val complexpow_0 = thm"complexpow_0"; |
|
936 |
val complexpow_Suc = thm"complexpow_Suc"; |
|
937 |
||
938 |
val Re = thm"Re"; |
|
939 |
val Im = thm"Im"; |
|
940 |
val complex_Re_Im_cancel_iff = thm"complex_Re_Im_cancel_iff"; |
|
941 |
val complex_Re_zero = thm"complex_Re_zero"; |
|
942 |
val complex_Im_zero = thm"complex_Im_zero"; |
|
943 |
val complex_Re_one = thm"complex_Re_one"; |
|
944 |
val complex_Im_one = thm"complex_Im_one"; |
|
945 |
val complex_Re_i = thm"complex_Re_i"; |
|
946 |
val complex_Im_i = thm"complex_Im_i"; |
|
947 |
val Re_complex_of_real = thm"Re_complex_of_real"; |
|
948 |
val Im_complex_of_real = thm"Im_complex_of_real"; |
|
949 |
val complex_minus = thm"complex_minus"; |
|
950 |
val complex_Re_minus = thm"complex_Re_minus"; |
|
951 |
val complex_Im_minus = thm"complex_Im_minus"; |
|
952 |
val complex_add = thm"complex_add"; |
|
953 |
val complex_Re_add = thm"complex_Re_add"; |
|
954 |
val complex_Im_add = thm"complex_Im_add"; |
|
955 |
val complex_add_commute = thm"complex_add_commute"; |
|
956 |
val complex_add_assoc = thm"complex_add_assoc"; |
|
957 |
val complex_add_zero_left = thm"complex_add_zero_left"; |
|
958 |
val complex_add_zero_right = thm"complex_add_zero_right"; |
|
959 |
val complex_diff = thm"complex_diff"; |
|
960 |
val complex_mult = thm"complex_mult"; |
|
961 |
val complex_mult_one_left = thm"complex_mult_one_left"; |
|
962 |
val complex_mult_one_right = thm"complex_mult_one_right"; |
|
963 |
val complex_inverse = thm"complex_inverse"; |
|
964 |
val complex_of_real_one = thm"complex_of_real_one"; |
|
965 |
val complex_of_real_zero = thm"complex_of_real_zero"; |
|
966 |
val complex_of_real_eq_iff = thm"complex_of_real_eq_iff"; |
|
967 |
val complex_of_real_minus = thm"complex_of_real_minus"; |
|
968 |
val complex_of_real_inverse = thm"complex_of_real_inverse"; |
|
969 |
val complex_of_real_add = thm"complex_of_real_add"; |
|
970 |
val complex_of_real_diff = thm"complex_of_real_diff"; |
|
971 |
val complex_of_real_mult = thm"complex_of_real_mult"; |
|
972 |
val complex_of_real_divide = thm"complex_of_real_divide"; |
|
973 |
val complex_of_real_pow = thm"complex_of_real_pow"; |
|
974 |
val complex_mod = thm"complex_mod"; |
|
975 |
val complex_mod_zero = thm"complex_mod_zero"; |
|
976 |
val complex_mod_one = thm"complex_mod_one"; |
|
977 |
val complex_mod_complex_of_real = thm"complex_mod_complex_of_real"; |
|
978 |
val complex_of_real_abs = thm"complex_of_real_abs"; |
|
979 |
val complex_cnj = thm"complex_cnj"; |
|
980 |
val complex_cnj_cancel_iff = thm"complex_cnj_cancel_iff"; |
|
981 |
val complex_cnj_cnj = thm"complex_cnj_cnj"; |
|
982 |
val complex_cnj_complex_of_real = thm"complex_cnj_complex_of_real"; |
|
983 |
val complex_mod_cnj = thm"complex_mod_cnj"; |
|
984 |
val complex_cnj_minus = thm"complex_cnj_minus"; |
|
985 |
val complex_cnj_inverse = thm"complex_cnj_inverse"; |
|
986 |
val complex_cnj_add = thm"complex_cnj_add"; |
|
987 |
val complex_cnj_diff = thm"complex_cnj_diff"; |
|
988 |
val complex_cnj_mult = thm"complex_cnj_mult"; |
|
989 |
val complex_cnj_divide = thm"complex_cnj_divide"; |
|
990 |
val complex_cnj_one = thm"complex_cnj_one"; |
|
991 |
val complex_cnj_pow = thm"complex_cnj_pow"; |
|
992 |
val complex_add_cnj = thm"complex_add_cnj"; |
|
993 |
val complex_diff_cnj = thm"complex_diff_cnj"; |
|
994 |
val complex_cnj_zero = thm"complex_cnj_zero"; |
|
995 |
val complex_cnj_zero_iff = thm"complex_cnj_zero_iff"; |
|
996 |
val complex_mult_cnj = thm"complex_mult_cnj"; |
|
997 |
val complex_mod_eq_zero_cancel = thm"complex_mod_eq_zero_cancel"; |
|
998 |
val complex_mod_complex_of_real_of_nat = thm"complex_mod_complex_of_real_of_nat"; |
|
999 |
val complex_mod_minus = thm"complex_mod_minus"; |
|
1000 |
val complex_mod_mult_cnj = thm"complex_mod_mult_cnj"; |
|
1001 |
val complex_mod_squared = thm"complex_mod_squared"; |
|
1002 |
val complex_mod_ge_zero = thm"complex_mod_ge_zero"; |
|
1003 |
val abs_cmod_cancel = thm"abs_cmod_cancel"; |
|
1004 |
val complex_mod_mult = thm"complex_mod_mult"; |
|
1005 |
val complex_mod_add_squared_eq = thm"complex_mod_add_squared_eq"; |
|
1006 |
val complex_Re_mult_cnj_le_cmod = thm"complex_Re_mult_cnj_le_cmod"; |
|
1007 |
val complex_Re_mult_cnj_le_cmod2 = thm"complex_Re_mult_cnj_le_cmod2"; |
|
1008 |
val real_sum_squared_expand = thm"real_sum_squared_expand"; |
|
1009 |
val complex_mod_triangle_squared = thm"complex_mod_triangle_squared"; |
|
1010 |
val complex_mod_minus_le_complex_mod = thm"complex_mod_minus_le_complex_mod"; |
|
1011 |
val complex_mod_triangle_ineq = thm"complex_mod_triangle_ineq"; |
|
1012 |
val complex_mod_triangle_ineq2 = thm"complex_mod_triangle_ineq2"; |
|
1013 |
val complex_mod_diff_commute = thm"complex_mod_diff_commute"; |
|
1014 |
val complex_mod_add_less = thm"complex_mod_add_less"; |
|
1015 |
val complex_mod_mult_less = thm"complex_mod_mult_less"; |
|
1016 |
val complex_mod_diff_ineq = thm"complex_mod_diff_ineq"; |
|
1017 |
val complex_Re_le_cmod = thm"complex_Re_le_cmod"; |
|
1018 |
val complex_mod_gt_zero = thm"complex_mod_gt_zero"; |
|
1019 |
val complex_mod_complexpow = thm"complex_mod_complexpow"; |
|
1020 |
val complex_mod_inverse = thm"complex_mod_inverse"; |
|
1021 |
val complex_mod_divide = thm"complex_mod_divide"; |
|
1022 |
val complexpow_i_squared = thm"complexpow_i_squared"; |
|
1023 |
val complex_i_not_zero = thm"complex_i_not_zero"; |
|
1024 |
val sgn_zero = thm"sgn_zero"; |
|
1025 |
val sgn_one = thm"sgn_one"; |
|
1026 |
val sgn_minus = thm"sgn_minus"; |
|
1027 |
val sgn_eq = thm"sgn_eq"; |
|
1028 |
val i_mult_eq = thm"i_mult_eq"; |
|
1029 |
val i_mult_eq2 = thm"i_mult_eq2"; |
|
1030 |
val Re_sgn = thm"Re_sgn"; |
|
1031 |
val Im_sgn = thm"Im_sgn"; |
|
1032 |
val complex_inverse_complex_split = thm"complex_inverse_complex_split"; |
|
1033 |
val cos_arg_i_mult_zero = thm"cos_arg_i_mult_zero"; |
|
1034 |
val complex_of_real_zero_iff = thm"complex_of_real_zero_iff"; |
|
1035 |
val rcis_Ex = thm"rcis_Ex"; |
|
1036 |
val Re_rcis = thm"Re_rcis"; |
|
1037 |
val Im_rcis = thm"Im_rcis"; |
|
1038 |
val complex_mod_rcis = thm"complex_mod_rcis"; |
|
1039 |
val complex_mod_sqrt_Re_mult_cnj = thm"complex_mod_sqrt_Re_mult_cnj"; |
|
1040 |
val complex_Re_cnj = thm"complex_Re_cnj"; |
|
1041 |
val complex_Im_cnj = thm"complex_Im_cnj"; |
|
1042 |
val complex_In_mult_cnj_zero = thm"complex_In_mult_cnj_zero"; |
|
1043 |
val complex_Re_mult = thm"complex_Re_mult"; |
|
1044 |
val complex_Re_mult_complex_of_real = thm"complex_Re_mult_complex_of_real"; |
|
1045 |
val complex_Im_mult_complex_of_real = thm"complex_Im_mult_complex_of_real"; |
|
1046 |
val complex_Re_mult_complex_of_real2 = thm"complex_Re_mult_complex_of_real2"; |
|
1047 |
val complex_Im_mult_complex_of_real2 = thm"complex_Im_mult_complex_of_real2"; |
|
1048 |
val cis_rcis_eq = thm"cis_rcis_eq"; |
|
1049 |
val rcis_mult = thm"rcis_mult"; |
|
1050 |
val cis_mult = thm"cis_mult"; |
|
1051 |
val cis_zero = thm"cis_zero"; |
|
1052 |
val rcis_zero_mod = thm"rcis_zero_mod"; |
|
1053 |
val rcis_zero_arg = thm"rcis_zero_arg"; |
|
1054 |
val complex_of_real_minus_one = thm"complex_of_real_minus_one"; |
|
1055 |
val complex_i_mult_minus = thm"complex_i_mult_minus"; |
|
1056 |
val cis_real_of_nat_Suc_mult = thm"cis_real_of_nat_Suc_mult"; |
|
1057 |
val DeMoivre = thm"DeMoivre"; |
|
1058 |
val DeMoivre2 = thm"DeMoivre2"; |
|
1059 |
val cis_inverse = thm"cis_inverse"; |
|
1060 |
val rcis_inverse = thm"rcis_inverse"; |
|
1061 |
val cis_divide = thm"cis_divide"; |
|
1062 |
val rcis_divide = thm"rcis_divide"; |
|
1063 |
val Re_cis = thm"Re_cis"; |
|
1064 |
val Im_cis = thm"Im_cis"; |
|
1065 |
val cos_n_Re_cis_pow_n = thm"cos_n_Re_cis_pow_n"; |
|
1066 |
val sin_n_Im_cis_pow_n = thm"sin_n_Im_cis_pow_n"; |
|
1067 |
val expi_add = thm"expi_add"; |
|
1068 |
val expi_zero = thm"expi_zero"; |
|
1069 |
val complex_Re_mult_eq = thm"complex_Re_mult_eq"; |
|
1070 |
val complex_Im_mult_eq = thm"complex_Im_mult_eq"; |
|
1071 |
val complex_expi_Ex = thm"complex_expi_Ex"; |
|
1072 |
*} |
|
1073 |
||
13957 | 1074 |
end |
1075 |
||
1076 |