author | paulson |
Mon, 08 Mar 2004 11:12:06 +0100 | |
changeset 14443 | 75910c7557c5 |
parent 14430 | 5cb24165a2e1 |
child 14469 | c7674b7034f5 |
permissions | -rw-r--r-- |
13957 | 1 |
(* Title: NSComplex.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 |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
5 |
Conversion to Isar and new proofs by Lawrence C Paulson, 2003/4 |
13957 | 6 |
*) |
7 |
||
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
8 |
header{*Nonstandard Complex Numbers*} |
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
9 |
|
14314 | 10 |
theory NSComplex = NSInduct: |
13957 | 11 |
|
12 |
constdefs |
|
13 |
hcomplexrel :: "((nat=>complex)*(nat=>complex)) set" |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
14 |
"hcomplexrel == {p. \<exists>X Y. p = ((X::nat=>complex),Y) & |
13957 | 15 |
{n::nat. X(n) = Y(n)}: FreeUltrafilterNat}" |
16 |
||
14314 | 17 |
typedef hcomplex = "{x::nat=>complex. True}//hcomplexrel" |
18 |
by (auto simp add: quotient_def) |
|
13957 | 19 |
|
14314 | 20 |
instance hcomplex :: zero .. |
21 |
instance hcomplex :: one .. |
|
22 |
instance hcomplex :: plus .. |
|
23 |
instance hcomplex :: times .. |
|
24 |
instance hcomplex :: minus .. |
|
25 |
instance hcomplex :: inverse .. |
|
26 |
instance hcomplex :: power .. |
|
27 |
||
28 |
defs (overloaded) |
|
29 |
hcomplex_zero_def: |
|
13957 | 30 |
"0 == Abs_hcomplex(hcomplexrel `` {%n. (0::complex)})" |
14314 | 31 |
|
32 |
hcomplex_one_def: |
|
13957 | 33 |
"1 == Abs_hcomplex(hcomplexrel `` {%n. (1::complex)})" |
34 |
||
35 |
||
14314 | 36 |
hcomplex_minus_def: |
37 |
"- z == Abs_hcomplex(UN X: Rep_hcomplex(z). |
|
38 |
hcomplexrel `` {%n::nat. - (X n)})" |
|
13957 | 39 |
|
14314 | 40 |
hcomplex_diff_def: |
13957 | 41 |
"w - z == w + -(z::hcomplex)" |
14314 | 42 |
|
14377 | 43 |
hcinv_def: |
44 |
"inverse(P) == Abs_hcomplex(UN X: Rep_hcomplex(P). |
|
45 |
hcomplexrel `` {%n. inverse(X n)})" |
|
46 |
||
13957 | 47 |
constdefs |
48 |
||
14314 | 49 |
hcomplex_of_complex :: "complex => hcomplex" |
13957 | 50 |
"hcomplex_of_complex z == Abs_hcomplex(hcomplexrel `` {%n. z})" |
14314 | 51 |
|
13957 | 52 |
(*--- real and Imaginary parts ---*) |
14314 | 53 |
|
54 |
hRe :: "hcomplex => hypreal" |
|
13957 | 55 |
"hRe(z) == Abs_hypreal(UN X:Rep_hcomplex(z). hyprel `` {%n. Re (X n)})" |
56 |
||
14314 | 57 |
hIm :: "hcomplex => hypreal" |
58 |
"hIm(z) == Abs_hypreal(UN X:Rep_hcomplex(z). hyprel `` {%n. Im (X n)})" |
|
13957 | 59 |
|
60 |
||
61 |
(*----------- modulus ------------*) |
|
62 |
||
14314 | 63 |
hcmod :: "hcomplex => hypreal" |
13957 | 64 |
"hcmod z == Abs_hypreal(UN X: Rep_hcomplex(z). |
65 |
hyprel `` {%n. cmod (X n)})" |
|
66 |
||
14314 | 67 |
(*------ imaginary unit ----------*) |
68 |
||
69 |
iii :: hcomplex |
|
13957 | 70 |
"iii == Abs_hcomplex(hcomplexrel `` {%n. ii})" |
71 |
||
72 |
(*------- complex conjugate ------*) |
|
73 |
||
14314 | 74 |
hcnj :: "hcomplex => hcomplex" |
13957 | 75 |
"hcnj z == Abs_hcomplex(UN X:Rep_hcomplex(z). hcomplexrel `` {%n. cnj (X n)})" |
76 |
||
14314 | 77 |
(*------------ Argand -------------*) |
13957 | 78 |
|
14314 | 79 |
hsgn :: "hcomplex => hcomplex" |
13957 | 80 |
"hsgn z == Abs_hcomplex(UN X:Rep_hcomplex(z). hcomplexrel `` {%n. sgn(X n)})" |
81 |
||
14314 | 82 |
harg :: "hcomplex => hypreal" |
13957 | 83 |
"harg z == Abs_hypreal(UN X:Rep_hcomplex(z). hyprel `` {%n. arg(X n)})" |
84 |
||
85 |
(* abbreviation for (cos a + i sin a) *) |
|
14314 | 86 |
hcis :: "hypreal => hcomplex" |
13957 | 87 |
"hcis a == Abs_hcomplex(UN X:Rep_hypreal(a). hcomplexrel `` {%n. cis (X n)})" |
88 |
||
89 |
(* abbreviation for r*(cos a + i sin a) *) |
|
14314 | 90 |
hrcis :: "[hypreal, hypreal] => hcomplex" |
13957 | 91 |
"hrcis r a == hcomplex_of_hypreal r * hcis a" |
92 |
||
14314 | 93 |
(*----- injection from hyperreals -----*) |
94 |
||
95 |
hcomplex_of_hypreal :: "hypreal => hcomplex" |
|
13957 | 96 |
"hcomplex_of_hypreal r == Abs_hcomplex(UN X:Rep_hypreal(r). |
97 |
hcomplexrel `` {%n. complex_of_real (X n)})" |
|
98 |
||
99 |
(*------------ e ^ (x + iy) ------------*) |
|
100 |
||
14314 | 101 |
hexpi :: "hcomplex => hcomplex" |
13957 | 102 |
"hexpi z == hcomplex_of_hypreal(( *f* exp) (hRe z)) * hcis (hIm z)" |
14314 | 103 |
|
13957 | 104 |
|
14377 | 105 |
constdefs |
106 |
HComplex :: "[hypreal,hypreal] => hcomplex" |
|
107 |
"HComplex x y == hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y" |
|
108 |
||
109 |
||
14314 | 110 |
defs (overloaded) |
13957 | 111 |
|
112 |
(*----------- division ----------*) |
|
113 |
||
14314 | 114 |
hcomplex_divide_def: |
13957 | 115 |
"w / (z::hcomplex) == w * inverse z" |
14314 | 116 |
|
117 |
hcomplex_add_def: |
|
13957 | 118 |
"w + z == Abs_hcomplex(UN X:Rep_hcomplex(w). UN Y:Rep_hcomplex(z). |
119 |
hcomplexrel `` {%n. X n + Y n})" |
|
120 |
||
14314 | 121 |
hcomplex_mult_def: |
13957 | 122 |
"w * z == Abs_hcomplex(UN X:Rep_hcomplex(w). UN Y:Rep_hcomplex(z). |
14314 | 123 |
hcomplexrel `` {%n. X n * Y n})" |
13957 | 124 |
|
125 |
||
126 |
||
127 |
consts |
|
14314 | 128 |
"hcpow" :: "[hcomplex,hypnat] => hcomplex" (infixr 80) |
13957 | 129 |
|
130 |
defs |
|
131 |
(* hypernatural powers of nonstandard complex numbers *) |
|
14314 | 132 |
hcpow_def: |
133 |
"(z::hcomplex) hcpow (n::hypnat) |
|
13957 | 134 |
== Abs_hcomplex(UN X:Rep_hcomplex(z). UN Y: Rep_hypnat(n). |
135 |
hcomplexrel `` {%n. (X n) ^ (Y n)})" |
|
136 |
||
14314 | 137 |
|
138 |
lemma hcomplexrel_refl: "(x,x): hcomplexrel" |
|
14374 | 139 |
by (simp add: hcomplexrel_def) |
14314 | 140 |
|
141 |
lemma hcomplexrel_sym: "(x,y): hcomplexrel ==> (y,x):hcomplexrel" |
|
14374 | 142 |
by (auto simp add: hcomplexrel_def eq_commute) |
14314 | 143 |
|
144 |
lemma hcomplexrel_trans: |
|
145 |
"[|(x,y): hcomplexrel; (y,z):hcomplexrel|] ==> (x,z):hcomplexrel" |
|
14374 | 146 |
by (simp add: hcomplexrel_def, ultra) |
14314 | 147 |
|
148 |
lemma equiv_hcomplexrel: "equiv UNIV hcomplexrel" |
|
14374 | 149 |
apply (simp add: equiv_def refl_def sym_def trans_def hcomplexrel_refl) |
150 |
apply (blast intro: hcomplexrel_sym hcomplexrel_trans) |
|
14314 | 151 |
done |
152 |
||
153 |
lemmas equiv_hcomplexrel_iff = |
|
154 |
eq_equiv_class_iff [OF equiv_hcomplexrel UNIV_I UNIV_I, simp] |
|
155 |
||
156 |
lemma hcomplexrel_in_hcomplex [simp]: "hcomplexrel``{x} : hcomplex" |
|
14374 | 157 |
by (simp add: hcomplex_def hcomplexrel_def quotient_def, blast) |
14314 | 158 |
|
159 |
lemma inj_on_Abs_hcomplex: "inj_on Abs_hcomplex hcomplex" |
|
160 |
apply (rule inj_on_inverseI) |
|
161 |
apply (erule Abs_hcomplex_inverse) |
|
162 |
done |
|
163 |
||
164 |
declare inj_on_Abs_hcomplex [THEN inj_on_iff, simp] |
|
165 |
Abs_hcomplex_inverse [simp] |
|
166 |
||
167 |
declare equiv_hcomplexrel [THEN eq_equiv_class_iff, simp] |
|
168 |
||
169 |
||
170 |
lemma inj_Rep_hcomplex: "inj(Rep_hcomplex)" |
|
171 |
apply (rule inj_on_inverseI) |
|
172 |
apply (rule Rep_hcomplex_inverse) |
|
173 |
done |
|
174 |
||
14374 | 175 |
lemma lemma_hcomplexrel_refl [simp]: "x: hcomplexrel `` {x}" |
176 |
by (simp add: hcomplexrel_def) |
|
14314 | 177 |
|
14374 | 178 |
lemma hcomplex_empty_not_mem [simp]: "{} \<notin> hcomplex" |
179 |
apply (simp add: hcomplex_def hcomplexrel_def) |
|
14314 | 180 |
apply (auto elim!: quotientE) |
181 |
done |
|
182 |
||
14374 | 183 |
lemma Rep_hcomplex_nonempty [simp]: "Rep_hcomplex x \<noteq> {}" |
184 |
by (cut_tac x = x in Rep_hcomplex, auto) |
|
14314 | 185 |
|
186 |
lemma eq_Abs_hcomplex: |
|
187 |
"(!!x. z = Abs_hcomplex(hcomplexrel `` {x}) ==> P) ==> P" |
|
188 |
apply (rule_tac x1=z in Rep_hcomplex [unfolded hcomplex_def, THEN quotientE]) |
|
189 |
apply (drule_tac f = Abs_hcomplex in arg_cong) |
|
14374 | 190 |
apply (force simp add: Rep_hcomplex_inverse hcomplexrel_def) |
14314 | 191 |
done |
192 |
||
14377 | 193 |
lemma hcomplexrel_iff [simp]: |
14374 | 194 |
"((X,Y): hcomplexrel) = ({n. X n = Y n}: FreeUltrafilterNat)" |
195 |
by (simp add: hcomplexrel_def) |
|
196 |
||
14314 | 197 |
|
198 |
subsection{*Properties of Nonstandard Real and Imaginary Parts*} |
|
199 |
||
200 |
lemma hRe: |
|
201 |
"hRe(Abs_hcomplex (hcomplexrel `` {X})) = |
|
202 |
Abs_hypreal(hyprel `` {%n. Re(X n)})" |
|
14374 | 203 |
apply (simp add: hRe_def) |
204 |
apply (rule_tac f = Abs_hypreal in arg_cong) |
|
14377 | 205 |
apply (auto iff: hcomplexrel_iff, ultra) |
14314 | 206 |
done |
207 |
||
208 |
lemma hIm: |
|
209 |
"hIm(Abs_hcomplex (hcomplexrel `` {X})) = |
|
210 |
Abs_hypreal(hyprel `` {%n. Im(X n)})" |
|
14374 | 211 |
apply (simp add: hIm_def) |
212 |
apply (rule_tac f = Abs_hypreal in arg_cong) |
|
14377 | 213 |
apply (auto iff: hcomplexrel_iff, ultra) |
14314 | 214 |
done |
215 |
||
14335 | 216 |
lemma hcomplex_hRe_hIm_cancel_iff: |
217 |
"(w=z) = (hRe(w) = hRe(z) & hIm(w) = hIm(z))" |
|
14374 | 218 |
apply (rule eq_Abs_hcomplex [of z]) |
219 |
apply (rule eq_Abs_hcomplex [of w]) |
|
14377 | 220 |
apply (auto simp add: hRe hIm complex_Re_Im_cancel_iff iff: hcomplexrel_iff) |
14314 | 221 |
apply (ultra+) |
222 |
done |
|
223 |
||
14377 | 224 |
lemma hcomplex_equality [intro?]: "hRe z = hRe w ==> hIm z = hIm w ==> z = w" |
225 |
by (simp add: hcomplex_hRe_hIm_cancel_iff) |
|
226 |
||
14374 | 227 |
lemma hcomplex_hRe_zero [simp]: "hRe 0 = 0" |
228 |
by (simp add: hcomplex_zero_def hRe hypreal_zero_num) |
|
14314 | 229 |
|
14374 | 230 |
lemma hcomplex_hIm_zero [simp]: "hIm 0 = 0" |
231 |
by (simp add: hcomplex_zero_def hIm hypreal_zero_num) |
|
14314 | 232 |
|
14374 | 233 |
lemma hcomplex_hRe_one [simp]: "hRe 1 = 1" |
234 |
by (simp add: hcomplex_one_def hRe hypreal_one_num) |
|
14314 | 235 |
|
14374 | 236 |
lemma hcomplex_hIm_one [simp]: "hIm 1 = 0" |
237 |
by (simp add: hcomplex_one_def hIm hypreal_one_def hypreal_zero_num) |
|
14314 | 238 |
|
239 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
240 |
subsection{*Addition for Nonstandard Complex Numbers*} |
14314 | 241 |
|
242 |
lemma hcomplex_add_congruent2: |
|
243 |
"congruent2 hcomplexrel (%X Y. hcomplexrel `` {%n. X n + Y n})" |
|
14377 | 244 |
by (auto simp add: congruent2_def iff: hcomplexrel_iff, ultra) |
14314 | 245 |
|
246 |
lemma hcomplex_add: |
|
14377 | 247 |
"Abs_hcomplex(hcomplexrel``{%n. X n}) + |
248 |
Abs_hcomplex(hcomplexrel``{%n. Y n}) = |
|
249 |
Abs_hcomplex(hcomplexrel``{%n. X n + Y n})" |
|
14374 | 250 |
apply (simp add: hcomplex_add_def) |
251 |
apply (rule_tac f = Abs_hcomplex in arg_cong) |
|
14377 | 252 |
apply (auto simp add: iff: hcomplexrel_iff, ultra) |
14314 | 253 |
done |
254 |
||
255 |
lemma hcomplex_add_commute: "(z::hcomplex) + w = w + z" |
|
14374 | 256 |
apply (rule eq_Abs_hcomplex [of z]) |
257 |
apply (rule eq_Abs_hcomplex [of w]) |
|
14335 | 258 |
apply (simp add: complex_add_commute hcomplex_add) |
14314 | 259 |
done |
260 |
||
261 |
lemma hcomplex_add_assoc: "((z1::hcomplex) + z2) + z3 = z1 + (z2 + z3)" |
|
14374 | 262 |
apply (rule eq_Abs_hcomplex [of z1]) |
263 |
apply (rule eq_Abs_hcomplex [of z2]) |
|
264 |
apply (rule eq_Abs_hcomplex [of z3]) |
|
14335 | 265 |
apply (simp add: hcomplex_add complex_add_assoc) |
14314 | 266 |
done |
267 |
||
268 |
lemma hcomplex_add_zero_left: "(0::hcomplex) + z = z" |
|
14374 | 269 |
apply (rule eq_Abs_hcomplex [of z]) |
270 |
apply (simp add: hcomplex_zero_def hcomplex_add) |
|
14314 | 271 |
done |
272 |
||
273 |
lemma hcomplex_add_zero_right: "z + (0::hcomplex) = z" |
|
14374 | 274 |
by (simp add: hcomplex_add_zero_left hcomplex_add_commute) |
14314 | 275 |
|
276 |
lemma hRe_add: "hRe(x + y) = hRe(x) + hRe(y)" |
|
14374 | 277 |
apply (rule eq_Abs_hcomplex [of x]) |
278 |
apply (rule eq_Abs_hcomplex [of y]) |
|
279 |
apply (simp add: hRe hcomplex_add hypreal_add complex_Re_add) |
|
14314 | 280 |
done |
281 |
||
282 |
lemma hIm_add: "hIm(x + y) = hIm(x) + hIm(y)" |
|
14374 | 283 |
apply (rule eq_Abs_hcomplex [of x]) |
284 |
apply (rule eq_Abs_hcomplex [of y]) |
|
285 |
apply (simp add: hIm hcomplex_add hypreal_add complex_Im_add) |
|
14314 | 286 |
done |
287 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
288 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
289 |
subsection{*Additive Inverse on Nonstandard Complex Numbers*} |
14314 | 290 |
|
291 |
lemma hcomplex_minus_congruent: |
|
14374 | 292 |
"congruent hcomplexrel (%X. hcomplexrel `` {%n. - (X n)})" |
293 |
by (simp add: congruent_def) |
|
14314 | 294 |
|
295 |
lemma hcomplex_minus: |
|
296 |
"- (Abs_hcomplex(hcomplexrel `` {%n. X n})) = |
|
297 |
Abs_hcomplex(hcomplexrel `` {%n. -(X n)})" |
|
14374 | 298 |
apply (simp add: hcomplex_minus_def) |
299 |
apply (rule_tac f = Abs_hcomplex in arg_cong) |
|
14377 | 300 |
apply (auto iff: hcomplexrel_iff, ultra) |
14314 | 301 |
done |
302 |
||
303 |
lemma hcomplex_add_minus_left: "-z + z = (0::hcomplex)" |
|
14374 | 304 |
apply (rule eq_Abs_hcomplex [of z]) |
305 |
apply (simp add: hcomplex_add hcomplex_minus hcomplex_zero_def) |
|
14314 | 306 |
done |
14335 | 307 |
|
14314 | 308 |
|
309 |
subsection{*Multiplication for Nonstandard Complex Numbers*} |
|
310 |
||
311 |
lemma hcomplex_mult: |
|
14374 | 312 |
"Abs_hcomplex(hcomplexrel``{%n. X n}) * |
14335 | 313 |
Abs_hcomplex(hcomplexrel``{%n. Y n}) = |
14374 | 314 |
Abs_hcomplex(hcomplexrel``{%n. X n * Y n})" |
315 |
apply (simp add: hcomplex_mult_def) |
|
316 |
apply (rule_tac f = Abs_hcomplex in arg_cong) |
|
14377 | 317 |
apply (auto iff: hcomplexrel_iff, ultra) |
14314 | 318 |
done |
319 |
||
320 |
lemma hcomplex_mult_commute: "(w::hcomplex) * z = z * w" |
|
14374 | 321 |
apply (rule eq_Abs_hcomplex [of w]) |
322 |
apply (rule eq_Abs_hcomplex [of z]) |
|
323 |
apply (simp add: hcomplex_mult complex_mult_commute) |
|
14314 | 324 |
done |
325 |
||
326 |
lemma hcomplex_mult_assoc: "((u::hcomplex) * v) * w = u * (v * w)" |
|
14374 | 327 |
apply (rule eq_Abs_hcomplex [of u]) |
328 |
apply (rule eq_Abs_hcomplex [of v]) |
|
329 |
apply (rule eq_Abs_hcomplex [of w]) |
|
330 |
apply (simp add: hcomplex_mult complex_mult_assoc) |
|
14314 | 331 |
done |
332 |
||
333 |
lemma hcomplex_mult_one_left: "(1::hcomplex) * z = z" |
|
14374 | 334 |
apply (rule eq_Abs_hcomplex [of z]) |
335 |
apply (simp add: hcomplex_one_def hcomplex_mult) |
|
14314 | 336 |
done |
337 |
||
338 |
lemma hcomplex_mult_zero_left: "(0::hcomplex) * z = 0" |
|
14374 | 339 |
apply (rule eq_Abs_hcomplex [of z]) |
340 |
apply (simp add: hcomplex_zero_def hcomplex_mult) |
|
14314 | 341 |
done |
342 |
||
14335 | 343 |
lemma hcomplex_add_mult_distrib: |
344 |
"((z1::hcomplex) + z2) * w = (z1 * w) + (z2 * w)" |
|
14374 | 345 |
apply (rule eq_Abs_hcomplex [of z1]) |
346 |
apply (rule eq_Abs_hcomplex [of z2]) |
|
347 |
apply (rule eq_Abs_hcomplex [of w]) |
|
348 |
apply (simp add: hcomplex_mult hcomplex_add left_distrib) |
|
14314 | 349 |
done |
350 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
351 |
lemma hcomplex_zero_not_eq_one: "(0::hcomplex) \<noteq> (1::hcomplex)" |
14374 | 352 |
by (simp add: hcomplex_zero_def hcomplex_one_def) |
353 |
||
14314 | 354 |
declare hcomplex_zero_not_eq_one [THEN not_sym, simp] |
355 |
||
356 |
||
357 |
subsection{*Inverse of Nonstandard Complex Number*} |
|
358 |
||
359 |
lemma hcomplex_inverse: |
|
360 |
"inverse (Abs_hcomplex(hcomplexrel `` {%n. X n})) = |
|
361 |
Abs_hcomplex(hcomplexrel `` {%n. inverse (X n)})" |
|
14374 | 362 |
apply (simp add: hcinv_def) |
363 |
apply (rule_tac f = Abs_hcomplex in arg_cong) |
|
14377 | 364 |
apply (auto iff: hcomplexrel_iff, ultra) |
14314 | 365 |
done |
366 |
||
367 |
lemma hcomplex_mult_inv_left: |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
368 |
"z \<noteq> (0::hcomplex) ==> inverse(z) * z = (1::hcomplex)" |
14374 | 369 |
apply (rule eq_Abs_hcomplex [of z]) |
370 |
apply (simp add: hcomplex_zero_def hcomplex_one_def hcomplex_inverse hcomplex_mult, ultra) |
|
14314 | 371 |
apply (rule ccontr) |
14374 | 372 |
apply (drule left_inverse, auto) |
14314 | 373 |
done |
374 |
||
14318 | 375 |
subsection {* The Field of Nonstandard Complex Numbers *} |
376 |
||
377 |
instance hcomplex :: field |
|
378 |
proof |
|
379 |
fix z u v w :: hcomplex |
|
380 |
show "(u + v) + w = u + (v + w)" |
|
381 |
by (simp add: hcomplex_add_assoc) |
|
382 |
show "z + w = w + z" |
|
383 |
by (simp add: hcomplex_add_commute) |
|
384 |
show "0 + z = z" |
|
14335 | 385 |
by (simp add: hcomplex_add_zero_left) |
14318 | 386 |
show "-z + z = 0" |
14335 | 387 |
by (simp add: hcomplex_add_minus_left) |
14318 | 388 |
show "z - w = z + -w" |
389 |
by (simp add: hcomplex_diff_def) |
|
390 |
show "(u * v) * w = u * (v * w)" |
|
391 |
by (simp add: hcomplex_mult_assoc) |
|
392 |
show "z * w = w * z" |
|
393 |
by (simp add: hcomplex_mult_commute) |
|
394 |
show "1 * z = z" |
|
14335 | 395 |
by (simp add: hcomplex_mult_one_left) |
14318 | 396 |
show "0 \<noteq> (1::hcomplex)" |
397 |
by (rule hcomplex_zero_not_eq_one) |
|
398 |
show "(u + v) * w = u * w + v * w" |
|
399 |
by (simp add: hcomplex_add_mult_distrib) |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
400 |
show "z / w = z * inverse w" |
14318 | 401 |
by (simp add: hcomplex_divide_def) |
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
402 |
assume "w \<noteq> 0" |
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
403 |
thus "inverse w * w = 1" |
14318 | 404 |
by (rule hcomplex_mult_inv_left) |
405 |
qed |
|
406 |
||
407 |
instance hcomplex :: division_by_zero |
|
408 |
proof |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
409 |
show "inverse 0 = (0::hcomplex)" |
14374 | 410 |
by (simp add: hcomplex_inverse hcomplex_zero_def) |
14318 | 411 |
qed |
14314 | 412 |
|
14374 | 413 |
|
14318 | 414 |
subsection{*More Minus Laws*} |
415 |
||
416 |
lemma hRe_minus: "hRe(-z) = - hRe(z)" |
|
14374 | 417 |
apply (rule eq_Abs_hcomplex [of z]) |
418 |
apply (simp add: hRe hcomplex_minus hypreal_minus complex_Re_minus) |
|
14318 | 419 |
done |
420 |
||
421 |
lemma hIm_minus: "hIm(-z) = - hIm(z)" |
|
14374 | 422 |
apply (rule eq_Abs_hcomplex [of z]) |
423 |
apply (simp add: hIm hcomplex_minus hypreal_minus complex_Im_minus) |
|
14318 | 424 |
done |
425 |
||
426 |
lemma hcomplex_add_minus_eq_minus: |
|
427 |
"x + y = (0::hcomplex) ==> x = -y" |
|
14374 | 428 |
apply (drule Ring_and_Field.equals_zero_I) |
429 |
apply (simp add: minus_equation_iff [of x y]) |
|
14318 | 430 |
done |
431 |
||
14377 | 432 |
lemma hcomplex_i_mult_eq [simp]: "iii * iii = - 1" |
433 |
by (simp add: iii_def hcomplex_mult hcomplex_one_def hcomplex_minus) |
|
434 |
||
435 |
lemma hcomplex_i_mult_left [simp]: "iii * (iii * z) = -z" |
|
436 |
by (simp add: mult_assoc [symmetric]) |
|
437 |
||
438 |
lemma hcomplex_i_not_zero [simp]: "iii \<noteq> 0" |
|
439 |
by (simp add: iii_def hcomplex_zero_def) |
|
440 |
||
14318 | 441 |
|
442 |
subsection{*More Multiplication Laws*} |
|
443 |
||
444 |
lemma hcomplex_mult_one_right: "z * (1::hcomplex) = z" |
|
14374 | 445 |
by (rule Ring_and_Field.mult_1_right) |
14318 | 446 |
|
14374 | 447 |
lemma hcomplex_mult_minus_one [simp]: "- 1 * (z::hcomplex) = -z" |
448 |
by simp |
|
14318 | 449 |
|
14374 | 450 |
lemma hcomplex_mult_minus_one_right [simp]: "(z::hcomplex) * - 1 = -z" |
451 |
by (subst hcomplex_mult_commute, simp) |
|
14318 | 452 |
|
14335 | 453 |
lemma hcomplex_mult_left_cancel: |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
454 |
"(c::hcomplex) \<noteq> (0::hcomplex) ==> (c*a=c*b) = (a=b)" |
14374 | 455 |
by (simp add: field_mult_cancel_left) |
14314 | 456 |
|
14335 | 457 |
lemma hcomplex_mult_right_cancel: |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
458 |
"(c::hcomplex) \<noteq> (0::hcomplex) ==> (a*c=b*c) = (a=b)" |
14374 | 459 |
by (simp add: Ring_and_Field.field_mult_cancel_right) |
14314 | 460 |
|
461 |
||
14318 | 462 |
subsection{*Subraction and Division*} |
14314 | 463 |
|
14318 | 464 |
lemma hcomplex_diff: |
465 |
"Abs_hcomplex(hcomplexrel``{%n. X n}) - Abs_hcomplex(hcomplexrel``{%n. Y n}) = |
|
466 |
Abs_hcomplex(hcomplexrel``{%n. X n - Y n})" |
|
14374 | 467 |
by (simp add: hcomplex_diff_def hcomplex_minus hcomplex_add complex_diff_def) |
14314 | 468 |
|
14374 | 469 |
lemma hcomplex_diff_eq_eq [simp]: "((x::hcomplex) - y = z) = (x = z + y)" |
470 |
by (rule Ring_and_Field.diff_eq_eq) |
|
14314 | 471 |
|
472 |
lemma hcomplex_add_divide_distrib: "(x+y)/(z::hcomplex) = x/z + y/z" |
|
14374 | 473 |
by (rule Ring_and_Field.add_divide_distrib) |
14314 | 474 |
|
475 |
||
476 |
subsection{*Embedding Properties for @{term hcomplex_of_hypreal} Map*} |
|
477 |
||
478 |
lemma hcomplex_of_hypreal: |
|
479 |
"hcomplex_of_hypreal (Abs_hypreal(hyprel `` {%n. X n})) = |
|
480 |
Abs_hcomplex(hcomplexrel `` {%n. complex_of_real (X n)})" |
|
14374 | 481 |
apply (simp add: hcomplex_of_hypreal_def) |
14377 | 482 |
apply (rule_tac f = Abs_hcomplex in arg_cong, auto iff: hcomplexrel_iff, ultra) |
14314 | 483 |
done |
484 |
||
14374 | 485 |
lemma hcomplex_of_hypreal_cancel_iff [iff]: |
486 |
"(hcomplex_of_hypreal x = hcomplex_of_hypreal y) = (x = y)" |
|
487 |
apply (rule eq_Abs_hypreal [of x]) |
|
488 |
apply (rule eq_Abs_hypreal [of y]) |
|
489 |
apply (simp add: hcomplex_of_hypreal) |
|
14314 | 490 |
done |
491 |
||
14335 | 492 |
lemma hcomplex_of_hypreal_minus: |
493 |
"hcomplex_of_hypreal(-x) = - hcomplex_of_hypreal x" |
|
14374 | 494 |
apply (rule eq_Abs_hypreal [of x]) |
495 |
apply (simp add: hcomplex_of_hypreal hcomplex_minus hypreal_minus complex_of_real_minus) |
|
14314 | 496 |
done |
497 |
||
14335 | 498 |
lemma hcomplex_of_hypreal_inverse: |
499 |
"hcomplex_of_hypreal(inverse x) = inverse(hcomplex_of_hypreal x)" |
|
14374 | 500 |
apply (rule eq_Abs_hypreal [of x]) |
501 |
apply (simp add: hcomplex_of_hypreal hypreal_inverse hcomplex_inverse complex_of_real_inverse) |
|
14314 | 502 |
done |
503 |
||
14335 | 504 |
lemma hcomplex_of_hypreal_add: |
505 |
"hcomplex_of_hypreal x + hcomplex_of_hypreal y = |
|
14314 | 506 |
hcomplex_of_hypreal (x + y)" |
14374 | 507 |
apply (rule eq_Abs_hypreal [of x]) |
508 |
apply (rule eq_Abs_hypreal [of y]) |
|
509 |
apply (simp add: hcomplex_of_hypreal hypreal_add hcomplex_add complex_of_real_add) |
|
14314 | 510 |
done |
511 |
||
512 |
lemma hcomplex_of_hypreal_diff: |
|
513 |
"hcomplex_of_hypreal x - hcomplex_of_hypreal y = |
|
514 |
hcomplex_of_hypreal (x - y)" |
|
14374 | 515 |
by (simp add: hcomplex_diff_def hcomplex_of_hypreal_minus [symmetric] hcomplex_of_hypreal_add hypreal_diff_def) |
14314 | 516 |
|
14335 | 517 |
lemma hcomplex_of_hypreal_mult: |
518 |
"hcomplex_of_hypreal x * hcomplex_of_hypreal y = |
|
14314 | 519 |
hcomplex_of_hypreal (x * y)" |
14374 | 520 |
apply (rule eq_Abs_hypreal [of x]) |
521 |
apply (rule eq_Abs_hypreal [of y]) |
|
522 |
apply (simp add: hcomplex_of_hypreal hypreal_mult hcomplex_mult complex_of_real_mult) |
|
14314 | 523 |
done |
524 |
||
525 |
lemma hcomplex_of_hypreal_divide: |
|
526 |
"hcomplex_of_hypreal x / hcomplex_of_hypreal y = hcomplex_of_hypreal(x/y)" |
|
14374 | 527 |
apply (simp add: hcomplex_divide_def) |
528 |
apply (case_tac "y=0", simp) |
|
14314 | 529 |
apply (auto simp add: hcomplex_of_hypreal_mult hcomplex_of_hypreal_inverse [symmetric]) |
14374 | 530 |
apply (simp add: hypreal_divide_def) |
14314 | 531 |
done |
532 |
||
14374 | 533 |
lemma hcomplex_of_hypreal_one [simp]: "hcomplex_of_hypreal 1 = 1" |
534 |
by (simp add: hcomplex_one_def hcomplex_of_hypreal hypreal_one_num) |
|
14314 | 535 |
|
14374 | 536 |
lemma hcomplex_of_hypreal_zero [simp]: "hcomplex_of_hypreal 0 = 0" |
537 |
by (simp add: hcomplex_zero_def hypreal_zero_def hcomplex_of_hypreal) |
|
538 |
||
539 |
lemma hRe_hcomplex_of_hypreal [simp]: "hRe(hcomplex_of_hypreal z) = z" |
|
540 |
apply (rule eq_Abs_hypreal [of z]) |
|
14314 | 541 |
apply (auto simp add: hcomplex_of_hypreal hRe) |
542 |
done |
|
543 |
||
14374 | 544 |
lemma hIm_hcomplex_of_hypreal [simp]: "hIm(hcomplex_of_hypreal z) = 0" |
545 |
apply (rule eq_Abs_hypreal [of z]) |
|
14314 | 546 |
apply (auto simp add: hcomplex_of_hypreal hIm hypreal_zero_num) |
547 |
done |
|
548 |
||
14374 | 549 |
lemma hcomplex_of_hypreal_epsilon_not_zero [simp]: |
550 |
"hcomplex_of_hypreal epsilon \<noteq> 0" |
|
551 |
by (auto simp add: hcomplex_of_hypreal epsilon_def hcomplex_zero_def) |
|
14314 | 552 |
|
14318 | 553 |
|
14377 | 554 |
subsection{*HComplex theorems*} |
555 |
||
556 |
lemma hRe_HComplex [simp]: "hRe (HComplex x y) = x" |
|
557 |
apply (rule eq_Abs_hypreal [of x]) |
|
558 |
apply (rule eq_Abs_hypreal [of y]) |
|
559 |
apply (simp add: HComplex_def hRe iii_def hcomplex_add hcomplex_mult hcomplex_of_hypreal) |
|
560 |
done |
|
561 |
||
562 |
lemma hIm_HComplex [simp]: "hIm (HComplex x y) = y" |
|
563 |
apply (rule eq_Abs_hypreal [of x]) |
|
564 |
apply (rule eq_Abs_hypreal [of y]) |
|
565 |
apply (simp add: HComplex_def hIm iii_def hcomplex_add hcomplex_mult hcomplex_of_hypreal) |
|
566 |
done |
|
567 |
||
568 |
text{*Relates the two nonstandard constructions*} |
|
569 |
lemma HComplex_eq_Abs_hcomplex_Complex: |
|
570 |
"HComplex (Abs_hypreal (hyprel `` {X})) (Abs_hypreal (hyprel `` {Y})) = |
|
571 |
Abs_hcomplex(hcomplexrel `` {%n::nat. Complex (X n) (Y n)})"; |
|
572 |
by (simp add: hcomplex_hRe_hIm_cancel_iff hRe hIm) |
|
573 |
||
574 |
lemma hcomplex_surj [simp]: "HComplex (hRe z) (hIm z) = z" |
|
575 |
by (simp add: hcomplex_equality) |
|
576 |
||
577 |
lemma hcomplex_induct [case_names rect, induct type: hcomplex]: |
|
578 |
"(\<And>x y. P (HComplex x y)) ==> P z" |
|
579 |
by (rule hcomplex_surj [THEN subst], blast) |
|
580 |
||
581 |
||
14318 | 582 |
subsection{*Modulus (Absolute Value) of Nonstandard Complex Number*} |
14314 | 583 |
|
584 |
lemma hcmod: |
|
585 |
"hcmod (Abs_hcomplex(hcomplexrel `` {%n. X n})) = |
|
586 |
Abs_hypreal(hyprel `` {%n. cmod (X n)})" |
|
587 |
||
14374 | 588 |
apply (simp add: hcmod_def) |
589 |
apply (rule_tac f = Abs_hypreal in arg_cong) |
|
14377 | 590 |
apply (auto iff: hcomplexrel_iff, ultra) |
14314 | 591 |
done |
592 |
||
14374 | 593 |
lemma hcmod_zero [simp]: "hcmod(0) = 0" |
14377 | 594 |
by (simp add: hcomplex_zero_def hypreal_zero_def hcmod) |
14314 | 595 |
|
14374 | 596 |
lemma hcmod_one [simp]: "hcmod(1) = 1" |
597 |
by (simp add: hcomplex_one_def hcmod hypreal_one_num) |
|
14314 | 598 |
|
14374 | 599 |
lemma hcmod_hcomplex_of_hypreal [simp]: "hcmod(hcomplex_of_hypreal x) = abs x" |
600 |
apply (rule eq_Abs_hypreal [of x]) |
|
14314 | 601 |
apply (auto simp add: hcmod hcomplex_of_hypreal hypreal_hrabs) |
602 |
done |
|
603 |
||
14335 | 604 |
lemma hcomplex_of_hypreal_abs: |
605 |
"hcomplex_of_hypreal (abs x) = |
|
14314 | 606 |
hcomplex_of_hypreal(hcmod(hcomplex_of_hypreal x))" |
14374 | 607 |
by simp |
14314 | 608 |
|
14377 | 609 |
lemma HComplex_inject [simp]: "HComplex x y = HComplex x' y' = (x=x' & y=y')" |
610 |
apply (rule iffI) |
|
611 |
prefer 2 apply simp |
|
612 |
apply (simp add: HComplex_def iii_def) |
|
613 |
apply (rule eq_Abs_hypreal [of x]) |
|
614 |
apply (rule eq_Abs_hypreal [of y]) |
|
615 |
apply (rule eq_Abs_hypreal [of x']) |
|
616 |
apply (rule eq_Abs_hypreal [of y']) |
|
617 |
apply (auto simp add: iii_def hcomplex_mult hcomplex_add hcomplex_of_hypreal) |
|
618 |
apply (ultra+) |
|
619 |
done |
|
620 |
||
621 |
lemma HComplex_add [simp]: |
|
622 |
"HComplex x1 y1 + HComplex x2 y2 = HComplex (x1+x2) (y1+y2)" |
|
623 |
by (simp add: HComplex_def hcomplex_of_hypreal_add [symmetric] add_ac right_distrib) |
|
624 |
||
625 |
lemma HComplex_minus [simp]: "- HComplex x y = HComplex (-x) (-y)" |
|
626 |
by (simp add: HComplex_def hcomplex_of_hypreal_minus) |
|
627 |
||
628 |
lemma HComplex_diff [simp]: |
|
629 |
"HComplex x1 y1 - HComplex x2 y2 = HComplex (x1-x2) (y1-y2)" |
|
630 |
by (simp add: diff_minus) |
|
631 |
||
632 |
lemma HComplex_mult [simp]: |
|
633 |
"HComplex x1 y1 * HComplex x2 y2 = HComplex (x1*x2 - y1*y2) (x1*y2 + y1*x2)" |
|
634 |
by (simp add: HComplex_def diff_minus hcomplex_of_hypreal_minus |
|
635 |
hcomplex_of_hypreal_add [symmetric] hcomplex_of_hypreal_mult [symmetric] |
|
636 |
add_ac mult_ac right_distrib) |
|
637 |
||
638 |
(*HComplex_inverse is proved below*) |
|
639 |
||
640 |
lemma hcomplex_of_hypreal_eq: "hcomplex_of_hypreal r = HComplex r 0" |
|
641 |
by (simp add: HComplex_def) |
|
642 |
||
643 |
lemma HComplex_add_hcomplex_of_hypreal [simp]: |
|
644 |
"HComplex x y + hcomplex_of_hypreal r = HComplex (x+r) y" |
|
645 |
by (simp add: hcomplex_of_hypreal_eq) |
|
646 |
||
647 |
lemma hcomplex_of_hypreal_add_HComplex [simp]: |
|
648 |
"hcomplex_of_hypreal r + HComplex x y = HComplex (r+x) y" |
|
649 |
by (simp add: i_def hcomplex_of_hypreal_eq) |
|
650 |
||
651 |
lemma HComplex_mult_hcomplex_of_hypreal: |
|
652 |
"HComplex x y * hcomplex_of_hypreal r = HComplex (x*r) (y*r)" |
|
653 |
by (simp add: hcomplex_of_hypreal_eq) |
|
654 |
||
655 |
lemma hcomplex_of_hypreal_mult_HComplex: |
|
656 |
"hcomplex_of_hypreal r * HComplex x y = HComplex (r*x) (r*y)" |
|
657 |
by (simp add: i_def hcomplex_of_hypreal_eq) |
|
658 |
||
659 |
lemma i_hcomplex_of_hypreal [simp]: |
|
660 |
"iii * hcomplex_of_hypreal r = HComplex 0 r" |
|
661 |
by (simp add: HComplex_def) |
|
662 |
||
663 |
lemma hcomplex_of_hypreal_i [simp]: |
|
664 |
"hcomplex_of_hypreal r * iii = HComplex 0 r" |
|
665 |
by (simp add: mult_commute) |
|
666 |
||
14314 | 667 |
|
668 |
subsection{*Conjugation*} |
|
669 |
||
670 |
lemma hcnj: |
|
671 |
"hcnj (Abs_hcomplex(hcomplexrel `` {%n. X n})) = |
|
14318 | 672 |
Abs_hcomplex(hcomplexrel `` {%n. cnj(X n)})" |
14374 | 673 |
apply (simp add: hcnj_def) |
674 |
apply (rule_tac f = Abs_hcomplex in arg_cong) |
|
14377 | 675 |
apply (auto iff: hcomplexrel_iff, ultra) |
14314 | 676 |
done |
677 |
||
14374 | 678 |
lemma hcomplex_hcnj_cancel_iff [iff]: "(hcnj x = hcnj y) = (x = y)" |
679 |
apply (rule eq_Abs_hcomplex [of x]) |
|
680 |
apply (rule eq_Abs_hcomplex [of y]) |
|
681 |
apply (simp add: hcnj) |
|
682 |
done |
|
683 |
||
684 |
lemma hcomplex_hcnj_hcnj [simp]: "hcnj (hcnj z) = z" |
|
685 |
apply (rule eq_Abs_hcomplex [of z]) |
|
686 |
apply (simp add: hcnj) |
|
14314 | 687 |
done |
688 |
||
14374 | 689 |
lemma hcomplex_hcnj_hcomplex_of_hypreal [simp]: |
690 |
"hcnj (hcomplex_of_hypreal x) = hcomplex_of_hypreal x" |
|
691 |
apply (rule eq_Abs_hypreal [of x]) |
|
692 |
apply (simp add: hcnj hcomplex_of_hypreal) |
|
14314 | 693 |
done |
694 |
||
14374 | 695 |
lemma hcomplex_hmod_hcnj [simp]: "hcmod (hcnj z) = hcmod z" |
696 |
apply (rule eq_Abs_hcomplex [of z]) |
|
697 |
apply (simp add: hcnj hcmod) |
|
14314 | 698 |
done |
699 |
||
700 |
lemma hcomplex_hcnj_minus: "hcnj (-z) = - hcnj z" |
|
14374 | 701 |
apply (rule eq_Abs_hcomplex [of z]) |
702 |
apply (simp add: hcnj hcomplex_minus complex_cnj_minus) |
|
14314 | 703 |
done |
704 |
||
705 |
lemma hcomplex_hcnj_inverse: "hcnj(inverse z) = inverse(hcnj z)" |
|
14374 | 706 |
apply (rule eq_Abs_hcomplex [of z]) |
707 |
apply (simp add: hcnj hcomplex_inverse complex_cnj_inverse) |
|
14314 | 708 |
done |
709 |
||
710 |
lemma hcomplex_hcnj_add: "hcnj(w + z) = hcnj(w) + hcnj(z)" |
|
14374 | 711 |
apply (rule eq_Abs_hcomplex [of z]) |
712 |
apply (rule eq_Abs_hcomplex [of w]) |
|
713 |
apply (simp add: hcnj hcomplex_add complex_cnj_add) |
|
14314 | 714 |
done |
715 |
||
716 |
lemma hcomplex_hcnj_diff: "hcnj(w - z) = hcnj(w) - hcnj(z)" |
|
14374 | 717 |
apply (rule eq_Abs_hcomplex [of z]) |
718 |
apply (rule eq_Abs_hcomplex [of w]) |
|
719 |
apply (simp add: hcnj hcomplex_diff complex_cnj_diff) |
|
14314 | 720 |
done |
721 |
||
722 |
lemma hcomplex_hcnj_mult: "hcnj(w * z) = hcnj(w) * hcnj(z)" |
|
14374 | 723 |
apply (rule eq_Abs_hcomplex [of z]) |
724 |
apply (rule eq_Abs_hcomplex [of w]) |
|
725 |
apply (simp add: hcnj hcomplex_mult complex_cnj_mult) |
|
14314 | 726 |
done |
727 |
||
728 |
lemma hcomplex_hcnj_divide: "hcnj(w / z) = (hcnj w)/(hcnj z)" |
|
14374 | 729 |
by (simp add: hcomplex_divide_def hcomplex_hcnj_mult hcomplex_hcnj_inverse) |
14314 | 730 |
|
14374 | 731 |
lemma hcnj_one [simp]: "hcnj 1 = 1" |
732 |
by (simp add: hcomplex_one_def hcnj) |
|
14314 | 733 |
|
14374 | 734 |
lemma hcomplex_hcnj_zero [simp]: "hcnj 0 = 0" |
735 |
by (simp add: hcomplex_zero_def hcnj) |
|
736 |
||
737 |
lemma hcomplex_hcnj_zero_iff [iff]: "(hcnj z = 0) = (z = 0)" |
|
738 |
apply (rule eq_Abs_hcomplex [of z]) |
|
739 |
apply (simp add: hcomplex_zero_def hcnj) |
|
14314 | 740 |
done |
741 |
||
14335 | 742 |
lemma hcomplex_mult_hcnj: |
743 |
"z * hcnj z = hcomplex_of_hypreal (hRe(z) ^ 2 + hIm(z) ^ 2)" |
|
14374 | 744 |
apply (rule eq_Abs_hcomplex [of z]) |
745 |
apply (simp add: hcnj hcomplex_mult hcomplex_of_hypreal hRe hIm hypreal_add |
|
746 |
hypreal_mult complex_mult_cnj numeral_2_eq_2) |
|
14314 | 747 |
done |
748 |
||
749 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
750 |
subsection{*More Theorems about the Function @{term hcmod}*} |
14314 | 751 |
|
14374 | 752 |
lemma hcomplex_hcmod_eq_zero_cancel [simp]: "(hcmod x = 0) = (x = 0)" |
753 |
apply (rule eq_Abs_hcomplex [of x]) |
|
754 |
apply (simp add: hcmod hcomplex_zero_def hypreal_zero_num) |
|
14314 | 755 |
done |
756 |
||
14374 | 757 |
lemma hcmod_hcomplex_of_hypreal_of_nat [simp]: |
14335 | 758 |
"hcmod (hcomplex_of_hypreal(hypreal_of_nat n)) = hypreal_of_nat n" |
14374 | 759 |
apply (simp add: abs_if linorder_not_less) |
14314 | 760 |
done |
761 |
||
14374 | 762 |
lemma hcmod_hcomplex_of_hypreal_of_hypnat [simp]: |
14335 | 763 |
"hcmod (hcomplex_of_hypreal(hypreal_of_hypnat n)) = hypreal_of_hypnat n" |
14374 | 764 |
apply (simp add: abs_if linorder_not_less) |
14314 | 765 |
done |
766 |
||
14374 | 767 |
lemma hcmod_minus [simp]: "hcmod (-x) = hcmod(x)" |
768 |
apply (rule eq_Abs_hcomplex [of x]) |
|
769 |
apply (simp add: hcmod hcomplex_minus) |
|
14314 | 770 |
done |
771 |
||
772 |
lemma hcmod_mult_hcnj: "hcmod(z * hcnj(z)) = hcmod(z) ^ 2" |
|
14374 | 773 |
apply (rule eq_Abs_hcomplex [of z]) |
774 |
apply (simp add: hcmod hcomplex_mult hcnj hypreal_mult complex_mod_mult_cnj numeral_2_eq_2) |
|
14314 | 775 |
done |
776 |
||
14374 | 777 |
lemma hcmod_ge_zero [simp]: "(0::hypreal) \<le> hcmod x" |
778 |
apply (rule eq_Abs_hcomplex [of x]) |
|
779 |
apply (simp add: hcmod hypreal_zero_num hypreal_le) |
|
14314 | 780 |
done |
781 |
||
14374 | 782 |
lemma hrabs_hcmod_cancel [simp]: "abs(hcmod x) = hcmod x" |
783 |
by (simp add: abs_if linorder_not_less) |
|
14314 | 784 |
|
785 |
lemma hcmod_mult: "hcmod(x*y) = hcmod(x) * hcmod(y)" |
|
14374 | 786 |
apply (rule eq_Abs_hcomplex [of x]) |
787 |
apply (rule eq_Abs_hcomplex [of y]) |
|
788 |
apply (simp add: hcmod hcomplex_mult hypreal_mult complex_mod_mult) |
|
14314 | 789 |
done |
790 |
||
791 |
lemma hcmod_add_squared_eq: |
|
792 |
"hcmod(x + y) ^ 2 = hcmod(x) ^ 2 + hcmod(y) ^ 2 + 2 * hRe(x * hcnj y)" |
|
14374 | 793 |
apply (rule eq_Abs_hcomplex [of x]) |
794 |
apply (rule eq_Abs_hcomplex [of y]) |
|
795 |
apply (simp add: hcmod hcomplex_add hypreal_mult hRe hcnj hcomplex_mult |
|
796 |
numeral_2_eq_2 realpow_two [symmetric] |
|
797 |
del: realpow_Suc) |
|
798 |
apply (simp add: numeral_2_eq_2 [symmetric] complex_mod_add_squared_eq |
|
799 |
hypreal_add [symmetric] hypreal_mult [symmetric] |
|
14314 | 800 |
hypreal_of_real_def [symmetric]) |
801 |
done |
|
802 |
||
14374 | 803 |
lemma hcomplex_hRe_mult_hcnj_le_hcmod [simp]: "hRe(x * hcnj y) \<le> hcmod(x * hcnj y)" |
804 |
apply (rule eq_Abs_hcomplex [of x]) |
|
805 |
apply (rule eq_Abs_hcomplex [of y]) |
|
806 |
apply (simp add: hcmod hcnj hcomplex_mult hRe hypreal_le) |
|
14314 | 807 |
done |
808 |
||
14374 | 809 |
lemma hcomplex_hRe_mult_hcnj_le_hcmod2 [simp]: "hRe(x * hcnj y) \<le> hcmod(x * y)" |
810 |
apply (cut_tac x = x and y = y in hcomplex_hRe_mult_hcnj_le_hcmod) |
|
14314 | 811 |
apply (simp add: hcmod_mult) |
812 |
done |
|
813 |
||
14374 | 814 |
lemma hcmod_triangle_squared [simp]: "hcmod (x + y) ^ 2 \<le> (hcmod(x) + hcmod(y)) ^ 2" |
815 |
apply (rule eq_Abs_hcomplex [of x]) |
|
816 |
apply (rule eq_Abs_hcomplex [of y]) |
|
817 |
apply (simp add: hcmod hcnj hcomplex_add hypreal_mult hypreal_add |
|
14323 | 818 |
hypreal_le realpow_two [symmetric] numeral_2_eq_2 |
14374 | 819 |
del: realpow_Suc) |
820 |
apply (simp add: numeral_2_eq_2 [symmetric]) |
|
14314 | 821 |
done |
822 |
||
14374 | 823 |
lemma hcmod_triangle_ineq [simp]: "hcmod (x + y) \<le> hcmod(x) + hcmod(y)" |
824 |
apply (rule eq_Abs_hcomplex [of x]) |
|
825 |
apply (rule eq_Abs_hcomplex [of y]) |
|
826 |
apply (simp add: hcmod hcomplex_add hypreal_add hypreal_le) |
|
14314 | 827 |
done |
828 |
||
14374 | 829 |
lemma hcmod_triangle_ineq2 [simp]: "hcmod(b + a) - hcmod b \<le> hcmod a" |
830 |
apply (cut_tac x1 = b and y1 = a and c = "-hcmod b" in hcmod_triangle_ineq [THEN add_right_mono]) |
|
14331 | 831 |
apply (simp add: add_ac) |
14314 | 832 |
done |
833 |
||
834 |
lemma hcmod_diff_commute: "hcmod (x - y) = hcmod (y - x)" |
|
14374 | 835 |
apply (rule eq_Abs_hcomplex [of x]) |
836 |
apply (rule eq_Abs_hcomplex [of y]) |
|
837 |
apply (simp add: hcmod hcomplex_diff complex_mod_diff_commute) |
|
14314 | 838 |
done |
839 |
||
14335 | 840 |
lemma hcmod_add_less: |
841 |
"[| hcmod x < r; hcmod y < s |] ==> hcmod (x + y) < r + s" |
|
14374 | 842 |
apply (rule eq_Abs_hcomplex [of x]) |
843 |
apply (rule eq_Abs_hcomplex [of y]) |
|
844 |
apply (rule eq_Abs_hypreal [of r]) |
|
845 |
apply (rule eq_Abs_hypreal [of s]) |
|
846 |
apply (simp add: hcmod hcomplex_add hypreal_add hypreal_less, ultra) |
|
14314 | 847 |
apply (auto intro: complex_mod_add_less) |
848 |
done |
|
849 |
||
14335 | 850 |
lemma hcmod_mult_less: |
851 |
"[| hcmod x < r; hcmod y < s |] ==> hcmod (x * y) < r * s" |
|
14374 | 852 |
apply (rule eq_Abs_hcomplex [of x]) |
853 |
apply (rule eq_Abs_hcomplex [of y]) |
|
854 |
apply (rule eq_Abs_hypreal [of r]) |
|
855 |
apply (rule eq_Abs_hypreal [of s]) |
|
856 |
apply (simp add: hcmod hypreal_mult hypreal_less hcomplex_mult, ultra) |
|
14314 | 857 |
apply (auto intro: complex_mod_mult_less) |
858 |
done |
|
859 |
||
14374 | 860 |
lemma hcmod_diff_ineq [simp]: "hcmod(a) - hcmod(b) \<le> hcmod(a + b)" |
861 |
apply (rule eq_Abs_hcomplex [of a]) |
|
862 |
apply (rule eq_Abs_hcomplex [of b]) |
|
863 |
apply (simp add: hcmod hcomplex_add hypreal_diff hypreal_le) |
|
14314 | 864 |
done |
865 |
||
866 |
||
867 |
subsection{*A Few Nonlinear Theorems*} |
|
868 |
||
869 |
lemma hcpow: |
|
870 |
"Abs_hcomplex(hcomplexrel``{%n. X n}) hcpow |
|
871 |
Abs_hypnat(hypnatrel``{%n. Y n}) = |
|
872 |
Abs_hcomplex(hcomplexrel``{%n. X n ^ Y n})" |
|
14374 | 873 |
apply (simp add: hcpow_def) |
874 |
apply (rule_tac f = Abs_hcomplex in arg_cong) |
|
14377 | 875 |
apply (auto iff: hcomplexrel_iff, ultra) |
14314 | 876 |
done |
877 |
||
14335 | 878 |
lemma hcomplex_of_hypreal_hyperpow: |
879 |
"hcomplex_of_hypreal (x pow n) = (hcomplex_of_hypreal x) hcpow n" |
|
14374 | 880 |
apply (rule eq_Abs_hypreal [of x]) |
881 |
apply (rule eq_Abs_hypnat [of n]) |
|
882 |
apply (simp add: hcomplex_of_hypreal hyperpow hcpow complex_of_real_pow) |
|
14314 | 883 |
done |
884 |
||
885 |
lemma hcmod_hcpow: "hcmod(x hcpow n) = hcmod(x) pow n" |
|
14374 | 886 |
apply (rule eq_Abs_hcomplex [of x]) |
887 |
apply (rule eq_Abs_hypnat [of n]) |
|
888 |
apply (simp add: hcpow hyperpow hcmod complex_mod_complexpow) |
|
14314 | 889 |
done |
890 |
||
891 |
lemma hcmod_hcomplex_inverse: "hcmod(inverse x) = inverse(hcmod x)" |
|
14374 | 892 |
apply (case_tac "x = 0", simp) |
14314 | 893 |
apply (rule_tac c1 = "hcmod x" in hypreal_mult_left_cancel [THEN iffD1]) |
894 |
apply (auto simp add: hcmod_mult [symmetric]) |
|
895 |
done |
|
896 |
||
14374 | 897 |
lemma hcmod_divide: "hcmod(x/y) = hcmod(x)/(hcmod y)" |
898 |
by (simp add: hcomplex_divide_def hypreal_divide_def hcmod_mult hcmod_hcomplex_inverse) |
|
14314 | 899 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
900 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
901 |
subsection{*Exponentiation*} |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
902 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
903 |
primrec |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
904 |
hcomplexpow_0: "z ^ 0 = 1" |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
905 |
hcomplexpow_Suc: "z ^ (Suc n) = (z::hcomplex) * (z ^ n)" |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
906 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
907 |
instance hcomplex :: ringpower |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
908 |
proof |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
909 |
fix z :: hcomplex |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
910 |
fix n :: nat |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
911 |
show "z^0 = 1" by simp |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
912 |
show "z^(Suc n) = z * (z^n)" by simp |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
913 |
qed |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
914 |
|
14377 | 915 |
lemma hcomplexpow_i_squared [simp]: "iii ^ 2 = - 1" |
916 |
by (simp add: power2_eq_square) |
|
917 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
918 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
919 |
lemma hcomplex_of_hypreal_pow: |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
920 |
"hcomplex_of_hypreal (x ^ n) = (hcomplex_of_hypreal x) ^ n" |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
921 |
apply (induct_tac "n") |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
922 |
apply (auto simp add: hcomplex_of_hypreal_mult [symmetric]) |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
923 |
done |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
924 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
925 |
lemma hcomplex_hcnj_pow: "hcnj(z ^ n) = hcnj(z) ^ n" |
14314 | 926 |
apply (induct_tac "n") |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
927 |
apply (auto simp add: hcomplex_hcnj_mult) |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
928 |
done |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
929 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
930 |
lemma hcmod_hcomplexpow: "hcmod(x ^ n) = hcmod(x) ^ n" |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
931 |
apply (induct_tac "n") |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
932 |
apply (auto simp add: hcmod_mult) |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
933 |
done |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
934 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
935 |
lemma hcpow_minus: |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
936 |
"(-x::hcomplex) hcpow n = |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
937 |
(if ( *pNat* even) n then (x hcpow n) else -(x hcpow n))" |
14374 | 938 |
apply (rule eq_Abs_hcomplex [of x]) |
939 |
apply (rule eq_Abs_hypnat [of n]) |
|
940 |
apply (auto simp add: hcpow hyperpow starPNat hcomplex_minus, ultra) |
|
14443
75910c7557c5
generic theorems about exponentials; general tidying up
paulson
parents:
14430
diff
changeset
|
941 |
apply (auto simp add: neg_power_if, ultra) |
14314 | 942 |
done |
943 |
||
944 |
lemma hcpow_mult: "((r::hcomplex) * s) hcpow n = (r hcpow n) * (s hcpow n)" |
|
14374 | 945 |
apply (rule eq_Abs_hcomplex [of r]) |
946 |
apply (rule eq_Abs_hcomplex [of s]) |
|
947 |
apply (rule eq_Abs_hypnat [of n]) |
|
948 |
apply (simp add: hcpow hypreal_mult hcomplex_mult power_mult_distrib) |
|
14314 | 949 |
done |
950 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
951 |
lemma hcpow_zero [simp]: "0 hcpow (n + 1) = 0" |
14374 | 952 |
apply (simp add: hcomplex_zero_def hypnat_one_def) |
953 |
apply (rule eq_Abs_hypnat [of n]) |
|
954 |
apply (simp add: hcpow hypnat_add) |
|
14314 | 955 |
done |
956 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
957 |
lemma hcpow_zero2 [simp]: "0 hcpow (hSuc n) = 0" |
14374 | 958 |
by (simp add: hSuc_def) |
14314 | 959 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
960 |
lemma hcpow_not_zero [simp,intro]: "r \<noteq> 0 ==> r hcpow n \<noteq> (0::hcomplex)" |
14374 | 961 |
apply (rule eq_Abs_hcomplex [of r]) |
962 |
apply (rule eq_Abs_hypnat [of n]) |
|
963 |
apply (auto simp add: hcpow hcomplex_zero_def, ultra) |
|
14314 | 964 |
done |
965 |
||
966 |
lemma hcpow_zero_zero: "r hcpow n = (0::hcomplex) ==> r = 0" |
|
14374 | 967 |
by (blast intro: ccontr dest: hcpow_not_zero) |
14314 | 968 |
|
969 |
lemma hcomplex_divide: |
|
970 |
"Abs_hcomplex(hcomplexrel``{%n. X n}) / Abs_hcomplex(hcomplexrel``{%n. Y n}) = |
|
971 |
Abs_hcomplex(hcomplexrel``{%n. X n / Y n})" |
|
14374 | 972 |
by (simp add: hcomplex_divide_def complex_divide_def hcomplex_inverse hcomplex_mult) |
973 |
||
14314 | 974 |
|
975 |
||
14377 | 976 |
|
14314 | 977 |
subsection{*The Function @{term hsgn}*} |
978 |
||
979 |
lemma hsgn: |
|
980 |
"hsgn (Abs_hcomplex(hcomplexrel `` {%n. X n})) = |
|
981 |
Abs_hcomplex(hcomplexrel `` {%n. sgn (X n)})" |
|
14374 | 982 |
apply (simp add: hsgn_def) |
983 |
apply (rule_tac f = Abs_hcomplex in arg_cong) |
|
14377 | 984 |
apply (auto iff: hcomplexrel_iff, ultra) |
14314 | 985 |
done |
986 |
||
14374 | 987 |
lemma hsgn_zero [simp]: "hsgn 0 = 0" |
988 |
by (simp add: hcomplex_zero_def hsgn) |
|
14314 | 989 |
|
14374 | 990 |
lemma hsgn_one [simp]: "hsgn 1 = 1" |
991 |
by (simp add: hcomplex_one_def hsgn) |
|
14314 | 992 |
|
993 |
lemma hsgn_minus: "hsgn (-z) = - hsgn(z)" |
|
14374 | 994 |
apply (rule eq_Abs_hcomplex [of z]) |
995 |
apply (simp add: hsgn hcomplex_minus sgn_minus) |
|
14314 | 996 |
done |
997 |
||
998 |
lemma hsgn_eq: "hsgn z = z / hcomplex_of_hypreal (hcmod z)" |
|
14374 | 999 |
apply (rule eq_Abs_hcomplex [of z]) |
1000 |
apply (simp add: hsgn hcomplex_divide hcomplex_of_hypreal hcmod sgn_eq) |
|
14314 | 1001 |
done |
1002 |
||
1003 |
||
14377 | 1004 |
lemma hcmod_i: "hcmod (HComplex x y) = ( *f* sqrt) (x ^ 2 + y ^ 2)" |
14374 | 1005 |
apply (rule eq_Abs_hypreal [of x]) |
14377 | 1006 |
apply (rule eq_Abs_hypreal [of y]) |
1007 |
apply (simp add: HComplex_eq_Abs_hcomplex_Complex starfun |
|
1008 |
hypreal_mult hypreal_add hcmod numeral_2_eq_2) |
|
14314 | 1009 |
done |
1010 |
||
14377 | 1011 |
lemma hcomplex_eq_cancel_iff1 [simp]: |
1012 |
"(hcomplex_of_hypreal xa = HComplex x y) = (xa = x & y = 0)" |
|
1013 |
by (simp add: hcomplex_of_hypreal_eq) |
|
14314 | 1014 |
|
14374 | 1015 |
lemma hcomplex_eq_cancel_iff2 [simp]: |
14377 | 1016 |
"(HComplex x y = hcomplex_of_hypreal xa) = (x = xa & y = 0)" |
1017 |
by (simp add: hcomplex_of_hypreal_eq) |
|
14314 | 1018 |
|
14377 | 1019 |
lemma HComplex_eq_0 [simp]: "(HComplex x y = 0) = (x = 0 & y = 0)" |
1020 |
by (insert hcomplex_eq_cancel_iff2 [of _ _ 0], simp) |
|
14314 | 1021 |
|
14377 | 1022 |
lemma HComplex_eq_1 [simp]: "(HComplex x y = 1) = (x = 1 & y = 0)" |
1023 |
by (insert hcomplex_eq_cancel_iff2 [of _ _ 1], simp) |
|
14314 | 1024 |
|
14377 | 1025 |
lemma i_eq_HComplex_0_1: "iii = HComplex 0 1" |
1026 |
by (insert hcomplex_of_hypreal_i [of 1], simp) |
|
14314 | 1027 |
|
14377 | 1028 |
lemma HComplex_eq_i [simp]: "(HComplex x y = iii) = (x = 0 & y = 1)" |
1029 |
by (simp add: i_eq_HComplex_0_1) |
|
14314 | 1030 |
|
14374 | 1031 |
lemma hRe_hsgn [simp]: "hRe(hsgn z) = hRe(z)/hcmod z" |
1032 |
apply (rule eq_Abs_hcomplex [of z]) |
|
1033 |
apply (simp add: hsgn hcmod hRe hypreal_divide) |
|
14314 | 1034 |
done |
1035 |
||
14374 | 1036 |
lemma hIm_hsgn [simp]: "hIm(hsgn z) = hIm(z)/hcmod z" |
1037 |
apply (rule eq_Abs_hcomplex [of z]) |
|
1038 |
apply (simp add: hsgn hcmod hIm hypreal_divide) |
|
14314 | 1039 |
done |
1040 |
||
14374 | 1041 |
lemma real_two_squares_add_zero_iff [simp]: "(x*x + y*y = 0) = ((x::real) = 0 & y = 0)" |
14377 | 1042 |
by (auto intro: real_sum_squares_cancel) |
14314 | 1043 |
|
14335 | 1044 |
lemma hcomplex_inverse_complex_split: |
1045 |
"inverse(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y) = |
|
14314 | 1046 |
hcomplex_of_hypreal(x/(x ^ 2 + y ^ 2)) - |
1047 |
iii * hcomplex_of_hypreal(y/(x ^ 2 + y ^ 2))" |
|
14374 | 1048 |
apply (rule eq_Abs_hypreal [of x]) |
1049 |
apply (rule eq_Abs_hypreal [of y]) |
|
1050 |
apply (simp add: hcomplex_of_hypreal hcomplex_mult hcomplex_add iii_def starfun hypreal_mult hypreal_add hcomplex_inverse hypreal_divide hcomplex_diff complex_inverse_complex_split numeral_2_eq_2) |
|
14377 | 1051 |
apply (simp add: diff_minus) |
14374 | 1052 |
done |
1053 |
||
14377 | 1054 |
lemma HComplex_inverse: |
1055 |
"inverse (HComplex x y) = |
|
1056 |
HComplex (x/(x ^ 2 + y ^ 2)) (-y/(x ^ 2 + y ^ 2))" |
|
1057 |
by (simp only: HComplex_def hcomplex_inverse_complex_split, simp) |
|
1058 |
||
1059 |
||
1060 |
||
14374 | 1061 |
lemma hRe_mult_i_eq[simp]: |
1062 |
"hRe (iii * hcomplex_of_hypreal y) = 0" |
|
1063 |
apply (simp add: iii_def) |
|
1064 |
apply (rule eq_Abs_hypreal [of y]) |
|
1065 |
apply (simp add: hcomplex_of_hypreal hcomplex_mult hRe hypreal_zero_num) |
|
14314 | 1066 |
done |
1067 |
||
14374 | 1068 |
lemma hIm_mult_i_eq [simp]: |
14314 | 1069 |
"hIm (iii * hcomplex_of_hypreal y) = y" |
14374 | 1070 |
apply (simp add: iii_def) |
1071 |
apply (rule eq_Abs_hypreal [of y]) |
|
1072 |
apply (simp add: hcomplex_of_hypreal hcomplex_mult hIm hypreal_zero_num) |
|
14314 | 1073 |
done |
1074 |
||
14374 | 1075 |
lemma hcmod_mult_i [simp]: "hcmod (iii * hcomplex_of_hypreal y) = abs y" |
1076 |
apply (rule eq_Abs_hypreal [of y]) |
|
1077 |
apply (simp add: hcomplex_of_hypreal hcmod hypreal_hrabs iii_def hcomplex_mult) |
|
14314 | 1078 |
done |
1079 |
||
14374 | 1080 |
lemma hcmod_mult_i2 [simp]: "hcmod (hcomplex_of_hypreal y * iii) = abs y" |
14377 | 1081 |
by (simp only: hcmod_mult_i hcomplex_mult_commute) |
14314 | 1082 |
|
1083 |
(*---------------------------------------------------------------------------*) |
|
1084 |
(* harg *) |
|
1085 |
(*---------------------------------------------------------------------------*) |
|
1086 |
||
1087 |
lemma harg: |
|
1088 |
"harg (Abs_hcomplex(hcomplexrel `` {%n. X n})) = |
|
1089 |
Abs_hypreal(hyprel `` {%n. arg (X n)})" |
|
14374 | 1090 |
apply (simp add: harg_def) |
1091 |
apply (rule_tac f = Abs_hypreal in arg_cong) |
|
14377 | 1092 |
apply (auto iff: hcomplexrel_iff, ultra) |
14314 | 1093 |
done |
1094 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
1095 |
lemma cos_harg_i_mult_zero_pos: |
14377 | 1096 |
"0 < y ==> ( *f* cos) (harg(HComplex 0 y)) = 0" |
14374 | 1097 |
apply (rule eq_Abs_hypreal [of y]) |
14377 | 1098 |
apply (simp add: HComplex_def hcomplex_of_hypreal iii_def hcomplex_mult |
1099 |
hcomplex_add hypreal_zero_num hypreal_less starfun harg, ultra) |
|
14314 | 1100 |
done |
1101 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
1102 |
lemma cos_harg_i_mult_zero_neg: |
14377 | 1103 |
"y < 0 ==> ( *f* cos) (harg(HComplex 0 y)) = 0" |
14374 | 1104 |
apply (rule eq_Abs_hypreal [of y]) |
14377 | 1105 |
apply (simp add: HComplex_def hcomplex_of_hypreal iii_def hcomplex_mult |
1106 |
hcomplex_add hypreal_zero_num hypreal_less starfun harg, ultra) |
|
14314 | 1107 |
done |
1108 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
1109 |
lemma cos_harg_i_mult_zero [simp]: |
14377 | 1110 |
"y \<noteq> 0 ==> ( *f* cos) (harg(HComplex 0 y)) = 0" |
1111 |
by (auto simp add: linorder_neq_iff |
|
1112 |
cos_harg_i_mult_zero_pos cos_harg_i_mult_zero_neg) |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
1113 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
1114 |
lemma hcomplex_of_hypreal_zero_iff [simp]: |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
1115 |
"(hcomplex_of_hypreal y = 0) = (y = 0)" |
14374 | 1116 |
apply (rule eq_Abs_hypreal [of y]) |
1117 |
apply (simp add: hcomplex_of_hypreal hypreal_zero_num hcomplex_zero_def) |
|
14314 | 1118 |
done |
1119 |
||
1120 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
1121 |
subsection{*Polar Form for Nonstandard Complex Numbers*} |
14314 | 1122 |
|
14335 | 1123 |
lemma complex_split_polar2: |
14377 | 1124 |
"\<forall>n. \<exists>r a. (z n) = complex_of_real r * (Complex (cos a) (sin a))" |
1125 |
by (blast intro: complex_split_polar) |
|
1126 |
||
1127 |
lemma lemma_hypreal_P_EX2: |
|
1128 |
"(\<exists>(x::hypreal) y. P x y) = |
|
1129 |
(\<exists>f g. P (Abs_hypreal(hyprel `` {f})) (Abs_hypreal(hyprel `` {g})))" |
|
1130 |
apply auto |
|
1131 |
apply (rule_tac z = x in eq_Abs_hypreal) |
|
1132 |
apply (rule_tac z = y in eq_Abs_hypreal, auto) |
|
14314 | 1133 |
done |
1134 |
||
1135 |
lemma hcomplex_split_polar: |
|
14377 | 1136 |
"\<exists>r a. z = hcomplex_of_hypreal r * (HComplex(( *f* cos) a)(( *f* sin) a))" |
14374 | 1137 |
apply (rule eq_Abs_hcomplex [of z]) |
14377 | 1138 |
apply (simp add: lemma_hypreal_P_EX2 hcomplex_of_hypreal iii_def starfun hcomplex_add hcomplex_mult HComplex_def) |
14374 | 1139 |
apply (cut_tac z = x in complex_split_polar2) |
14335 | 1140 |
apply (drule choice, safe)+ |
14374 | 1141 |
apply (rule_tac x = f in exI) |
1142 |
apply (rule_tac x = fa in exI, auto) |
|
14314 | 1143 |
done |
1144 |
||
1145 |
lemma hcis: |
|
1146 |
"hcis (Abs_hypreal(hyprel `` {%n. X n})) = |
|
1147 |
Abs_hcomplex(hcomplexrel `` {%n. cis (X n)})" |
|
14374 | 1148 |
apply (simp add: hcis_def) |
14377 | 1149 |
apply (rule_tac f = Abs_hcomplex in arg_cong, auto iff: hcomplexrel_iff, ultra) |
14314 | 1150 |
done |
1151 |
||
1152 |
lemma hcis_eq: |
|
1153 |
"hcis a = |
|
1154 |
(hcomplex_of_hypreal(( *f* cos) a) + |
|
1155 |
iii * hcomplex_of_hypreal(( *f* sin) a))" |
|
14374 | 1156 |
apply (rule eq_Abs_hypreal [of a]) |
1157 |
apply (simp add: starfun hcis hcomplex_of_hypreal iii_def hcomplex_mult hcomplex_add cis_def) |
|
14314 | 1158 |
done |
1159 |
||
1160 |
lemma hrcis: |
|
1161 |
"hrcis (Abs_hypreal(hyprel `` {%n. X n})) (Abs_hypreal(hyprel `` {%n. Y n})) = |
|
1162 |
Abs_hcomplex(hcomplexrel `` {%n. rcis (X n) (Y n)})" |
|
14374 | 1163 |
by (simp add: hrcis_def hcomplex_of_hypreal hcomplex_mult hcis rcis_def) |
14314 | 1164 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
1165 |
lemma hrcis_Ex: "\<exists>r a. z = hrcis r a" |
14377 | 1166 |
apply (simp add: hrcis_def hcis_eq hcomplex_of_hypreal_mult_HComplex [symmetric]) |
14314 | 1167 |
apply (rule hcomplex_split_polar) |
1168 |
done |
|
1169 |
||
14374 | 1170 |
lemma hRe_hcomplex_polar [simp]: |
14377 | 1171 |
"hRe (hcomplex_of_hypreal r * HComplex (( *f* cos) a) (( *f* sin) a)) = |
1172 |
r * ( *f* cos) a" |
|
1173 |
by (simp add: hcomplex_of_hypreal_mult_HComplex) |
|
14314 | 1174 |
|
14374 | 1175 |
lemma hRe_hrcis [simp]: "hRe(hrcis r a) = r * ( *f* cos) a" |
1176 |
by (simp add: hrcis_def hcis_eq) |
|
14314 | 1177 |
|
14374 | 1178 |
lemma hIm_hcomplex_polar [simp]: |
14377 | 1179 |
"hIm (hcomplex_of_hypreal r * HComplex (( *f* cos) a) (( *f* sin) a)) = |
1180 |
r * ( *f* sin) a" |
|
1181 |
by (simp add: hcomplex_of_hypreal_mult_HComplex) |
|
14314 | 1182 |
|
14374 | 1183 |
lemma hIm_hrcis [simp]: "hIm(hrcis r a) = r * ( *f* sin) a" |
1184 |
by (simp add: hrcis_def hcis_eq) |
|
14314 | 1185 |
|
14377 | 1186 |
|
1187 |
lemma hcmod_unit_one [simp]: |
|
1188 |
"hcmod (HComplex (( *f* cos) a) (( *f* sin) a)) = 1" |
|
1189 |
apply (rule eq_Abs_hypreal [of a]) |
|
1190 |
apply (simp add: HComplex_def iii_def starfun hcomplex_of_hypreal |
|
1191 |
hcomplex_mult hcmod hcomplex_add hypreal_one_def) |
|
1192 |
done |
|
1193 |
||
14374 | 1194 |
lemma hcmod_complex_polar [simp]: |
14377 | 1195 |
"hcmod (hcomplex_of_hypreal r * HComplex (( *f* cos) a) (( *f* sin) a)) = |
1196 |
abs r" |
|
1197 |
apply (simp only: hcmod_mult hcmod_unit_one, simp) |
|
14314 | 1198 |
done |
1199 |
||
14374 | 1200 |
lemma hcmod_hrcis [simp]: "hcmod(hrcis r a) = abs r" |
1201 |
by (simp add: hrcis_def hcis_eq) |
|
14314 | 1202 |
|
1203 |
(*---------------------------------------------------------------------------*) |
|
1204 |
(* (r1 * hrcis a) * (r2 * hrcis b) = r1 * r2 * hrcis (a + b) *) |
|
1205 |
(*---------------------------------------------------------------------------*) |
|
1206 |
||
1207 |
lemma hcis_hrcis_eq: "hcis a = hrcis 1 a" |
|
14374 | 1208 |
by (simp add: hrcis_def) |
14314 | 1209 |
declare hcis_hrcis_eq [symmetric, simp] |
1210 |
||
1211 |
lemma hrcis_mult: |
|
1212 |
"hrcis r1 a * hrcis r2 b = hrcis (r1*r2) (a + b)" |
|
14374 | 1213 |
apply (simp add: hrcis_def) |
1214 |
apply (rule eq_Abs_hypreal [of r1]) |
|
1215 |
apply (rule eq_Abs_hypreal [of r2]) |
|
1216 |
apply (rule eq_Abs_hypreal [of a]) |
|
1217 |
apply (rule eq_Abs_hypreal [of b]) |
|
1218 |
apply (simp add: hrcis hcis hypreal_add hypreal_mult hcomplex_of_hypreal |
|
1219 |
hcomplex_mult cis_mult [symmetric] |
|
14314 | 1220 |
complex_of_real_mult [symmetric]) |
1221 |
done |
|
1222 |
||
1223 |
lemma hcis_mult: "hcis a * hcis b = hcis (a + b)" |
|
14374 | 1224 |
apply (rule eq_Abs_hypreal [of a]) |
1225 |
apply (rule eq_Abs_hypreal [of b]) |
|
1226 |
apply (simp add: hcis hcomplex_mult hypreal_add cis_mult) |
|
14314 | 1227 |
done |
1228 |
||
14374 | 1229 |
lemma hcis_zero [simp]: "hcis 0 = 1" |
1230 |
by (simp add: hcomplex_one_def hcis hypreal_zero_num) |
|
14314 | 1231 |
|
14374 | 1232 |
lemma hrcis_zero_mod [simp]: "hrcis 0 a = 0" |
1233 |
apply (simp add: hcomplex_zero_def) |
|
1234 |
apply (rule eq_Abs_hypreal [of a]) |
|
1235 |
apply (simp add: hrcis hypreal_zero_num) |
|
14314 | 1236 |
done |
1237 |
||
14374 | 1238 |
lemma hrcis_zero_arg [simp]: "hrcis r 0 = hcomplex_of_hypreal r" |
1239 |
apply (rule eq_Abs_hypreal [of r]) |
|
1240 |
apply (simp add: hrcis hypreal_zero_num hcomplex_of_hypreal) |
|
14314 | 1241 |
done |
1242 |
||
14374 | 1243 |
lemma hcomplex_i_mult_minus [simp]: "iii * (iii * x) = - x" |
1244 |
by (simp add: hcomplex_mult_assoc [symmetric]) |
|
14314 | 1245 |
|
14374 | 1246 |
lemma hcomplex_i_mult_minus2 [simp]: "iii * iii * x = - x" |
1247 |
by simp |
|
14314 | 1248 |
|
1249 |
lemma hcis_hypreal_of_nat_Suc_mult: |
|
1250 |
"hcis (hypreal_of_nat (Suc n) * a) = hcis a * hcis (hypreal_of_nat n * a)" |
|
14374 | 1251 |
apply (rule eq_Abs_hypreal [of a]) |
1252 |
apply (simp add: hypreal_of_nat hcis hypreal_mult hcomplex_mult cis_real_of_nat_Suc_mult) |
|
14314 | 1253 |
done |
1254 |
||
1255 |
lemma NSDeMoivre: "(hcis a) ^ n = hcis (hypreal_of_nat n * a)" |
|
1256 |
apply (induct_tac "n") |
|
14374 | 1257 |
apply (simp_all add: hcis_hypreal_of_nat_Suc_mult) |
14314 | 1258 |
done |
1259 |
||
14335 | 1260 |
lemma hcis_hypreal_of_hypnat_Suc_mult: |
1261 |
"hcis (hypreal_of_hypnat (n + 1) * a) = |
|
14314 | 1262 |
hcis a * hcis (hypreal_of_hypnat n * a)" |
14374 | 1263 |
apply (rule eq_Abs_hypreal [of a]) |
1264 |
apply (rule eq_Abs_hypnat [of n]) |
|
1265 |
apply (simp add: hcis hypreal_of_hypnat hypnat_add hypnat_one_def hypreal_mult hcomplex_mult cis_real_of_nat_Suc_mult) |
|
14314 | 1266 |
done |
1267 |
||
1268 |
lemma NSDeMoivre_ext: "(hcis a) hcpow n = hcis (hypreal_of_hypnat n * a)" |
|
14374 | 1269 |
apply (rule eq_Abs_hypreal [of a]) |
1270 |
apply (rule eq_Abs_hypnat [of n]) |
|
1271 |
apply (simp add: hcis hypreal_of_hypnat hypreal_mult hcpow DeMoivre) |
|
14314 | 1272 |
done |
1273 |
||
1274 |
lemma DeMoivre2: |
|
1275 |
"(hrcis r a) ^ n = hrcis (r ^ n) (hypreal_of_nat n * a)" |
|
14374 | 1276 |
apply (simp add: hrcis_def power_mult_distrib NSDeMoivre hcomplex_of_hypreal_pow) |
14314 | 1277 |
done |
1278 |
||
1279 |
lemma DeMoivre2_ext: |
|
1280 |
"(hrcis r a) hcpow n = hrcis (r pow n) (hypreal_of_hypnat n * a)" |
|
14374 | 1281 |
apply (simp add: hrcis_def hcpow_mult NSDeMoivre_ext hcomplex_of_hypreal_hyperpow) |
1282 |
done |
|
1283 |
||
1284 |
lemma hcis_inverse [simp]: "inverse(hcis a) = hcis (-a)" |
|
1285 |
apply (rule eq_Abs_hypreal [of a]) |
|
1286 |
apply (simp add: hcomplex_inverse hcis hypreal_minus) |
|
14314 | 1287 |
done |
1288 |
||
14374 | 1289 |
lemma hrcis_inverse: "inverse(hrcis r a) = hrcis (inverse r) (-a)" |
1290 |
apply (rule eq_Abs_hypreal [of a]) |
|
1291 |
apply (rule eq_Abs_hypreal [of r]) |
|
1292 |
apply (simp add: hcomplex_inverse hrcis hypreal_minus hypreal_inverse rcis_inverse, ultra) |
|
1293 |
apply (simp add: real_divide_def) |
|
14314 | 1294 |
done |
1295 |
||
14374 | 1296 |
lemma hRe_hcis [simp]: "hRe(hcis a) = ( *f* cos) a" |
1297 |
apply (rule eq_Abs_hypreal [of a]) |
|
1298 |
apply (simp add: hcis starfun hRe) |
|
14314 | 1299 |
done |
1300 |
||
14374 | 1301 |
lemma hIm_hcis [simp]: "hIm(hcis a) = ( *f* sin) a" |
1302 |
apply (rule eq_Abs_hypreal [of a]) |
|
1303 |
apply (simp add: hcis starfun hIm) |
|
14314 | 1304 |
done |
1305 |
||
14374 | 1306 |
lemma cos_n_hRe_hcis_pow_n: "( *f* cos) (hypreal_of_nat n * a) = hRe(hcis a ^ n)" |
14377 | 1307 |
by (simp add: NSDeMoivre) |
14314 | 1308 |
|
14374 | 1309 |
lemma sin_n_hIm_hcis_pow_n: "( *f* sin) (hypreal_of_nat n * a) = hIm(hcis a ^ n)" |
14377 | 1310 |
by (simp add: NSDeMoivre) |
14314 | 1311 |
|
14374 | 1312 |
lemma cos_n_hRe_hcis_hcpow_n: "( *f* cos) (hypreal_of_hypnat n * a) = hRe(hcis a hcpow n)" |
14377 | 1313 |
by (simp add: NSDeMoivre_ext) |
14314 | 1314 |
|
14374 | 1315 |
lemma sin_n_hIm_hcis_hcpow_n: "( *f* sin) (hypreal_of_hypnat n * a) = hIm(hcis a hcpow n)" |
14377 | 1316 |
by (simp add: NSDeMoivre_ext) |
14314 | 1317 |
|
1318 |
lemma hexpi_add: "hexpi(a + b) = hexpi(a) * hexpi(b)" |
|
14374 | 1319 |
apply (simp add: hexpi_def) |
1320 |
apply (rule eq_Abs_hcomplex [of a]) |
|
1321 |
apply (rule eq_Abs_hcomplex [of b]) |
|
1322 |
apply (simp add: hcis hRe hIm hcomplex_add hcomplex_mult hypreal_mult starfun hcomplex_of_hypreal cis_mult [symmetric] complex_Im_add complex_Re_add exp_add complex_of_real_mult) |
|
14314 | 1323 |
done |
1324 |
||
1325 |
||
14374 | 1326 |
subsection{*@{term hcomplex_of_complex}: the Injection from |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
1327 |
type @{typ complex} to to @{typ hcomplex}*} |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
1328 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
1329 |
lemma inj_hcomplex_of_complex: "inj(hcomplex_of_complex)" |
14374 | 1330 |
apply (rule inj_onI, rule ccontr) |
1331 |
apply (simp add: hcomplex_of_complex_def) |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
1332 |
done |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
1333 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
1334 |
lemma hcomplex_of_complex_i: "iii = hcomplex_of_complex ii" |
14374 | 1335 |
by (simp add: iii_def hcomplex_of_complex_def) |
14314 | 1336 |
|
14374 | 1337 |
lemma hcomplex_of_complex_add [simp]: |
14314 | 1338 |
"hcomplex_of_complex (z1 + z2) = hcomplex_of_complex z1 + hcomplex_of_complex z2" |
14374 | 1339 |
by (simp add: hcomplex_of_complex_def hcomplex_add) |
14314 | 1340 |
|
14374 | 1341 |
lemma hcomplex_of_complex_mult [simp]: |
14314 | 1342 |
"hcomplex_of_complex (z1 * z2) = hcomplex_of_complex z1 * hcomplex_of_complex z2" |
14374 | 1343 |
by (simp add: hcomplex_of_complex_def hcomplex_mult) |
14314 | 1344 |
|
14374 | 1345 |
lemma hcomplex_of_complex_eq_iff [simp]: |
1346 |
"(hcomplex_of_complex z1 = hcomplex_of_complex z2) = (z1 = z2)" |
|
1347 |
by (simp add: hcomplex_of_complex_def) |
|
14314 | 1348 |
|
14374 | 1349 |
|
1350 |
lemma hcomplex_of_complex_minus [simp]: |
|
14335 | 1351 |
"hcomplex_of_complex (-r) = - hcomplex_of_complex r" |
14374 | 1352 |
by (simp add: hcomplex_of_complex_def hcomplex_minus) |
14314 | 1353 |
|
14374 | 1354 |
lemma hcomplex_of_complex_one [simp]: "hcomplex_of_complex 1 = 1" |
1355 |
by (simp add: hcomplex_of_complex_def hcomplex_one_def) |
|
14314 | 1356 |
|
14374 | 1357 |
lemma hcomplex_of_complex_zero [simp]: "hcomplex_of_complex 0 = 0" |
1358 |
by (simp add: hcomplex_of_complex_def hcomplex_zero_def) |
|
14314 | 1359 |
|
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1360 |
lemma hcomplex_of_complex_zero_iff [simp]: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1361 |
"(hcomplex_of_complex r = 0) = (r = 0)" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1362 |
by (auto intro: FreeUltrafilterNat_P |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1363 |
simp add: hcomplex_of_complex_def hcomplex_zero_def) |
14314 | 1364 |
|
14374 | 1365 |
lemma hcomplex_of_complex_inverse [simp]: |
14335 | 1366 |
"hcomplex_of_complex (inverse r) = inverse (hcomplex_of_complex r)" |
14314 | 1367 |
apply (case_tac "r=0") |
14336 | 1368 |
apply (simp add: hcomplex_of_complex_zero) |
14374 | 1369 |
apply (rule_tac c1 = "hcomplex_of_complex r" |
14336 | 1370 |
in hcomplex_mult_left_cancel [THEN iffD1]) |
14314 | 1371 |
apply (force simp add: hcomplex_of_complex_zero_iff) |
1372 |
apply (subst hcomplex_of_complex_mult [symmetric]) |
|
14374 | 1373 |
apply (simp add: hcomplex_of_complex_one hcomplex_of_complex_zero_iff) |
14314 | 1374 |
done |
1375 |
||
14374 | 1376 |
lemma hcomplex_of_complex_divide [simp]: |
14335 | 1377 |
"hcomplex_of_complex (z1 / z2) = hcomplex_of_complex z1 / hcomplex_of_complex z2" |
14374 | 1378 |
by (simp add: hcomplex_divide_def complex_divide_def) |
14314 | 1379 |
|
1380 |
lemma hRe_hcomplex_of_complex: |
|
1381 |
"hRe (hcomplex_of_complex z) = hypreal_of_real (Re z)" |
|
14374 | 1382 |
by (simp add: hcomplex_of_complex_def hypreal_of_real_def hRe) |
14314 | 1383 |
|
1384 |
lemma hIm_hcomplex_of_complex: |
|
1385 |
"hIm (hcomplex_of_complex z) = hypreal_of_real (Im z)" |
|
14374 | 1386 |
by (simp add: hcomplex_of_complex_def hypreal_of_real_def hIm) |
14314 | 1387 |
|
1388 |
lemma hcmod_hcomplex_of_complex: |
|
1389 |
"hcmod (hcomplex_of_complex x) = hypreal_of_real (cmod x)" |
|
14374 | 1390 |
by (simp add: hypreal_of_real_def hcomplex_of_complex_def hcmod) |
14314 | 1391 |
|
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1392 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1393 |
subsection{*Numerals and Arithmetic*} |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1394 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1395 |
instance hcomplex :: number .. |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1396 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1397 |
primrec (*the type constraint is essential!*) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1398 |
number_of_Pls: "number_of bin.Pls = 0" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1399 |
number_of_Min: "number_of bin.Min = - (1::hcomplex)" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1400 |
number_of_BIT: "number_of(w BIT x) = (if x then 1 else 0) + |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1401 |
(number_of w) + (number_of w)" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1402 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1403 |
declare number_of_Pls [simp del] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1404 |
number_of_Min [simp del] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1405 |
number_of_BIT [simp del] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1406 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1407 |
instance hcomplex :: number_ring |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1408 |
proof |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1409 |
show "Numeral0 = (0::hcomplex)" by (rule number_of_Pls) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1410 |
show "-1 = - (1::hcomplex)" by (rule number_of_Min) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1411 |
fix w :: bin and x :: bool |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1412 |
show "(number_of (w BIT x) :: hcomplex) = |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1413 |
(if x then 1 else 0) + number_of w + number_of w" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1414 |
by (rule number_of_BIT) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1415 |
qed |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1416 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1417 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1418 |
text{*Collapse applications of @{term hcomplex_of_complex} to @{term number_of}*} |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1419 |
lemma hcomplex_number_of [simp]: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1420 |
"hcomplex_of_complex (number_of w) = number_of w" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1421 |
apply (induct w) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1422 |
apply (simp_all only: number_of hcomplex_of_complex_add |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1423 |
hcomplex_of_complex_minus, simp_all) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1424 |
done |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1425 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1426 |
lemma hcomplex_of_hypreal_eq_hcomplex_of_complex: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1427 |
"hcomplex_of_hypreal (hypreal_of_real x) = |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1428 |
hcomplex_of_complex(complex_of_real x)" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1429 |
by (simp add: hypreal_of_real_def hcomplex_of_hypreal hcomplex_of_complex_def |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1430 |
complex_of_real_def) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1431 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1432 |
lemma hcomplex_hypreal_number_of: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1433 |
"hcomplex_of_complex (number_of w) = hcomplex_of_hypreal(number_of w)" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1434 |
by (simp only: complex_number_of [symmetric] hypreal_number_of [symmetric] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1435 |
hcomplex_of_hypreal_eq_hcomplex_of_complex) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1436 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1437 |
text{*This theorem is necessary because theorems such as |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1438 |
@{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
|
1439 |
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
|
1440 |
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
|
1441 |
lemma iszero_hcomplex_number_of [simp]: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1442 |
"iszero (number_of w :: hcomplex) = iszero (number_of w :: real)" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1443 |
apply (simp only: iszero_complex_number_of [symmetric]) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1444 |
apply (simp only: hcomplex_of_complex_zero_iff hcomplex_number_of [symmetric] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1445 |
iszero_def) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1446 |
done |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1447 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1448 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1449 |
(* |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1450 |
Goal "z + hcnj z = |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1451 |
hcomplex_of_hypreal (2 * hRe(z))" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1452 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1453 |
by (auto_tac (claset(),HOL_ss addsimps [hRe,hcnj,hcomplex_add, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1454 |
hypreal_mult,hcomplex_of_hypreal,complex_add_cnj])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1455 |
qed "hcomplex_add_hcnj"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1456 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1457 |
Goal "z - hcnj z = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1458 |
\ hcomplex_of_hypreal (hypreal_of_real #2 * hIm(z)) * iii"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1459 |
by (res_inst_tac [("z","z")] eq_Abs_hcomplex 1); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1460 |
by (auto_tac (claset(),simpset() addsimps [hIm,hcnj,hcomplex_diff, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1461 |
hypreal_of_real_def,hypreal_mult,hcomplex_of_hypreal, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1462 |
complex_diff_cnj,iii_def,hcomplex_mult])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1463 |
qed "hcomplex_diff_hcnj"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1464 |
*) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1465 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1466 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1467 |
lemma hcomplex_hcnj_num_zero_iff: "(hcnj z = 0) = (z = 0)" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1468 |
apply (auto simp add: hcomplex_hcnj_zero_iff) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1469 |
done |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1470 |
declare hcomplex_hcnj_num_zero_iff [simp] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1471 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1472 |
lemma hcomplex_zero_num: "0 = Abs_hcomplex (hcomplexrel `` {%n. 0})" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1473 |
apply (simp add: hcomplex_zero_def) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1474 |
done |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1475 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1476 |
lemma hcomplex_one_num: "1 = Abs_hcomplex (hcomplexrel `` {%n. 1})" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1477 |
apply (simp add: hcomplex_one_def) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1478 |
done |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1479 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1480 |
(*** Real and imaginary stuff ***) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1481 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1482 |
(*Convert??? |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1483 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1484 |
"((number_of xa :: hcomplex) + iii * number_of ya = |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1485 |
number_of xb + iii * number_of yb) = |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1486 |
(((number_of xa :: hcomplex) = number_of xb) & |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1487 |
((number_of ya :: hcomplex) = number_of yb))" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1488 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1489 |
hcomplex_hypreal_number_of])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1490 |
qed "hcomplex_number_of_eq_cancel_iff"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1491 |
Addsimps [hcomplex_number_of_eq_cancel_iff]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1492 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1493 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1494 |
"((number_of xa :: hcomplex) + number_of ya * iii = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1495 |
\ number_of xb + number_of yb * iii) = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1496 |
\ (((number_of xa :: hcomplex) = number_of xb) & \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1497 |
\ ((number_of ya :: hcomplex) = number_of yb))"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1498 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iffA, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1499 |
hcomplex_hypreal_number_of])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1500 |
qed "hcomplex_number_of_eq_cancel_iffA"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1501 |
Addsimps [hcomplex_number_of_eq_cancel_iffA]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1502 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1503 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1504 |
"((number_of xa :: hcomplex) + number_of ya * iii = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1505 |
\ number_of xb + iii * number_of yb) = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1506 |
\ (((number_of xa :: hcomplex) = number_of xb) & \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1507 |
\ ((number_of ya :: hcomplex) = number_of yb))"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1508 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iffB, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1509 |
hcomplex_hypreal_number_of])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1510 |
qed "hcomplex_number_of_eq_cancel_iffB"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1511 |
Addsimps [hcomplex_number_of_eq_cancel_iffB]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1512 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1513 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1514 |
"((number_of xa :: hcomplex) + iii * number_of ya = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1515 |
\ number_of xb + number_of yb * iii) = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1516 |
\ (((number_of xa :: hcomplex) = number_of xb) & \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1517 |
\ ((number_of ya :: hcomplex) = number_of yb))"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1518 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iffC, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1519 |
hcomplex_hypreal_number_of])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1520 |
qed "hcomplex_number_of_eq_cancel_iffC"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1521 |
Addsimps [hcomplex_number_of_eq_cancel_iffC]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1522 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1523 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1524 |
"((number_of xa :: hcomplex) + iii * number_of ya = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1525 |
\ number_of xb) = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1526 |
\ (((number_of xa :: hcomplex) = number_of xb) & \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1527 |
\ ((number_of ya :: hcomplex) = 0))"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1528 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff2, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1529 |
hcomplex_hypreal_number_of,hcomplex_of_hypreal_zero_iff])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1530 |
qed "hcomplex_number_of_eq_cancel_iff2"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1531 |
Addsimps [hcomplex_number_of_eq_cancel_iff2]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1532 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1533 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1534 |
"((number_of xa :: hcomplex) + number_of ya * iii = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1535 |
\ number_of xb) = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1536 |
\ (((number_of xa :: hcomplex) = number_of xb) & \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1537 |
\ ((number_of ya :: hcomplex) = 0))"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1538 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff2a, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1539 |
hcomplex_hypreal_number_of,hcomplex_of_hypreal_zero_iff])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1540 |
qed "hcomplex_number_of_eq_cancel_iff2a"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1541 |
Addsimps [hcomplex_number_of_eq_cancel_iff2a]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1542 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1543 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1544 |
"((number_of xa :: hcomplex) + iii * number_of ya = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1545 |
\ iii * number_of yb) = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1546 |
\ (((number_of xa :: hcomplex) = 0) & \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1547 |
\ ((number_of ya :: hcomplex) = number_of yb))"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1548 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff3, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1549 |
hcomplex_hypreal_number_of,hcomplex_of_hypreal_zero_iff])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1550 |
qed "hcomplex_number_of_eq_cancel_iff3"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1551 |
Addsimps [hcomplex_number_of_eq_cancel_iff3]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1552 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1553 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1554 |
"((number_of xa :: hcomplex) + number_of ya * iii= \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1555 |
\ iii * number_of yb) = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1556 |
\ (((number_of xa :: hcomplex) = 0) & \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1557 |
\ ((number_of ya :: hcomplex) = number_of yb))"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1558 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff3a, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1559 |
hcomplex_hypreal_number_of,hcomplex_of_hypreal_zero_iff])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1560 |
qed "hcomplex_number_of_eq_cancel_iff3a"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1561 |
Addsimps [hcomplex_number_of_eq_cancel_iff3a]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1562 |
*) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1563 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1564 |
lemma hcomplex_number_of_hcnj [simp]: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1565 |
"hcnj (number_of v :: hcomplex) = number_of v" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1566 |
by (simp only: hcomplex_number_of [symmetric] hcomplex_hypreal_number_of |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1567 |
hcomplex_hcnj_hcomplex_of_hypreal) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1568 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1569 |
lemma hcomplex_number_of_hcmod [simp]: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1570 |
"hcmod(number_of v :: hcomplex) = abs (number_of v :: hypreal)" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1571 |
by (simp only: hcomplex_number_of [symmetric] hcomplex_hypreal_number_of |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1572 |
hcmod_hcomplex_of_hypreal) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1573 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1574 |
lemma hcomplex_number_of_hRe [simp]: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1575 |
"hRe(number_of v :: hcomplex) = number_of v" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1576 |
by (simp only: hcomplex_number_of [symmetric] hcomplex_hypreal_number_of |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1577 |
hRe_hcomplex_of_hypreal) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1578 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1579 |
lemma hcomplex_number_of_hIm [simp]: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1580 |
"hIm(number_of v :: hcomplex) = 0" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1581 |
by (simp only: hcomplex_number_of [symmetric] hcomplex_hypreal_number_of |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1582 |
hIm_hcomplex_of_hypreal) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1583 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
1584 |
|
14314 | 1585 |
ML |
1586 |
{* |
|
1587 |
val hcomplex_zero_def = thm"hcomplex_zero_def"; |
|
1588 |
val hcomplex_one_def = thm"hcomplex_one_def"; |
|
1589 |
val hcomplex_minus_def = thm"hcomplex_minus_def"; |
|
1590 |
val hcomplex_diff_def = thm"hcomplex_diff_def"; |
|
1591 |
val hcomplex_divide_def = thm"hcomplex_divide_def"; |
|
1592 |
val hcomplex_mult_def = thm"hcomplex_mult_def"; |
|
1593 |
val hcomplex_add_def = thm"hcomplex_add_def"; |
|
1594 |
val hcomplex_of_complex_def = thm"hcomplex_of_complex_def"; |
|
1595 |
val iii_def = thm"iii_def"; |
|
1596 |
||
1597 |
val hcomplexrel_iff = thm"hcomplexrel_iff"; |
|
1598 |
val hcomplexrel_refl = thm"hcomplexrel_refl"; |
|
1599 |
val hcomplexrel_sym = thm"hcomplexrel_sym"; |
|
1600 |
val hcomplexrel_trans = thm"hcomplexrel_trans"; |
|
1601 |
val equiv_hcomplexrel = thm"equiv_hcomplexrel"; |
|
1602 |
val equiv_hcomplexrel_iff = thm"equiv_hcomplexrel_iff"; |
|
1603 |
val hcomplexrel_in_hcomplex = thm"hcomplexrel_in_hcomplex"; |
|
1604 |
val inj_on_Abs_hcomplex = thm"inj_on_Abs_hcomplex"; |
|
1605 |
val inj_Rep_hcomplex = thm"inj_Rep_hcomplex"; |
|
1606 |
val lemma_hcomplexrel_refl = thm"lemma_hcomplexrel_refl"; |
|
1607 |
val hcomplex_empty_not_mem = thm"hcomplex_empty_not_mem"; |
|
1608 |
val Rep_hcomplex_nonempty = thm"Rep_hcomplex_nonempty"; |
|
1609 |
val eq_Abs_hcomplex = thm"eq_Abs_hcomplex"; |
|
1610 |
val hRe = thm"hRe"; |
|
1611 |
val hIm = thm"hIm"; |
|
1612 |
val hcomplex_hRe_hIm_cancel_iff = thm"hcomplex_hRe_hIm_cancel_iff"; |
|
1613 |
val hcomplex_hRe_zero = thm"hcomplex_hRe_zero"; |
|
1614 |
val hcomplex_hIm_zero = thm"hcomplex_hIm_zero"; |
|
1615 |
val hcomplex_hRe_one = thm"hcomplex_hRe_one"; |
|
1616 |
val hcomplex_hIm_one = thm"hcomplex_hIm_one"; |
|
1617 |
val inj_hcomplex_of_complex = thm"inj_hcomplex_of_complex"; |
|
1618 |
val hcomplex_of_complex_i = thm"hcomplex_of_complex_i"; |
|
1619 |
val hcomplex_add_congruent2 = thm"hcomplex_add_congruent2"; |
|
1620 |
val hcomplex_add = thm"hcomplex_add"; |
|
1621 |
val hcomplex_add_commute = thm"hcomplex_add_commute"; |
|
1622 |
val hcomplex_add_assoc = thm"hcomplex_add_assoc"; |
|
1623 |
val hcomplex_add_zero_left = thm"hcomplex_add_zero_left"; |
|
1624 |
val hcomplex_add_zero_right = thm"hcomplex_add_zero_right"; |
|
1625 |
val hRe_add = thm"hRe_add"; |
|
1626 |
val hIm_add = thm"hIm_add"; |
|
1627 |
val hcomplex_minus_congruent = thm"hcomplex_minus_congruent"; |
|
1628 |
val hcomplex_minus = thm"hcomplex_minus"; |
|
1629 |
val hcomplex_add_minus_left = thm"hcomplex_add_minus_left"; |
|
1630 |
val hRe_minus = thm"hRe_minus"; |
|
1631 |
val hIm_minus = thm"hIm_minus"; |
|
1632 |
val hcomplex_add_minus_eq_minus = thm"hcomplex_add_minus_eq_minus"; |
|
1633 |
val hcomplex_diff = thm"hcomplex_diff"; |
|
1634 |
val hcomplex_diff_eq_eq = thm"hcomplex_diff_eq_eq"; |
|
1635 |
val hcomplex_mult = thm"hcomplex_mult"; |
|
1636 |
val hcomplex_mult_commute = thm"hcomplex_mult_commute"; |
|
1637 |
val hcomplex_mult_assoc = thm"hcomplex_mult_assoc"; |
|
1638 |
val hcomplex_mult_one_left = thm"hcomplex_mult_one_left"; |
|
1639 |
val hcomplex_mult_one_right = thm"hcomplex_mult_one_right"; |
|
1640 |
val hcomplex_mult_zero_left = thm"hcomplex_mult_zero_left"; |
|
1641 |
val hcomplex_mult_minus_one = thm"hcomplex_mult_minus_one"; |
|
1642 |
val hcomplex_mult_minus_one_right = thm"hcomplex_mult_minus_one_right"; |
|
1643 |
val hcomplex_add_mult_distrib = thm"hcomplex_add_mult_distrib"; |
|
1644 |
val hcomplex_zero_not_eq_one = thm"hcomplex_zero_not_eq_one"; |
|
1645 |
val hcomplex_inverse = thm"hcomplex_inverse"; |
|
1646 |
val hcomplex_mult_inv_left = thm"hcomplex_mult_inv_left"; |
|
1647 |
val hcomplex_mult_left_cancel = thm"hcomplex_mult_left_cancel"; |
|
1648 |
val hcomplex_mult_right_cancel = thm"hcomplex_mult_right_cancel"; |
|
1649 |
val hcomplex_add_divide_distrib = thm"hcomplex_add_divide_distrib"; |
|
1650 |
val hcomplex_of_hypreal = thm"hcomplex_of_hypreal"; |
|
1651 |
val hcomplex_of_hypreal_cancel_iff = thm"hcomplex_of_hypreal_cancel_iff"; |
|
1652 |
val hcomplex_of_hypreal_minus = thm"hcomplex_of_hypreal_minus"; |
|
1653 |
val hcomplex_of_hypreal_inverse = thm"hcomplex_of_hypreal_inverse"; |
|
1654 |
val hcomplex_of_hypreal_add = thm"hcomplex_of_hypreal_add"; |
|
1655 |
val hcomplex_of_hypreal_diff = thm"hcomplex_of_hypreal_diff"; |
|
1656 |
val hcomplex_of_hypreal_mult = thm"hcomplex_of_hypreal_mult"; |
|
1657 |
val hcomplex_of_hypreal_divide = thm"hcomplex_of_hypreal_divide"; |
|
1658 |
val hcomplex_of_hypreal_one = thm"hcomplex_of_hypreal_one"; |
|
1659 |
val hcomplex_of_hypreal_zero = thm"hcomplex_of_hypreal_zero"; |
|
1660 |
val hcomplex_of_hypreal_pow = thm"hcomplex_of_hypreal_pow"; |
|
1661 |
val hRe_hcomplex_of_hypreal = thm"hRe_hcomplex_of_hypreal"; |
|
1662 |
val hIm_hcomplex_of_hypreal = thm"hIm_hcomplex_of_hypreal"; |
|
1663 |
val hcomplex_of_hypreal_epsilon_not_zero = thm"hcomplex_of_hypreal_epsilon_not_zero"; |
|
1664 |
val hcmod = thm"hcmod"; |
|
1665 |
val hcmod_zero = thm"hcmod_zero"; |
|
1666 |
val hcmod_one = thm"hcmod_one"; |
|
1667 |
val hcmod_hcomplex_of_hypreal = thm"hcmod_hcomplex_of_hypreal"; |
|
1668 |
val hcomplex_of_hypreal_abs = thm"hcomplex_of_hypreal_abs"; |
|
1669 |
val hcnj = thm"hcnj"; |
|
1670 |
val hcomplex_hcnj_cancel_iff = thm"hcomplex_hcnj_cancel_iff"; |
|
1671 |
val hcomplex_hcnj_hcnj = thm"hcomplex_hcnj_hcnj"; |
|
1672 |
val hcomplex_hcnj_hcomplex_of_hypreal = thm"hcomplex_hcnj_hcomplex_of_hypreal"; |
|
1673 |
val hcomplex_hmod_hcnj = thm"hcomplex_hmod_hcnj"; |
|
1674 |
val hcomplex_hcnj_minus = thm"hcomplex_hcnj_minus"; |
|
1675 |
val hcomplex_hcnj_inverse = thm"hcomplex_hcnj_inverse"; |
|
1676 |
val hcomplex_hcnj_add = thm"hcomplex_hcnj_add"; |
|
1677 |
val hcomplex_hcnj_diff = thm"hcomplex_hcnj_diff"; |
|
1678 |
val hcomplex_hcnj_mult = thm"hcomplex_hcnj_mult"; |
|
1679 |
val hcomplex_hcnj_divide = thm"hcomplex_hcnj_divide"; |
|
1680 |
val hcnj_one = thm"hcnj_one"; |
|
1681 |
val hcomplex_hcnj_pow = thm"hcomplex_hcnj_pow"; |
|
1682 |
val hcomplex_hcnj_zero = thm"hcomplex_hcnj_zero"; |
|
1683 |
val hcomplex_hcnj_zero_iff = thm"hcomplex_hcnj_zero_iff"; |
|
1684 |
val hcomplex_mult_hcnj = thm"hcomplex_mult_hcnj"; |
|
1685 |
val hcomplex_hcmod_eq_zero_cancel = thm"hcomplex_hcmod_eq_zero_cancel"; |
|
14371
c78c7da09519
Conversion of HyperNat to Isar format and its declaration as a semiring
paulson
parents:
14370
diff
changeset
|
1686 |
|
14314 | 1687 |
val hcmod_hcomplex_of_hypreal_of_nat = thm"hcmod_hcomplex_of_hypreal_of_nat"; |
1688 |
val hcmod_hcomplex_of_hypreal_of_hypnat = thm"hcmod_hcomplex_of_hypreal_of_hypnat"; |
|
1689 |
val hcmod_minus = thm"hcmod_minus"; |
|
1690 |
val hcmod_mult_hcnj = thm"hcmod_mult_hcnj"; |
|
1691 |
val hcmod_ge_zero = thm"hcmod_ge_zero"; |
|
1692 |
val hrabs_hcmod_cancel = thm"hrabs_hcmod_cancel"; |
|
1693 |
val hcmod_mult = thm"hcmod_mult"; |
|
1694 |
val hcmod_add_squared_eq = thm"hcmod_add_squared_eq"; |
|
1695 |
val hcomplex_hRe_mult_hcnj_le_hcmod = thm"hcomplex_hRe_mult_hcnj_le_hcmod"; |
|
1696 |
val hcomplex_hRe_mult_hcnj_le_hcmod2 = thm"hcomplex_hRe_mult_hcnj_le_hcmod2"; |
|
1697 |
val hcmod_triangle_squared = thm"hcmod_triangle_squared"; |
|
1698 |
val hcmod_triangle_ineq = thm"hcmod_triangle_ineq"; |
|
1699 |
val hcmod_triangle_ineq2 = thm"hcmod_triangle_ineq2"; |
|
1700 |
val hcmod_diff_commute = thm"hcmod_diff_commute"; |
|
1701 |
val hcmod_add_less = thm"hcmod_add_less"; |
|
1702 |
val hcmod_mult_less = thm"hcmod_mult_less"; |
|
1703 |
val hcmod_diff_ineq = thm"hcmod_diff_ineq"; |
|
1704 |
val hcpow = thm"hcpow"; |
|
1705 |
val hcomplex_of_hypreal_hyperpow = thm"hcomplex_of_hypreal_hyperpow"; |
|
1706 |
val hcmod_hcomplexpow = thm"hcmod_hcomplexpow"; |
|
1707 |
val hcmod_hcpow = thm"hcmod_hcpow"; |
|
1708 |
val hcpow_minus = thm"hcpow_minus"; |
|
1709 |
val hcmod_hcomplex_inverse = thm"hcmod_hcomplex_inverse"; |
|
1710 |
val hcmod_divide = thm"hcmod_divide"; |
|
1711 |
val hcpow_mult = thm"hcpow_mult"; |
|
1712 |
val hcpow_zero = thm"hcpow_zero"; |
|
1713 |
val hcpow_zero2 = thm"hcpow_zero2"; |
|
1714 |
val hcpow_not_zero = thm"hcpow_not_zero"; |
|
1715 |
val hcpow_zero_zero = thm"hcpow_zero_zero"; |
|
1716 |
val hcomplex_i_mult_eq = thm"hcomplex_i_mult_eq"; |
|
1717 |
val hcomplexpow_i_squared = thm"hcomplexpow_i_squared"; |
|
1718 |
val hcomplex_i_not_zero = thm"hcomplex_i_not_zero"; |
|
1719 |
val hcomplex_divide = thm"hcomplex_divide"; |
|
1720 |
val hsgn = thm"hsgn"; |
|
1721 |
val hsgn_zero = thm"hsgn_zero"; |
|
1722 |
val hsgn_one = thm"hsgn_one"; |
|
1723 |
val hsgn_minus = thm"hsgn_minus"; |
|
1724 |
val hsgn_eq = thm"hsgn_eq"; |
|
1725 |
val lemma_hypreal_P_EX2 = thm"lemma_hypreal_P_EX2"; |
|
1726 |
val hcmod_i = thm"hcmod_i"; |
|
1727 |
val hcomplex_eq_cancel_iff2 = thm"hcomplex_eq_cancel_iff2"; |
|
1728 |
val hRe_hsgn = thm"hRe_hsgn"; |
|
1729 |
val hIm_hsgn = thm"hIm_hsgn"; |
|
1730 |
val real_two_squares_add_zero_iff = thm"real_two_squares_add_zero_iff"; |
|
1731 |
val hRe_mult_i_eq = thm"hRe_mult_i_eq"; |
|
1732 |
val hIm_mult_i_eq = thm"hIm_mult_i_eq"; |
|
1733 |
val hcmod_mult_i = thm"hcmod_mult_i"; |
|
1734 |
val hcmod_mult_i2 = thm"hcmod_mult_i2"; |
|
1735 |
val harg = thm"harg"; |
|
1736 |
val cos_harg_i_mult_zero = thm"cos_harg_i_mult_zero"; |
|
1737 |
val hcomplex_of_hypreal_zero_iff = thm"hcomplex_of_hypreal_zero_iff"; |
|
1738 |
val complex_split_polar2 = thm"complex_split_polar2"; |
|
1739 |
val hcomplex_split_polar = thm"hcomplex_split_polar"; |
|
1740 |
val hcis = thm"hcis"; |
|
1741 |
val hcis_eq = thm"hcis_eq"; |
|
1742 |
val hrcis = thm"hrcis"; |
|
1743 |
val hrcis_Ex = thm"hrcis_Ex"; |
|
1744 |
val hRe_hcomplex_polar = thm"hRe_hcomplex_polar"; |
|
1745 |
val hRe_hrcis = thm"hRe_hrcis"; |
|
1746 |
val hIm_hcomplex_polar = thm"hIm_hcomplex_polar"; |
|
1747 |
val hIm_hrcis = thm"hIm_hrcis"; |
|
1748 |
val hcmod_complex_polar = thm"hcmod_complex_polar"; |
|
1749 |
val hcmod_hrcis = thm"hcmod_hrcis"; |
|
1750 |
val hcis_hrcis_eq = thm"hcis_hrcis_eq"; |
|
1751 |
val hrcis_mult = thm"hrcis_mult"; |
|
1752 |
val hcis_mult = thm"hcis_mult"; |
|
1753 |
val hcis_zero = thm"hcis_zero"; |
|
1754 |
val hrcis_zero_mod = thm"hrcis_zero_mod"; |
|
1755 |
val hrcis_zero_arg = thm"hrcis_zero_arg"; |
|
1756 |
val hcomplex_i_mult_minus = thm"hcomplex_i_mult_minus"; |
|
1757 |
val hcomplex_i_mult_minus2 = thm"hcomplex_i_mult_minus2"; |
|
1758 |
val hcis_hypreal_of_nat_Suc_mult = thm"hcis_hypreal_of_nat_Suc_mult"; |
|
1759 |
val NSDeMoivre = thm"NSDeMoivre"; |
|
1760 |
val hcis_hypreal_of_hypnat_Suc_mult = thm"hcis_hypreal_of_hypnat_Suc_mult"; |
|
1761 |
val NSDeMoivre_ext = thm"NSDeMoivre_ext"; |
|
1762 |
val DeMoivre2 = thm"DeMoivre2"; |
|
1763 |
val DeMoivre2_ext = thm"DeMoivre2_ext"; |
|
1764 |
val hcis_inverse = thm"hcis_inverse"; |
|
1765 |
val hrcis_inverse = thm"hrcis_inverse"; |
|
1766 |
val hRe_hcis = thm"hRe_hcis"; |
|
1767 |
val hIm_hcis = thm"hIm_hcis"; |
|
1768 |
val cos_n_hRe_hcis_pow_n = thm"cos_n_hRe_hcis_pow_n"; |
|
1769 |
val sin_n_hIm_hcis_pow_n = thm"sin_n_hIm_hcis_pow_n"; |
|
1770 |
val cos_n_hRe_hcis_hcpow_n = thm"cos_n_hRe_hcis_hcpow_n"; |
|
1771 |
val sin_n_hIm_hcis_hcpow_n = thm"sin_n_hIm_hcis_hcpow_n"; |
|
1772 |
val hexpi_add = thm"hexpi_add"; |
|
1773 |
val hcomplex_of_complex_add = thm"hcomplex_of_complex_add"; |
|
1774 |
val hcomplex_of_complex_mult = thm"hcomplex_of_complex_mult"; |
|
1775 |
val hcomplex_of_complex_eq_iff = thm"hcomplex_of_complex_eq_iff"; |
|
1776 |
val hcomplex_of_complex_minus = thm"hcomplex_of_complex_minus"; |
|
1777 |
val hcomplex_of_complex_one = thm"hcomplex_of_complex_one"; |
|
1778 |
val hcomplex_of_complex_zero = thm"hcomplex_of_complex_zero"; |
|
1779 |
val hcomplex_of_complex_zero_iff = thm"hcomplex_of_complex_zero_iff"; |
|
1780 |
val hcomplex_of_complex_inverse = thm"hcomplex_of_complex_inverse"; |
|
1781 |
val hcomplex_of_complex_divide = thm"hcomplex_of_complex_divide"; |
|
1782 |
val hRe_hcomplex_of_complex = thm"hRe_hcomplex_of_complex"; |
|
1783 |
val hIm_hcomplex_of_complex = thm"hIm_hcomplex_of_complex"; |
|
1784 |
val hcmod_hcomplex_of_complex = thm"hcmod_hcomplex_of_complex"; |
|
1785 |
*} |
|
1786 |
||
13957 | 1787 |
end |