src/HOL/Complex/Complex.thy
author paulson
Tue Feb 03 11:06:36 2004 +0100 (2004-02-03)
changeset 14373 67a628beb981
parent 14354 988aa4648597
child 14374 61de62096768
permissions -rw-r--r--
tidying of the complex numbers
paulson@13957
     1
(*  Title:       Complex.thy
paulson@13957
     2
    Author:      Jacques D. Fleuriot
paulson@13957
     3
    Copyright:   2001 University of Edinburgh
paulson@13957
     4
*)
paulson@13957
     5
paulson@14373
     6
header {* Complex numbers *}
paulson@14373
     7
paulson@14323
     8
theory Complex = HLog:
paulson@13957
     9
paulson@14373
    10
subsection {* Representation of complex numbers *}
paulson@14373
    11
paulson@14373
    12
datatype complex = Complex real real
paulson@13957
    13
paulson@14323
    14
instance complex :: zero ..
paulson@14323
    15
instance complex :: one ..
paulson@14323
    16
instance complex :: plus ..
paulson@14323
    17
instance complex :: times ..
paulson@14323
    18
instance complex :: minus ..
paulson@14323
    19
instance complex :: inverse ..
paulson@14323
    20
instance complex :: power ..
paulson@13957
    21
paulson@13957
    22
consts
paulson@14373
    23
  "ii"    :: complex    ("\<i>")
paulson@14373
    24
paulson@14373
    25
consts Re :: "complex => real"
paulson@14373
    26
primrec "Re (Complex x y) = x"
paulson@14373
    27
paulson@14373
    28
consts Im :: "complex => real"
paulson@14373
    29
primrec "Im (Complex x y) = y"
paulson@14373
    30
paulson@14373
    31
lemma complex_surj [simp]: "Complex (Re z) (Im z) = z"
paulson@14373
    32
  by (induct z) simp
paulson@13957
    33
paulson@13957
    34
constdefs
paulson@13957
    35
paulson@13957
    36
  (*----------- modulus ------------*)
paulson@13957
    37
paulson@14323
    38
  cmod :: "complex => real"
paulson@14323
    39
  "cmod z == sqrt(Re(z) ^ 2 + Im(z) ^ 2)"
paulson@13957
    40
paulson@14323
    41
  (*----- injection from reals -----*)
paulson@14323
    42
paulson@14323
    43
  complex_of_real :: "real => complex"
paulson@14373
    44
  "complex_of_real r == Complex r 0"
paulson@14323
    45
paulson@13957
    46
  (*------- complex conjugate ------*)
paulson@13957
    47
paulson@14323
    48
  cnj :: "complex => complex"
paulson@14373
    49
  "cnj z == Complex (Re z) (-Im z)"
paulson@13957
    50
paulson@14323
    51
  (*------------ Argand -------------*)
paulson@13957
    52
paulson@14323
    53
  sgn :: "complex => complex"
paulson@13957
    54
  "sgn z == z / complex_of_real(cmod z)"
paulson@13957
    55
paulson@14323
    56
  arg :: "complex => real"
paulson@14354
    57
  "arg z == @a. Re(sgn z) = cos a & Im(sgn z) = sin a & -pi < a & a \<le> pi"
paulson@14323
    58
paulson@13957
    59
paulson@14323
    60
defs (overloaded)
paulson@14323
    61
paulson@14323
    62
  complex_zero_def:
paulson@14373
    63
  "0 == Complex 0 0"
paulson@13957
    64
paulson@14323
    65
  complex_one_def:
paulson@14373
    66
  "1 == Complex 1 0"
paulson@14323
    67
paulson@14373
    68
  i_def: "ii == Complex 0 1"
paulson@14323
    69
paulson@14373
    70
  complex_minus_def: "- z == Complex (- Re z) (- Im z)"
paulson@14323
    71
paulson@14323
    72
  complex_inverse_def:
paulson@14373
    73
   "inverse z ==
paulson@14373
    74
    Complex (Re z / ((Re z)\<twosuperior> + (Im z)\<twosuperior>)) (- Im z / ((Re z)\<twosuperior> + (Im z)\<twosuperior>))"
paulson@13957
    75
paulson@14323
    76
  complex_add_def:
paulson@14373
    77
    "z + w == Complex (Re z + Re w) (Im z + Im w)"
paulson@13957
    78
paulson@14323
    79
  complex_diff_def:
paulson@14373
    80
    "z - w == z + - (w::complex)"
paulson@13957
    81
paulson@14373
    82
  complex_mult_def: 
paulson@14373
    83
    "z * w == Complex (Re z * Re w - Im z * Im w) (Re z * Im w + Im z * Re w)"
paulson@13957
    84
paulson@14373
    85
  complex_divide_def: "w / (z::complex) == w * inverse z"
paulson@14323
    86
paulson@13957
    87
paulson@13957
    88
constdefs
paulson@13957
    89
paulson@13957
    90
  (* abbreviation for (cos a + i sin a) *)
paulson@14323
    91
  cis :: "real => complex"
paulson@13957
    92
  "cis a == complex_of_real(cos a) + ii * complex_of_real(sin a)"
paulson@13957
    93
paulson@13957
    94
  (* abbreviation for r*(cos a + i sin a) *)
paulson@14323
    95
  rcis :: "[real, real] => complex"
paulson@13957
    96
  "rcis r a == complex_of_real r * cis a"
paulson@13957
    97
paulson@13957
    98
  (* e ^ (x + iy) *)
paulson@14323
    99
  expi :: "complex => complex"
paulson@13957
   100
  "expi z == complex_of_real(exp (Re z)) * cis (Im z)"
paulson@14323
   101
paulson@14323
   102
paulson@14373
   103
lemma complex_equality [intro?]: "Re z = Re w ==> Im z = Im w ==> z = w"
paulson@14373
   104
  by (induct z, induct w) simp
paulson@14323
   105
paulson@14373
   106
lemma Re: "Re(Complex x y) = x"
paulson@14373
   107
by simp
paulson@14323
   108
declare Re [simp]
paulson@14323
   109
paulson@14373
   110
lemma Im: "Im(Complex x y) = y"
paulson@14373
   111
by simp
paulson@14323
   112
declare Im [simp]
paulson@14323
   113
paulson@14323
   114
lemma complex_Re_Im_cancel_iff: "(w=z) = (Re(w) = Re(z) & Im(w) = Im(z))"
paulson@14373
   115
by (induct w, induct z, simp)
paulson@14323
   116
paulson@14323
   117
lemma complex_Re_zero: "Re 0 = 0"
paulson@14373
   118
by (simp add: complex_zero_def)
paulson@14323
   119
paulson@14323
   120
lemma complex_Im_zero: "Im 0 = 0"
paulson@14373
   121
by (simp add: complex_zero_def)
paulson@14323
   122
declare complex_Re_zero [simp] complex_Im_zero [simp]
paulson@14323
   123
paulson@14323
   124
lemma complex_Re_one: "Re 1 = 1"
paulson@14373
   125
by (simp add: complex_one_def)
paulson@14323
   126
declare complex_Re_one [simp]
paulson@14323
   127
paulson@14323
   128
lemma complex_Im_one: "Im 1 = 0"
paulson@14373
   129
by (simp add: complex_one_def)
paulson@14323
   130
declare complex_Im_one [simp]
paulson@14323
   131
paulson@14323
   132
lemma complex_Re_i: "Re(ii) = 0"
paulson@14373
   133
by (simp add: i_def)
paulson@14323
   134
declare complex_Re_i [simp]
paulson@14323
   135
paulson@14323
   136
lemma complex_Im_i: "Im(ii) = 1"
paulson@14373
   137
by (simp add: i_def)
paulson@14323
   138
declare complex_Im_i [simp]
paulson@14323
   139
paulson@14323
   140
lemma Re_complex_of_real_zero: "Re(complex_of_real 0) = 0"
paulson@14373
   141
by (simp add: complex_of_real_def)
paulson@14323
   142
declare Re_complex_of_real_zero [simp]
paulson@14323
   143
paulson@14323
   144
lemma Im_complex_of_real_zero: "Im(complex_of_real 0) = 0"
paulson@14373
   145
by (simp add: complex_of_real_def)
paulson@14323
   146
declare Im_complex_of_real_zero [simp]
paulson@14323
   147
paulson@14323
   148
lemma Re_complex_of_real_one: "Re(complex_of_real 1) = 1"
paulson@14373
   149
by (simp add: complex_of_real_def)
paulson@14323
   150
declare Re_complex_of_real_one [simp]
paulson@14323
   151
paulson@14323
   152
lemma Im_complex_of_real_one: "Im(complex_of_real 1) = 0"
paulson@14373
   153
by (simp add: complex_of_real_def)
paulson@14323
   154
declare Im_complex_of_real_one [simp]
paulson@14323
   155
paulson@14323
   156
lemma Re_complex_of_real: "Re(complex_of_real z) = z"
paulson@14373
   157
by (simp add: complex_of_real_def)
paulson@14323
   158
declare Re_complex_of_real [simp]
paulson@14323
   159
paulson@14323
   160
lemma Im_complex_of_real: "Im(complex_of_real z) = 0"
paulson@14373
   161
by (simp add: complex_of_real_def)
paulson@14323
   162
declare Im_complex_of_real [simp]
paulson@14323
   163
paulson@14323
   164
paulson@14323
   165
subsection{*Negation*}
paulson@14323
   166
paulson@14373
   167
lemma complex_minus: "- (Complex x y) = Complex (-x) (-y)"
paulson@14373
   168
by (simp add: complex_minus_def)
paulson@14323
   169
paulson@14323
   170
lemma complex_Re_minus: "Re (-z) = - Re z"
paulson@14373
   171
by (simp add: complex_minus_def)
paulson@14323
   172
paulson@14323
   173
lemma complex_Im_minus: "Im (-z) = - Im z"
paulson@14373
   174
by (simp add: complex_minus_def)
paulson@14323
   175
paulson@14323
   176
lemma complex_minus_zero: "-(0::complex) = 0"
paulson@14373
   177
by (simp add: complex_minus_def complex_zero_def)
paulson@14323
   178
declare complex_minus_zero [simp]
paulson@14323
   179
paulson@14323
   180
lemma complex_minus_zero_iff: "(-x = 0) = (x = (0::complex))"
paulson@14373
   181
by (induct x, simp add: complex_minus_def complex_zero_def)
paulson@14323
   182
declare complex_minus_zero_iff [simp]
paulson@14323
   183
