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