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