paulson@14323
   184
paulson@14323
   185
subsection{*Addition*}
paulson@14323
   186
paulson@14373
   187
lemma complex_add: "Complex x1 y1 + Complex x2 y2 = Complex (x1+x2) (y1+y2)"
paulson@14373
   188
by (simp add: complex_add_def)
paulson@14323
   189
paulson@14323
   190
lemma complex_Re_add: "Re(x + y) = Re(x) + Re(y)"
paulson@14373
   191
by (simp add: complex_add_def)
paulson@14323
   192
paulson@14323
   193
lemma complex_Im_add: "Im(x + y) = Im(x) + Im(y)"
paulson@14373
   194
by (simp add: complex_add_def)
paulson@14323
   195
paulson@14323
   196
lemma complex_add_commute: "(u::complex) + v = v + u"
paulson@14373
   197
by (simp add: complex_add_def add_commute)
paulson@14323
   198
paulson@14323
   199
lemma complex_add_assoc: "((u::complex) + v) + w = u + (v + w)"
paulson@14373
   200
by (simp add: complex_add_def add_assoc)
paulson@14323
   201
paulson@14323
   202
lemma complex_add_zero_left: "(0::complex) + z = z"
paulson@14373
   203
by (simp add: complex_add_def complex_zero_def)
paulson@14323
   204
paulson@14323
   205
lemma complex_add_zero_right: "z + (0::complex) = z"
paulson@14373
   206
by (simp add: complex_add_def complex_zero_def)
paulson@14323
   207
paulson@14373
   208
lemma complex_add_minus_left: "-z + z = (0::complex)"
paulson@14373
   209
by (simp add: complex_add_def complex_minus_def complex_zero_def)
paulson@14323
   210
paulson@14323
   211
lemma complex_diff:
paulson@14373
   212
      "Complex x1 y1 - Complex x2 y2 = Complex (x1-x2) (y1-y2)"
paulson@14373
   213
by (simp add: complex_add_def complex_minus_def complex_diff_def)
paulson@14323
   214
paulson@14323
   215
subsection{*Multiplication*}
paulson@14323
   216
paulson@14323
   217
lemma complex_mult:
paulson@14373
   218
     "Complex x1 y1 * Complex x2 y2 = Complex (x1*x2 - y1*y2) (x1*y2 + y1*x2)"
paulson@14373
   219
by (simp add: complex_mult_def)
paulson@14323
   220
paulson@14323
   221
lemma complex_mult_commute: "(w::complex) * z = z * w"
paulson@14373
   222
by (simp add: complex_mult_def mult_commute add_commute)
paulson@14323
   223
paulson@14323
   224
lemma complex_mult_assoc: "((u::complex) * v) * w = u * (v * w)"
paulson@14373
   225
by (simp add: complex_mult_def mult_ac add_ac 
paulson@14373
   226
              right_diff_distrib right_distrib left_diff_distrib left_distrib)
paulson@14323
   227
paulson@14323
   228
lemma complex_mult_one_left: "(1::complex) * z = z"
paulson@14373
   229
by (simp add: complex_mult_def complex_one_def)
paulson@14323
   230
paulson@14323
   231
lemma complex_mult_one_right: "z * (1::complex) = z"
paulson@14373
   232
by (simp add: complex_mult_def complex_one_def)
paulson@14323
   233
paulson@14323
   234
paulson@14323
   235
subsection{*Inverse*}
paulson@14323
   236
paulson@14354
   237
lemma complex_inverse:
paulson@14373
   238
     "inverse (Complex x y) = Complex (x/(x ^ 2 + y ^ 2)) (-y/(x ^ 2 + y ^ 2))"
paulson@14373
   239
by (simp add: complex_inverse_def)
paulson@14335
   240
paulson@14354
   241
lemma complex_mult_inv_left: "z \<noteq> (0::complex) ==> inverse(z) * z = 1"
paulson@14373
   242
apply (induct z) 
paulson@14373
   243
apply (rename_tac x y) 
paulson@14334
   244
apply (auto simp add: complex_mult complex_inverse complex_one_def 
paulson@14353
   245
       complex_zero_def add_divide_distrib [symmetric] power2_eq_square mult_ac)
paulson@14334
   246
apply (drule_tac y = y in real_sum_squares_not_zero)
paulson@14334
   247
apply (drule_tac [2] x = x in real_sum_squares_not_zero2, auto)
paulson@14323
   248
done
paulson@14323
   249
paulson@14335
   250
paulson@14335
   251
subsection {* The field of complex numbers *}
paulson@14335
   252
paulson@14335
   253
instance complex :: field
paulson@14335
   254
proof
paulson@14335
   255
  fix z u v w :: complex
paulson@14335
   256
  show "(u + v) + w = u + (v + w)"
paulson@14335
   257
    by (rule complex_add_assoc) 
paulson@14335
   258
  show "z + w = w + z"
paulson@14335
   259
    by (rule complex_add_commute) 
paulson@14335
   260
  show "0 + z = z"
paulson@14335
   261
    by (rule complex_add_zero_left) 
paulson@14335
   262
  show "-z + z = 0"
paulson@14341
   263
    by (rule complex_add_minus_left) 
paulson@14335
   264
  show "z - w = z + -w"
paulson@14335
   265
    by (simp add: complex_diff_def)
paulson@14335
   266
  show "(u * v) * w = u * (v * w)"
paulson@14335
   267
    by (rule complex_mult_assoc) 
paulson@14335
   268
  show "z * w = w * z"
paulson@14335
   269
    by (rule complex_mult_commute) 
paulson@14335
   270
  show "1 * z = z"
paulson@14335
   271
    by (rule complex_mult_one_left) 
paulson@14341
   272
  show "0 \<noteq> (1::complex)"
paulson@14373
   273
    by (simp add: complex_zero_def complex_one_def)
paulson@14335
   274
  show "(u + v) * w = u * w + v * w"
paulson@14373
   275
    by (simp add: complex_mult_def complex_add_def left_distrib real_diff_def add_ac)
paulson@14341
   276
  show "z+u = z+v ==> u=v"
paulson@14341
   277
    proof -
paulson@14341
   278
      assume eq: "z+u = z+v" 
paulson@14341
   279
      hence "(-z + z) + u = (-z + z) + v" by (simp only: eq complex_add_assoc)
paulson@14373
   280
      thus "u = v" by (simp add: complex_add_minus_left complex_add_zero_left)
paulson@14341
   281
    qed
paulson@14335
   282
  assume neq: "w \<noteq> 0"
paulson@14335
   283
  thus "z / w = z * inverse w"
paulson@14335
   284
    by (simp add: complex_divide_def)
paulson@14335
   285
  show "inverse w * w = 1"
paulson@14335
   286
    by (simp add: neq complex_mult_inv_left) 
paulson@14335
   287
qed
paulson@14335
   288
paulson@14373
   289
instance complex :: division_by_zero
paulson@14373
   290
proof
paulson@14373
   291
  show inv: "inverse 0 = (0::complex)"
paulson@14373
   292
    by (simp add: complex_inverse_def complex_zero_def)
paulson@14373
   293
  fix x :: complex
paulson@14373
   294
  show "x/0 = 0" 
paulson@14373
   295
    by (simp add: complex_divide_def inv)
paulson@14373
   296
qed
paulson@14335
   297
paulson@14323
   298
paulson@14323
   299
subsection{*Embedding Properties for @{term complex_of_real} Map*}
paulson@14323
   300
paulson@14373
   301
lemma complex_of_real_one: "complex_of_real 1 = 1"
paulson@14373
   302
by (simp add: complex_one_def complex_of_real_def)
paulson@14323
   303
declare complex_of_real_one [simp]
paulson@14323
   304
paulson@14373
   305
lemma complex_of_real_zero: "complex_of_real 0 = 0"
paulson@14373
   306
by (simp add: complex_zero_def complex_of_real_def)
paulson@14323
   307
declare complex_of_real_zero [simp]
paulson@14323
   308
paulson@14348
   309
lemma complex_of_real_eq_iff:
paulson@14348
   310
     "(complex_of_real x = complex_of_real y) = (x = y)"
paulson@14373
   311
by (simp add: complex_of_real_def) 
paulson@14323
   312
declare complex_of_real_eq_iff [iff]
paulson@14323
   313
paulson@14323
   314
lemma complex_of_real_minus: "complex_of_real(-x) = - complex_of_real x"
paulson@14373
   315
by (simp add: complex_of_real_def complex_minus)
paulson@14323
   316
paulson@14348
   317
lemma complex_of_real_inverse:
paulson@14348
   318
 "complex_of_real(inverse x) = inverse(complex_of_real x)"
paulson@14348
   319
apply (case_tac "x=0", simp)
paulson@14334
   320
apply (simp add: complex_inverse complex_of_real_def real_divide_def 
paulson@14353
   321
                 inverse_mult_distrib power2_eq_square)
paulson@14323
   322
done
paulson@14323
   323
paulson@14348
   324
lemma complex_of_real_add:
paulson@14373
   325
     "complex_of_real x + complex_of_real y = complex_of_real (x + y)"
paulson@14373
   326
by (simp add: complex_add complex_of_real_def)
paulson@14323
   327
paulson@14348
   328
lemma complex_of_real_diff:
paulson@14373
   329
     "complex_of_real x - complex_of_real y = complex_of_real (x - y)"
paulson@14373
   330
by (simp add: complex_of_real_minus [symmetric] complex_diff_def complex_of_real_add)
paulson@14323
   331
paulson@14348
   332
lemma complex_of_real_mult:
paulson@14373
   333
     "complex_of_real x * complex_of_real y = complex_of_real (x * y)"
paulson@14373
   334
by (simp add: complex_mult complex_of_real_def)
paulson@14323
   335
paulson@14323
   336
lemma complex_of_real_divide:
paulson@14323
   337
      "complex_of_real x / complex_of_real y = complex_of_real(x/y)"
paulson@14373
   338
apply (simp add: complex_divide_def)
paulson@14373
   339
apply (case_tac "y=0", simp)
paulson@14373
   340
apply (simp add: complex_of_real_mult [symmetric] complex_of_real_inverse real_divide_def)
paulson@14323
   341
done
paulson@14323
   342
paulson@14373
   343
lemma complex_mod: "cmod (Complex x y) = sqrt(x ^ 2 + y ^ 2)"
paulson@14373
   344
by (simp add: cmod_def)
paulson@14323
   345
paulson@14323
   346
