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