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