lemma complex_mod_zero: "cmod(0) = 0"
paulson@14373
   347
by (simp add: cmod_def)
paulson@14323
   348
declare complex_mod_zero [simp]
paulson@14323
   349
paulson@14348
   350
lemma complex_mod_one [simp]: "cmod(1) = 1"
paulson@14353
   351
by (simp add: cmod_def power2_eq_square)
paulson@14323
   352
paulson@14323
   353
lemma complex_mod_complex_of_real: "cmod(complex_of_real x) = abs x"
paulson@14373
   354
by (simp add: complex_of_real_def power2_eq_square complex_mod)
paulson@14323
   355
declare complex_mod_complex_of_real [simp]
paulson@14323
   356
paulson@14348
   357
lemma complex_of_real_abs:
paulson@14348
   358
     "complex_of_real (abs x) = complex_of_real(cmod(complex_of_real x))"
paulson@14373
   359
by simp
paulson@14348
   360
paulson@14323
   361
paulson@14323
   362
paulson@14323
   363
subsection{*Conjugation is an Automorphism*}
paulson@14323
   364
paulson@14373
   365
lemma complex_cnj: "cnj (Complex x y) = Complex x (-y)"
paulson@14373
   366
by (simp add: cnj_def)
paulson@14323
   367
paulson@14323
   368
lemma complex_cnj_cancel_iff: "(cnj x = cnj y) = (x = y)"
paulson@14373
   369
by (simp add: cnj_def complex_Re_Im_cancel_iff)
paulson@14323
   370
declare complex_cnj_cancel_iff [simp]
paulson@14323
   371
paulson@14323
   372
lemma complex_cnj_cnj: "cnj (cnj z) = z"
paulson@14373
   373
by (simp add: cnj_def)
paulson@14323
   374
declare complex_cnj_cnj [simp]
paulson@14323
   375
paulson@14348
   376
lemma complex_cnj_complex_of_real:
paulson@14373
   377
     "cnj (complex_of_real x) = complex_of_real x"
paulson@14373
   378
by (simp add: complex_of_real_def complex_cnj)
paulson@14323
   379
declare complex_cnj_complex_of_real [simp]
paulson@14323
   380
paulson@14323
   381
lemma complex_mod_cnj: "cmod (cnj z) = cmod z"
paulson@14373
   382
by (induct z, simp add: complex_cnj complex_mod power2_eq_square)
paulson@14323
   383
declare complex_mod_cnj [simp]
paulson@14323
   384
paulson@14323
   385
lemma complex_cnj_minus: "cnj (-z) = - cnj z"
paulson@14373
   386
by (simp add: cnj_def complex_minus complex_Re_minus complex_Im_minus)
paulson@14323
   387
paulson@14323
   388
lemma complex_cnj_inverse: "cnj(inverse z) = inverse(cnj z)"
paulson@14373
   389
by (induct z, simp add: complex_cnj complex_inverse power2_eq_square)
paulson@14323
   390
paulson@14323
   391
lemma complex_cnj_add: "cnj(w + z) = cnj(w) + cnj(z)"
paulson@14373
   392
by (induct w, induct z, simp add: complex_cnj complex_add)
paulson@14323
   393
paulson@14323
   394
lemma complex_cnj_diff: "cnj(w - z) = cnj(w) - cnj(z)"
paulson@14373
   395
by (simp add: complex_diff_def complex_cnj_add complex_cnj_minus)
paulson@14323
   396
paulson@14323
   397
lemma complex_cnj_mult: "cnj(w * z) = cnj(w) * cnj(z)"
paulson@14373
   398
by (induct w, induct z, simp add: complex_cnj complex_mult)
paulson@14323
   399
paulson@14323
   400
lemma complex_cnj_divide: "cnj(w / z) = (cnj w)/(cnj z)"
paulson@14373
   401
by (simp add: complex_divide_def complex_cnj_mult complex_cnj_inverse)
paulson@14323
   402
paulson@14323
   403
lemma complex_cnj_one: "cnj 1 = 1"
paulson@14373
   404
by (simp add: cnj_def complex_one_def)
paulson@14323
   405
declare complex_cnj_one [simp]
paulson@14323
   406
paulson@14323
   407
lemma complex_add_cnj: "z + cnj z = complex_of_real (2 * Re(z))"
paulson@14373
   408
by (induct z, simp add: complex_add complex_cnj complex_of_real_def)
paulson@14323
   409
paulson@14323
   410
lemma complex_diff_cnj: "z - cnj z = complex_of_real (2 * Im(z)) * ii"
paulson@14373
   411
apply (induct z)
paulson@14354
   412
apply (simp add: complex_add complex_cnj complex_of_real_def complex_diff_def 
paulson@14354
   413
                 complex_minus i_def complex_mult)
paulson@14323
   414
done
paulson@14323
   415
paulson@14354
   416
lemma complex_cnj_zero [simp]: "cnj 0 = 0"
paulson@14334
   417
by (simp add: cnj_def complex_zero_def)
paulson@14323
   418
paulson@14323
   419
lemma complex_cnj_zero_iff: "(cnj z = 0) = (z = 0)"
paulson@14373
   420
by (induct z, simp add: complex_zero_def complex_cnj)
paulson@14323
   421
declare complex_cnj_zero_iff [iff]
paulson@14323
   422
paulson@14323
   423
lemma complex_mult_cnj: "z * cnj z = complex_of_real (Re(z) ^ 2 + Im(z) ^ 2)"
paulson@14373
   424
by (induct z, simp add: complex_cnj complex_mult complex_of_real_def power2_eq_square)
paulson@14323
   425
paulson@14323
   426
paulson@14323
   427
subsection{*Algebra*}
paulson@14323
   428
paulson@14323
   429
lemma complex_add_left_cancel_zero: "(x + y = x) = (y = (0::complex))"
paulson@14373
   430
by (induct x, induct y, simp add: complex_zero_def complex_add)
paulson@14323
   431
declare complex_add_left_cancel_zero [simp]
paulson@14323
   432
paulson@14373
   433
lemma complex_diff_mult_distrib: "((z1::complex) - z2) * w = (z1 * w) - (z2 * w)"
paulson@14373
   434
by (simp add: complex_diff_def left_distrib)
paulson@14323
   435
paulson@14373
   436
lemma complex_diff_mult_distrib2: "(w::complex) * (z1 - z2) = (w * z1) - (w * z2)"
paulson@14373
   437
by (simp add: complex_diff_def right_distrib)
paulson@14323
   438
paulson@14323
   439
paulson@14323
   440
subsection{*Modulus*}
paulson@14323
   441
paulson@14323
   442
lemma complex_mod_eq_zero_cancel: "(cmod x = 0) = (x = 0)"
paulson@14373
   443
apply (induct x)
paulson@14373
   444
apply (auto intro: real_sum_squares_cancel real_sum_squares_cancel2 
paulson@14373
   445
            simp add: complex_mod complex_zero_def power2_eq_square)
paulson@14323
   446
done
paulson@14323
   447
declare complex_mod_eq_zero_cancel [simp]
paulson@14323
   448
paulson@14373
   449
lemma complex_mod_complex_of_real_of_nat:
paulson@14373
   450
     "cmod (complex_of_real(real (n::nat))) = real n"
paulson@14373
   451
by simp
paulson@14323
   452
declare complex_mod_complex_of_real_of_nat [simp]
paulson@14323
   453
paulson@14323
   454
lemma complex_mod_minus: "cmod (-x) = cmod(x)"
paulson@14373
   455
by (induct x, simp add: complex_mod complex_minus power2_eq_square)
paulson@14323
   456
declare complex_mod_minus [simp]
paulson@14323
   457
paulson@14323
   458
lemma complex_mod_mult_cnj: "cmod(z * cnj(z)) = cmod(z) ^ 2"
paulson@14373
   459
apply (induct z, simp add: complex_mod complex_cnj complex_mult)
paulson@14373
   460
apply (simp add: power2_eq_square real_abs_def)
paulson@14323
   461
done
paulson@14323
   462
paulson@14373
   463
lemma complex_mod_squared: "cmod(Complex x y) ^ 2 = x ^ 2 + y ^ 2"
paulson@14373
   464
by (simp add: cmod_def)
paulson@14323
   465
paulson@14354
   466
lemma complex_mod_ge_zero: "0 \<le> cmod x"
paulson@14373
   467
by (simp add: cmod_def)
paulson@14323
   468
declare complex_mod_ge_zero [simp]
paulson@14323
   469
paulson@14323
   470
lemma abs_cmod_cancel: "abs(cmod x) = cmod x"
paulson@14373
   471
by (simp add: abs_if linorder_not_less) 
paulson@14323
   472
declare abs_cmod_cancel [simp]
paulson@14323
   473
paulson@14323
   474
lemma complex_mod_mult: "cmod(x*y) = cmod(x) * cmod(y)"
paulson@14373
   475
apply (induct x, induct y)
paulson@14323
   476
apply (auto simp add: complex_mult complex_mod real_sqrt_mult_distrib2 [symmetric] simp del: realpow_Suc)
paulson@14348
   477
apply (rule_tac n = 1 in power_inject_base)
paulson@14353
   478
apply (auto simp add: power2_eq_square [symmetric] simp del: realpow_Suc)
paulson@14353
   479
apply (auto simp add: real_diff_def power2_eq_square right_distrib left_distrib add_ac mult_ac)
paulson@14323
   480
done
paulson@14323
   481
paulson@14323
   482
lemma complex_mod_add_squared_eq: "cmod(x + y) ^ 2 = cmod(x) ^ 2 + cmod(y) ^ 2 + 2 * Re(x * cnj y)"
paulson@14373
   483
apply (induct x, induct y)
paulson@14323
   484
apply (auto simp add: complex_add complex_mod_squared complex_mult complex_cnj real_diff_def simp del: realpow_Suc)
paulson@14353
   485
apply (auto simp add: right_distrib left_distrib power2_eq_square mult_ac add_ac)
paulson@14323
   486
done
paulson@14323
   487
paulson@14354
   488
lemma complex_Re_mult_cnj_le_cmod: "Re(x * cnj y) \<le> cmod(x * cnj y)"
paulson@14373
   489
apply (induct x, induct y)
paulson@14323
   490
apply (auto simp add: complex_mod complex_mult complex_cnj real_diff_def simp del: realpow_Suc)
paulson@14323
   491
done
paulson@14323
   492
declare complex_Re_mult_cnj_le_cmod [simp]
paulson@14323
   493
paulson@14354
   494
