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