24 |
24 |
25 (*--- real and Imaginary parts ---*) |
25 (*--- real and Imaginary parts ---*) |
26 |
26 |
27 definition |
27 definition |
28 hRe :: "hcomplex => hypreal" where |
28 hRe :: "hcomplex => hypreal" where |
29 [code func del]: "hRe = *f* Re" |
29 [code del]: "hRe = *f* Re" |
30 |
30 |
31 definition |
31 definition |
32 hIm :: "hcomplex => hypreal" where |
32 hIm :: "hcomplex => hypreal" where |
33 [code func del]: "hIm = *f* Im" |
33 [code del]: "hIm = *f* Im" |
34 |
34 |
35 |
35 |
36 (*------ imaginary unit ----------*) |
36 (*------ imaginary unit ----------*) |
37 |
37 |
38 definition |
38 definition |
41 |
41 |
42 (*------- complex conjugate ------*) |
42 (*------- complex conjugate ------*) |
43 |
43 |
44 definition |
44 definition |
45 hcnj :: "hcomplex => hcomplex" where |
45 hcnj :: "hcomplex => hcomplex" where |
46 [code func del]: "hcnj = *f* cnj" |
46 [code del]: "hcnj = *f* cnj" |
47 |
47 |
48 (*------------ Argand -------------*) |
48 (*------------ Argand -------------*) |
49 |
49 |
50 definition |
50 definition |
51 hsgn :: "hcomplex => hcomplex" where |
51 hsgn :: "hcomplex => hcomplex" where |
52 [code func del]: "hsgn = *f* sgn" |
52 [code del]: "hsgn = *f* sgn" |
53 |
53 |
54 definition |
54 definition |
55 harg :: "hcomplex => hypreal" where |
55 harg :: "hcomplex => hypreal" where |
56 [code func del]: "harg = *f* arg" |
56 [code del]: "harg = *f* arg" |
57 |
57 |
58 definition |
58 definition |
59 (* abbreviation for (cos a + i sin a) *) |
59 (* abbreviation for (cos a + i sin a) *) |
60 hcis :: "hypreal => hcomplex" where |
60 hcis :: "hypreal => hcomplex" where |
61 [code func del]:"hcis = *f* cis" |
61 [code del]:"hcis = *f* cis" |
62 |
62 |
63 (*----- injection from hyperreals -----*) |
63 (*----- injection from hyperreals -----*) |
64 |
64 |
65 abbreviation |
65 abbreviation |
66 hcomplex_of_hypreal :: "hypreal \<Rightarrow> hcomplex" where |
66 hcomplex_of_hypreal :: "hypreal \<Rightarrow> hcomplex" where |
67 "hcomplex_of_hypreal \<equiv> of_hypreal" |
67 "hcomplex_of_hypreal \<equiv> of_hypreal" |
68 |
68 |
69 definition |
69 definition |
70 (* abbreviation for r*(cos a + i sin a) *) |
70 (* abbreviation for r*(cos a + i sin a) *) |
71 hrcis :: "[hypreal, hypreal] => hcomplex" where |
71 hrcis :: "[hypreal, hypreal] => hcomplex" where |
72 [code func del]: "hrcis = *f2* rcis" |
72 [code del]: "hrcis = *f2* rcis" |
73 |
73 |
74 (*------------ e ^ (x + iy) ------------*) |
74 (*------------ e ^ (x + iy) ------------*) |
75 definition |
75 definition |
76 hexpi :: "hcomplex => hcomplex" where |
76 hexpi :: "hcomplex => hcomplex" where |
77 [code func del]: "hexpi = *f* expi" |
77 [code del]: "hexpi = *f* expi" |
78 |
78 |
79 definition |
79 definition |
80 HComplex :: "[hypreal,hypreal] => hcomplex" where |
80 HComplex :: "[hypreal,hypreal] => hcomplex" where |
81 [code func del]: "HComplex = *f2* Complex" |
81 [code del]: "HComplex = *f2* Complex" |
82 |
82 |
83 lemmas hcomplex_defs [transfer_unfold] = |
83 lemmas hcomplex_defs [transfer_unfold] = |
84 hRe_def hIm_def iii_def hcnj_def hsgn_def harg_def hcis_def |
84 hRe_def hIm_def iii_def hcnj_def hsgn_def harg_def hcis_def |
85 hrcis_def hexpi_def HComplex_def |
85 hrcis_def hexpi_def HComplex_def |
86 |
86 |