lemma complex_Re_mult_cnj_le_cmod2: "Re(x * cnj y) \<le> cmod(x * y)"
paulson@14373
   495
by (insert complex_Re_mult_cnj_le_cmod [of x y], simp add: complex_mod_mult)
paulson@14323
   496
declare complex_Re_mult_cnj_le_cmod2 [simp]
paulson@14323
   497
paulson@14323
   498
lemma real_sum_squared_expand: "((x::real) + y) ^ 2 = x ^ 2 + y ^ 2 + 2 * x * y"
paulson@14373
   499
by (simp add: left_distrib right_distrib power2_eq_square)
paulson@14323
   500
paulson@14354
   501
lemma complex_mod_triangle_squared: "cmod (x + y) ^ 2 \<le> (cmod(x) + cmod(y)) ^ 2"
paulson@14373
   502
by (simp add: real_sum_squared_expand complex_mod_add_squared_eq real_mult_assoc complex_mod_mult [symmetric])
paulson@14323
   503
declare complex_mod_triangle_squared [simp]
paulson@14323
   504
paulson@14354
   505
lemma complex_mod_minus_le_complex_mod: "- cmod x \<le> cmod x"
paulson@14373
   506
by (rule order_trans [OF _ complex_mod_ge_zero], simp)
paulson@14323
   507
declare complex_mod_minus_le_complex_mod [simp]
paulson@14323
   508
paulson@14354
   509
lemma complex_mod_triangle_ineq: "cmod (x + y) \<le> cmod(x) + cmod(y)"
paulson@14334
   510
apply (rule_tac n = 1 in realpow_increasing)
paulson@14323
   511
apply (auto intro:  order_trans [OF _ complex_mod_ge_zero]
paulson@14353
   512
            simp add: power2_eq_square [symmetric])
paulson@14323
   513
done
paulson@14323
   514
declare complex_mod_triangle_ineq [simp]
paulson@14323
   515
paulson@14354
   516
lemma complex_mod_triangle_ineq2: "cmod(b + a) - cmod b \<le> cmod a"
paulson@14373
   517
by (insert complex_mod_triangle_ineq [THEN add_right_mono, of b a"-cmod b"], simp)
paulson@14323
   518
declare complex_mod_triangle_ineq2 [simp]
paulson@14323
   519
paulson@14323
   520
lemma complex_mod_diff_commute: "cmod (x - y) = cmod (y - x)"
paulson@14373
   521
apply (induct x, induct y)
paulson@14353
   522
apply (auto simp add: complex_diff complex_mod right_diff_distrib power2_eq_square left_diff_distrib add_ac mult_ac)
paulson@14323
   523
done
paulson@14323
   524
paulson@14323
   525
lemma complex_mod_add_less: "[| cmod x < r; cmod y < s |] ==> cmod (x + y) < r + s"
paulson@14334
   526
by (auto intro: order_le_less_trans complex_mod_triangle_ineq)
paulson@14323
   527
paulson@14323
   528
lemma complex_mod_mult_less: "[| cmod x < r; cmod y < s |] ==> cmod (x * y) < r * s"
paulson@14334
   529
by (auto intro: real_mult_less_mono' simp add: complex_mod_mult)
paulson@14323
   530
paulson@14354
   531
lemma complex_mod_diff_ineq: "cmod(a) - cmod(b) \<le> cmod(a + b)"
paulson@14323
   532
apply (rule linorder_cases [of "cmod(a)" "cmod (b)"])
paulson@14323
   533
apply auto
paulson@14334
   534
apply (rule order_trans [of _ 0], rule order_less_imp_le)
paulson@14334
   535
apply (simp add: compare_rls, simp)  
paulson@14323
   536
apply (simp add: compare_rls)
paulson@14323
   537
apply (rule complex_mod_minus [THEN subst])
paulson@14323
   538
apply (rule order_trans)
paulson@14323
   539
apply (rule_tac [2] complex_mod_triangle_ineq)
paulson@14373
   540
apply (auto simp add: add_ac)
paulson@14323
   541
done
paulson@14323
   542
declare complex_mod_diff_ineq [simp]
paulson@14323
   543
paulson@14354
   544
lemma complex_Re_le_cmod: "Re z \<le> cmod z"
paulson@14373
   545
by (induct z, simp add: complex_mod del: realpow_Suc)
paulson@14323
   546
declare complex_Re_le_cmod [simp]
paulson@14323
   547
paulson@14354
   548
lemma complex_mod_gt_zero: "z \<noteq> 0 ==> 0 < cmod z"
paulson@14373
   549
apply (insert complex_mod_ge_zero [of z])
paulson@14334
   550
apply (drule order_le_imp_less_or_eq, auto)
paulson@14323
   551
done
paulson@14323
   552
paulson@14323
   553
paulson@14323
   554
subsection{*A Few More Theorems*}
paulson@14323
   555
paulson@14323
   556
lemma complex_mod_inverse: "cmod(inverse x) = inverse(cmod x)"
paulson@14373
   557
apply (case_tac "x=0", simp)
paulson@14323
   558
apply (rule_tac c1 = "cmod x" in real_mult_left_cancel [THEN iffD1])
paulson@14323
   559
apply (auto simp add: complex_mod_mult [symmetric])
paulson@14323
   560
done
paulson@14323
   561
paulson@14373
   562
lemma complex_mod_divide: "cmod(x/y) = cmod(x)/(cmod y)"
paulson@14373
   563
by (simp add: complex_divide_def real_divide_def, simp add: complex_mod_mult complex_mod_inverse)
paulson@14323
   564
paulson@14373
   565
lemma complex_inverse_divide: "inverse(x/y) = y/(x::complex)"
paulson@14373
   566
by (simp add: complex_divide_def inverse_mult_distrib mult_commute)
paulson@14323
   567
declare complex_inverse_divide [simp]
paulson@14323
   568
paulson@14354
   569
paulson@14354
   570
subsection{*Exponentiation*}
paulson@14354
   571
paulson@14354
   572
primrec
paulson@14354
   573
     complexpow_0:   "z ^ 0       = 1"
paulson@14354
   574
     complexpow_Suc: "z ^ (Suc n) = (z::complex) * (z ^ n)"
paulson@14354
   575
paulson@14354
   576
paulson@14354
   577
instance complex :: ringpower
paulson@14354
   578
proof
paulson@14354
   579
  fix z :: complex
paulson@14354
   580
  fix n :: nat
paulson@14354
   581
  show "z^0 = 1" by simp
paulson@14354
   582
  show "z^(Suc n) = z * (z^n)" by simp
paulson@14354
   583
qed
paulson@14323
   584
paulson@14323
   585
paulson@14354
   586
lemma complex_of_real_pow: "complex_of_real (x ^ n) = (complex_of_real x) ^ n"
paulson@14323
   587
apply (induct_tac "n")
paulson@14354
   588
apply (auto simp add: complex_of_real_mult [symmetric])
paulson@14323
   589
done
paulson@14323
   590
paulson@14354
   591
lemma complex_cnj_pow: "cnj(z ^ n) = cnj(z) ^ n"
paulson@14323
   592
apply (induct_tac "n")
paulson@14354
   593
apply (auto simp add: complex_cnj_mult)
paulson@14323
   594
done
paulson@14323
   595
paulson@14354
   596
lemma complex_mod_complexpow: "cmod(x ^ n) = cmod(x) ^ n"
paulson@14354
   597
apply (induct_tac "n")
paulson@14354
   598
apply (auto simp add: complex_mod_mult)
paulson@14354
   599
done
paulson@14354
   600
paulson@14354
   601
lemma complexpow_minus: "(-x::complex) ^ n = (if even n then (x ^ n) else -(x ^ n))"
paulson@14354
   602
by (induct_tac "n", auto)
paulson@14354
   603
paulson@14354
   604
lemma complexpow_i_squared [simp]: "ii ^ 2 = -(1::complex)"
paulson@14354
   605
by (simp add: i_def complex_mult complex_one_def complex_minus numeral_2_eq_2)
paulson@14354
   606
paulson@14354
   607
lemma complex_i_not_zero [simp]: "ii \<noteq> 0"
paulson@14373
   608
by (simp add: i_def complex_zero_def)
paulson@14354
   609
paulson@14354
   610
paulson@14354
   611
subsection{*The Function @{term sgn}*}
paulson@14323
   612
paulson@14323
   613
lemma sgn_zero: "sgn 0 = 0"
paulson@14373
   614
by (simp add: sgn_def)
paulson@14323
   615
declare sgn_zero [simp]
paulson@14323
   616
paulson@14323
   617
lemma sgn_one: "sgn 1 = 1"
paulson@14373
   618
by (simp add: sgn_def)
paulson@14323
   619
declare sgn_one [simp]
paulson@14323
   620
paulson@14323
   621
lemma sgn_minus: "sgn (-z) = - sgn(z)"
paulson@14373
   622
by (simp add: sgn_def)
paulson@14323
   623
paulson@14323
   624
lemma sgn_eq:
paulson@14323
   625
    "sgn z = z / complex_of_real (cmod z)"
paulson@14373
   626
apply (simp add: sgn_def)
paulson@14323
   627
done
paulson@14323
   628
paulson@14354
   629
lemma complex_split: "\<exists>x y. z = complex_of_real(x) + ii * complex_of_real(y)"
paulson@14373
   630
apply (induct z)
paulson@14323
   631
apply (auto simp add: complex_of_real_def i_def complex_mult complex_add)
paulson@14323
   632
done
paulson@14323
   633
paulson@14323
   634
lemma Re_complex_i: "Re(complex_of_real(x) + ii * complex_of_real(y)) = x"
paulson@14334
   635
by (auto simp add: complex_of_real_def i_def complex_mult complex_add)
paulson@14323
   636
declare Re_complex_i [simp]
paulson@14323
   637
paulson@14323
   638
lemma Im_complex_i: "Im(complex_of_real(x) + ii * complex_of_real(y)) = y"
paulson@14334
   639
by (auto simp add: complex_of_real_def i_def complex_mult complex_add)
paulson@14323
   640
declare Im_complex_i [simp]
paulson@14323
   641
paulson@14323
   642
lemma i_mult_eq: "ii * ii = complex_of_real (-1)"
paulson@14373
   643
by (simp add: i_def complex_of_real_def complex_mult complex_add)
paulson@14323
   644
paulson@14323
   645
lemma i_mult_eq2: "ii * ii = -(1::complex)"
paulson@14373
   646
by (simp add: i_def complex_one_def complex_mult complex_minus)
paulson@14323
   647
declare i_mult_eq2 [simp]
paulson@14323
   648
paulson@14323
   649
lemma cmod_i: "cmod (complex_of_real(x) + ii * complex_of_real(y)) =
paulson@14323
   650
      sqrt (x ^ 2 + y ^ 2)"
paulson@14373
   651
by (simp add: complex_mult complex_add i_def complex_of_real_def cmod_def)
paulson@14323
   652
paulson@14323
   653
lemma complex_eq_Re_eq:
paulson@14323
   654
     "complex_of_real xa + ii * complex_of_real ya =
paulson@14323
   655
      complex_of_real xb + ii * complex_of_real yb
paulson@14323
   656
       ==> xa = xb"
paulson@14373
   657
by (simp add: complex_of_real_def i_def complex_mult complex_add)
paulson@14323
   658
paulson@14323
   659
lemma complex_eq_Im_eq:
paulson@14323
   660
     "complex_of_real xa + ii * complex_of_real ya =
paulson@14323
   661
      complex_of_real xb + ii * complex_of_real yb
paulson@14323
   662
       ==> ya = yb"
paulson@14373
   663
by (simp add: complex_of_real_def i_def complex_mult complex_add)
paulson@14323
   664
paulson@14323
   665
lemma complex_eq_cancel_iff: "(complex_of_real xa + ii * complex_of_real ya =
paulson@14323
   666
       complex_of_real xb + ii * complex_of_real yb) = ((xa = xb) & (ya = yb))"
