author | wenzelm |
Fri, 17 Nov 2006 02:20:03 +0100 | |
changeset 21404 | eb85850d3eb7 |
parent 20730 | da903f59e9ba |
child 21839 | 54018ed3b99d |
permissions | -rw-r--r-- |
13957 | 1 |
(* Title: NSComplex.thy |
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
2 |
ID: $Id$ |
13957 | 3 |
Author: Jacques D. Fleuriot |
4 |
Copyright: 2001 University of Edinburgh |
|
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
5 |
Conversion to Isar and new proofs by Lawrence C Paulson, 2003/4 |
13957 | 6 |
*) |
7 |
||
14430
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
8 |
header{*Nonstandard Complex Numbers*} |
5cb24165a2e1
new material from Avigad, and simplified treatment of division by 0
paulson
parents:
14421
diff
changeset
|
9 |
|
15131 | 10 |
theory NSComplex |
15140 | 11 |
imports Complex |
15131 | 12 |
begin |
13957 | 13 |
|
17300 | 14 |
types hcomplex = "complex star" |
13957 | 15 |
|
19765 | 16 |
abbreviation |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
17 |
hcomplex_of_complex :: "complex => complex star" where |
19765 | 18 |
"hcomplex_of_complex == star_of" |
14377 | 19 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
20 |
abbreviation |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
21 |
hcmod :: "complex star => real star" where |
20558 | 22 |
"hcmod == hnorm" |
23 |
||
13957 | 24 |
|
25 |
(*--- real and Imaginary parts ---*) |
|
14314 | 26 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
27 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
28 |
hRe :: "hcomplex => hypreal" where |
19765 | 29 |
"hRe = *f* Re" |
13957 | 30 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
31 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
32 |
hIm :: "hcomplex => hypreal" where |
19765 | 33 |
"hIm = *f* Im" |
13957 | 34 |
|
35 |
||
14314 | 36 |
(*------ imaginary unit ----------*) |
37 |
||
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
38 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
39 |
iii :: hcomplex where |
19765 | 40 |
"iii = star_of ii" |
13957 | 41 |
|
42 |
(*------- complex conjugate ------*) |
|
43 |
||
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
44 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
45 |
hcnj :: "hcomplex => hcomplex" where |
19765 | 46 |
"hcnj = *f* cnj" |
13957 | 47 |
|
14314 | 48 |
(*------------ Argand -------------*) |
13957 | 49 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
50 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
51 |
hsgn :: "hcomplex => hcomplex" where |
19765 | 52 |
"hsgn = *f* sgn" |
13957 | 53 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
54 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
55 |
harg :: "hcomplex => hypreal" where |
19765 | 56 |
"harg = *f* arg" |
13957 | 57 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
58 |
definition |
13957 | 59 |
(* abbreviation for (cos a + i sin a) *) |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
60 |
hcis :: "hypreal => hcomplex" where |
19765 | 61 |
"hcis = *f* cis" |
13957 | 62 |
|
14314 | 63 |
(*----- injection from hyperreals -----*) |
64 |
||
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
65 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
66 |
hcomplex_of_hypreal :: "hypreal => hcomplex" where |
19765 | 67 |
"hcomplex_of_hypreal = *f* complex_of_real" |
13957 | 68 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
69 |
definition |
14653 | 70 |
(* abbreviation for r*(cos a + i sin a) *) |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
71 |
hrcis :: "[hypreal, hypreal] => hcomplex" where |
19765 | 72 |
"hrcis = *f2* rcis" |
14653 | 73 |
|
13957 | 74 |
(*------------ e ^ (x + iy) ------------*) |
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
75 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
76 |
hexpi :: "hcomplex => hcomplex" where |
19765 | 77 |
"hexpi = *f* expi" |
14314 | 78 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
79 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
80 |
HComplex :: "[hypreal,hypreal] => hcomplex" where |
19765 | 81 |
"HComplex = *f2* Complex" |
13957 | 82 |
|
21404
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
83 |
definition |
eb85850d3eb7
more robust syntax for definition/abbreviation/notation;
wenzelm
parents:
20730
diff
changeset
|
84 |
hcpow :: "[hcomplex,hypnat] => hcomplex" (infixr "hcpow" 80) where |
19765 | 85 |
"(z::hcomplex) hcpow (n::hypnat) = ( *f2* op ^) z n" |
13957 | 86 |
|
17332
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17318
diff
changeset
|
87 |
lemmas hcomplex_defs [transfer_unfold] = |
20558 | 88 |
hRe_def hIm_def iii_def hcnj_def hsgn_def harg_def hcis_def |
17332
4910cf8c0cd2
added theorem attributes transfer_intro, transfer_unfold, transfer_refold; simplified some proofs; some rearranging
huffman
parents:
17318
diff
changeset
|
89 |
hcomplex_of_hypreal_def hrcis_def hexpi_def HComplex_def hcpow_def |
14374 | 90 |
|
20558 | 91 |
lemma hcmod_def: "hcmod = *f* cmod" |
92 |
by (rule hnorm_def) |
|
93 |
||
14314 | 94 |
|
95 |
subsection{*Properties of Nonstandard Real and Imaginary Parts*} |
|
96 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
97 |
lemma hRe: "hRe (star_n X) = star_n (%n. Re(X n))" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
98 |
by (simp add: hRe_def starfun) |
14314 | 99 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
100 |
lemma hIm: "hIm (star_n X) = star_n (%n. Im(X n))" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
101 |
by (simp add: hIm_def starfun) |
14314 | 102 |
|
14335 | 103 |
lemma hcomplex_hRe_hIm_cancel_iff: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
104 |
"!!w z. (w=z) = (hRe(w) = hRe(z) & hIm(w) = hIm(z))" |
20727 | 105 |
by transfer (rule complex_Re_Im_cancel_iff) |
14314 | 106 |
|
20727 | 107 |
lemma hcomplex_equality [intro?]: |
108 |
"!!z w. hRe z = hRe w ==> hIm z = hIm w ==> z = w" |
|
109 |
by transfer (rule complex_equality) |
|
14377 | 110 |
|
14374 | 111 |
lemma hcomplex_hRe_zero [simp]: "hRe 0 = 0" |
20727 | 112 |
by transfer (rule complex_Re_zero) |
14314 | 113 |
|
14374 | 114 |
lemma hcomplex_hIm_zero [simp]: "hIm 0 = 0" |
20727 | 115 |
by transfer (rule complex_Im_zero) |
14314 | 116 |
|
14374 | 117 |
lemma hcomplex_hRe_one [simp]: "hRe 1 = 1" |
20727 | 118 |
by transfer (rule complex_Re_one) |
14314 | 119 |
|
14374 | 120 |
lemma hcomplex_hIm_one [simp]: "hIm 1 = 0" |
20727 | 121 |
by transfer (rule complex_Im_one) |
14314 | 122 |
|
123 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
124 |
subsection{*Addition for Nonstandard Complex Numbers*} |
14314 | 125 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
126 |
lemma hRe_add: "!!x y. hRe(x + y) = hRe(x) + hRe(y)" |
20727 | 127 |
by transfer (rule complex_Re_add) |
14314 | 128 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
129 |
lemma hIm_add: "!!x y. hIm(x + y) = hIm(x) + hIm(y)" |
20727 | 130 |
by transfer (rule complex_Im_add) |
14374 | 131 |
|
14318 | 132 |
subsection{*More Minus Laws*} |
133 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
134 |
lemma hRe_minus: "!!z. hRe(-z) = - hRe(z)" |
20727 | 135 |
by transfer (rule complex_Re_minus) |
14318 | 136 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
137 |
lemma hIm_minus: "!!z. hIm(-z) = - hIm(z)" |
20727 | 138 |
by transfer (rule complex_Im_minus) |
14318 | 139 |
|
140 |
lemma hcomplex_add_minus_eq_minus: |
|
141 |
"x + y = (0::hcomplex) ==> x = -y" |
|
14738 | 142 |
apply (drule OrderedGroup.equals_zero_I) |
14374 | 143 |
apply (simp add: minus_equation_iff [of x y]) |
14318 | 144 |
done |
145 |
||
14377 | 146 |
lemma hcomplex_i_mult_eq [simp]: "iii * iii = - 1" |
20727 | 147 |
by transfer (rule i_mult_eq2) |
14377 | 148 |
|
20727 | 149 |
lemma hcomplex_i_mult_left [simp]: "!!z. iii * (iii * z) = -z" |
150 |
by transfer (rule complex_i_mult_minus) |
|
14377 | 151 |
|
152 |
lemma hcomplex_i_not_zero [simp]: "iii \<noteq> 0" |
|
20727 | 153 |
by transfer (rule complex_i_not_zero) |
14377 | 154 |
|
14318 | 155 |
|
156 |
subsection{*More Multiplication Laws*} |
|
157 |
||
20727 | 158 |
lemma hcomplex_mult_minus_one: "- 1 * (z::hcomplex) = -z" |
14374 | 159 |
by simp |
14318 | 160 |
|
20727 | 161 |
lemma hcomplex_mult_minus_one_right: "(z::hcomplex) * - 1 = -z" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
162 |
by simp |
14318 | 163 |
|
14335 | 164 |
lemma hcomplex_mult_left_cancel: |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
165 |
"(c::hcomplex) \<noteq> (0::hcomplex) ==> (c*a=c*b) = (a=b)" |
20727 | 166 |
by simp |
14314 | 167 |
|
14335 | 168 |
lemma hcomplex_mult_right_cancel: |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
169 |
"(c::hcomplex) \<noteq> (0::hcomplex) ==> (a*c=b*c) = (a=b)" |
20727 | 170 |
by simp |
14314 | 171 |
|
172 |
||
14318 | 173 |
subsection{*Subraction and Division*} |
14314 | 174 |
|
14374 | 175 |
lemma hcomplex_diff_eq_eq [simp]: "((x::hcomplex) - y = z) = (x = z + y)" |
14738 | 176 |
by (rule OrderedGroup.diff_eq_eq) |
14314 | 177 |
|
178 |
lemma hcomplex_add_divide_distrib: "(x+y)/(z::hcomplex) = x/z + y/z" |
|
14374 | 179 |
by (rule Ring_and_Field.add_divide_distrib) |
14314 | 180 |
|
181 |
||
182 |
subsection{*Embedding Properties for @{term hcomplex_of_hypreal} Map*} |
|
183 |
||
184 |
lemma hcomplex_of_hypreal: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
185 |
"hcomplex_of_hypreal (star_n X) = star_n (%n. complex_of_real (X n))" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
186 |
by (simp add: hcomplex_of_hypreal_def starfun) |
14314 | 187 |
|
14374 | 188 |
lemma hcomplex_of_hypreal_cancel_iff [iff]: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
189 |
"!!x y. (hcomplex_of_hypreal x = hcomplex_of_hypreal y) = (x = y)" |
20727 | 190 |
by transfer (rule of_real_eq_iff) |
14314 | 191 |
|
14374 | 192 |
lemma hcomplex_of_hypreal_one [simp]: "hcomplex_of_hypreal 1 = 1" |
20727 | 193 |
by transfer (rule of_real_1) |
14314 | 194 |
|
14374 | 195 |
lemma hcomplex_of_hypreal_zero [simp]: "hcomplex_of_hypreal 0 = 0" |
20727 | 196 |
by transfer (rule of_real_0) |
14374 | 197 |
|
15013 | 198 |
lemma hcomplex_of_hypreal_minus [simp]: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
199 |
"!!x. hcomplex_of_hypreal(-x) = - hcomplex_of_hypreal x" |
20727 | 200 |
by transfer (rule of_real_minus) |
15013 | 201 |
|
202 |
lemma hcomplex_of_hypreal_inverse [simp]: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
203 |
"!!x. hcomplex_of_hypreal(inverse x) = inverse(hcomplex_of_hypreal x)" |
20727 | 204 |
by transfer (rule of_real_inverse) |
15013 | 205 |
|
206 |
lemma hcomplex_of_hypreal_add [simp]: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
207 |
"!!x y. hcomplex_of_hypreal (x + y) = |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
208 |
hcomplex_of_hypreal x + hcomplex_of_hypreal y" |
20727 | 209 |
by transfer (rule of_real_add) |
15013 | 210 |
|
211 |
lemma hcomplex_of_hypreal_diff [simp]: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
212 |
"!!x y. hcomplex_of_hypreal (x - y) = |
15013 | 213 |
hcomplex_of_hypreal x - hcomplex_of_hypreal y " |
20727 | 214 |
by transfer (rule of_real_diff) |
15013 | 215 |
|
216 |
lemma hcomplex_of_hypreal_mult [simp]: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
217 |
"!!x y. hcomplex_of_hypreal (x * y) = |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
218 |
hcomplex_of_hypreal x * hcomplex_of_hypreal y" |
20727 | 219 |
by transfer (rule of_real_mult) |
15013 | 220 |
|
221 |
lemma hcomplex_of_hypreal_divide [simp]: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
222 |
"!!x y. hcomplex_of_hypreal(x/y) = |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
223 |
hcomplex_of_hypreal x / hcomplex_of_hypreal y" |
20727 | 224 |
by transfer (rule of_real_divide) |
15013 | 225 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
226 |
lemma hRe_hcomplex_of_hypreal [simp]: "!!z. hRe(hcomplex_of_hypreal z) = z" |
20727 | 227 |
by transfer (rule Re_complex_of_real) |
14314 | 228 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
229 |
lemma hIm_hcomplex_of_hypreal [simp]: "!!z. hIm(hcomplex_of_hypreal z) = 0" |
20727 | 230 |
by transfer (rule Im_complex_of_real) |
14314 | 231 |
|
14374 | 232 |
lemma hcomplex_of_hypreal_epsilon_not_zero [simp]: |
233 |
"hcomplex_of_hypreal epsilon \<noteq> 0" |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
234 |
by (simp add: hcomplex_of_hypreal epsilon_def star_n_zero_num star_n_eq_iff) |
14314 | 235 |
|
14318 | 236 |
|
14377 | 237 |
subsection{*HComplex theorems*} |
238 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
239 |
lemma hRe_HComplex [simp]: "!!x y. hRe (HComplex x y) = x" |
20727 | 240 |
by transfer (rule Re) |
14377 | 241 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
242 |
lemma hIm_HComplex [simp]: "!!x y. hIm (HComplex x y) = y" |
20727 | 243 |
by transfer (rule Im) |
14377 | 244 |
|
245 |
text{*Relates the two nonstandard constructions*} |
|
17300 | 246 |
lemma HComplex_eq_Abs_star_Complex: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
247 |
"HComplex (star_n X) (star_n Y) = |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
248 |
star_n (%n::nat. Complex (X n) (Y n))" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
249 |
by (simp add: hcomplex_hRe_hIm_cancel_iff hRe hIm) |
14377 | 250 |
|
20727 | 251 |
lemma hcomplex_surj [simp]: "!!z. HComplex (hRe z) (hIm z) = z" |
252 |
by transfer (rule complex_surj) |
|
14377 | 253 |
|
17300 | 254 |
lemma hcomplex_induct [case_names rect(*, induct type: hcomplex*)]: |
14377 | 255 |
"(\<And>x y. P (HComplex x y)) ==> P z" |
256 |
by (rule hcomplex_surj [THEN subst], blast) |
|
257 |
||
258 |
||
14318 | 259 |
subsection{*Modulus (Absolute Value) of Nonstandard Complex Number*} |
14314 | 260 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
261 |
lemma hcmod: "hcmod (star_n X) = star_n (%n. cmod (X n))" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
262 |
by (simp add: hcmod_def starfun) |
14314 | 263 |
|
14374 | 264 |
lemma hcmod_zero [simp]: "hcmod(0) = 0" |
20727 | 265 |
by (rule hnorm_zero) |
14314 | 266 |
|
14374 | 267 |
lemma hcmod_one [simp]: "hcmod(1) = 1" |
20727 | 268 |
by (rule hnorm_one) |
14314 | 269 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
270 |
lemma hcmod_hcomplex_of_hypreal [simp]: |
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
271 |
"!!x. hcmod(hcomplex_of_hypreal x) = abs x" |
20727 | 272 |
by transfer (rule norm_of_real) |
14314 | 273 |
|
14335 | 274 |
lemma hcomplex_of_hypreal_abs: |
275 |
"hcomplex_of_hypreal (abs x) = |
|
14314 | 276 |
hcomplex_of_hypreal(hcmod(hcomplex_of_hypreal x))" |
14374 | 277 |
by simp |
14314 | 278 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
279 |
lemma HComplex_inject [simp]: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
280 |
"!!x y x' y'. HComplex x y = HComplex x' y' = (x=x' & y=y')" |
20727 | 281 |
by transfer (rule complex.inject) |
14377 | 282 |
|
283 |
lemma HComplex_add [simp]: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
284 |
"!!x1 y1 x2 y2. HComplex x1 y1 + HComplex x2 y2 = HComplex (x1+x2) (y1+y2)" |
20727 | 285 |
by transfer (rule complex_add) |
14377 | 286 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
287 |
lemma HComplex_minus [simp]: "!!x y. - HComplex x y = HComplex (-x) (-y)" |
20727 | 288 |
by transfer (rule complex_minus) |
14377 | 289 |
|
290 |
lemma HComplex_diff [simp]: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
291 |
"!!x1 y1 x2 y2. HComplex x1 y1 - HComplex x2 y2 = HComplex (x1-x2) (y1-y2)" |
20727 | 292 |
by transfer (rule complex_diff) |
14377 | 293 |
|
294 |
lemma HComplex_mult [simp]: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
295 |
"!!x1 y1 x2 y2. HComplex x1 y1 * HComplex x2 y2 = |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
296 |
HComplex (x1*x2 - y1*y2) (x1*y2 + y1*x2)" |
20727 | 297 |
by transfer (rule complex_mult) |
14377 | 298 |
|
299 |
(*HComplex_inverse is proved below*) |
|
300 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
301 |
lemma hcomplex_of_hypreal_eq: "!!r. hcomplex_of_hypreal r = HComplex r 0" |
20727 | 302 |
by transfer (rule complex_of_real_def) |
14377 | 303 |
|
304 |
lemma HComplex_add_hcomplex_of_hypreal [simp]: |
|
20727 | 305 |
"!!x y r. HComplex x y + hcomplex_of_hypreal r = HComplex (x+r) y" |
306 |
by transfer (rule Complex_add_complex_of_real) |
|
14377 | 307 |
|
308 |
lemma hcomplex_of_hypreal_add_HComplex [simp]: |
|
20727 | 309 |
"!!r x y. hcomplex_of_hypreal r + HComplex x y = HComplex (r+x) y" |
310 |
by transfer (rule complex_of_real_add_Complex) |
|
14377 | 311 |
|
312 |
lemma HComplex_mult_hcomplex_of_hypreal: |
|
20727 | 313 |
"!!x y r. HComplex x y * hcomplex_of_hypreal r = HComplex (x*r) (y*r)" |
314 |
by transfer (rule Complex_mult_complex_of_real) |
|
14377 | 315 |
|
316 |
lemma hcomplex_of_hypreal_mult_HComplex: |
|
20727 | 317 |
"!!r x y. hcomplex_of_hypreal r * HComplex x y = HComplex (r*x) (r*y)" |
318 |
by transfer (rule complex_of_real_mult_Complex) |
|
14377 | 319 |
|
320 |
lemma i_hcomplex_of_hypreal [simp]: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
321 |
"!!r. iii * hcomplex_of_hypreal r = HComplex 0 r" |
20727 | 322 |
by transfer (rule i_complex_of_real) |
14377 | 323 |
|
324 |
lemma hcomplex_of_hypreal_i [simp]: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
325 |
"!!r. hcomplex_of_hypreal r * iii = HComplex 0 r" |
20727 | 326 |
by transfer (rule complex_of_real_i) |
14377 | 327 |
|
14314 | 328 |
|
329 |
subsection{*Conjugation*} |
|
330 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
331 |
lemma hcnj: "hcnj (star_n X) = star_n (%n. cnj(X n))" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
332 |
by (simp add: hcnj_def starfun) |
14314 | 333 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
334 |
lemma hcomplex_hcnj_cancel_iff [iff]: "!!x y. (hcnj x = hcnj y) = (x = y)" |
20727 | 335 |
by transfer (rule complex_cnj_cancel_iff) |
14374 | 336 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
337 |
lemma hcomplex_hcnj_hcnj [simp]: "!!z. hcnj (hcnj z) = z" |
20727 | 338 |
by transfer (rule complex_cnj_cnj) |
14314 | 339 |
|
14374 | 340 |
lemma hcomplex_hcnj_hcomplex_of_hypreal [simp]: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
341 |
"!!x. hcnj (hcomplex_of_hypreal x) = hcomplex_of_hypreal x" |
20727 | 342 |
by transfer (rule complex_cnj_complex_of_real) |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
343 |
|
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
344 |
lemma hcomplex_hmod_hcnj [simp]: "!!z. hcmod (hcnj z) = hcmod z" |
20727 | 345 |
by transfer (rule complex_mod_cnj) |
14314 | 346 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
347 |
lemma hcomplex_hcnj_minus: "!!z. hcnj (-z) = - hcnj z" |
20727 | 348 |
by transfer (rule complex_cnj_minus) |
14314 | 349 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
350 |
lemma hcomplex_hcnj_inverse: "!!z. hcnj(inverse z) = inverse(hcnj z)" |
20727 | 351 |
by transfer (rule complex_cnj_inverse) |
14314 | 352 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
353 |
lemma hcomplex_hcnj_add: "!!w z. hcnj(w + z) = hcnj(w) + hcnj(z)" |
20727 | 354 |
by transfer (rule complex_cnj_add) |
14314 | 355 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
356 |
lemma hcomplex_hcnj_diff: "!!w z. hcnj(w - z) = hcnj(w) - hcnj(z)" |
20727 | 357 |
by transfer (rule complex_cnj_diff) |
14314 | 358 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
359 |
lemma hcomplex_hcnj_mult: "!!w z. hcnj(w * z) = hcnj(w) * hcnj(z)" |
20727 | 360 |
by transfer (rule complex_cnj_mult) |
14314 | 361 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
362 |
lemma hcomplex_hcnj_divide: "!!w z. hcnj(w / z) = (hcnj w)/(hcnj z)" |
20727 | 363 |
by transfer (rule complex_cnj_divide) |
14314 | 364 |
|
14374 | 365 |
lemma hcnj_one [simp]: "hcnj 1 = 1" |
20727 | 366 |
by transfer (rule complex_cnj_one) |
14314 | 367 |
|
14374 | 368 |
lemma hcomplex_hcnj_zero [simp]: "hcnj 0 = 0" |
20727 | 369 |
by transfer (rule complex_cnj_zero) |
14374 | 370 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
371 |
lemma hcomplex_hcnj_zero_iff [iff]: "!!z. (hcnj z = 0) = (z = 0)" |
20727 | 372 |
by transfer (rule complex_cnj_zero_iff) |
14314 | 373 |
|
14335 | 374 |
lemma hcomplex_mult_hcnj: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
375 |
"!!z. z * hcnj z = hcomplex_of_hypreal (hRe(z) ^ 2 + hIm(z) ^ 2)" |
20727 | 376 |
by transfer (rule complex_mult_cnj) |
14314 | 377 |
|
378 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
379 |
subsection{*More Theorems about the Function @{term hcmod}*} |
14314 | 380 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
381 |
lemma hcomplex_hcmod_eq_zero_cancel [simp]: "!!x. (hcmod x = 0) = (x = 0)" |
20727 | 382 |
by transfer (rule complex_mod_eq_zero_cancel) |
14314 | 383 |
|
14374 | 384 |
lemma hcmod_hcomplex_of_hypreal_of_nat [simp]: |
14335 | 385 |
"hcmod (hcomplex_of_hypreal(hypreal_of_nat n)) = hypreal_of_nat n" |
20727 | 386 |
by simp |
14314 | 387 |
|
14374 | 388 |
lemma hcmod_hcomplex_of_hypreal_of_hypnat [simp]: |
14335 | 389 |
"hcmod (hcomplex_of_hypreal(hypreal_of_hypnat n)) = hypreal_of_hypnat n" |
20727 | 390 |
by simp |
14314 | 391 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
392 |
lemma hcmod_minus [simp]: "!!x. hcmod (-x) = hcmod(x)" |
20727 | 393 |
by transfer (rule complex_mod_minus) |
14314 | 394 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
395 |
lemma hcmod_mult_hcnj: "!!z. hcmod(z * hcnj(z)) = hcmod(z) ^ 2" |
20727 | 396 |
by transfer (rule complex_mod_mult_cnj) |
14314 | 397 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
398 |
lemma hcmod_ge_zero [simp]: "!!x. (0::hypreal) \<le> hcmod x" |
20727 | 399 |
by transfer (rule complex_mod_ge_zero) |
14314 | 400 |
|
14374 | 401 |
lemma hrabs_hcmod_cancel [simp]: "abs(hcmod x) = hcmod x" |
402 |
by (simp add: abs_if linorder_not_less) |
|
14314 | 403 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
404 |
lemma hcmod_mult: "!!x y. hcmod(x*y) = hcmod(x) * hcmod(y)" |
20727 | 405 |
by transfer (rule complex_mod_mult) |
14314 | 406 |
|
407 |
lemma hcmod_add_squared_eq: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
408 |
"!!x y. hcmod(x + y) ^ 2 = hcmod(x) ^ 2 + hcmod(y) ^ 2 + 2 * hRe(x * hcnj y)" |
20727 | 409 |
by transfer (rule complex_mod_add_squared_eq) |
14314 | 410 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
411 |
lemma hcomplex_hRe_mult_hcnj_le_hcmod [simp]: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
412 |
"!!x y. hRe(x * hcnj y) \<le> hcmod(x * hcnj y)" |
20727 | 413 |
by transfer (rule complex_Re_mult_cnj_le_cmod) |
14314 | 414 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
415 |
lemma hcomplex_hRe_mult_hcnj_le_hcmod2 [simp]: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
416 |
"!!x y. hRe(x * hcnj y) \<le> hcmod(x * y)" |
20727 | 417 |
by transfer (rule complex_Re_mult_cnj_le_cmod2) |
14314 | 418 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
419 |
lemma hcmod_triangle_squared [simp]: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
420 |
"!!x y. hcmod (x + y) ^ 2 \<le> (hcmod(x) + hcmod(y)) ^ 2" |
20727 | 421 |
by transfer (rule complex_mod_triangle_squared) |
14314 | 422 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
423 |
lemma hcmod_triangle_ineq [simp]: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
424 |
"!!x y. hcmod (x + y) \<le> hcmod(x) + hcmod(y)" |
20727 | 425 |
by transfer (rule complex_mod_triangle_ineq) |
14314 | 426 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
427 |
lemma hcmod_triangle_ineq2 [simp]: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
428 |
"!!a b. hcmod(b + a) - hcmod b \<le> hcmod a" |
20727 | 429 |
by transfer (rule complex_mod_triangle_ineq2) |
14314 | 430 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
431 |
lemma hcmod_diff_commute: "!!x y. hcmod (x - y) = hcmod (y - x)" |
20727 | 432 |
by transfer (rule complex_mod_diff_commute) |
14314 | 433 |
|
14335 | 434 |
lemma hcmod_add_less: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
435 |
"!!x y r s. [| hcmod x < r; hcmod y < s |] ==> hcmod (x + y) < r + s" |
20727 | 436 |
by transfer (rule complex_mod_add_less) |
14314 | 437 |
|
14335 | 438 |
lemma hcmod_mult_less: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
439 |
"!!x y r s. [| hcmod x < r; hcmod y < s |] ==> hcmod (x * y) < r * s" |
20727 | 440 |
by transfer (rule complex_mod_mult_less) |
14314 | 441 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
442 |
lemma hcmod_diff_ineq [simp]: "!!a b. hcmod(a) - hcmod(b) \<le> hcmod(a + b)" |
20727 | 443 |
by transfer (rule complex_mod_diff_ineq) |
14314 | 444 |
|
445 |
||
446 |
subsection{*A Few Nonlinear Theorems*} |
|
447 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
448 |
lemma hcpow: "star_n X hcpow star_n Y = star_n (%n. X n ^ Y n)" |
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17373
diff
changeset
|
449 |
by (simp add: hcpow_def starfun2_star_n) |
14314 | 450 |
|
14335 | 451 |
lemma hcomplex_of_hypreal_hyperpow: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
452 |
"!!x n. hcomplex_of_hypreal (x pow n) = (hcomplex_of_hypreal x) hcpow n" |
20727 | 453 |
by transfer (rule complex_of_real_pow) |
14314 | 454 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
455 |
lemma hcmod_hcpow: "!!x n. hcmod(x hcpow n) = hcmod(x) pow n" |
20727 | 456 |
by transfer (rule complex_mod_complexpow) |
14314 | 457 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
458 |
lemma hcmod_hcomplex_inverse: "!!x. hcmod(inverse x) = inverse(hcmod x)" |
20727 | 459 |
by transfer (rule complex_mod_inverse) |
14314 | 460 |
|
20727 | 461 |
lemma hcmod_divide: "!!x y. hcmod(x/y) = hcmod(x)/(hcmod y)" |
462 |
by transfer (rule norm_divide) |
|
14314 | 463 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
464 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
465 |
subsection{*Exponentiation*} |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
466 |
|
17300 | 467 |
lemma hcomplexpow_0 [simp]: "z ^ 0 = (1::hcomplex)" |
468 |
by (rule power_0) |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
469 |
|
17300 | 470 |
lemma hcomplexpow_Suc [simp]: "z ^ (Suc n) = (z::hcomplex) * (z ^ n)" |
471 |
by (rule power_Suc) |
|
472 |
||
14377 | 473 |
lemma hcomplexpow_i_squared [simp]: "iii ^ 2 = - 1" |
20727 | 474 |
by transfer (rule complexpow_i_squared) |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
475 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
476 |
lemma hcomplex_of_hypreal_pow: |
20727 | 477 |
"!!x. hcomplex_of_hypreal (x ^ n) = (hcomplex_of_hypreal x) ^ n" |
478 |
by transfer (rule of_real_power) |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
479 |
|
20727 | 480 |
lemma hcomplex_hcnj_pow: "!!z. hcnj(z ^ n) = hcnj(z) ^ n" |
481 |
by transfer (rule complex_cnj_pow) |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
482 |
|
20727 | 483 |
lemma hcmod_hcomplexpow: "!!x. hcmod(x ^ n) = hcmod(x) ^ n" |
484 |
by transfer (rule norm_power) |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
485 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
486 |
lemma hcpow_minus: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
487 |
"!!x n. (-x::hcomplex) hcpow n = |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
488 |
(if ( *p* even) n then (x hcpow n) else -(x hcpow n))" |
20727 | 489 |
by transfer (rule neg_power_if) |
14314 | 490 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
491 |
lemma hcpow_mult: |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
492 |
"!!r s n. ((r::hcomplex) * s) hcpow n = (r hcpow n) * (s hcpow n)" |
20727 | 493 |
by transfer (rule power_mult_distrib) |
14314 | 494 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
495 |
lemma hcpow_zero [simp]: "!!n. 0 hcpow (n + 1) = 0" |
20727 | 496 |
by transfer simp |
14314 | 497 |
|
20727 | 498 |
lemma hcpow_zero2 [simp]: "!!n. 0 hcpow (hSuc n) = 0" |
14374 | 499 |
by (simp add: hSuc_def) |
14314 | 500 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
501 |
lemma hcpow_not_zero [simp,intro]: |
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
502 |
"!!r n. r \<noteq> 0 ==> r hcpow n \<noteq> (0::hcomplex)" |
20727 | 503 |
by transfer (rule field_power_not_zero) |
14314 | 504 |
|
505 |
lemma hcpow_zero_zero: "r hcpow n = (0::hcomplex) ==> r = 0" |
|
14374 | 506 |
by (blast intro: ccontr dest: hcpow_not_zero) |
14314 | 507 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
508 |
lemma star_n_divide: "star_n X / star_n Y = star_n (%n. X n / Y n)" |
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17373
diff
changeset
|
509 |
by (simp add: star_divide_def starfun2_star_n) |
14377 | 510 |
|
14314 | 511 |
subsection{*The Function @{term hsgn}*} |
512 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
513 |
lemma hsgn: "hsgn (star_n X) = star_n (%n. sgn (X n))" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
514 |
by (simp add: hsgn_def starfun) |
14314 | 515 |
|
14374 | 516 |
lemma hsgn_zero [simp]: "hsgn 0 = 0" |
20727 | 517 |
by transfer (rule sgn_zero) |
14314 | 518 |
|
14374 | 519 |
lemma hsgn_one [simp]: "hsgn 1 = 1" |
20727 | 520 |
by transfer (rule sgn_one) |
14314 | 521 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
522 |
lemma hsgn_minus: "!!z. hsgn (-z) = - hsgn(z)" |
20727 | 523 |
by transfer (rule sgn_minus) |
14314 | 524 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
525 |
lemma hsgn_eq: "!!z. hsgn z = z / hcomplex_of_hypreal (hcmod z)" |
20727 | 526 |
by transfer (rule sgn_eq) |
14314 | 527 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
528 |
lemma hcmod_i: "!!x y. hcmod (HComplex x y) = ( *f* sqrt) (x ^ 2 + y ^ 2)" |
20727 | 529 |
by transfer (rule complex_mod) |
14314 | 530 |
|
14377 | 531 |
lemma hcomplex_eq_cancel_iff1 [simp]: |
532 |
"(hcomplex_of_hypreal xa = HComplex x y) = (xa = x & y = 0)" |
|
533 |
by (simp add: hcomplex_of_hypreal_eq) |
|
14314 | 534 |
|
14374 | 535 |
lemma hcomplex_eq_cancel_iff2 [simp]: |
14377 | 536 |
"(HComplex x y = hcomplex_of_hypreal xa) = (x = xa & y = 0)" |
537 |
by (simp add: hcomplex_of_hypreal_eq) |
|
14314 | 538 |
|
20727 | 539 |
lemma HComplex_eq_0 [simp]: "!!x y. (HComplex x y = 0) = (x = 0 & y = 0)" |
540 |
by transfer (rule Complex_eq_0) |
|
14314 | 541 |
|
20727 | 542 |
lemma HComplex_eq_1 [simp]: "!!x y. (HComplex x y = 1) = (x = 1 & y = 0)" |
543 |
by transfer (rule Complex_eq_1) |
|
14314 | 544 |
|
14377 | 545 |
lemma i_eq_HComplex_0_1: "iii = HComplex 0 1" |
20727 | 546 |
by transfer (rule i_def [THEN meta_eq_to_obj_eq]) |
14314 | 547 |
|
20727 | 548 |
lemma HComplex_eq_i [simp]: "!!x y. (HComplex x y = iii) = (x = 0 & y = 1)" |
549 |
by transfer (rule Complex_eq_i) |
|
14314 | 550 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
551 |
lemma hRe_hsgn [simp]: "!!z. hRe(hsgn z) = hRe(z)/hcmod z" |
20727 | 552 |
by transfer (rule Re_sgn) |
14314 | 553 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
554 |
lemma hIm_hsgn [simp]: "!!z. hIm(hsgn z) = hIm(z)/hcmod z" |
20727 | 555 |
by transfer (rule Im_sgn) |
14314 | 556 |
|
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15013
diff
changeset
|
557 |
(*????move to RealDef????*) |
14374 | 558 |
lemma real_two_squares_add_zero_iff [simp]: "(x*x + y*y = 0) = ((x::real) = 0 & y = 0)" |
15085
5693a977a767
removed some [iff] declarations from RealDef.thy, concerning inequalities
paulson
parents:
15013
diff
changeset
|
559 |
by (auto intro: real_sum_squares_cancel iff: real_add_eq_0_iff) |
14314 | 560 |
|
14335 | 561 |
lemma hcomplex_inverse_complex_split: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
562 |
"!!x y. inverse(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y) = |
14314 | 563 |
hcomplex_of_hypreal(x/(x ^ 2 + y ^ 2)) - |
564 |
iii * hcomplex_of_hypreal(y/(x ^ 2 + y ^ 2))" |
|
20727 | 565 |
by transfer (rule complex_inverse_complex_split) |
14374 | 566 |
|
14377 | 567 |
lemma HComplex_inverse: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
568 |
"!!x y. inverse (HComplex x y) = |
14377 | 569 |
HComplex (x/(x ^ 2 + y ^ 2)) (-y/(x ^ 2 + y ^ 2))" |
20727 | 570 |
by transfer (rule complex_inverse) |
14377 | 571 |
|
14374 | 572 |
lemma hRe_mult_i_eq[simp]: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
573 |
"!!y. hRe (iii * hcomplex_of_hypreal y) = 0" |
20727 | 574 |
by transfer simp |
14314 | 575 |
|
14374 | 576 |
lemma hIm_mult_i_eq [simp]: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
577 |
"!!y. hIm (iii * hcomplex_of_hypreal y) = y" |
20727 | 578 |
by transfer simp |
14314 | 579 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
580 |
lemma hcmod_mult_i [simp]: "!!y. hcmod (iii * hcomplex_of_hypreal y) = abs y" |
20727 | 581 |
by transfer simp |
14314 | 582 |
|
20727 | 583 |
lemma hcmod_mult_i2 [simp]: "!!y. hcmod (hcomplex_of_hypreal y * iii) = abs y" |
584 |
by transfer simp |
|
14314 | 585 |
|
586 |
(*---------------------------------------------------------------------------*) |
|
587 |
(* harg *) |
|
588 |
(*---------------------------------------------------------------------------*) |
|
589 |
||
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
590 |
lemma harg: "harg (star_n X) = star_n (%n. arg (X n))" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
591 |
by (simp add: harg_def starfun) |
14314 | 592 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
593 |
lemma cos_harg_i_mult_zero_pos: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
594 |
"!!y. 0 < y ==> ( *f* cos) (harg(HComplex 0 y)) = 0" |
20727 | 595 |
by transfer (rule cos_arg_i_mult_zero_pos) |
14314 | 596 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
597 |
lemma cos_harg_i_mult_zero_neg: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
598 |
"!!y. y < 0 ==> ( *f* cos) (harg(HComplex 0 y)) = 0" |
20727 | 599 |
by transfer (rule cos_arg_i_mult_zero_neg) |
14314 | 600 |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
601 |
lemma cos_harg_i_mult_zero [simp]: |
20727 | 602 |
"!!y. y \<noteq> 0 ==> ( *f* cos) (harg(HComplex 0 y)) = 0" |
603 |
by transfer (rule cos_arg_i_mult_zero) |
|
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
604 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
605 |
lemma hcomplex_of_hypreal_zero_iff [simp]: |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
606 |
"!!y. (hcomplex_of_hypreal y = 0) = (y = 0)" |
20727 | 607 |
by transfer (rule of_real_eq_0_iff) |
14314 | 608 |
|
609 |
||
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
610 |
subsection{*Polar Form for Nonstandard Complex Numbers*} |
14314 | 611 |
|
14335 | 612 |
lemma complex_split_polar2: |
14377 | 613 |
"\<forall>n. \<exists>r a. (z n) = complex_of_real r * (Complex (cos a) (sin a))" |
614 |
by (blast intro: complex_split_polar) |
|
615 |
||
616 |
lemma lemma_hypreal_P_EX2: |
|
617 |
"(\<exists>(x::hypreal) y. P x y) = |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
618 |
(\<exists>f g. P (star_n f) (star_n g))" |
14377 | 619 |
apply auto |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
620 |
apply (rule_tac x = x in star_cases) |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
621 |
apply (rule_tac x = y in star_cases, auto) |
14314 | 622 |
done |
623 |
||
624 |
lemma hcomplex_split_polar: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
625 |
"!!z. \<exists>r a. z = hcomplex_of_hypreal r * (HComplex(( *f* cos) a)(( *f* sin) a))" |
20727 | 626 |
by transfer (rule complex_split_polar) |
14314 | 627 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
628 |
lemma hcis: "hcis (star_n X) = star_n (%n. cis (X n))" |
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
629 |
by (simp add: hcis_def starfun) |
14314 | 630 |
|
631 |
lemma hcis_eq: |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
632 |
"!!a. hcis a = |
14314 | 633 |
(hcomplex_of_hypreal(( *f* cos) a) + |
634 |
iii * hcomplex_of_hypreal(( *f* sin) a))" |
|
20727 | 635 |
by transfer (simp add: cis_def) |
14314 | 636 |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
637 |
lemma hrcis: "hrcis (star_n X) (star_n Y) = star_n (%n. rcis (X n) (Y n))" |
17429
e8d6ed3aacfe
merged Transfer.thy and StarType.thy into StarDef.thy; renamed Ifun2_of to starfun2; cleaned up
huffman
parents:
17373
diff
changeset
|
638 |
by (simp add: hrcis_def starfun2_star_n) |
14314 | 639 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
640 |
lemma hrcis_Ex: "!!z. \<exists>r a. z = hrcis r a" |
20727 | 641 |
by transfer (rule rcis_Ex) |
14314 | 642 |
|
14374 | 643 |
lemma hRe_hcomplex_polar [simp]: |
20727 | 644 |
"!!r a. hRe (hcomplex_of_hypreal r * HComplex (( *f* cos) a) (( *f* sin) a)) = |
14377 | 645 |
r * ( *f* cos) a" |
20727 | 646 |
by transfer simp |
14314 | 647 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
648 |
lemma hRe_hrcis [simp]: "!!r a. hRe(hrcis r a) = r * ( *f* cos) a" |
20727 | 649 |
by transfer (rule Re_rcis) |
14314 | 650 |
|
14374 | 651 |
lemma hIm_hcomplex_polar [simp]: |
20727 | 652 |
"!!r a. hIm (hcomplex_of_hypreal r * HComplex (( *f* cos) a) (( *f* sin) a)) = |
14377 | 653 |
r * ( *f* sin) a" |
20727 | 654 |
by transfer simp |
14314 | 655 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
656 |
lemma hIm_hrcis [simp]: "!!r a. hIm(hrcis r a) = r * ( *f* sin) a" |
20727 | 657 |
by transfer (rule Im_rcis) |
14377 | 658 |
|
659 |
lemma hcmod_unit_one [simp]: |
|
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
660 |
"!!a. hcmod (HComplex (( *f* cos) a) (( *f* sin) a)) = 1" |
20727 | 661 |
by transfer (rule cmod_unit_one) |
14377 | 662 |
|
14374 | 663 |
lemma hcmod_complex_polar [simp]: |
20727 | 664 |
"!!r a. hcmod (hcomplex_of_hypreal r * HComplex (( *f* cos) a) (( *f* sin) a)) = |
14377 | 665 |
abs r" |
20727 | 666 |
by transfer (rule cmod_complex_polar) |
14314 | 667 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
668 |
lemma hcmod_hrcis [simp]: "!!r a. hcmod(hrcis r a) = abs r" |
20727 | 669 |
by transfer (rule complex_mod_rcis) |
14314 | 670 |
|
671 |
(*---------------------------------------------------------------------------*) |
|
672 |
(* (r1 * hrcis a) * (r2 * hrcis b) = r1 * r2 * hrcis (a + b) *) |
|
673 |
(*---------------------------------------------------------------------------*) |
|
674 |
||
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
675 |
lemma hcis_hrcis_eq: "!!a. hcis a = hrcis 1 a" |
20727 | 676 |
by transfer (rule cis_rcis_eq) |
14314 | 677 |
declare hcis_hrcis_eq [symmetric, simp] |
678 |
||
679 |
lemma hrcis_mult: |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
680 |
"!!a b r1 r2. hrcis r1 a * hrcis r2 b = hrcis (r1*r2) (a + b)" |
20727 | 681 |
by transfer (rule rcis_mult) |
14314 | 682 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
683 |
lemma hcis_mult: "!!a b. hcis a * hcis b = hcis (a + b)" |
20727 | 684 |
by transfer (rule cis_mult) |
14314 | 685 |
|
14374 | 686 |
lemma hcis_zero [simp]: "hcis 0 = 1" |
20727 | 687 |
by transfer (rule cis_zero) |
14314 | 688 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
689 |
lemma hrcis_zero_mod [simp]: "!!a. hrcis 0 a = 0" |
20727 | 690 |
by transfer (rule rcis_zero_mod) |
14314 | 691 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
692 |
lemma hrcis_zero_arg [simp]: "!!r. hrcis r 0 = hcomplex_of_hypreal r" |
20727 | 693 |
by transfer (rule rcis_zero_arg) |
14314 | 694 |
|
20727 | 695 |
lemma hcomplex_i_mult_minus [simp]: "!!x. iii * (iii * x) = - x" |
696 |
by transfer (rule complex_i_mult_minus) |
|
14314 | 697 |
|
14374 | 698 |
lemma hcomplex_i_mult_minus2 [simp]: "iii * iii * x = - x" |
699 |
by simp |
|
14314 | 700 |
|
701 |
lemma hcis_hypreal_of_nat_Suc_mult: |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
702 |
"!!a. hcis (hypreal_of_nat (Suc n) * a) = |
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
703 |
hcis a * hcis (hypreal_of_nat n * a)" |
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
704 |
apply transfer |
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
705 |
apply (fold real_of_nat_def) |
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
706 |
apply (rule cis_real_of_nat_Suc_mult) |
14314 | 707 |
done |
708 |
||
20727 | 709 |
lemma NSDeMoivre: "!!a. (hcis a) ^ n = hcis (hypreal_of_nat n * a)" |
710 |
apply transfer |
|
711 |
apply (fold real_of_nat_def) |
|
712 |
apply (rule DeMoivre) |
|
14314 | 713 |
done |
714 |
||
14335 | 715 |
lemma hcis_hypreal_of_hypnat_Suc_mult: |
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
716 |
"!! a n. hcis (hypreal_of_hypnat (n + 1) * a) = |
14314 | 717 |
hcis a * hcis (hypreal_of_hypnat n * a)" |
20727 | 718 |
by transfer (simp add: cis_real_of_nat_Suc_mult) |
14314 | 719 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
720 |
lemma NSDeMoivre_ext: |
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
721 |
"!!a n. (hcis a) hcpow n = hcis (hypreal_of_hypnat n * a)" |
20727 | 722 |
by transfer (rule DeMoivre) |
14314 | 723 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
724 |
lemma NSDeMoivre2: |
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
725 |
"!!a r. (hrcis r a) ^ n = hrcis (r ^ n) (hypreal_of_nat n * a)" |
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
726 |
apply transfer |
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
727 |
apply (fold real_of_nat_def) |
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
728 |
apply (rule DeMoivre2) |
14314 | 729 |
done |
730 |
||
731 |
lemma DeMoivre2_ext: |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
732 |
"!! a r n. (hrcis r a) hcpow n = hrcis (r pow n) (hypreal_of_hypnat n * a)" |
20727 | 733 |
by transfer (rule DeMoivre2) |
14374 | 734 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
735 |
lemma hcis_inverse [simp]: "!!a. inverse(hcis a) = hcis (-a)" |
20727 | 736 |
by transfer (rule cis_inverse) |
14314 | 737 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
738 |
lemma hrcis_inverse: "!!a r. inverse(hrcis r a) = hrcis (inverse r) (-a)" |
20727 | 739 |
by transfer (simp add: rcis_inverse inverse_eq_divide [symmetric]) |
14314 | 740 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
741 |
lemma hRe_hcis [simp]: "!!a. hRe(hcis a) = ( *f* cos) a" |
20727 | 742 |
by transfer (rule Re_cis) |
14314 | 743 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
744 |
lemma hIm_hcis [simp]: "!!a. hIm(hcis a) = ( *f* sin) a" |
20727 | 745 |
by transfer (rule Im_cis) |
14314 | 746 |
|
14374 | 747 |
lemma cos_n_hRe_hcis_pow_n: "( *f* cos) (hypreal_of_nat n * a) = hRe(hcis a ^ n)" |
14377 | 748 |
by (simp add: NSDeMoivre) |
14314 | 749 |
|
14374 | 750 |
lemma sin_n_hIm_hcis_pow_n: "( *f* sin) (hypreal_of_nat n * a) = hIm(hcis a ^ n)" |
14377 | 751 |
by (simp add: NSDeMoivre) |
14314 | 752 |
|
14374 | 753 |
lemma cos_n_hRe_hcis_hcpow_n: "( *f* cos) (hypreal_of_hypnat n * a) = hRe(hcis a hcpow n)" |
14377 | 754 |
by (simp add: NSDeMoivre_ext) |
14314 | 755 |
|
14374 | 756 |
lemma sin_n_hIm_hcis_hcpow_n: "( *f* sin) (hypreal_of_hypnat n * a) = hIm(hcis a hcpow n)" |
14377 | 757 |
by (simp add: NSDeMoivre_ext) |
14314 | 758 |
|
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
759 |
lemma hexpi_add: "!!a b. hexpi(a + b) = hexpi(a) * hexpi(b)" |
20727 | 760 |
by transfer (rule expi_add) |
14314 | 761 |
|
762 |
||
14374 | 763 |
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
|
764 |
type @{typ complex} to to @{typ hcomplex}*} |
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
765 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
766 |
lemma inj_hcomplex_of_complex: "inj(hcomplex_of_complex)" |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
767 |
by (rule inj_onI, simp) |
14354
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
768 |
|
988aa4648597
types complex and hcomplex are now instances of class ringpower:
paulson
parents:
14341
diff
changeset
|
769 |
lemma hcomplex_of_complex_i: "iii = hcomplex_of_complex ii" |
20727 | 770 |
by (rule iii_def) |
14314 | 771 |
|
772 |
lemma hRe_hcomplex_of_complex: |
|
773 |
"hRe (hcomplex_of_complex z) = hypreal_of_real (Re z)" |
|
20727 | 774 |
by transfer (rule refl) |
14314 | 775 |
|
776 |
lemma hIm_hcomplex_of_complex: |
|
777 |
"hIm (hcomplex_of_complex z) = hypreal_of_real (Im z)" |
|
20727 | 778 |
by transfer (rule refl) |
14314 | 779 |
|
780 |
lemma hcmod_hcomplex_of_complex: |
|
781 |
"hcmod (hcomplex_of_complex x) = hypreal_of_real (cmod x)" |
|
20727 | 782 |
by transfer (rule refl) |
14314 | 783 |
|
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
784 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
785 |
subsection{*Numerals and Arithmetic*} |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
786 |
|
20485 | 787 |
lemma hcomplex_number_of_def: "(number_of w :: hcomplex) == of_int w" |
20727 | 788 |
by transfer (rule number_of_eq [THEN eq_reflection]) |
15013 | 789 |
|
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
790 |
lemma hcomplex_of_hypreal_eq_hcomplex_of_complex: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
791 |
"hcomplex_of_hypreal (hypreal_of_real x) = |
15013 | 792 |
hcomplex_of_complex (complex_of_real x)" |
20727 | 793 |
by transfer (rule refl) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
794 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
795 |
lemma hcomplex_hypreal_number_of: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
796 |
"hcomplex_of_complex (number_of w) = hcomplex_of_hypreal(number_of w)" |
20727 | 797 |
by transfer (rule complex_number_of [symmetric]) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
798 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
799 |
text{*This theorem is necessary because theorems such as |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
800 |
@{text iszero_number_of_0} only hold for ordered rings. They cannot |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
801 |
be generalized to fields in general because they fail for finite fields. |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
802 |
They work for type complex because the reals can be embedded in them.*} |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
803 |
lemma iszero_hcomplex_number_of [simp]: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
804 |
"iszero (number_of w :: hcomplex) = iszero (number_of w :: real)" |
17373
27509e72f29e
removed duplicated lemmas; convert more proofs to transfer principle
huffman
parents:
17332
diff
changeset
|
805 |
by (transfer iszero_def, simp) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
806 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
807 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
808 |
(* |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
809 |
Goal "z + hcnj z = |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
810 |
hcomplex_of_hypreal (2 * hRe(z))" |
17300 | 811 |
by (res_inst_tac [("z","z")] eq_Abs_star 1); |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
812 |
by (auto_tac (claset(),HOL_ss addsimps [hRe,hcnj,star_n_add, |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
813 |
hypreal_mult,hcomplex_of_hypreal,complex_add_cnj])); |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
814 |
qed "star_n_add_hcnj"; |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
815 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
816 |
Goal "z - hcnj z = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
817 |
\ hcomplex_of_hypreal (hypreal_of_real #2 * hIm(z)) * iii"; |
17300 | 818 |
by (res_inst_tac [("z","z")] eq_Abs_star 1); |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
819 |
by (auto_tac (claset(),simpset() addsimps [hIm,hcnj,hcomplex_diff, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
820 |
hypreal_of_real_def,hypreal_mult,hcomplex_of_hypreal, |
17318
bc1c75855f3d
starfun, starset, and other functions on NS types are now polymorphic;
huffman
parents:
17300
diff
changeset
|
821 |
complex_diff_cnj,iii_def,star_n_mult])); |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
822 |
qed "hcomplex_diff_hcnj"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
823 |
*) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
824 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
825 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
826 |
(*** Real and imaginary stuff ***) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
827 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
828 |
(*Convert??? |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
829 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
830 |
"((number_of xa :: hcomplex) + iii * number_of ya = |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
831 |
number_of xb + iii * number_of yb) = |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
832 |
(((number_of xa :: hcomplex) = number_of xb) & |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
833 |
((number_of ya :: hcomplex) = number_of yb))" |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
834 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
835 |
hcomplex_hypreal_number_of])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
836 |
qed "hcomplex_number_of_eq_cancel_iff"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
837 |
Addsimps [hcomplex_number_of_eq_cancel_iff]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
838 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
839 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
840 |
"((number_of xa :: hcomplex) + number_of ya * iii = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
841 |
\ number_of xb + number_of yb * iii) = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
842 |
\ (((number_of xa :: hcomplex) = number_of xb) & \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
843 |
\ ((number_of ya :: hcomplex) = number_of yb))"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
844 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iffA, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
845 |
hcomplex_hypreal_number_of])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
846 |
qed "hcomplex_number_of_eq_cancel_iffA"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
847 |
Addsimps [hcomplex_number_of_eq_cancel_iffA]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
848 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
849 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
850 |
"((number_of xa :: hcomplex) + number_of ya * iii = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
851 |
\ number_of xb + iii * number_of yb) = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
852 |
\ (((number_of xa :: hcomplex) = number_of xb) & \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
853 |
\ ((number_of ya :: hcomplex) = number_of yb))"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
854 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iffB, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
855 |
hcomplex_hypreal_number_of])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
856 |
qed "hcomplex_number_of_eq_cancel_iffB"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
857 |
Addsimps [hcomplex_number_of_eq_cancel_iffB]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
858 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
859 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
860 |
"((number_of xa :: hcomplex) + iii * number_of ya = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
861 |
\ number_of xb + number_of yb * iii) = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
862 |
\ (((number_of xa :: hcomplex) = number_of xb) & \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
863 |
\ ((number_of ya :: hcomplex) = number_of yb))"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
864 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iffC, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
865 |
hcomplex_hypreal_number_of])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
866 |
qed "hcomplex_number_of_eq_cancel_iffC"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
867 |
Addsimps [hcomplex_number_of_eq_cancel_iffC]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
868 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
869 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
870 |
"((number_of xa :: hcomplex) + iii * number_of ya = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
871 |
\ number_of xb) = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
872 |
\ (((number_of xa :: hcomplex) = number_of xb) & \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
873 |
\ ((number_of ya :: hcomplex) = 0))"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
874 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff2, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
875 |
hcomplex_hypreal_number_of,hcomplex_of_hypreal_zero_iff])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
876 |
qed "hcomplex_number_of_eq_cancel_iff2"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
877 |
Addsimps [hcomplex_number_of_eq_cancel_iff2]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
878 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
879 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
880 |
"((number_of xa :: hcomplex) + number_of ya * iii = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
881 |
\ number_of xb) = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
882 |
\ (((number_of xa :: hcomplex) = number_of xb) & \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
883 |
\ ((number_of ya :: hcomplex) = 0))"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
884 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff2a, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
885 |
hcomplex_hypreal_number_of,hcomplex_of_hypreal_zero_iff])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
886 |
qed "hcomplex_number_of_eq_cancel_iff2a"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
887 |
Addsimps [hcomplex_number_of_eq_cancel_iff2a]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
888 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
889 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
890 |
"((number_of xa :: hcomplex) + iii * number_of ya = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
891 |
\ iii * number_of yb) = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
892 |
\ (((number_of xa :: hcomplex) = 0) & \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
893 |
\ ((number_of ya :: hcomplex) = number_of yb))"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
894 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff3, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
895 |
hcomplex_hypreal_number_of,hcomplex_of_hypreal_zero_iff])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
896 |
qed "hcomplex_number_of_eq_cancel_iff3"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
897 |
Addsimps [hcomplex_number_of_eq_cancel_iff3]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
898 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
899 |
Goalw [hcomplex_number_of_def] |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
900 |
"((number_of xa :: hcomplex) + number_of ya * iii= \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
901 |
\ iii * number_of yb) = \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
902 |
\ (((number_of xa :: hcomplex) = 0) & \ |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
903 |
\ ((number_of ya :: hcomplex) = number_of yb))"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
904 |
by (auto_tac (claset(), HOL_ss addsimps [hcomplex_eq_cancel_iff3a, |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
905 |
hcomplex_hypreal_number_of,hcomplex_of_hypreal_zero_iff])); |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
906 |
qed "hcomplex_number_of_eq_cancel_iff3a"; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
907 |
Addsimps [hcomplex_number_of_eq_cancel_iff3a]; |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
908 |
*) |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
909 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
910 |
lemma hcomplex_number_of_hcnj [simp]: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
911 |
"hcnj (number_of v :: hcomplex) = number_of v" |
20727 | 912 |
by transfer (rule complex_number_of_cnj) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
913 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
914 |
lemma hcomplex_number_of_hcmod [simp]: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
915 |
"hcmod(number_of v :: hcomplex) = abs (number_of v :: hypreal)" |
20727 | 916 |
by transfer (rule complex_number_of_cmod) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
917 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
918 |
lemma hcomplex_number_of_hRe [simp]: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
919 |
"hRe(number_of v :: hcomplex) = number_of v" |
20727 | 920 |
by transfer (rule complex_number_of_Re) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
921 |
|
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
922 |
lemma hcomplex_number_of_hIm [simp]: |
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
923 |
"hIm(number_of v :: hcomplex) = 0" |
20727 | 924 |
by transfer (rule complex_number_of_Im) |
14387
e96d5c42c4b0
Polymorphic treatment of binary arithmetic using axclasses
paulson
parents:
14377
diff
changeset
|
925 |
|
13957 | 926 |
end |