paulson@14373
   667
by (auto intro: complex_eq_Im_eq complex_eq_Re_eq)
paulson@14323
   668
declare complex_eq_cancel_iff [iff]
paulson@14323
   669
paulson@14323
   670
lemma complex_eq_cancel_iffA: "(complex_of_real xa + complex_of_real ya * ii =
paulson@14373
   671
       complex_of_real xb + complex_of_real yb * ii) = ((xa = xb) & (ya = yb))"
paulson@14373
   672
by (simp add: mult_commute)
paulson@14323
   673
declare complex_eq_cancel_iffA [iff]
paulson@14323
   674
paulson@14323
   675
lemma complex_eq_cancel_iffB: "(complex_of_real xa + complex_of_real ya * ii =
paulson@14323
   676
       complex_of_real xb + ii * complex_of_real yb) = ((xa = xb) & (ya = yb))"
paulson@14373
   677
by (auto simp add: mult_commute)
paulson@14323
   678
declare complex_eq_cancel_iffB [iff]
paulson@14323
   679
paulson@14323
   680
lemma complex_eq_cancel_iffC: "(complex_of_real xa + ii * complex_of_real ya  =
paulson@14323
   681
       complex_of_real xb + complex_of_real yb * ii) = ((xa = xb) & (ya = yb))"
paulson@14373
   682
by (auto simp add: mult_commute)
paulson@14323
   683
declare complex_eq_cancel_iffC [iff]
paulson@14323
   684
paulson@14323
   685
lemma complex_eq_cancel_iff2: "(complex_of_real x + ii * complex_of_real y =
paulson@14323
   686
      complex_of_real xa) = (x = xa & y = 0)"
paulson@14334
   687
apply (cut_tac xa = x and ya = y and xb = xa and yb = 0 in complex_eq_cancel_iff)
paulson@14323
   688
apply (simp del: complex_eq_cancel_iff)
paulson@14323
   689
done
paulson@14323
   690
declare complex_eq_cancel_iff2 [simp]
paulson@14323
   691
paulson@14323
   692
lemma complex_eq_cancel_iff2a: "(complex_of_real x + complex_of_real y * ii =
paulson@14323
   693
      complex_of_real xa) = (x = xa & y = 0)"
paulson@14373
   694
by (auto simp add: mult_commute)
paulson@14323
   695
declare complex_eq_cancel_iff2a [simp]
paulson@14323
   696
paulson@14323
   697
lemma complex_eq_cancel_iff3: "(complex_of_real x + ii * complex_of_real y =
paulson@14323
   698
      ii * complex_of_real ya) = (x = 0 & y = ya)"
paulson@14334
   699
apply (cut_tac xa = x and ya = y and xb = 0 and yb = ya in complex_eq_cancel_iff)
paulson@14323
   700
apply (simp del: complex_eq_cancel_iff)
paulson@14323
   701
done
paulson@14323
   702
declare complex_eq_cancel_iff3 [simp]
paulson@14323
   703
paulson@14323
   704
lemma complex_eq_cancel_iff3a: "(complex_of_real x + complex_of_real y * ii =
paulson@14323
   705
      ii * complex_of_real ya) = (x = 0 & y = ya)"
paulson@14373
   706
by (auto simp add: mult_commute)
paulson@14323
   707
declare complex_eq_cancel_iff3a [simp]
paulson@14323
   708
paulson@14323
   709
lemma complex_split_Re_zero:
paulson@14323
   710
     "complex_of_real x + ii * complex_of_real y = 0
paulson@14323
   711
      ==> x = 0"
paulson@14373
   712
by (simp add: complex_of_real_def i_def complex_zero_def complex_mult complex_add)
paulson@14323
   713
paulson@14323
   714
lemma complex_split_Im_zero:
paulson@14323
   715
     "complex_of_real x + ii * complex_of_real y = 0
paulson@14323
   716
      ==> y = 0"
paulson@14373
   717
by (simp add: complex_of_real_def i_def complex_zero_def complex_mult complex_add)
paulson@14323
   718
paulson@14373
   719
lemma Re_sgn: "Re(sgn z) = Re(z)/cmod z"
paulson@14373
   720
apply (induct z)
paulson@14373
   721
apply (simp add: sgn_def complex_divide_def complex_of_real_inverse [symmetric])
paulson@14373
   722
apply (simp add: complex_of_real_def complex_mult real_divide_def)
paulson@14323
   723
done
paulson@14323
   724
declare Re_sgn [simp]
paulson@14323
   725
paulson@14323
   726
lemma Im_sgn:
paulson@14323
   727
      "Im(sgn z) = Im(z)/cmod z"
paulson@14373
   728
apply (induct z)
paulson@14373
   729
apply (simp add: sgn_def complex_divide_def complex_of_real_inverse [symmetric])
paulson@14373
   730
apply (simp add: complex_of_real_def complex_mult real_divide_def)
paulson@14323
   731
done
paulson@14323
   732
declare Im_sgn [simp]
paulson@14323
   733
paulson@14323
   734
lemma complex_inverse_complex_split:
paulson@14323
   735
     "inverse(complex_of_real x + ii * complex_of_real y) =
paulson@14323
   736
      complex_of_real(x/(x ^ 2 + y ^ 2)) -
paulson@14323
   737
      ii * complex_of_real(y/(x ^ 2 + y ^ 2))"
paulson@14373
   738
by (simp add: complex_of_real_def i_def complex_mult complex_add 
paulson@14373
   739
         complex_diff_def complex_minus complex_inverse real_divide_def)
paulson@14323
   740
paulson@14323
   741
(*----------------------------------------------------------------------------*)
paulson@14323
   742
(* Many of the theorems below need to be moved elsewhere e.g. Transc. Also *)
paulson@14323
   743
(* many of the theorems are not used - so should they be kept?                *)
paulson@14323
   744
(*----------------------------------------------------------------------------*)
paulson@14323
   745
paulson@14354
   746
lemma complex_of_real_zero_iff [simp]: "(complex_of_real y = 0) = (y = 0)"
paulson@14354
   747
by (auto simp add: complex_zero_def complex_of_real_def)
paulson@14354
   748
paulson@14373
   749
lemma Re_mult_i_eq: "Re (ii * complex_of_real y) = 0"
paulson@14373
   750
by (simp add: i_def complex_of_real_def complex_mult)
paulson@14323
   751
declare Re_mult_i_eq [simp]
paulson@14323
   752
paulson@14373
   753
lemma Im_mult_i_eq: "Im (ii * complex_of_real y) = y"
paulson@14373
   754
by (simp add: i_def complex_of_real_def complex_mult)
paulson@14323
   755
declare Im_mult_i_eq [simp]
paulson@14323
   756
paulson@14373
   757
lemma complex_mod_mult_i: "cmod (ii * complex_of_real y) = abs y"
paulson@14373
   758
by (simp add: i_def complex_of_real_def complex_mult complex_mod power2_eq_square)
paulson@14323
   759
declare complex_mod_mult_i [simp]
paulson@14323
   760
paulson@14354
   761
lemma cos_arg_i_mult_zero_pos:
paulson@14323
   762
   "0 < y ==> cos (arg(ii * complex_of_real y)) = 0"
paulson@14373
   763
apply (simp add: arg_def abs_if)
paulson@14334
   764
apply (rule_tac a = "pi/2" in someI2, auto)
paulson@14334
   765
apply (rule order_less_trans [of _ 0], auto)
paulson@14323
   766
done
paulson@14323
   767
paulson@14354
   768
lemma cos_arg_i_mult_zero_neg:
paulson@14323
   769
   "y < 0 ==> cos (arg(ii * complex_of_real y)) = 0"
paulson@14373
   770
apply (simp add: arg_def abs_if)
paulson@14334
   771
apply (rule_tac a = "- pi/2" in someI2, auto)
paulson@14334
   772
apply (rule order_trans [of _ 0], auto)
paulson@14323
   773
done
paulson@14323
   774
paulson@14354
   775
lemma cos_arg_i_mult_zero [simp]
paulson@14354
   776
    : "y \<noteq> 0 ==> cos (arg(ii * complex_of_real y)) = 0"
paulson@14373
   777
apply (insert linorder_less_linear [of y 0]) 
paulson@14373
   778
apply (auto simp add: cos_arg_i_mult_zero_pos cos_arg_i_mult_zero_neg)
paulson@14373
   779
done
paulson@14323
   780
paulson@14323
   781
paulson@14323
   782
subsection{*Finally! Polar Form for Complex Numbers*}
paulson@14323
   783
paulson@14354
   784
lemma complex_split_polar: "\<exists>r a. z = complex_of_real r *
paulson@14323
   785
      (complex_of_real(cos a) + ii * complex_of_real(sin a))"
paulson@14334
   786
apply (cut_tac z = z in complex_split)
paulson@14354
   787
apply (auto simp add: polar_Ex right_distrib complex_of_real_mult mult_ac)
paulson@14323
   788
done
paulson@14323
   789
paulson@14354
   790
lemma rcis_Ex: "\<exists>r a. z = rcis r a"
paulson@14373
   791
apply (simp add: rcis_def cis_def)
paulson@14323
   792
apply (rule complex_split_polar)
paulson@14323
   793
done
paulson@14323
   794
paulson@14323
   795
lemma Re_complex_polar: "Re(complex_of_real r *
paulson@14323
   796
      (complex_of_real(cos a) + ii * complex_of_real(sin a))) = r * cos a"
paulson@14373
   797
by (auto simp add: right_distrib complex_of_real_mult mult_ac)
paulson@14323
   798
declare Re_complex_polar [simp]
paulson@14323
   799
paulson@14323
   800
lemma Re_rcis: "Re(rcis r a) = r * cos a"
paulson@14373
   801
by (simp add: rcis_def cis_def)
paulson@14323
   802
declare Re_rcis [simp]
paulson@14323
   803
paulson@14348
   804
lemma Im_complex_polar [simp]:
paulson@14348
   805
     "Im(complex_of_real r * 
paulson@14348
   806
         (complex_of_real(cos a) + ii * complex_of_real(sin a))) = 
paulson@14348
   807
      r * sin a"
paulson@14373
   808
by (auto simp add: right_distrib complex_of_real_mult mult_ac)
paulson@14323
   809
paulson@14348
   810
lemma Im_rcis [simp]: "Im(rcis r a) = r * sin a"
paulson@14373
   811
by (simp add: rcis_def cis_def)
paulson@14323
   812
paulson@14348
   813
lemma complex_mod_complex_polar [simp]:
paulson@14348
   814
     "cmod (complex_of_real r * 
paulson@14348
   815
            (complex_of_real(cos a) + ii * complex_of_real(sin a))) = 
paulson@14348
   816
      abs r"
paulson@14373
   817
by (auto simp add: right_distrib cmod_i complex_of_real_mult
paulson@14348
   818
                      right_distrib [symmetric] power_mult_distrib mult_ac 
paulson@14348
   819
         simp del: realpow_Suc)
paulson@14323
   820
paulson@14323
   821
lemma complex_mod_rcis: "cmod(rcis r a) = abs r"
paulson@14373
   822
by (simp add: rcis_def cis_def)
paulson@14323
   823
declare complex_mod_rcis [simp]
paulson@14323
   824
paulson@14323
   825
lemma complex_mod_sqrt_Re_mult_cnj: "cmod z = sqrt (Re (z * cnj z))"
paulson@14373
   826
apply (simp add: cmod_def)
paulson@14323
   827
apply (rule real_sqrt_eq_iff [THEN iffD2])
paulson@14323
   828
apply (auto simp add: complex_mult_cnj)
paulson@14323
   829
done
paulson@14323
   830
paulson@14323
   831
lemma complex_Re_cnj: "Re(cnj z) = Re z"
paulson@14373
   832
by (induct z, simp add: complex_cnj)
paulson@14323
   833
declare complex_Re_cnj [simp]
paulson@14323
   834
paulson@14323
   835
lemma complex_Im_cnj: "Im(cnj z) = - Im z"
paulson@14373
   836
by (induct z, simp add: complex_cnj)
paulson@14323
   837
declare complex_Im_cnj [simp]
paulson@14323
   838
paulson@14323
   839
lemma complex_In_mult_cnj_zero: "Im (z * cnj z) = 0"
paulson@14373
   840
by (induct z, simp add: complex_cnj complex_mult)
paulson@14323
   841
declare complex_In_mult_cnj_zero [simp]
paulson@14323
   842
paulson@14323
   843
lemma complex_Re_mult: "[| Im w = 0; Im z = 0 |] ==> Re(w * z) = Re(w) * Re(z)"
paulson@14373
   844
by (induct z, induct w, simp add: complex_mult)
paulson@14323
   845
paulson@14323
   846
lemma complex_Re_mult_complex_of_real: "Re (z * complex_of_real c) = Re(z) * c"
paulson@14373
   847
by (induct z, simp add: complex_of_real_def complex_mult)
paulson@14323
   848
declare complex_Re_mult_complex_of_real [simp]
paulson@14323
   849
paulson@14323
   850
lemma complex_Im_mult_complex_of_real: "Im (z * complex_of_real c) = Im(z) * c"
paulson@14373
   851
by (induct z, simp add: complex_of_real_def complex_mult)
paulson@14323
   852
declare complex_Im_mult_complex_of_real [simp]
paulson@14323
   853
paulson@14323
   854
lemma complex_Re_mult_complex_of_real2: "Re (complex_of_real c * z) = c * Re(z)"
paulson@14373
   855
by (induct z, simp add: complex_of_real_def complex_mult)
paulson@14323
   856
declare complex_Re_mult_complex_of_real2 [simp]
paulson@14323
   857
paulson@14323
   858
lemma complex_Im_mult_complex_of_real2: "Im (complex_of_real c * z) = c * Im(z)"
paulson@14373
   859
by (induct z, simp add: complex_of_real_def complex_mult)
paulson@14323
   860
declare complex_Im_mult_complex_of_real2 [simp]
paulson@14323
   861
paulson@14323
   862
(*---------------------------------------------------------------------------*)
paulson@14323
   863
(*  (r1 * cis a) * (r2 * cis b) = r1 * r2 * cis (a + b)                      *)
paulson@14323
   864
(*---------------------------------------------------------------------------*)
paulson@14323
   865
paulson@14323
   866
lemma cis_rcis_eq: "cis a = rcis 1 a"
paulson@14373
   867
by (simp add: rcis_def)
paulson@14323
   868
paulson@14323
   869
lemma rcis_mult:
paulson@14323
   870
  "rcis r1 a * rcis r2 b = rcis (r1*r2) (a + b)"
paulson@14373
   871
apply (simp add: rcis_def cis_def cos_add sin_add right_distrib left_distrib 
paulson@14373
   872
                 mult_ac add_ac)
paulson@14373
   873
apply (auto simp add: right_distrib [symmetric] complex_mult_assoc [symmetric] complex_of_real_mult complex_of_real_add complex_add_assoc [symmetric] i_mult_eq simp del: i_mult_eq2)
paulson@14373
   874
apply (auto simp add: add_ac)
paulson@14334
   875
apply (auto simp add: complex_add_assoc [symmetric] complex_of_real_add right_distrib real_diff_def mult_ac add_ac)
paulson@14323
   876
done
paulson@14323
   877
paulson@14323
   878
lemma cis_mult: "cis a * cis b = cis (a + b)"
paulson@14373
   879
by (simp add: cis_rcis_eq rcis_mult)
paulson@14323
   880
paulson@14323
   881
lemma cis_zero: "cis 0 = 1"
paulson@14373
   882
by (simp add: cis_def)
paulson@14323
   883
declare cis_zero [simp]
paulson@14323
   884
paulson@14323
   885
lemma cis_zero2: "cis 0 = complex_of_real 1"
paulson@14373
   886
by (simp add: cis_def)
paulson@14323
   887
declare cis_zero2 [simp]
paulson@14323
   888
paulson@14323
   889
lemma rcis_zero_mod: "rcis 0 a = 0"
paulson@14373
   890
by (simp add: rcis_def)
paulson@14323
   891
declare rcis_zero_mod [simp]
paulson@14323
   892
paulson@14323
   893
lemma rcis_zero_arg: "rcis r 0 = complex_of_real r"
paulson@14373
   894
by (simp add: rcis_def)
paulson@14323
   895
declare rcis_zero_arg [simp]
paulson@14323
   896
paulson@14323
   897
lemma complex_of_real_minus_one:
paulson@14323
   898
   "complex_of_real (-(1::real)) = -(1::complex)"
paulson@14373
   899
apply (simp add: complex_of_real_def complex_one_def complex_minus)
paulson@14323
   900
done
paulson@14323
   901
paulson@14323
   902
lemma complex_i_mult_minus: "ii * (ii * x) = - x"
paulson@14373
   903
by (simp add: complex_mult_assoc [symmetric])
paulson@14323
   904
declare complex_i_mult_minus [simp]
paulson@14323
   905
paulson@14323
   906
paulson@14323
   907
lemma cis_real_of_nat_Suc_mult:
paulson@14323
   908
   "cis (real (Suc n) * a) = cis a * cis (real n * a)"
paulson@14373
   909
apply (simp add: cis_def)
paulson@14373
   910
apply (auto simp add: real_of_nat_Suc left_distrib cos_add sin_add left_distrib right_distrib complex_of_real_add complex_of_real_mult mult_ac add_ac)
paulson@14373
   911
apply (auto simp add: right_distrib [symmetric] complex_mult_assoc [symmetric] i_mult_eq complex_of_real_mult complex_of_real_add complex_add_assoc [symmetric] complex_of_real_minus [symmetric] real_diff_def mult_ac simp del: i_mult_eq2)
paulson@14323
   912
done
paulson@14323
   913
paulson@14323
   914
lemma DeMoivre: "(cis a) ^ n = cis (real n * a)"
paulson@14323
   915
apply (induct_tac "n")
paulson@14323
   916
apply (auto simp add: cis_real_of_nat_Suc_mult)
paulson@14323
   917
done
paulson@14323
   918
paulson@14323
   919
lemma DeMoivre2:
paulson@14323
   920
   "(rcis r a) ^ n = rcis (r ^ n) (real n * a)"
paulson@14373
   921
apply (simp add: rcis_def power_mult_distrib DeMoivre complex_of_real_pow)
paulson@14323
   922
done
paulson@14323
   923
paulson@14323
   924
lemma cis_inverse: "inverse(cis a) = cis (-a)"
paulson@14373
   925
by (simp add: cis_def complex_inverse_complex_split complex_of_real_minus complex_diff_def)
paulson@14323
   926
declare cis_inverse [simp]
paulson@14323
   927
paulson@14323
   928
lemma rcis_inverse: "inverse(rcis r a) = rcis (1/r) (-a)"
paulson@14354
   929
apply (case_tac "r=0", simp)
paulson@14354
   930
apply (auto simp add: complex_inverse_complex_split right_distrib 
paulson@14354
   931
            complex_of_real_mult rcis_def cis_def power2_eq_square mult_ac)
paulson@14334
   932
apply (auto simp add: right_distrib [symmetric] complex_of_real_minus complex_diff_def)
paulson@14323
   933
done
paulson@14323
   934
paulson@14323
   935
lemma cis_divide: "cis a / cis b = cis (a - b)"
paulson@14373
   936
by (simp add: complex_divide_def cis_mult real_diff_def)
paulson@14323
   937
paulson@14354
   938
lemma rcis_divide: "rcis r1 a / rcis r2 b = rcis (r1/r2) (a - b)"
paulson@14373
   939
apply (simp add: complex_divide_def)
paulson@14373
   940
apply (case_tac "r2=0", simp)
paulson@14373
   941
apply (simp add: rcis_inverse rcis_mult real_diff_def)
paulson@14323
   942
done
paulson@14323
   943
paulson@14323
   944
lemma Re_cis: "Re(cis a) = cos a"
paulson@14373
   945
by (simp add: cis_def)
paulson@14323
   946
declare Re_cis [simp]
paulson@14323
   947
paulson@14323
   948
lemma Im_cis: "Im(cis a) = sin a"
paulson@14373
   949
by (simp add: cis_def)
paulson@14323
   950
declare Im_cis [simp]
paulson@14323
   951
paulson@14323
   952
lemma cos_n_Re_cis_pow_n: "cos (real n * a) = Re(cis a ^ n)"
paulson@14334
   953
by (auto simp add: DeMoivre)
paulson@14323
   954
paulson@14323
   955
lemma sin_n_Im_cis_pow_n: "sin (real n * a) = Im(cis a ^ n)"
paulson@14334
   956
by (auto simp add: DeMoivre)
paulson@14323
   957
paulson@14323
   958
lemma expi_Im_split:
paulson@14323
   959
    "expi (ii * complex_of_real y) =
paulson@14323
   960
     complex_of_real (cos y) + ii * complex_of_real (sin y)"
paulson@14373
   961
by (simp add: expi_def cis_def)
paulson@14323
   962
paulson@14323
   963
lemma expi_Im_cis:
paulson@14323
   964
    "expi (ii * complex_of_real y) = cis y"
paulson@14373
   965
by (simp add: expi_def)
paulson@14323
   966
paulson@14323
   967
lemma expi_add: "expi(a + b) = expi(a) * expi(b)"
paulson@14373
   968
by (simp add: expi_def complex_Re_add exp_add complex_Im_add cis_mult [symmetric] complex_of_real_mult mult_ac)
paulson@14323
   969
paulson@14323
   970
lemma expi_complex_split:
paulson@14323
   971
     "expi(complex_of_real x + ii * complex_of_real y) =
paulson@14323
   972
      complex_of_real (exp(x)) * cis y"
paulson@14373
   973
by (simp add: expi_def)
paulson@14323
   974
paulson@14323
   975
lemma expi_zero: "expi (0::complex) = 1"
paulson@14373
   976
by (simp add: expi_def)
paulson@14323
   977
declare expi_zero [simp]
paulson@14323
   978
paulson@14323
   979
lemma complex_Re_mult_eq: "Re (w * z) = Re w * Re z - Im w * Im z"
paulson@14373
   980
by (induct z, induct w, simp add: complex_mult)
paulson@14323
   981
paulson@14323
   982
lemma complex_Im_mult_eq:
paulson@14323
   983
     "Im (w * z) = Re w * Im z + Im w * Re z"
paulson@14373
   984
apply (induct z, induct w, simp add: complex_mult)
paulson@14323
   985
done
paulson@14323
   986
paulson@14323
   987
lemma complex_expi_Ex: 
paulson@14354
   988
   "\<exists>a r. z = complex_of_real r * expi a"
paulson@14373
   989
apply (insert rcis_Ex [of z])
paulson@14323
   990
apply (auto simp add: expi_def rcis_def complex_mult_assoc [symmetric] complex_of_real_mult)
paulson@14334
   991
apply (rule_tac x = "ii * complex_of_real a" in exI, auto)
paulson@14323
   992
done
paulson@14323
   993
paulson@14323
   994
paulson@14323
   995
paulson@14323
   996
ML
paulson@14323
   997
{*
paulson@14323
   998
val complex_zero_def = thm"complex_zero_def";
paulson@14323
   999
val complex_one_def = thm"complex_one_def";
paulson@14323
  1000
val complex_minus_def = thm"complex_minus_def";
paulson@14323
  1001
val complex_diff_def = thm"complex_diff_def";
paulson@14323
  1002
val complex_divide_def = thm"complex_divide_def";
paulson@14323
  1003
val complex_mult_def = thm"complex_mult_def";
paulson@14323
  1004
val complex_add_def = thm"complex_add_def";
paulson@14323
  1005
val complex_of_real_def = thm"complex_of_real_def";
paulson@14323
  1006
val i_def = thm"i_def";
paulson@14323
  1007
val expi_def = thm"expi_def";
paulson@14323
  1008
val cis_def = thm"cis_def";
paulson@14323
  1009
val rcis_def = thm"rcis_def";
paulson@14323
  1010
val cmod_def = thm"cmod_def";
paulson@14323
  1011
val cnj_def = thm"cnj_def";
paulson@14323
  1012
val sgn_def = thm"sgn_def";
paulson@14323
  1013
val arg_def = thm"arg_def";
paulson@14323
  1014
val complexpow_0 = thm"complexpow_0";
paulson@14323
  1015
val complexpow_Suc = thm"complexpow_Suc";
paulson@14323
  1016
paulson@14323
  1017
val Re = thm"Re";
paulson@14323
  1018
val Im = thm"Im";
paulson@14323
  1019
val complex_Re_Im_cancel_iff = thm"complex_Re_Im_cancel_iff";
paulson@14323
  1020
val complex_Re_zero = thm"complex_Re_zero";
paulson@14323
  1021
val complex_Im_zero = thm"complex_Im_zero";
paulson@14323
  1022
val complex_Re_one = thm"complex_Re_one";
paulson@14323
  1023
val complex_Im_one = thm"complex_Im_one";
paulson@14323
  1024
val complex_Re_i = thm"complex_Re_i";
paulson@14323
  1025
val complex_Im_i = thm"complex_Im_i";
paulson@14323
  1026
val Re_complex_of_real_zero = thm"Re_complex_of_real_zero";
paulson@14323
  1027
val Im_complex_of_real_zero = thm"Im_complex_of_real_zero";
paulson@14323
  1028
val Re_complex_of_real_one = thm"Re_complex_of_real_one";
paulson@14323
  1029
val Im_complex_of_real_one = thm"Im_complex_of_real_one";
paulson@14323
  1030
val Re_complex_of_real = thm"Re_complex_of_real";
paulson@14323
  1031
val Im_complex_of_real = thm"Im_complex_of_real";
paulson@14323
  1032
val complex_minus = thm"complex_minus";
paulson@14323
  1033
val complex_Re_minus = thm"complex_Re_minus";
paulson@14323
  1034
val complex_Im_minus = thm"complex_Im_minus";
paulson@14323
  1035
val complex_minus_zero = thm"complex_minus_zero";
paulson@14323
  1036
val complex_minus_zero_iff = thm"complex_minus_zero_iff";
paulson@14323
  1037
val complex_add = thm"complex_add";
paulson@14323
  1038
val complex_Re_add = thm"complex_Re_add";
paulson@14323
  1039
val complex_Im_add = thm"complex_Im_add";
paulson@14323
  1040
val complex_add_commute = thm"complex_add_commute";
paulson@14323
  1041
val complex_add_assoc = thm"complex_add_assoc";
paulson@14323
  1042
val complex_add_zero_left = thm"complex_add_zero_left";
paulson@14323
  1043
val complex_add_zero_right = thm"complex_add_zero_right";
paulson@14323
  1044
val complex_diff = thm"complex_diff";
paulson@14323
  1045
val complex_mult = thm"complex_mult";
paulson@14323
  1046
val complex_mult_one_left = thm"complex_mult_one_left";
paulson@14323
  1047
val complex_mult_one_right = thm"complex_mult_one_right";
paulson@14323
  1048
val complex_inverse = thm"complex_inverse";
paulson@14323
  1049
val complex_of_real_one = thm"complex_of_real_one";
paulson@14323
  1050
val complex_of_real_zero = thm"complex_of_real_zero";
paulson@14323
  1051
val complex_of_real_eq_iff = thm"complex_of_real_eq_iff";
paulson@14323
  1052
val complex_of_real_minus = thm"complex_of_real_minus";
paulson@14323
  1053
val complex_of_real_inverse = thm"complex_of_real_inverse";
paulson@14323
  1054
val complex_of_real_add = thm"complex_of_real_add";
paulson@14323
  1055
val complex_of_real_diff = thm"complex_of_real_diff";
paulson@14323
  1056
val complex_of_real_mult = thm"complex_of_real_mult";
paulson@14323
  1057
val complex_of_real_divide = thm"complex_of_real_divide";
paulson@14323
  1058
val complex_of_real_pow = thm"complex_of_real_pow";
paulson@14323
  1059
val complex_mod = thm"complex_mod";
paulson@14323
  1060
val complex_mod_zero = thm"complex_mod_zero";
paulson@14323
  1061
val complex_mod_one = thm"complex_mod_one";
paulson@14323
  1062
val complex_mod_complex_of_real = thm"complex_mod_complex_of_real";
paulson@14323
  1063
val complex_of_real_abs = thm"complex_of_real_abs";
paulson@14323
  1064
val complex_cnj = thm"complex_cnj";
paulson@14323
  1065
val complex_cnj_cancel_iff = thm"complex_cnj_cancel_iff";
paulson@14323
  1066
val complex_cnj_cnj = thm"complex_cnj_cnj";
paulson@14323
  1067
val complex_cnj_complex_of_real = thm"complex_cnj_complex_of_real";
paulson@14323
  1068
val complex_mod_cnj = thm"complex_mod_cnj";
paulson@14323
  1069
val complex_cnj_minus = thm"complex_cnj_minus";
paulson@14323
  1070
val complex_cnj_inverse = thm"complex_cnj_inverse";
paulson@14323
  1071
val complex_cnj_add = thm"complex_cnj_add";
paulson@14323
  1072
val complex_cnj_diff = thm"complex_cnj_diff";
paulson@14323
  1073
val complex_cnj_mult = thm"complex_cnj_mult";
paulson@14323
  1074
val complex_cnj_divide = thm"complex_cnj_divide";
paulson@14323
  1075
val complex_cnj_one = thm"complex_cnj_one";
paulson@14323
  1076
val complex_cnj_pow = thm"complex_cnj_pow";
paulson@14323
  1077
val complex_add_cnj = thm"complex_add_cnj";
paulson@14323
  1078
val complex_diff_cnj = thm"complex_diff_cnj";
paulson@14323
  1079
val complex_cnj_zero = thm"complex_cnj_zero";
paulson@14323
  1080
val complex_cnj_zero_iff = thm"complex_cnj_zero_iff";
paulson@14323
  1081
val complex_mult_cnj = thm"complex_mult_cnj";
paulson@14323
  1082
val complex_add_left_cancel_zero = thm"complex_add_left_cancel_zero";
paulson@14323
  1083
val complex_diff_mult_distrib = thm"complex_diff_mult_distrib";
paulson@14323
  1084
val complex_diff_mult_distrib2 = thm"complex_diff_mult_distrib2";
paulson@14323
  1085
val complex_mod_eq_zero_cancel = thm"complex_mod_eq_zero_cancel";
paulson@14323
  1086
val complex_mod_complex_of_real_of_nat = thm"complex_mod_complex_of_real_of_nat";
paulson@14323
  1087
val complex_mod_minus = thm"complex_mod_minus";
paulson@14323
  1088
val complex_mod_mult_cnj = thm"complex_mod_mult_cnj";
paulson@14323
  1089
val complex_mod_squared = thm"complex_mod_squared";
paulson@14323
  1090
val complex_mod_ge_zero = thm"complex_mod_ge_zero";
paulson@14323
  1091
val abs_cmod_cancel = thm"abs_cmod_cancel";
paulson@14323
  1092
val complex_mod_mult = thm"complex_mod_mult";
paulson@14323
  1093
val complex_mod_add_squared_eq = thm"complex_mod_add_squared_eq";
paulson@14323
  1094
val complex_Re_mult_cnj_le_cmod = thm"complex_Re_mult_cnj_le_cmod";
paulson@14323
  1095
val complex_Re_mult_cnj_le_cmod2 = thm"complex_Re_mult_cnj_le_cmod2";
paulson@14323
  1096
val real_sum_squared_expand = thm"real_sum_squared_expand";
paulson@14323
  1097
val complex_mod_triangle_squared = thm"complex_mod_triangle_squared";
paulson@14323
  1098
val complex_mod_minus_le_complex_mod = thm"complex_mod_minus_le_complex_mod";
paulson@14323
  1099
val complex_mod_triangle_ineq = thm"complex_mod_triangle_ineq";
paulson@14323
  1100
val complex_mod_triangle_ineq2 = thm"complex_mod_triangle_ineq2";
paulson@14323
  1101
val complex_mod_diff_commute = thm"complex_mod_diff_commute";
paulson@14323
  1102
val complex_mod_add_less = thm"complex_mod_add_less";
paulson@14323
  1103
val complex_mod_mult_less = thm"complex_mod_mult_less";
paulson@14323
  1104
val complex_mod_diff_ineq = thm"complex_mod_diff_ineq";
paulson@14323
  1105
val complex_Re_le_cmod = thm"complex_Re_le_cmod";
paulson@14323
  1106
val complex_mod_gt_zero = thm"complex_mod_gt_zero";
paulson@14323
  1107
val complex_mod_complexpow = thm"complex_mod_complexpow";
paulson@14323
  1108
val complexpow_minus = thm"complexpow_minus";
paulson@14323
  1109
val complex_mod_inverse = thm"complex_mod_inverse";
paulson@14323
  1110
val complex_mod_divide = thm"complex_mod_divide";
paulson@14323
  1111
val complex_inverse_divide = thm"complex_inverse_divide";
paulson@14323
  1112
val complexpow_i_squared = thm"complexpow_i_squared";
paulson@14323
  1113
val complex_i_not_zero = thm"complex_i_not_zero";
paulson@14323
  1114
val sgn_zero = thm"sgn_zero";
paulson@14323
  1115
val sgn_one = thm"sgn_one";
paulson@14323
  1116
val sgn_minus = thm"sgn_minus";
paulson@14323
  1117
val sgn_eq = thm"sgn_eq";
paulson@14323
  1118
val complex_split = thm"complex_split";
paulson@14323
  1119
val Re_complex_i = thm"Re_complex_i";
paulson@14323
  1120
val Im_complex_i = thm"Im_complex_i";
paulson@14323
  1121
val i_mult_eq = thm"i_mult_eq";
paulson@14323
  1122
val i_mult_eq2 = thm"i_mult_eq2";
paulson@14323
  1123
val cmod_i = thm"cmod_i";
paulson@14323
  1124
val complex_eq_Re_eq = thm"complex_eq_Re_eq";
paulson@14323
  1125
val complex_eq_Im_eq = thm"complex_eq_Im_eq";
paulson@14323
  1126
val complex_eq_cancel_iff = thm"complex_eq_cancel_iff";
paulson@14323
  1127
val complex_eq_cancel_iffA = thm"complex_eq_cancel_iffA";
paulson@14323
  1128
val complex_eq_cancel_iffB = thm"complex_eq_cancel_iffB";
paulson@14323
  1129
val complex_eq_cancel_iffC = thm"complex_eq_cancel_iffC";
paulson@14323
  1130
val complex_eq_cancel_iff2 = thm"complex_eq_cancel_iff2";
paulson@14323
  1131
val complex_eq_cancel_iff2a = thm"complex_eq_cancel_iff2a";
paulson@14323
  1132
val complex_eq_cancel_iff3 = thm"complex_eq_cancel_iff3";
paulson@14323
  1133
val complex_eq_cancel_iff3a = thm"complex_eq_cancel_iff3a";
paulson@14323
  1134
val complex_split_Re_zero = thm"complex_split_Re_zero";
paulson@14323
  1135
val complex_split_Im_zero = thm"complex_split_Im_zero";
paulson@14323
  1136
val Re_sgn = thm"Re_sgn";
paulson@14323
  1137
val Im_sgn = thm"Im_sgn";
paulson@14323
  1138
val complex_inverse_complex_split = thm"complex_inverse_complex_split";
paulson@14323
  1139
val Re_mult_i_eq = thm"Re_mult_i_eq";
paulson@14323
  1140
val Im_mult_i_eq = thm"Im_mult_i_eq";
paulson@14323
  1141
val complex_mod_mult_i = thm"complex_mod_mult_i";
paulson@14323
  1142
val cos_arg_i_mult_zero = thm"cos_arg_i_mult_zero";
paulson@14323
  1143
val complex_of_real_zero_iff = thm"complex_of_real_zero_iff";
paulson@14323
  1144
val complex_split_polar = thm"complex_split_polar";
paulson@14323
  1145
val rcis_Ex = thm"rcis_Ex";
paulson@14323
  1146
val Re_complex_polar = thm"Re_complex_polar";
paulson@14323
  1147
val Re_rcis = thm"Re_rcis";
paulson@14323
  1148
val Im_complex_polar = thm"Im_complex_polar";
paulson@14323
  1149
val Im_rcis = thm"Im_rcis";
paulson@14323
  1150
val complex_mod_complex_polar = thm"complex_mod_complex_polar";
paulson@14323
  1151
val complex_mod_rcis = thm"complex_mod_rcis";
paulson@14323
  1152
val complex_mod_sqrt_Re_mult_cnj = thm"complex_mod_sqrt_Re_mult_cnj";
paulson@14323
  1153
val complex_Re_cnj = thm"complex_Re_cnj";
paulson@14323
  1154
val complex_Im_cnj = thm"complex_Im_cnj";
paulson@14323
  1155
val complex_In_mult_cnj_zero = thm"complex_In_mult_cnj_zero";
paulson@14323
  1156
val complex_Re_mult = thm"complex_Re_mult";
paulson@14323
  1157
val complex_Re_mult_complex_of_real = thm"complex_Re_mult_complex_of_real";
paulson@14323
  1158
val complex_Im_mult_complex_of_real = thm"complex_Im_mult_complex_of_real";
paulson@14323
  1159
val complex_Re_mult_complex_of_real2 = thm"complex_Re_mult_complex_of_real2";
paulson@14323
  1160
val complex_Im_mult_complex_of_real2 = thm"complex_Im_mult_complex_of_real2";
paulson@14323
  1161
val cis_rcis_eq = thm"cis_rcis_eq";
paulson@14323
  1162
val rcis_mult = thm"rcis_mult";
paulson@14323
  1163
val cis_mult = thm"cis_mult";
paulson@14323
  1164
val cis_zero = thm"cis_zero";
paulson@14323
  1165
val cis_zero2 = thm"cis_zero2";
paulson@14323
  1166
val rcis_zero_mod = thm"rcis_zero_mod";
paulson@14323
  1167
val rcis_zero_arg = thm"rcis_zero_arg";
paulson@14323
  1168
val complex_of_real_minus_one = thm"complex_of_real_minus_one";
paulson@14323
  1169
val complex_i_mult_minus = thm"complex_i_mult_minus";
paulson@14323
  1170
val cis_real_of_nat_Suc_mult = thm"cis_real_of_nat_Suc_mult";
paulson@14323
  1171
val DeMoivre = thm"DeMoivre";
paulson@14323
  1172
val DeMoivre2 = thm"DeMoivre2";
paulson@14323
  1173
val cis_inverse = thm"cis_inverse";
paulson@14323
  1174
val rcis_inverse = thm"rcis_inverse";
paulson@14323
  1175
val cis_divide = thm"cis_divide";
paulson@14323
  1176
val rcis_divide = thm"rcis_divide";
paulson@14323
  1177
val Re_cis = thm"Re_cis";
paulson@14323
  1178
val Im_cis = thm"Im_cis";
paulson@14323
  1179
val cos_n_Re_cis_pow_n = thm"cos_n_Re_cis_pow_n";
paulson@14323
  1180
val sin_n_Im_cis_pow_n = thm"sin_n_Im_cis_pow_n";
paulson@14323
  1181
val expi_Im_split = thm"expi_Im_split";
paulson@14323
  1182
val expi_Im_cis = thm"expi_Im_cis";
paulson@14323
  1183
val expi_add = thm"expi_add";
paulson@14323
  1184
val expi_complex_split = thm"expi_complex_split";
paulson@14323
  1185
val expi_zero = thm"expi_zero";
paulson@14323
  1186
val complex_Re_mult_eq = thm"complex_Re_mult_eq";
paulson@14323
  1187
val complex_Im_mult_eq = thm"complex_Im_mult_eq";
paulson@14323
  1188
val complex_expi_Ex = thm"complex_expi_Ex";
paulson@14323
  1189
*}
paulson@14323
  1190
paulson@13957
  1191
end
paulson@13957
  1192
paulson@13957
  1193