src/HOL/Complex/Complex.thy
author paulson
Thu, 01 Jan 2004 21:47:07 +0100
changeset 14335 9c0b5e081037
parent 14334 6137d24eef79
child 14341 a09441bd4f1e
permissions -rw-r--r--
conversion of Real/PReal to Isar script; type "complex" is now in class "field"
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     1
(*  Title:       Complex.thy
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     2
    Author:      Jacques D. Fleuriot
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     3
    Copyright:   2001 University of Edinburgh
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     4
    Description: Complex numbers
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     5
*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     6
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
     7
theory Complex = HLog:
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     8
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
     9
typedef complex = "{p::(real*real). True}"
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    10
  by blast
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    11
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    12
instance complex :: zero ..
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    13
instance complex :: one ..
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    14
instance complex :: plus ..
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    15
instance complex :: times ..
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    16
instance complex :: minus ..
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    17
instance complex :: inverse ..
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    18
instance complex :: power ..
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    19
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    20
consts
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    21
  "ii"    :: complex        ("ii")
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    22
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    23
constdefs
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    24
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    25
  (*--- real and Imaginary parts ---*)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    26
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    27
  Re :: "complex => real"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    28
  "Re(z) == fst(Rep_complex z)"
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    29
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    30
  Im :: "complex => real"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    31
  "Im(z) == snd(Rep_complex z)"
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    32
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    33
  (*----------- modulus ------------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    34
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    35
  cmod :: "complex => real"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    36
  "cmod z == sqrt(Re(z) ^ 2 + Im(z) ^ 2)"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    37
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    38
  (*----- injection from reals -----*)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    39
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    40
  complex_of_real :: "real => complex"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    41
  "complex_of_real r == Abs_complex(r,0::real)"
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    42
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    43
  (*------- complex conjugate ------*)
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    44
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    45
  cnj :: "complex => complex"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    46
  "cnj z == Abs_complex(Re z, -Im z)"
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    47
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    48
  (*------------ Argand -------------*)
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    49
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    50
  sgn :: "complex => complex"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    51
  "sgn z == z / complex_of_real(cmod z)"
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    52
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    53
  arg :: "complex => real"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    54
  "arg z == @a. Re(sgn z) = cos a & Im(sgn z) = sin a & -pi < a & a <= pi"
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    55
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    56
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    57
defs (overloaded)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    58
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    59
  complex_zero_def:
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    60
  "0 == Abs_complex(0::real,0)"
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    61
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    62
  complex_one_def:
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    63
  "1 == Abs_complex(1,0::real)"
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    64
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    65
  (*------ imaginary unit ----------*)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    66
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    67
  i_def:
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    68
  "ii == Abs_complex(0::real,1)"
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    69
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    70
  (*----------- negation -----------*)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    71
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    72
  complex_minus_def:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    73
  "- (z::complex) == Abs_complex(-Re z, -Im z)"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    74
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    75
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    76
  (*----------- inverse -----------*)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    77
  complex_inverse_def:
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    78
  "inverse (z::complex) == Abs_complex(Re(z)/(Re(z) ^ 2 + Im(z) ^ 2),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    79
                            -Im(z)/(Re(z) ^ 2 + Im(z) ^ 2))"
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    80
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    81
  complex_add_def:
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    82
  "w + (z::complex) == Abs_complex(Re(w) + Re(z),Im(w) + Im(z))"
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    83
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    84
  complex_diff_def:
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    85
  "w - (z::complex) == w + -(z::complex)"
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    86
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    87
  complex_mult_def:
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    88
  "w * (z::complex) == Abs_complex(Re(w) * Re(z) - Im(w) * Im(z),
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    89
			Re(w) * Im(z) + Im(w) * Re(z))"
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    90
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    91
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    92
  (*----------- division ----------*)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    93
  complex_divide_def:
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    94
  "w / (z::complex) == w * inverse z"
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    95
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    96
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
    97
primrec
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    98
     complexpow_0:   "z ^ 0       = complex_of_real 1"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
    99
     complexpow_Suc: "z ^ (Suc n) = (z::complex) * (z ^ n)"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   100
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   101
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   102
constdefs
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   103
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   104
  (* abbreviation for (cos a + i sin a) *)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   105
  cis :: "real => complex"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   106
  "cis a == complex_of_real(cos a) + ii * complex_of_real(sin a)"
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   107
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   108
  (* abbreviation for r*(cos a + i sin a) *)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   109
  rcis :: "[real, real] => complex"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   110
  "rcis r a == complex_of_real r * cis a"
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   111
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   112
  (* e ^ (x + iy) *)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   113
  expi :: "complex => complex"
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
   114
  "expi z == complex_of_real(exp (Re z)) * cis (Im z)"
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   115
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   116
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   117
lemma inj_Rep_complex: "inj Rep_complex"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   118
apply (rule inj_on_inverseI)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   119
apply (rule Rep_complex_inverse)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   120
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   121
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   122
lemma inj_Abs_complex: "inj Abs_complex"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   123
apply (rule inj_on_inverseI)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   124
apply (rule Abs_complex_inverse)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   125
apply (simp (no_asm) add: complex_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   126
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   127
declare inj_Abs_complex [THEN injD, simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   128
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   129
lemma Abs_complex_cancel_iff: "(Abs_complex x = Abs_complex y) = (x = y)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   130
by (auto dest: inj_Abs_complex [THEN injD])
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   131
declare Abs_complex_cancel_iff [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   132
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   133
lemma pair_mem_complex: "(x,y) : complex"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   134
by (unfold complex_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   135
declare pair_mem_complex [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   136
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   137
lemma Abs_complex_inverse2: "Rep_complex (Abs_complex (x,y)) = (x,y)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   138
apply (simp (no_asm) add: Abs_complex_inverse)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   139
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   140
declare Abs_complex_inverse2 [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   141
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   142
lemma eq_Abs_complex: "(!!x y. z = Abs_complex(x,y) ==> P) ==> P"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   143
apply (rule_tac p = "Rep_complex z" in PairE)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   144
apply (drule_tac f = Abs_complex in arg_cong)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   145
apply (force simp add: Rep_complex_inverse)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   146
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   147
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   148
lemma Re: "Re(Abs_complex(x,y)) = x"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   149
apply (unfold Re_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   150
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   151
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   152
declare Re [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   153
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   154
lemma Im: "Im(Abs_complex(x,y)) = y"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   155
apply (unfold Im_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   156
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   157
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   158
declare Im [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   159
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   160
lemma Abs_complex_cancel: "Abs_complex(Re(z),Im(z)) = z"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   161
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   162
apply (simp (no_asm_simp))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   163
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   164
declare Abs_complex_cancel [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   165
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   166
lemma complex_Re_Im_cancel_iff: "(w=z) = (Re(w) = Re(z) & Im(w) = Im(z))"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   167
apply (rule_tac z = w in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   168
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   169
apply (auto dest: inj_Abs_complex [THEN injD])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   170
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   171
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   172
lemma complex_Re_zero: "Re 0 = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   173
apply (unfold complex_zero_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   174
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   175
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   176
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   177
lemma complex_Im_zero: "Im 0 = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   178
apply (unfold complex_zero_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   179
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   180
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   181
declare complex_Re_zero [simp] complex_Im_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   182
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   183
lemma complex_Re_one: "Re 1 = 1"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   184
apply (unfold complex_one_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   185
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   186
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   187
declare complex_Re_one [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   188
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   189
lemma complex_Im_one: "Im 1 = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   190
apply (unfold complex_one_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   191
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   192
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   193
declare complex_Im_one [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   194
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   195
lemma complex_Re_i: "Re(ii) = 0"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   196
by (unfold i_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   197
declare complex_Re_i [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   198
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   199
lemma complex_Im_i: "Im(ii) = 1"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   200
by (unfold i_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   201
declare complex_Im_i [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   202
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   203
lemma Re_complex_of_real_zero: "Re(complex_of_real 0) = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   204
apply (unfold complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   205
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   206
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   207
declare Re_complex_of_real_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   208
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   209
lemma Im_complex_of_real_zero: "Im(complex_of_real 0) = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   210
apply (unfold complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   211
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   212
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   213
declare Im_complex_of_real_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   214
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   215
lemma Re_complex_of_real_one: "Re(complex_of_real 1) = 1"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   216
apply (unfold complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   217
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   218
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   219
declare Re_complex_of_real_one [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   220
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   221
lemma Im_complex_of_real_one: "Im(complex_of_real 1) = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   222
apply (unfold complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   223
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   224
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   225
declare Im_complex_of_real_one [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   226
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   227
lemma Re_complex_of_real: "Re(complex_of_real z) = z"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   228
by (unfold complex_of_real_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   229
declare Re_complex_of_real [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   230
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   231
lemma Im_complex_of_real: "Im(complex_of_real z) = 0"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   232
by (unfold complex_of_real_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   233
declare Im_complex_of_real [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   234
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   235
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   236
subsection{*Negation*}
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   237
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   238
lemma complex_minus: "- Abs_complex(x,y) = Abs_complex(-x,-y)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   239
apply (unfold complex_minus_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   240
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   241
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   242
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   243
lemma complex_Re_minus: "Re (-z) = - Re z"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   244
apply (unfold Re_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   245
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   246
apply (auto simp add: complex_minus)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   247
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   248
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   249
lemma complex_Im_minus: "Im (-z) = - Im z"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   250
apply (unfold Im_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   251
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   252
apply (auto simp add: complex_minus)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   253
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   254
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   255
lemma complex_minus_minus: "- (- z) = (z::complex)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   256
apply (unfold complex_minus_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   257
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   258
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   259
declare complex_minus_minus [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   260
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   261
lemma inj_complex_minus: "inj(%r::complex. -r)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   262
apply (rule inj_onI)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   263
apply (drule_tac f = uminus in arg_cong, simp)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   264
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   265
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   266
lemma complex_minus_zero: "-(0::complex) = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   267
apply (unfold complex_zero_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   268
apply (simp (no_asm) add: complex_minus)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   269
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   270
declare complex_minus_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   271
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   272
lemma complex_minus_zero_iff: "(-x = 0) = (x = (0::complex))"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   273
apply (rule_tac z = x in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   274
apply (auto dest: inj_Abs_complex [THEN injD]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   275
            simp add: complex_zero_def complex_minus)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   276
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   277
declare complex_minus_zero_iff [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   278
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   279
lemma complex_minus_zero_iff2: "(0 = -x) = (x = (0::real))"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   280
by (auto dest: sym)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   281
declare complex_minus_zero_iff2 [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   282
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   283
lemma complex_minus_not_zero_iff: "(-x ~= 0) = (x ~= (0::complex))"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   284
by auto
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   285
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   286
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   287
subsection{*Addition*}
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   288
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   289
lemma complex_add:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   290
      "Abs_complex(x1,y1) + Abs_complex(x2,y2) = Abs_complex(x1+x2,y1+y2)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   291
apply (unfold complex_add_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   292
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   293
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   294
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   295
lemma complex_Re_add: "Re(x + y) = Re(x) + Re(y)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   296
apply (unfold Re_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   297
apply (rule_tac z = x in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   298
apply (rule_tac z = y in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   299
apply (auto simp add: complex_add)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   300
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   301
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   302
lemma complex_Im_add: "Im(x + y) = Im(x) + Im(y)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   303
apply (unfold Im_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   304
apply (rule_tac z = x in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   305
apply (rule_tac z = y in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   306
apply (auto simp add: complex_add)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   307
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   308
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   309
lemma complex_add_commute: "(u::complex) + v = v + u"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   310
apply (unfold complex_add_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   311
apply (simp (no_asm) add: real_add_commute)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   312
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   313
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   314
lemma complex_add_assoc: "((u::complex) + v) + w = u + (v + w)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   315
apply (unfold complex_add_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   316
apply (simp (no_asm) add: real_add_assoc)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   317
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   318
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   319
lemma complex_add_left_commute: "(x::complex) + (y + z) = y + (x + z)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   320
apply (unfold complex_add_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   321
apply (simp (no_asm) add: add_left_commute)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   322
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   324
lemmas complex_add_ac = complex_add_assoc complex_add_commute
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   325
                      complex_add_left_commute
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   326
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   327
lemma complex_add_zero_left: "(0::complex) + z = z"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   328
apply (unfold complex_add_def complex_zero_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   329
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   330
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   331
declare complex_add_zero_left [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   332
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   333
lemma complex_add_zero_right: "z + (0::complex) = z"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   334
apply (unfold complex_add_def complex_zero_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   335
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   336
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   337
declare complex_add_zero_right [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   338
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   339
lemma complex_add_minus_right_zero:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   340
      "z + -z = (0::complex)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   341
apply (unfold complex_add_def complex_minus_def complex_zero_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   342
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   343
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   344
declare complex_add_minus_right_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   345
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   346
lemma complex_add_minus_left_zero:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   347
      "-z + z = (0::complex)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   348
apply (unfold complex_add_def complex_minus_def complex_zero_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   349
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   350
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   351
declare complex_add_minus_left_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   352
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   353
lemma complex_add_minus_cancel: "z + (- z + w) = (w::complex)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   354
apply (simp (no_asm) add: complex_add_assoc [symmetric])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   355
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   356
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   357
lemma complex_minus_add_cancel: "(-z) + (z + w) = (w::complex)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   358
apply (simp (no_asm) add: complex_add_assoc [symmetric])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   359
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   360
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   361
declare complex_add_minus_cancel [simp] complex_minus_add_cancel [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   362
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   363
lemma complex_add_minus_eq_minus: "x + y = (0::complex) ==> x = -y"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   364
by (auto simp add: complex_Re_Im_cancel_iff complex_Re_add complex_Im_add complex_Re_minus complex_Im_minus)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   365
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   366
lemma complex_minus_add_distrib: "-(x + y) = -x + -(y::complex)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   367
apply (rule_tac z = x in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   368
apply (rule_tac z = y in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   369
apply (auto simp add: complex_minus complex_add)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   370
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   371
declare complex_minus_add_distrib [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   372
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   373
lemma complex_add_left_cancel: "((x::complex) + y = x + z) = (y = z)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   374
apply safe
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   375
apply (drule_tac f = "%t.-x + t" in arg_cong)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   376
apply (simp add: complex_add_assoc [symmetric])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   377
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   378
declare complex_add_left_cancel [iff]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   379
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   380
lemma complex_add_right_cancel: "(y + (x::complex)= z + x) = (y = z)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   381
apply (simp (no_asm) add: complex_add_commute)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   382
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   383
declare complex_add_right_cancel [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   384
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   385
lemma complex_eq_minus_iff: "((x::complex) = y) = (0 = x + - y)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   386
apply safe
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   387
apply (rule_tac [2] x1 = "-y" in complex_add_right_cancel [THEN iffD1], auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   388
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   389
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   390
lemma complex_eq_minus_iff2: "((x::complex) = y) = (x + - y = 0)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   391
apply safe
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   392
apply (rule_tac [2] x1 = "-y" in complex_add_right_cancel [THEN iffD1], auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   393
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   394
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   395
lemma complex_diff_0: "(0::complex) - x = -x"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   396
apply (simp (no_asm) add: complex_diff_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   397
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   398
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   399
lemma complex_diff_0_right: "x - (0::complex) = x"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   400
apply (simp (no_asm) add: complex_diff_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   401
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   402
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   403
lemma complex_diff_self: "x - x = (0::complex)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   404
apply (simp (no_asm) add: complex_diff_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   405
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   406
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   407
declare complex_diff_0 [simp] complex_diff_0_right [simp] complex_diff_self [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   408
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   409
lemma complex_diff:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   410
      "Abs_complex(x1,y1) - Abs_complex(x2,y2) = Abs_complex(x1-x2,y1-y2)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   411
apply (unfold complex_diff_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   412
apply (simp (no_asm) add: complex_add complex_minus)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   413
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   414
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   415
lemma complex_diff_eq_eq: "((x::complex) - y = z) = (x = z + y)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   416
by (auto simp add: complex_diff_def complex_add_assoc)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   417
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   418
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   419
subsection{*Multiplication*}
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   420
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   421
lemma complex_mult:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   422
      "Abs_complex(x1,y1) * Abs_complex(x2,y2) =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   423
       Abs_complex(x1*x2 - y1*y2,x1*y2 + y1*x2)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   424
apply (unfold complex_mult_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   425
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   426
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   427
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   428
lemma complex_mult_commute: "(w::complex) * z = z * w"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   429
apply (unfold complex_mult_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   430
apply (simp (no_asm) add: real_mult_commute real_add_commute)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   431
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   432
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   433
lemma complex_mult_assoc: "((u::complex) * v) * w = u * (v * w)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   434
apply (unfold complex_mult_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   435
apply (simp (no_asm) add: complex_Re_Im_cancel_iff real_mult_assoc right_diff_distrib right_distrib left_diff_distrib left_distrib mult_left_commute)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   436
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   437
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   438
lemma complex_mult_left_commute: "(x::complex) * (y * z) = y * (x * z)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   439
apply (unfold complex_mult_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   440
apply (simp (no_asm) add: complex_Re_Im_cancel_iff mult_left_commute right_diff_distrib right_distrib)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   441
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   442
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   443
lemmas complex_mult_ac = complex_mult_assoc complex_mult_commute
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   444
                      complex_mult_left_commute
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   445
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   446
lemma complex_mult_one_left: "(1::complex) * z = z"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   447
apply (unfold complex_one_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   448
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   449
apply (simp (no_asm_simp) add: complex_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   450
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   451
declare complex_mult_one_left [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   452
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   453
lemma complex_mult_one_right: "z * (1::complex) = z"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   454
apply (simp (no_asm) add: complex_mult_commute)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   455
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   456
declare complex_mult_one_right [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   457
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   458
lemma complex_mult_zero_left: "(0::complex) * z = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   459
apply (unfold complex_zero_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   460
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   461
apply (simp (no_asm_simp) add: complex_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   462
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   463
declare complex_mult_zero_left [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   464
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   465
lemma complex_mult_zero_right: "z * 0 = (0::complex)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   466
apply (simp (no_asm) add: complex_mult_commute)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   467
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   468
declare complex_mult_zero_right [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   469
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   470
lemma complex_divide_zero: "0 / z = (0::complex)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   471
by (unfold complex_divide_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   472
declare complex_divide_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   473
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   474
lemma complex_minus_mult_eq1: "-(x * y) = -x * (y::complex)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   475
apply (rule_tac z = x in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   476
apply (rule_tac z = y in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   477
apply (auto simp add: complex_mult complex_minus real_diff_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   478
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   479
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   480
lemma complex_minus_mult_eq2: "-(x * y) = x * -(y::complex)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   481
apply (rule_tac z = x in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   482
apply (rule_tac z = y in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   483
apply (auto simp add: complex_mult complex_minus real_diff_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   484
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   485
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   486
lemma complex_add_mult_distrib: "((z1::complex) + z2) * w = (z1 * w) + (z2 * w)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   487
apply (rule_tac z = z1 in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   488
apply (rule_tac z = z2 in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   489
apply (rule_tac z = w in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   490
apply (auto simp add: complex_mult complex_add left_distrib real_diff_def add_ac)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   491
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   492
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   493
lemma complex_add_mult_distrib2: "(w::complex) * (z1 + z2) = (w * z1) + (w * z2)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   494
apply (rule_tac z1 = "z1 + z2" in complex_mult_commute [THEN ssubst])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   495
apply (simp (no_asm) add: complex_add_mult_distrib)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   496
apply (simp (no_asm) add: complex_mult_commute)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   497
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   498
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   499
lemma complex_zero_not_eq_one: "(0::complex) ~= 1"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   500
apply (unfold complex_zero_def complex_one_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   501
apply (simp (no_asm) add: complex_Re_Im_cancel_iff)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   502
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   503
declare complex_zero_not_eq_one [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   504
declare complex_zero_not_eq_one [THEN not_sym, simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   505
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   506
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   507
subsection{*Inverse*}
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   508
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   509
lemma complex_inverse: "inverse (Abs_complex(x,y)) =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   510
     Abs_complex(x/(x ^ 2 + y ^ 2),-y/(x ^ 2 + y ^ 2))"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   511
apply (unfold complex_inverse_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   512
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   513
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   514
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   515
lemma COMPLEX_INVERSE_ZERO: "inverse 0 = (0::complex)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   516
by (unfold complex_inverse_def complex_zero_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   517
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   518
lemma COMPLEX_DIVISION_BY_ZERO: "a / (0::complex) = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   519
apply (simp (no_asm) add: complex_divide_def COMPLEX_INVERSE_ZERO)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   520
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   521
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   522
instance complex :: division_by_zero
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   523
proof
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   524
  fix x :: complex
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   525
  show "inverse 0 = (0::complex)" by (rule COMPLEX_INVERSE_ZERO)
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   526
  show "x/0 = 0" by (rule COMPLEX_DIVISION_BY_ZERO) 
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   527
qed
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   528
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   529
lemma complex_mult_inv_left: "z ~= (0::complex) ==> inverse(z) * z = 1"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   530
apply (rule_tac z = z in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   531
apply (auto simp add: complex_mult complex_inverse complex_one_def 
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   532
       complex_zero_def add_divide_distrib [symmetric] real_power_two mult_ac)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   533
apply (drule_tac y = y in real_sum_squares_not_zero)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   534
apply (drule_tac [2] x = x in real_sum_squares_not_zero2, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   535
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   536
declare complex_mult_inv_left [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   537
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   538
lemma complex_mult_inv_right: "z ~= (0::complex) ==> z * inverse(z) = 1"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   539
by (auto intro: complex_mult_commute [THEN subst])
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   540
declare complex_mult_inv_right [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   541
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   542
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   543
subsection {* The field of complex numbers *}
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   544
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   545
instance complex :: field
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   546
proof
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   547
  fix z u v w :: complex
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   548
  show "(u + v) + w = u + (v + w)"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   549
    by (rule complex_add_assoc) 
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   550
  show "z + w = w + z"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   551
    by (rule complex_add_commute) 
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   552
  show "0 + z = z"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   553
    by (rule complex_add_zero_left) 
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   554
  show "-z + z = 0"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   555
    by (rule complex_add_minus_left_zero) 
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   556
  show "z - w = z + -w"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   557
    by (simp add: complex_diff_def)
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   558
  show "(u * v) * w = u * (v * w)"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   559
    by (rule complex_mult_assoc) 
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   560
  show "z * w = w * z"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   561
    by (rule complex_mult_commute) 
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   562
  show "1 * z = z"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   563
    by (rule complex_mult_one_left) 
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   564
  show "0 \<noteq> (1::complex)"  --{*for some reason it has to be early*}
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   565
    by (rule complex_zero_not_eq_one) 
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   566
  show "(u + v) * w = u * w + v * w"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   567
    by (rule complex_add_mult_distrib) 
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   568
  assume neq: "w \<noteq> 0"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   569
  thus "z / w = z * inverse w"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   570
    by (simp add: complex_divide_def)
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   571
  show "inverse w * w = 1"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   572
    by (simp add: neq complex_mult_inv_left) 
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   573
qed
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   574
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   575
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   576
lemma complex_mult_minus_one: "-(1::complex) * z = -z"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   577
apply (simp (no_asm))
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   578
done
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   579
declare complex_mult_minus_one [simp]
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   580
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   581
lemma complex_mult_minus_one_right: "z * -(1::complex) = -z"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   582
apply (subst complex_mult_commute)
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   583
apply (simp (no_asm))
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   584
done
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   585
declare complex_mult_minus_one_right [simp]
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   586
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   587
lemma complex_minus_mult_cancel: "-x * -y = x * (y::complex)"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   588
apply (simp (no_asm))
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   589
done
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   590
declare complex_minus_mult_cancel [simp]
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   591
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   592
lemma complex_minus_mult_commute: "-x * y = x * -(y::complex)"
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   593
apply (simp (no_asm))
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   594
done
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   595
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   596
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   597
lemma complex_mult_left_cancel: "(c::complex) ~= 0 ==> (c*a=c*b) = (a=b)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   598
apply auto
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   599
apply (drule_tac f = "%x. x*inverse c" in arg_cong)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   600
apply (simp add: complex_mult_ac)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   601
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   602
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   603
lemma complex_mult_right_cancel: "(c::complex) ~= 0 ==> (a*c=b*c) = (a=b)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   604
apply safe
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   605
apply (drule_tac f = "%x. x*inverse c" in arg_cong)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   606
apply (simp add: complex_mult_ac)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   607
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   608
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   609
lemma complex_inverse_not_zero: "z ~= 0 ==> inverse(z::complex) ~= 0"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   610
apply safe
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   611
apply (frule complex_mult_right_cancel [THEN iffD2])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   612
apply (erule_tac [2] V = "inverse z = 0" in thin_rl)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   613
apply (assumption, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   614
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   615
declare complex_inverse_not_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   616
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   617
lemma complex_mult_not_zero: "!!x. [| x ~= 0; y ~= (0::complex) |] ==> x * y ~= 0"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   618
apply safe
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   619
apply (drule_tac f = "%z. inverse x*z" in arg_cong)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   620
apply (simp add: complex_mult_assoc [symmetric])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   621
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   622
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   623
lemmas complex_mult_not_zeroE = complex_mult_not_zero [THEN notE, standard]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   624
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   625
lemma complex_inverse_inverse: "inverse(inverse (x::complex)) = x"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   626
apply (case_tac "x = 0", simp add: COMPLEX_INVERSE_ZERO)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   627
apply (rule_tac c1 = "inverse x" in complex_mult_right_cancel [THEN iffD1])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   628
apply (erule complex_inverse_not_zero)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   629
apply (auto dest: complex_inverse_not_zero)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   630
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   631
declare complex_inverse_inverse [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   632
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   633
lemma complex_inverse_one: "inverse(1::complex) = 1"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   634
apply (unfold complex_one_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   635
apply (simp (no_asm) add: complex_inverse)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   636
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   637
declare complex_inverse_one [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   638
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   639
lemma complex_minus_inverse: "inverse(-x) = -inverse(x::complex)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   640
apply (case_tac "x = 0", simp add: COMPLEX_INVERSE_ZERO)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   641
apply (rule_tac c1 = "-x" in complex_mult_right_cancel [THEN iffD1], force)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   642
apply (subst complex_mult_inv_left, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   643
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   644
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   645
lemma complex_inverse_distrib: "inverse(x*y) = inverse x * inverse (y::complex)"
14335
9c0b5e081037 conversion of Real/PReal to Isar script;
paulson
parents: 14334
diff changeset
   646
apply (rule inverse_mult_distrib) 
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   647
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   648
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   649
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   650
subsection{*Division*}
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   651
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   652
(*adding some of these theorems to simpset as for reals:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   653
  not 100% convinced for some*)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   654
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   655
lemma complex_times_divide1_eq: "(x::complex) * (y/z) = (x*y)/z"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   656
apply (simp (no_asm) add: complex_divide_def complex_mult_assoc)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   657
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   658
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   659
lemma complex_times_divide2_eq: "(y/z) * (x::complex) = (y*x)/z"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   660
apply (simp (no_asm) add: complex_divide_def complex_mult_ac)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   661
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   662
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   663
declare complex_times_divide1_eq [simp] complex_times_divide2_eq [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   664
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   665
lemma complex_divide_divide1_eq: "(x::complex) / (y/z) = (x*z)/y"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   666
apply (simp (no_asm) add: complex_divide_def complex_inverse_distrib complex_mult_ac)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   667
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   668
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   669
lemma complex_divide_divide2_eq: "((x::complex) / y) / z = x/(y*z)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   670
apply (simp (no_asm) add: complex_divide_def complex_inverse_distrib complex_mult_assoc)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   671
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   672
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   673
declare complex_divide_divide1_eq [simp] complex_divide_divide2_eq [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   674
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   675
(** As with multiplication, pull minus signs OUT of the / operator **)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   676
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   677
lemma complex_minus_divide_eq: "(-x) / (y::complex) = - (x/y)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   678
apply (simp (no_asm) add: complex_divide_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   679
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   680
declare complex_minus_divide_eq [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   681
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   682
lemma complex_divide_minus_eq: "(x / -(y::complex)) = - (x/y)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   683
apply (simp (no_asm) add: complex_divide_def complex_minus_inverse)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   684
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   685
declare complex_divide_minus_eq [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   686
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   687
lemma complex_add_divide_distrib: "(x+y)/(z::complex) = x/z + y/z"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   688
apply (simp (no_asm) add: complex_divide_def complex_add_mult_distrib)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   689
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   690
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   691
subsection{*Embedding Properties for @{term complex_of_real} Map*}
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   692
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   693
lemma inj_complex_of_real: "inj complex_of_real"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   694
apply (rule inj_onI)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   695
apply (auto dest: inj_Abs_complex [THEN injD] simp add: complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   696
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   697
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   698
lemma complex_of_real_one:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   699
      "complex_of_real 1 = 1"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   700
apply (unfold complex_one_def complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   701
apply (rule refl)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   702
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   703
declare complex_of_real_one [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   704
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   705
lemma complex_of_real_zero:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   706
      "complex_of_real 0 = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   707
apply (unfold complex_zero_def complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   708
apply (rule refl)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   709
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   710
declare complex_of_real_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   711
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   712
lemma complex_of_real_eq_iff: "(complex_of_real x = complex_of_real y) = (x = y)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   713
by (auto dest: inj_complex_of_real [THEN injD])
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   714
declare complex_of_real_eq_iff [iff]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   715
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   716
lemma complex_of_real_minus: "complex_of_real(-x) = - complex_of_real x"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   717
apply (simp (no_asm) add: complex_of_real_def complex_minus)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   718
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   719
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   720
lemma complex_of_real_inverse: "complex_of_real(inverse x) = inverse(complex_of_real x)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   721
apply (case_tac "x=0")
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   722
apply (simp add: DIVISION_BY_ZERO COMPLEX_INVERSE_ZERO)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   723
apply (simp add: complex_inverse complex_of_real_def real_divide_def 
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   724
                 inverse_mult_distrib real_power_two)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   725
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   726
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   727
lemma complex_of_real_add: "complex_of_real x + complex_of_real y = complex_of_real (x + y)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   728
apply (simp (no_asm) add: complex_add complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   729
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   730
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   731
lemma complex_of_real_diff: "complex_of_real x - complex_of_real y = complex_of_real (x - y)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   732
apply (simp (no_asm) add: complex_of_real_minus [symmetric] complex_diff_def complex_of_real_add)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   733
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   734
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   735
lemma complex_of_real_mult: "complex_of_real x * complex_of_real y = complex_of_real (x * y)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   736
apply (simp (no_asm) add: complex_mult complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   737
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   738
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   739
lemma complex_of_real_divide:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   740
      "complex_of_real x / complex_of_real y = complex_of_real(x/y)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   741
apply (unfold complex_divide_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   742
apply (case_tac "y=0")
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   743
apply (simp (no_asm_simp) add: DIVISION_BY_ZERO COMPLEX_INVERSE_ZERO)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   744
apply (simp (no_asm_simp) add: complex_of_real_mult [symmetric] complex_of_real_inverse real_divide_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   745
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   746
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   747
lemma complex_of_real_pow: "complex_of_real (x ^ n) = (complex_of_real x) ^ n"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   748
apply (induct_tac "n")
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   749
apply (auto simp add: complex_of_real_mult [symmetric])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   750
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   751
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   752
lemma complex_mod: "cmod (Abs_complex(x,y)) = sqrt(x ^ 2 + y ^ 2)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   753
apply (unfold cmod_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   754
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   755
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   756
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   757
lemma complex_mod_zero: "cmod(0) = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   758
apply (unfold cmod_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   759
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   760
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   761
declare complex_mod_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   762
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   763
lemma complex_mod_one: "cmod(1) = 1"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   764
by (unfold cmod_def, simp)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   765
declare complex_mod_one [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   766
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   767
lemma complex_mod_complex_of_real: "cmod(complex_of_real x) = abs x"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   768
apply (unfold complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   769
apply (simp (no_asm) add: complex_mod)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   770
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   771
declare complex_mod_complex_of_real [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   772
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   773
lemma complex_of_real_abs: "complex_of_real (abs x) = complex_of_real(cmod(complex_of_real x))"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   774
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   775
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   776
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   777
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   778
subsection{*Conjugation is an Automorphism*}
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   779
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   780
lemma complex_cnj: "cnj (Abs_complex(x,y)) = Abs_complex(x,-y)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   781
apply (unfold cnj_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   782
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   783
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   784
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   785
lemma inj_cnj: "inj cnj"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   786
apply (rule inj_onI)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   787
apply (auto simp add: cnj_def Abs_complex_cancel_iff complex_Re_Im_cancel_iff)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   788
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   789
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   790
lemma complex_cnj_cancel_iff: "(cnj x = cnj y) = (x = y)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   791
by (auto dest: inj_cnj [THEN injD])
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   792
declare complex_cnj_cancel_iff [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   793
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   794
lemma complex_cnj_cnj: "cnj (cnj z) = z"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   795
apply (unfold cnj_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   796
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   797
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   798
declare complex_cnj_cnj [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   799
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   800
lemma complex_cnj_complex_of_real: "cnj (complex_of_real x) = complex_of_real x"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   801
apply (unfold complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   802
apply (simp (no_asm) add: complex_cnj)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   803
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   804
declare complex_cnj_complex_of_real [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   805
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   806
lemma complex_mod_cnj: "cmod (cnj z) = cmod z"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   807
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   808
apply (simp (no_asm_simp) add: complex_cnj complex_mod real_power_two)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   809
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   810
declare complex_mod_cnj [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   811
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   812
lemma complex_cnj_minus: "cnj (-z) = - cnj z"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   813
apply (unfold cnj_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   814
apply (simp (no_asm) add: complex_minus complex_Re_minus complex_Im_minus)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   815
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   816
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   817
lemma complex_cnj_inverse: "cnj(inverse z) = inverse(cnj z)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   818
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   819
apply (simp (no_asm_simp) add: complex_cnj complex_inverse real_power_two)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   820
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   821
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   822
lemma complex_cnj_add: "cnj(w + z) = cnj(w) + cnj(z)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   823
apply (rule_tac z = w in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   824
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   825
apply (simp (no_asm_simp) add: complex_cnj complex_add)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   826
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   827
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   828
lemma complex_cnj_diff: "cnj(w - z) = cnj(w) - cnj(z)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   829
apply (unfold complex_diff_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   830
apply (simp (no_asm) add: complex_cnj_add complex_cnj_minus)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   831
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   832
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   833
lemma complex_cnj_mult: "cnj(w * z) = cnj(w) * cnj(z)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   834
apply (rule_tac z = w in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   835
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   836
apply (simp (no_asm_simp) add: complex_cnj complex_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   837
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   838
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   839
lemma complex_cnj_divide: "cnj(w / z) = (cnj w)/(cnj z)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   840
apply (unfold complex_divide_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   841
apply (simp (no_asm) add: complex_cnj_mult complex_cnj_inverse)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   842
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   843
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   844
lemma complex_cnj_one: "cnj 1 = 1"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   845
apply (unfold cnj_def complex_one_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   846
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   847
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   848
declare complex_cnj_one [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   849
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   850
lemma complex_cnj_pow: "cnj(z ^ n) = cnj(z) ^ n"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   851
apply (induct_tac "n")
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   852
apply (auto simp add: complex_cnj_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   853
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   854
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   855
lemma complex_add_cnj: "z + cnj z = complex_of_real (2 * Re(z))"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   856
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   857
apply (simp (no_asm_simp) add: complex_add complex_cnj complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   858
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   859
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   860
lemma complex_diff_cnj: "z - cnj z = complex_of_real (2 * Im(z)) * ii"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   861
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   862
apply (simp (no_asm_simp) add: complex_add complex_cnj complex_of_real_def complex_diff_def complex_minus i_def complex_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   863
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   864
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   865
lemma complex_cnj_zero: "cnj 0 = 0"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   866
by (simp add: cnj_def complex_zero_def)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   867
declare complex_cnj_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   868
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   869
lemma complex_cnj_zero_iff: "(cnj z = 0) = (z = 0)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   870
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   871
apply (auto simp add: complex_zero_def complex_cnj)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   872
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   873
declare complex_cnj_zero_iff [iff]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   874
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   875
lemma complex_mult_cnj: "z * cnj z = complex_of_real (Re(z) ^ 2 + Im(z) ^ 2)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   876
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   877
apply (auto simp add: complex_cnj complex_mult complex_of_real_def real_power_two)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   878
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   879
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   880
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   881
subsection{*Algebra*}
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   882
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   883
lemma complex_mult_zero_iff: "(x*y = (0::complex)) = (x = 0 | y = 0)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   884
apply auto
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   885
apply (auto intro: ccontr dest: complex_mult_not_zero)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   886
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   887
declare complex_mult_zero_iff [iff]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   888
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   889
lemma complex_add_left_cancel_zero: "(x + y = x) = (y = (0::complex))"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   890
apply (unfold complex_zero_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   891
apply (rule_tac z = x in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   892
apply (rule_tac z = y in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   893
apply (auto simp add: complex_add)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   894
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   895
declare complex_add_left_cancel_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   896
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   897
lemma complex_diff_mult_distrib:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   898
      "((z1::complex) - z2) * w = (z1 * w) - (z2 * w)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   899
apply (unfold complex_diff_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   900
apply (simp (no_asm) add: complex_add_mult_distrib)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   901
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   902
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   903
lemma complex_diff_mult_distrib2:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   904
      "(w::complex) * (z1 - z2) = (w * z1) - (w * z2)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   905
apply (unfold complex_diff_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   906
apply (simp (no_asm) add: complex_add_mult_distrib2)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   907
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   908
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   909
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   910
subsection{*Modulus*}
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   911
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   912
(*
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   913
Goal "[| sqrt(x) = 0; 0 <= x |] ==> x = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   914
by (auto_tac (claset() addIs [real_sqrt_eq_zero_cancel],
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   915
    simpset()));
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   916
qed "real_sqrt_eq_zero_cancel2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   917
*)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   918
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   919
lemma complex_mod_eq_zero_cancel: "(cmod x = 0) = (x = 0)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   920
apply (rule_tac z = x in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   921
apply (auto intro: real_sum_squares_cancel real_sum_squares_cancel2 simp add: complex_mod complex_zero_def real_power_two)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   922
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   923
declare complex_mod_eq_zero_cancel [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   924
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   925
lemma complex_mod_complex_of_real_of_nat: "cmod (complex_of_real(real (n::nat))) = real n"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   926
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   927
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   928
declare complex_mod_complex_of_real_of_nat [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   929
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   930
lemma complex_mod_minus: "cmod (-x) = cmod(x)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   931
apply (rule_tac z = x in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   932
apply (simp (no_asm_simp) add: complex_mod complex_minus real_power_two)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   933
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   934
declare complex_mod_minus [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   935
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   936
lemma complex_mod_mult_cnj: "cmod(z * cnj(z)) = cmod(z) ^ 2"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   937
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   938
apply (simp (no_asm_simp) add: complex_mod complex_cnj complex_mult);
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   939
apply (simp (no_asm) add: real_power_two real_abs_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   940
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   941
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   942
lemma complex_mod_squared: "cmod(Abs_complex(x,y)) ^ 2 = x ^ 2 + y ^ 2"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   943
by (unfold cmod_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   944
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   945
lemma complex_mod_ge_zero: "0 <= cmod x"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   946
apply (unfold cmod_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   947
apply (auto intro: real_sqrt_ge_zero)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   948
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   949
declare complex_mod_ge_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   950
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   951
lemma abs_cmod_cancel: "abs(cmod x) = cmod x"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   952
by (auto intro: abs_eqI1)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   953
declare abs_cmod_cancel [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   954
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   955
lemma complex_mod_mult: "cmod(x*y) = cmod(x) * cmod(y)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   956
apply (rule_tac z = x in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   957
apply (rule_tac z = y in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   958
apply (auto simp add: complex_mult complex_mod real_sqrt_mult_distrib2 [symmetric] simp del: realpow_Suc)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   959
apply (rule_tac n = 1 in realpow_Suc_cancel_eq)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   960
apply (auto simp add: real_power_two [symmetric] simp del: realpow_Suc)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   961
apply (auto simp add: real_diff_def real_power_two right_distrib left_distrib add_ac mult_ac)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   962
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   963
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   964
lemma complex_mod_add_squared_eq: "cmod(x + y) ^ 2 = cmod(x) ^ 2 + cmod(y) ^ 2 + 2 * Re(x * cnj y)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   965
apply (rule_tac z = x in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   966
apply (rule_tac z = y in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   967
apply (auto simp add: complex_add complex_mod_squared complex_mult complex_cnj real_diff_def simp del: realpow_Suc)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   968
apply (auto simp add: right_distrib left_distrib real_power_two mult_ac add_ac)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   969
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   970
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   971
lemma complex_Re_mult_cnj_le_cmod: "Re(x * cnj y) <= cmod(x * cnj y)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   972
apply (rule_tac z = x in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   973
apply (rule_tac z = y in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   974
apply (auto simp add: complex_mod complex_mult complex_cnj real_diff_def simp del: realpow_Suc)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   975
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   976
declare complex_Re_mult_cnj_le_cmod [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   977
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   978
lemma complex_Re_mult_cnj_le_cmod2: "Re(x * cnj y) <= cmod(x * y)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   979
apply (cut_tac x = x and y = y in complex_Re_mult_cnj_le_cmod)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   980
apply (simp add: complex_mod_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   981
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   982
declare complex_Re_mult_cnj_le_cmod2 [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   983
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   984
lemma real_sum_squared_expand: "((x::real) + y) ^ 2 = x ^ 2 + y ^ 2 + 2 * x * y"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
   985
apply (simp (no_asm) add: left_distrib right_distrib real_power_two)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   986
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   987
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   988
lemma complex_mod_triangle_squared: "cmod (x + y) ^ 2 <= (cmod(x) + cmod(y)) ^ 2"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   989
apply (simp (no_asm) add: real_sum_squared_expand complex_mod_add_squared_eq real_mult_assoc complex_mod_mult [symmetric])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   990
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   991
declare complex_mod_triangle_squared [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   992
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   993
lemma complex_mod_minus_le_complex_mod: "- cmod x <= cmod x"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   994
apply (rule order_trans [OF _ complex_mod_ge_zero]) 
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   995
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   996
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   997
declare complex_mod_minus_le_complex_mod [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   998
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
   999
lemma complex_mod_triangle_ineq: "cmod (x + y) <= cmod(x) + cmod(y)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1000
apply (rule_tac n = 1 in realpow_increasing)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1001
apply (auto intro:  order_trans [OF _ complex_mod_ge_zero]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1002
            simp add: real_power_two [symmetric])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1003
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1004
declare complex_mod_triangle_ineq [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1005
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1006
lemma complex_mod_triangle_ineq2: "cmod(b + a) - cmod b <= cmod a"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1007
apply (cut_tac x1 = b and y1 = a and c = "-cmod b" 
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1008
       in complex_mod_triangle_ineq [THEN add_right_mono])
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1009
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1010
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1011
declare complex_mod_triangle_ineq2 [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1012
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1013
lemma complex_mod_diff_commute: "cmod (x - y) = cmod (y - x)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1014
apply (rule_tac z = x in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1015
apply (rule_tac z = y in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1016
apply (auto simp add: complex_diff complex_mod right_diff_distrib real_power_two left_diff_distrib add_ac mult_ac)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1017
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1018
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1019
lemma complex_mod_add_less: "[| cmod x < r; cmod y < s |] ==> cmod (x + y) < r + s"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1020
by (auto intro: order_le_less_trans complex_mod_triangle_ineq)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1021
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1022
lemma complex_mod_mult_less: "[| cmod x < r; cmod y < s |] ==> cmod (x * y) < r * s"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1023
by (auto intro: real_mult_less_mono' simp add: complex_mod_mult)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1024
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1025
lemma complex_mod_diff_ineq: "cmod(a) - cmod(b) <= cmod(a + b)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1026
apply (rule linorder_cases [of "cmod(a)" "cmod (b)"])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1027
apply auto
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1028
apply (rule order_trans [of _ 0], rule order_less_imp_le)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1029
apply (simp add: compare_rls, simp)  
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1030
apply (simp add: compare_rls)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1031
apply (rule complex_mod_minus [THEN subst])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1032
apply (rule order_trans)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1033
apply (rule_tac [2] complex_mod_triangle_ineq)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1034
apply (auto simp add: complex_add_ac)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1035
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1036
declare complex_mod_diff_ineq [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1037
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1038
lemma complex_Re_le_cmod: "Re z <= cmod z"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1039
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1040
apply (auto simp add: complex_mod simp del: realpow_Suc)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1041
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1042
declare complex_Re_le_cmod [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1043
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1044
lemma complex_mod_gt_zero: "z ~= 0 ==> 0 < cmod z"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1045
apply (cut_tac x = z in complex_mod_ge_zero)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1046
apply (drule order_le_imp_less_or_eq, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1047
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1048
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1049
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1050
subsection{*A Few More Theorems*}
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1051
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1052
lemma complex_mod_complexpow: "cmod(x ^ n) = cmod(x) ^ n"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1053
apply (induct_tac "n")
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1054
apply (auto simp add: complex_mod_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1055
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1056
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1057
lemma complexpow_minus: "(-x::complex) ^ n = (if even n then (x ^ n) else -(x ^ n))"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1058
by (induct_tac "n", auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1059
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1060
lemma complex_inverse_minus: "inverse (-x) = - inverse (x::complex)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1061
apply (rule_tac z = x in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1062
apply (simp (no_asm_simp) add: complex_inverse complex_minus real_power_two)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1063
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1064
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1065
lemma complex_divide_one: "x / (1::complex) = x"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1066
apply (unfold complex_divide_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1067
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1068
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1069
declare complex_divide_one [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1070
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1071
lemma complex_mod_inverse: "cmod(inverse x) = inverse(cmod x)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1072
apply (case_tac "x=0", simp add: COMPLEX_INVERSE_ZERO)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1073
apply (rule_tac c1 = "cmod x" in real_mult_left_cancel [THEN iffD1])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1074
apply (auto simp add: complex_mod_mult [symmetric])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1075
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1076
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1077
lemma complex_mod_divide:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1078
      "cmod(x/y) = cmod(x)/(cmod y)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1079
apply (unfold complex_divide_def real_divide_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1080
apply (auto simp add: complex_mod_mult complex_mod_inverse)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1081
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1082
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1083
lemma complex_inverse_divide:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1084
      "inverse(x/y) = y/(x::complex)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1085
apply (unfold complex_divide_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1086
apply (auto simp add: complex_inverse_distrib complex_mult_commute)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1087
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1088
declare complex_inverse_divide [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1089
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1090
lemma complexpow_mult: "((r::complex) * s) ^ n = (r ^ n) * (s ^ n)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1091
apply (induct_tac "n")
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1092
apply (auto simp add: complex_mult_ac)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1093
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1094
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1095
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1096
subsection{*More Exponentiation*}
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1097
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1098
lemma complexpow_zero: "(0::complex) ^ (Suc n) = 0"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1099
by auto
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1100
declare complexpow_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1101
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1102
lemma complexpow_not_zero [rule_format (no_asm)]: "r ~= (0::complex) --> r ^ n ~= 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1103
apply (induct_tac "n")
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1104
apply (auto simp add: complex_mult_not_zero)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1105
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1106
declare complexpow_not_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1107
declare complexpow_not_zero [intro]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1108
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1109
lemma complexpow_zero_zero: "r ^ n = (0::complex) ==> r = 0"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1110
by (blast intro: ccontr dest: complexpow_not_zero)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1111
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1112
lemma complexpow_i_squared: "ii ^ 2 = -(1::complex)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1113
apply (unfold i_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1114
apply (auto simp add: complex_mult complex_one_def complex_minus numeral_2_eq_2)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1115
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1116
declare complexpow_i_squared [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1117
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1118
lemma complex_i_not_zero: "ii ~= 0"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1119
by (unfold i_def complex_zero_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1120
declare complex_i_not_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1121
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1122
lemma complex_mult_eq_zero_cancel1: "x * y ~= (0::complex) ==> x ~= 0"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1123
by auto
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1124
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1125
lemma complex_mult_eq_zero_cancel2: "x * y ~= 0 ==> y ~= (0::complex)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1126
by auto
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1127
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1128
lemma complex_mult_not_eq_zero_iff: "(x * y ~= 0) = (x ~= 0 & y ~= (0::complex))"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1129
by auto
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1130
declare complex_mult_not_eq_zero_iff [iff]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1131
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1132
lemma complexpow_inverse: "inverse ((r::complex) ^ n) = (inverse r) ^ n"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1133
apply (induct_tac "n")
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1134
apply (auto simp add: complex_inverse_distrib)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1135
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1136
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1137
(*---------------------------------------------------------------------------*)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1138
(* sgn                                                                       *)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1139
(*---------------------------------------------------------------------------*)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1140
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1141
lemma sgn_zero: "sgn 0 = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1142
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1143
apply (unfold sgn_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1144
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1145
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1146
declare sgn_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1147
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1148
lemma sgn_one: "sgn 1 = 1"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1149
apply (unfold sgn_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1150
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1151
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1152
declare sgn_one [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1153
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1154
lemma sgn_minus: "sgn (-z) = - sgn(z)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1155
by (unfold sgn_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1156
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1157
lemma sgn_eq:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1158
    "sgn z = z / complex_of_real (cmod z)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1159
apply (unfold sgn_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1160
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1161
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1162
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1163
lemma complex_split: "EX x y. z = complex_of_real(x) + ii * complex_of_real(y)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1164
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1165
apply (auto simp add: complex_of_real_def i_def complex_mult complex_add)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1166
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1167
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1168
lemma Re_complex_i: "Re(complex_of_real(x) + ii * complex_of_real(y)) = x"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1169
by (auto simp add: complex_of_real_def i_def complex_mult complex_add)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1170
declare Re_complex_i [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1171
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1172
lemma Im_complex_i: "Im(complex_of_real(x) + ii * complex_of_real(y)) = y"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1173
by (auto simp add: complex_of_real_def i_def complex_mult complex_add)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1174
declare Im_complex_i [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1175
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1176
lemma i_mult_eq: "ii * ii = complex_of_real (-1)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1177
apply (unfold i_def complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1178
apply (auto simp add: complex_mult complex_add)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1179
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1180
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1181
lemma i_mult_eq2: "ii * ii = -(1::complex)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1182
apply (unfold i_def complex_one_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1183
apply (simp (no_asm) add: complex_mult complex_minus)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1184
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1185
declare i_mult_eq2 [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1186
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1187
lemma cmod_i: "cmod (complex_of_real(x) + ii * complex_of_real(y)) =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1188
      sqrt (x ^ 2 + y ^ 2)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1189
apply (auto simp add: complex_mult complex_add i_def complex_of_real_def cmod_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1190
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1191
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1192
lemma complex_eq_Re_eq:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1193
     "complex_of_real xa + ii * complex_of_real ya =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1194
      complex_of_real xb + ii * complex_of_real yb
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1195
       ==> xa = xb"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1196
apply (unfold complex_of_real_def i_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1197
apply (auto simp add: complex_mult complex_add)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1198
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1199
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1200
lemma complex_eq_Im_eq:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1201
     "complex_of_real xa + ii * complex_of_real ya =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1202
      complex_of_real xb + ii * complex_of_real yb
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1203
       ==> ya = yb"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1204
apply (unfold complex_of_real_def i_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1205
apply (auto simp add: complex_mult complex_add)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1206
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1207
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1208
lemma complex_eq_cancel_iff: "(complex_of_real xa + ii * complex_of_real ya =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1209
       complex_of_real xb + ii * complex_of_real yb) = ((xa = xb) & (ya = yb))"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1210
apply (auto intro: complex_eq_Im_eq complex_eq_Re_eq)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1211
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1212
declare complex_eq_cancel_iff [iff]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1213
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1214
lemma complex_eq_cancel_iffA: "(complex_of_real xa + complex_of_real ya * ii =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1215
       complex_of_real xb + complex_of_real yb * ii ) = ((xa = xb) & (ya = yb))"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1216
apply (auto simp add: complex_mult_commute)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1217
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1218
declare complex_eq_cancel_iffA [iff]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1219
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1220
lemma complex_eq_cancel_iffB: "(complex_of_real xa + complex_of_real ya * ii =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1221
       complex_of_real xb + ii * complex_of_real yb) = ((xa = xb) & (ya = yb))"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1222
apply (auto simp add: complex_mult_commute)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1223
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1224
declare complex_eq_cancel_iffB [iff]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1225
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1226
lemma complex_eq_cancel_iffC: "(complex_of_real xa + ii * complex_of_real ya  =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1227
       complex_of_real xb + complex_of_real yb * ii) = ((xa = xb) & (ya = yb))"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1228
apply (auto simp add: complex_mult_commute)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1229
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1230
declare complex_eq_cancel_iffC [iff]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1231
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1232
lemma complex_eq_cancel_iff2: "(complex_of_real x + ii * complex_of_real y =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1233
      complex_of_real xa) = (x = xa & y = 0)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1234
apply (cut_tac xa = x and ya = y and xb = xa and yb = 0 in complex_eq_cancel_iff)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1235
apply (simp del: complex_eq_cancel_iff)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1236
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1237
declare complex_eq_cancel_iff2 [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1238
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1239
lemma complex_eq_cancel_iff2a: "(complex_of_real x + complex_of_real y * ii =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1240
      complex_of_real xa) = (x = xa & y = 0)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1241
apply (auto simp add: complex_mult_commute)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1242
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1243
declare complex_eq_cancel_iff2a [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1244
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1245
lemma complex_eq_cancel_iff3: "(complex_of_real x + ii * complex_of_real y =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1246
      ii * complex_of_real ya) = (x = 0 & y = ya)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1247
apply (cut_tac xa = x and ya = y and xb = 0 and yb = ya in complex_eq_cancel_iff)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1248
apply (simp del: complex_eq_cancel_iff)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1249
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1250
declare complex_eq_cancel_iff3 [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1251
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1252
lemma complex_eq_cancel_iff3a: "(complex_of_real x + complex_of_real y * ii =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1253
      ii * complex_of_real ya) = (x = 0 & y = ya)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1254
apply (auto simp add: complex_mult_commute)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1255
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1256
declare complex_eq_cancel_iff3a [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1257
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1258
lemma complex_split_Re_zero:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1259
     "complex_of_real x + ii * complex_of_real y = 0
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1260
      ==> x = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1261
apply (unfold complex_of_real_def i_def complex_zero_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1262
apply (auto simp add: complex_mult complex_add)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1263
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1264
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1265
lemma complex_split_Im_zero:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1266
     "complex_of_real x + ii * complex_of_real y = 0
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1267
      ==> y = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1268
apply (unfold complex_of_real_def i_def complex_zero_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1269
apply (auto simp add: complex_mult complex_add)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1270
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1271
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1272
lemma Re_sgn:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1273
      "Re(sgn z) = Re(z)/cmod z"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1274
apply (unfold sgn_def complex_divide_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1275
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1276
apply (auto simp add: complex_of_real_inverse [symmetric])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1277
apply (auto simp add: complex_of_real_def complex_mult real_divide_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1278
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1279
declare Re_sgn [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1280
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1281
lemma Im_sgn:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1282
      "Im(sgn z) = Im(z)/cmod z"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1283
apply (unfold sgn_def complex_divide_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1284
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1285
apply (auto simp add: complex_of_real_inverse [symmetric])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1286
apply (auto simp add: complex_of_real_def complex_mult real_divide_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1287
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1288
declare Im_sgn [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1289
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1290
lemma complex_inverse_complex_split:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1291
     "inverse(complex_of_real x + ii * complex_of_real y) =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1292
      complex_of_real(x/(x ^ 2 + y ^ 2)) -
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1293
      ii * complex_of_real(y/(x ^ 2 + y ^ 2))"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1294
apply (unfold complex_of_real_def i_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1295
apply (auto simp add: complex_mult complex_add complex_diff_def complex_minus complex_inverse real_divide_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1296
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1297
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1298
(*----------------------------------------------------------------------------*)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1299
(* Many of the theorems below need to be moved elsewhere e.g. Transc. Also *)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1300
(* many of the theorems are not used - so should they be kept?                *)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1301
(*----------------------------------------------------------------------------*)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1302
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1303
lemma Re_mult_i_eq:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1304
    "Re (ii * complex_of_real y) = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1305
apply (unfold i_def complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1306
apply (auto simp add: complex_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1307
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1308
declare Re_mult_i_eq [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1309
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1310
lemma Im_mult_i_eq:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1311
    "Im (ii * complex_of_real y) = y"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1312
apply (unfold i_def complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1313
apply (auto simp add: complex_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1314
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1315
declare Im_mult_i_eq [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1316
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1317
lemma complex_mod_mult_i:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1318
    "cmod (ii * complex_of_real y) = abs y"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1319
apply (unfold i_def complex_of_real_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1320
apply (auto simp add: complex_mult complex_mod real_power_two)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1321
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1322
declare complex_mod_mult_i [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1324
lemma cos_arg_i_mult_zero:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1325
   "0 < y ==> cos (arg(ii * complex_of_real y)) = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1326
apply (unfold arg_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1327
apply (auto simp add: abs_eqI2)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1328
apply (rule_tac a = "pi/2" in someI2, auto)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1329
apply (rule order_less_trans [of _ 0], auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1330
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1331
declare cos_arg_i_mult_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1332
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1333
lemma cos_arg_i_mult_zero2:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1334
   "y < 0 ==> cos (arg(ii * complex_of_real y)) = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1335
apply (unfold arg_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1336
apply (auto simp add: abs_minus_eqI2)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1337
apply (rule_tac a = "- pi/2" in someI2, auto)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1338
apply (rule order_trans [of _ 0], auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1339
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1340
declare cos_arg_i_mult_zero2 [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1341
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1342
lemma complex_of_real_not_zero_iff:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1343
      "(complex_of_real y ~= 0) = (y ~= 0)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1344
apply (unfold complex_zero_def complex_of_real_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1345
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1346
declare complex_of_real_not_zero_iff [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1347
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1348
lemma complex_of_real_zero_iff: "(complex_of_real y = 0) = (y = 0)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1349
apply auto
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1350
apply (rule ccontr, drule complex_of_real_not_zero_iff [THEN iffD2], simp)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1351
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1352
declare complex_of_real_zero_iff [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1353
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1354
lemma cos_arg_i_mult_zero3: "y ~= 0 ==> cos (arg(ii * complex_of_real y)) = 0"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1355
by (cut_tac x = y and y = 0 in linorder_less_linear, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1356
declare cos_arg_i_mult_zero3 [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1357
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1358
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1359
subsection{*Finally! Polar Form for Complex Numbers*}
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1360
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1361
lemma complex_split_polar: "EX r a. z = complex_of_real r *
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1362
      (complex_of_real(cos a) + ii * complex_of_real(sin a))"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1363
apply (cut_tac z = z in complex_split)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1364
apply (auto simp add: polar_Ex complex_add_mult_distrib2 complex_of_real_mult complex_mult_ac)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1365
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1366
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1367
lemma rcis_Ex: "EX r a. z = rcis r a"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1368
apply (unfold rcis_def cis_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1369
apply (rule complex_split_polar)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1370
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1371
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1372
lemma Re_complex_polar: "Re(complex_of_real r *
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1373
      (complex_of_real(cos a) + ii * complex_of_real(sin a))) = r * cos a"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1374
apply (auto simp add: complex_add_mult_distrib2 complex_of_real_mult complex_mult_ac)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1375
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1376
declare Re_complex_polar [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1377
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1378
lemma Re_rcis: "Re(rcis r a) = r * cos a"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1379
by (unfold rcis_def cis_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1380
declare Re_rcis [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1381
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1382
lemma Im_complex_polar: "Im(complex_of_real r *
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1383
      (complex_of_real(cos a) + ii * complex_of_real(sin a))) = r * sin a"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1384
apply (auto simp add: complex_add_mult_distrib2 complex_of_real_mult complex_mult_ac)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1385
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1386
declare Im_complex_polar [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1387
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1388
lemma Im_rcis: "Im(rcis r a) = r * sin a"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1389
by (unfold rcis_def cis_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1390
declare Im_rcis [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1391
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1392
lemma complex_mod_complex_polar: "cmod (complex_of_real r *
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1393
      (complex_of_real(cos a) + ii * complex_of_real(sin a))) = abs r"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1394
apply (auto simp add: complex_add_mult_distrib2 cmod_i complex_of_real_mult right_distrib [symmetric] realpow_mult complex_mult_ac mult_ac simp del: realpow_Suc)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1395
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1396
declare complex_mod_complex_polar [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1397
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1398
lemma complex_mod_rcis: "cmod(rcis r a) = abs r"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1399
by (unfold rcis_def cis_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1400
declare complex_mod_rcis [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1401
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1402
lemma complex_mod_sqrt_Re_mult_cnj: "cmod z = sqrt (Re (z * cnj z))"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1403
apply (unfold cmod_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1404
apply (rule real_sqrt_eq_iff [THEN iffD2])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1405
apply (auto simp add: complex_mult_cnj)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1406
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1407
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1408
lemma complex_Re_cnj: "Re(cnj z) = Re z"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1409
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1410
apply (auto simp add: complex_cnj)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1411
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1412
declare complex_Re_cnj [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1413
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1414
lemma complex_Im_cnj: "Im(cnj z) = - Im z"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1415
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1416
apply (auto simp add: complex_cnj)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1417
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1418
declare complex_Im_cnj [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1419
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1420
lemma complex_In_mult_cnj_zero: "Im (z * cnj z) = 0"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1421
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1422
apply (auto simp add: complex_cnj complex_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1423
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1424
declare complex_In_mult_cnj_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1425
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1426
lemma complex_Re_mult: "[| Im w = 0; Im z = 0 |] ==> Re(w * z) = Re(w) * Re(z)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1427
apply (rule_tac z = z in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1428
apply (rule_tac z = w in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1429
apply (auto simp add: complex_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1430
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1431
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1432
lemma complex_Re_mult_complex_of_real: "Re (z * complex_of_real c) = Re(z) * c"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1433
apply (unfold complex_of_real_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1434
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1435
apply (auto simp add: complex_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1436
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1437
declare complex_Re_mult_complex_of_real [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1438
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1439
lemma complex_Im_mult_complex_of_real: "Im (z * complex_of_real c) = Im(z) * c"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1440
apply (unfold complex_of_real_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1441
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1442
apply (auto simp add: complex_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1443
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1444
declare complex_Im_mult_complex_of_real [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1445
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1446
lemma complex_Re_mult_complex_of_real2: "Re (complex_of_real c * z) = c * Re(z)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1447
apply (unfold complex_of_real_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1448
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1449
apply (auto simp add: complex_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1450
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1451
declare complex_Re_mult_complex_of_real2 [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1452
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1453
lemma complex_Im_mult_complex_of_real2: "Im (complex_of_real c * z) = c * Im(z)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1454
apply (unfold complex_of_real_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1455
apply (rule_tac z = z in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1456
apply (auto simp add: complex_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1457
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1458
declare complex_Im_mult_complex_of_real2 [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1459
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1460
(*---------------------------------------------------------------------------*)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1461
(*  (r1 * cis a) * (r2 * cis b) = r1 * r2 * cis (a + b)                      *)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1462
(*---------------------------------------------------------------------------*)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1463
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1464
lemma cis_rcis_eq: "cis a = rcis 1 a"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1465
apply (unfold rcis_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1466
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1467
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1468
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1469
lemma rcis_mult:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1470
  "rcis r1 a * rcis r2 b = rcis (r1*r2) (a + b)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1471
apply (unfold rcis_def cis_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1472
apply (auto simp add: cos_add sin_add complex_add_mult_distrib2 complex_add_mult_distrib complex_mult_ac complex_add_ac)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1473
apply (auto simp add: complex_add_mult_distrib2 [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)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1474
apply (auto simp add: complex_add_ac)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1475
apply (auto simp add: complex_add_assoc [symmetric] complex_of_real_add right_distrib real_diff_def mult_ac add_ac)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1476
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1477
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1478
lemma cis_mult: "cis a * cis b = cis (a + b)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1479
apply (simp (no_asm) add: cis_rcis_eq rcis_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1480
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1481
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1482
lemma cis_zero: "cis 0 = 1"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1483
by (unfold cis_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1484
declare cis_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1485
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1486
lemma cis_zero2: "cis 0 = complex_of_real 1"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1487
by (unfold cis_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1488
declare cis_zero2 [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1489
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1490
lemma rcis_zero_mod: "rcis 0 a = 0"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1491
apply (unfold rcis_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1492
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1493
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1494
declare rcis_zero_mod [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1495
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1496
lemma rcis_zero_arg: "rcis r 0 = complex_of_real r"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1497
apply (unfold rcis_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1498
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1499
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1500
declare rcis_zero_arg [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1501
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1502
lemma complex_of_real_minus_one:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1503
   "complex_of_real (-(1::real)) = -(1::complex)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1504
apply (unfold complex_of_real_def complex_one_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1505
apply (simp (no_asm) add: complex_minus)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1506
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1507
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1508
lemma complex_i_mult_minus: "ii * (ii * x) = - x"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1509
apply (simp (no_asm) add: complex_mult_assoc [symmetric])
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1510
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1511
declare complex_i_mult_minus [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1512
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1513
lemma complex_i_mult_minus2: "ii * ii * x = - x"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1514
apply (simp (no_asm))
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1515
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1516
declare complex_i_mult_minus2 [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1517
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1518
lemma cis_real_of_nat_Suc_mult:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1519
   "cis (real (Suc n) * a) = cis a * cis (real n * a)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1520
apply (unfold cis_def)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1521
apply (auto simp add: real_of_nat_Suc left_distrib cos_add sin_add complex_add_mult_distrib complex_add_mult_distrib2 complex_of_real_add complex_of_real_mult complex_mult_ac complex_add_ac)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1522
apply (auto simp add: complex_add_mult_distrib2 [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)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1523
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1524
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1525
lemma DeMoivre: "(cis a) ^ n = cis (real n * a)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1526
apply (induct_tac "n")
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1527
apply (auto simp add: cis_real_of_nat_Suc_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1528
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1529
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1530
lemma DeMoivre2:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1531
   "(rcis r a) ^ n = rcis (r ^ n) (real n * a)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1532
apply (unfold rcis_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1533
apply (auto simp add: complexpow_mult DeMoivre complex_of_real_pow)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1534
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1535
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1536
lemma cis_inverse: "inverse(cis a) = cis (-a)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1537
apply (unfold cis_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1538
apply (auto simp add: complex_inverse_complex_split complex_of_real_minus complex_diff_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1539
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1540
declare cis_inverse [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1541
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1542
lemma rcis_inverse: "inverse(rcis r a) = rcis (1/r) (-a)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1543
apply (case_tac "r=0")
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1544
apply (simp (no_asm_simp) add: DIVISION_BY_ZERO COMPLEX_INVERSE_ZERO)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1545
apply (auto simp add: complex_inverse_complex_split complex_add_mult_distrib2 complex_of_real_mult rcis_def cis_def real_power_two complex_mult_ac mult_ac)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1546
apply (auto simp add: right_distrib [symmetric] complex_of_real_minus complex_diff_def)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1547
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1548
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1549
lemma cis_divide: "cis a / cis b = cis (a - b)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1550
apply (unfold complex_divide_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1551
apply (auto simp add: cis_mult real_diff_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1552
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1553
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1554
lemma rcis_divide:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1555
 "rcis r1 a / rcis r2 b = rcis (r1/r2) (a - b)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1556
apply (unfold complex_divide_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1557
apply (case_tac "r2=0")
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1558
apply (simp (no_asm_simp) add: DIVISION_BY_ZERO COMPLEX_INVERSE_ZERO)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1559
apply (auto simp add: rcis_inverse rcis_mult real_diff_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1560
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1561
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1562
lemma Re_cis: "Re(cis a) = cos a"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1563
by (unfold cis_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1564
declare Re_cis [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1565
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1566
lemma Im_cis: "Im(cis a) = sin a"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1567
by (unfold cis_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1568
declare Im_cis [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1569
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1570
lemma cos_n_Re_cis_pow_n: "cos (real n * a) = Re(cis a ^ n)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1571
by (auto simp add: DeMoivre)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1572
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1573
lemma sin_n_Im_cis_pow_n: "sin (real n * a) = Im(cis a ^ n)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1574
by (auto simp add: DeMoivre)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1575
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1576
lemma expi_Im_split:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1577
    "expi (ii * complex_of_real y) =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1578
     complex_of_real (cos y) + ii * complex_of_real (sin y)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1579
apply (unfold expi_def cis_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1580
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1581
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1582
lemma expi_Im_cis:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1583
    "expi (ii * complex_of_real y) = cis y"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1584
apply (unfold expi_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1585
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1586
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1587
lemma expi_add: "expi(a + b) = expi(a) * expi(b)"
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1588
apply (unfold expi_def)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1589
apply (auto simp add: complex_Re_add exp_add complex_Im_add cis_mult [symmetric] complex_of_real_mult complex_mult_ac)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1590
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1591
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1592
lemma expi_complex_split:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1593
     "expi(complex_of_real x + ii * complex_of_real y) =
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1594
      complex_of_real (exp(x)) * cis y"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1595
apply (unfold expi_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1596
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1597
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1598
lemma expi_zero: "expi (0::complex) = 1"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1599
by (unfold expi_def, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1600
declare expi_zero [simp]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1601
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1602
lemma complex_Re_mult_eq: "Re (w * z) = Re w * Re z - Im w * Im z"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1603
apply (rule_tac z = z in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1604
apply (rule_tac z = w in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1605
apply (auto simp add: complex_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1606
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1607
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1608
lemma complex_Im_mult_eq:
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1609
     "Im (w * z) = Re w * Im z + Im w * Re z"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1610
apply (rule_tac z = z in eq_Abs_complex)
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1611
apply (rule_tac z = w in eq_Abs_complex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1612
apply (auto simp add: complex_mult)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1613
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1614
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1615
lemma complex_expi_Ex: 
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1616
   "EX a r. z = complex_of_real r * expi a"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1617
apply (cut_tac z = z in rcis_Ex)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1618
apply (auto simp add: expi_def rcis_def complex_mult_assoc [symmetric] complex_of_real_mult)
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1619
apply (rule_tac x = "ii * complex_of_real a" in exI, auto)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1620
done
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1621
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1622
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1623
(****
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1624
Goal "[| - pi < a; a <= pi |] ==> (-pi < a & a <= 0) | (0 <= a & a <= pi)"
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1625
by Auto_tac
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1626
qed "lemma_split_interval";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1627
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1628
Goalw [arg_def]
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1629
  "[| r ~= 0; - pi < a; a <= pi |] \
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1630
\  ==> arg(complex_of_real r * \
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1631
\      (complex_of_real(cos a) + ii * complex_of_real(sin a))) = a";
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1632
by Auto_tac
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1633
by (cut_inst_tac [("x","0"),("y","r")] linorder_less_linear 1);
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1634
by (auto_tac (claset(),simpset() addsimps (map (full_rename_numerals thy)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1635
    [rabs_eqI2,rabs_minus_eqI2,real_minus_rinv]) [real_divide_def,
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1636
    minus_mult_right RS sym] mult_ac));
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1637
by (auto_tac (claset(),simpset() addsimps [real_mult_assoc RS sym]));
14334
6137d24eef79 tweaking of lemmas in RealDef, RealOrd
paulson
parents: 14323
diff changeset
  1638
by (dtac lemma_split_interval 1 THEN safe)
14323
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1639
****)
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1640
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1641
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1642
ML
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1643
{*
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1644
val complex_zero_def = thm"complex_zero_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1645
val complex_one_def = thm"complex_one_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1646
val complex_minus_def = thm"complex_minus_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1647
val complex_diff_def = thm"complex_diff_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1648
val complex_divide_def = thm"complex_divide_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1649
val complex_mult_def = thm"complex_mult_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1650
val complex_add_def = thm"complex_add_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1651
val complex_of_real_def = thm"complex_of_real_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1652
val i_def = thm"i_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1653
val expi_def = thm"expi_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1654
val cis_def = thm"cis_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1655
val rcis_def = thm"rcis_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1656
val cmod_def = thm"cmod_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1657
val cnj_def = thm"cnj_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1658
val sgn_def = thm"sgn_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1659
val arg_def = thm"arg_def";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1660
val complexpow_0 = thm"complexpow_0";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1661
val complexpow_Suc = thm"complexpow_Suc";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1662
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1663
val inj_Rep_complex = thm"inj_Rep_complex";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1664
val inj_Abs_complex = thm"inj_Abs_complex";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1665
val Abs_complex_cancel_iff = thm"Abs_complex_cancel_iff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1666
val pair_mem_complex = thm"pair_mem_complex";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1667
val Abs_complex_inverse2 = thm"Abs_complex_inverse2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1668
val eq_Abs_complex = thm"eq_Abs_complex";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1669
val Re = thm"Re";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1670
val Im = thm"Im";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1671
val Abs_complex_cancel = thm"Abs_complex_cancel";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1672
val complex_Re_Im_cancel_iff = thm"complex_Re_Im_cancel_iff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1673
val complex_Re_zero = thm"complex_Re_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1674
val complex_Im_zero = thm"complex_Im_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1675
val complex_Re_one = thm"complex_Re_one";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1676
val complex_Im_one = thm"complex_Im_one";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1677
val complex_Re_i = thm"complex_Re_i";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1678
val complex_Im_i = thm"complex_Im_i";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1679
val Re_complex_of_real_zero = thm"Re_complex_of_real_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1680
val Im_complex_of_real_zero = thm"Im_complex_of_real_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1681
val Re_complex_of_real_one = thm"Re_complex_of_real_one";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1682
val Im_complex_of_real_one = thm"Im_complex_of_real_one";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1683
val Re_complex_of_real = thm"Re_complex_of_real";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1684
val Im_complex_of_real = thm"Im_complex_of_real";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1685
val complex_minus = thm"complex_minus";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1686
val complex_Re_minus = thm"complex_Re_minus";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1687
val complex_Im_minus = thm"complex_Im_minus";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1688
val complex_minus_minus = thm"complex_minus_minus";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1689
val inj_complex_minus = thm"inj_complex_minus";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1690
val complex_minus_zero = thm"complex_minus_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1691
val complex_minus_zero_iff = thm"complex_minus_zero_iff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1692
val complex_minus_zero_iff2 = thm"complex_minus_zero_iff2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1693
val complex_minus_not_zero_iff = thm"complex_minus_not_zero_iff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1694
val complex_add = thm"complex_add";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1695
val complex_Re_add = thm"complex_Re_add";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1696
val complex_Im_add = thm"complex_Im_add";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1697
val complex_add_commute = thm"complex_add_commute";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1698
val complex_add_assoc = thm"complex_add_assoc";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1699
val complex_add_left_commute = thm"complex_add_left_commute";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1700
val complex_add_zero_left = thm"complex_add_zero_left";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1701
val complex_add_zero_right = thm"complex_add_zero_right";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1702
val complex_add_minus_right_zero = thm"complex_add_minus_right_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1703
val complex_add_minus_left_zero = thm"complex_add_minus_left_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1704
val complex_add_minus_cancel = thm"complex_add_minus_cancel";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1705
val complex_minus_add_cancel = thm"complex_minus_add_cancel";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1706
val complex_add_minus_eq_minus = thm"complex_add_minus_eq_minus";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1707
val complex_minus_add_distrib = thm"complex_minus_add_distrib";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1708
val complex_add_left_cancel = thm"complex_add_left_cancel";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1709
val complex_add_right_cancel = thm"complex_add_right_cancel";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1710
val complex_eq_minus_iff = thm"complex_eq_minus_iff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1711
val complex_eq_minus_iff2 = thm"complex_eq_minus_iff2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1712
val complex_diff_0 = thm"complex_diff_0";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1713
val complex_diff_0_right = thm"complex_diff_0_right";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1714
val complex_diff_self = thm"complex_diff_self";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1715
val complex_diff = thm"complex_diff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1716
val complex_diff_eq_eq = thm"complex_diff_eq_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1717
val complex_mult = thm"complex_mult";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1718
val complex_mult_commute = thm"complex_mult_commute";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1719
val complex_mult_assoc = thm"complex_mult_assoc";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1720
val complex_mult_left_commute = thm"complex_mult_left_commute";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1721
val complex_mult_one_left = thm"complex_mult_one_left";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1722
val complex_mult_one_right = thm"complex_mult_one_right";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1723
val complex_mult_zero_left = thm"complex_mult_zero_left";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1724
val complex_mult_zero_right = thm"complex_mult_zero_right";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1725
val complex_divide_zero = thm"complex_divide_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1726
val complex_minus_mult_eq1 = thm"complex_minus_mult_eq1";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1727
val complex_minus_mult_eq2 = thm"complex_minus_mult_eq2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1728
val complex_mult_minus_one = thm"complex_mult_minus_one";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1729
val complex_mult_minus_one_right = thm"complex_mult_minus_one_right";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1730
val complex_minus_mult_cancel = thm"complex_minus_mult_cancel";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1731
val complex_minus_mult_commute = thm"complex_minus_mult_commute";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1732
val complex_add_mult_distrib = thm"complex_add_mult_distrib";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1733
val complex_add_mult_distrib2 = thm"complex_add_mult_distrib2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1734
val complex_zero_not_eq_one = thm"complex_zero_not_eq_one";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1735
val complex_inverse = thm"complex_inverse";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1736
val COMPLEX_INVERSE_ZERO = thm"COMPLEX_INVERSE_ZERO";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1737
val COMPLEX_DIVISION_BY_ZERO = thm"COMPLEX_DIVISION_BY_ZERO";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1738
val complex_mult_inv_left = thm"complex_mult_inv_left";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1739
val complex_mult_inv_right = thm"complex_mult_inv_right";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1740
val complex_mult_left_cancel = thm"complex_mult_left_cancel";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1741
val complex_mult_right_cancel = thm"complex_mult_right_cancel";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1742
val complex_inverse_not_zero = thm"complex_inverse_not_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1743
val complex_mult_not_zero = thm"complex_mult_not_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1744
val complex_inverse_inverse = thm"complex_inverse_inverse";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1745
val complex_inverse_one = thm"complex_inverse_one";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1746
val complex_minus_inverse = thm"complex_minus_inverse";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1747
val complex_inverse_distrib = thm"complex_inverse_distrib";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1748
val complex_times_divide1_eq = thm"complex_times_divide1_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1749
val complex_times_divide2_eq = thm"complex_times_divide2_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1750
val complex_divide_divide1_eq = thm"complex_divide_divide1_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1751
val complex_divide_divide2_eq = thm"complex_divide_divide2_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1752
val complex_minus_divide_eq = thm"complex_minus_divide_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1753
val complex_divide_minus_eq = thm"complex_divide_minus_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1754
val complex_add_divide_distrib = thm"complex_add_divide_distrib";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1755
val inj_complex_of_real = thm"inj_complex_of_real";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1756
val complex_of_real_one = thm"complex_of_real_one";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1757
val complex_of_real_zero = thm"complex_of_real_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1758
val complex_of_real_eq_iff = thm"complex_of_real_eq_iff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1759
val complex_of_real_minus = thm"complex_of_real_minus";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1760
val complex_of_real_inverse = thm"complex_of_real_inverse";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1761
val complex_of_real_add = thm"complex_of_real_add";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1762
val complex_of_real_diff = thm"complex_of_real_diff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1763
val complex_of_real_mult = thm"complex_of_real_mult";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1764
val complex_of_real_divide = thm"complex_of_real_divide";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1765
val complex_of_real_pow = thm"complex_of_real_pow";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1766
val complex_mod = thm"complex_mod";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1767
val complex_mod_zero = thm"complex_mod_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1768
val complex_mod_one = thm"complex_mod_one";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1769
val complex_mod_complex_of_real = thm"complex_mod_complex_of_real";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1770
val complex_of_real_abs = thm"complex_of_real_abs";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1771
val complex_cnj = thm"complex_cnj";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1772
val inj_cnj = thm"inj_cnj";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1773
val complex_cnj_cancel_iff = thm"complex_cnj_cancel_iff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1774
val complex_cnj_cnj = thm"complex_cnj_cnj";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1775
val complex_cnj_complex_of_real = thm"complex_cnj_complex_of_real";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1776
val complex_mod_cnj = thm"complex_mod_cnj";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1777
val complex_cnj_minus = thm"complex_cnj_minus";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1778
val complex_cnj_inverse = thm"complex_cnj_inverse";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1779
val complex_cnj_add = thm"complex_cnj_add";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1780
val complex_cnj_diff = thm"complex_cnj_diff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1781
val complex_cnj_mult = thm"complex_cnj_mult";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1782
val complex_cnj_divide = thm"complex_cnj_divide";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1783
val complex_cnj_one = thm"complex_cnj_one";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1784
val complex_cnj_pow = thm"complex_cnj_pow";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1785
val complex_add_cnj = thm"complex_add_cnj";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1786
val complex_diff_cnj = thm"complex_diff_cnj";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1787
val complex_cnj_zero = thm"complex_cnj_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1788
val complex_cnj_zero_iff = thm"complex_cnj_zero_iff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1789
val complex_mult_cnj = thm"complex_mult_cnj";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1790
val complex_mult_zero_iff = thm"complex_mult_zero_iff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1791
val complex_add_left_cancel_zero = thm"complex_add_left_cancel_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1792
val complex_diff_mult_distrib = thm"complex_diff_mult_distrib";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1793
val complex_diff_mult_distrib2 = thm"complex_diff_mult_distrib2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1794
val complex_mod_eq_zero_cancel = thm"complex_mod_eq_zero_cancel";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1795
val complex_mod_complex_of_real_of_nat = thm"complex_mod_complex_of_real_of_nat";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1796
val complex_mod_minus = thm"complex_mod_minus";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1797
val complex_mod_mult_cnj = thm"complex_mod_mult_cnj";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1798
val complex_mod_squared = thm"complex_mod_squared";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1799
val complex_mod_ge_zero = thm"complex_mod_ge_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1800
val abs_cmod_cancel = thm"abs_cmod_cancel";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1801
val complex_mod_mult = thm"complex_mod_mult";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1802
val complex_mod_add_squared_eq = thm"complex_mod_add_squared_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1803
val complex_Re_mult_cnj_le_cmod = thm"complex_Re_mult_cnj_le_cmod";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1804
val complex_Re_mult_cnj_le_cmod2 = thm"complex_Re_mult_cnj_le_cmod2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1805
val real_sum_squared_expand = thm"real_sum_squared_expand";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1806
val complex_mod_triangle_squared = thm"complex_mod_triangle_squared";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1807
val complex_mod_minus_le_complex_mod = thm"complex_mod_minus_le_complex_mod";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1808
val complex_mod_triangle_ineq = thm"complex_mod_triangle_ineq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1809
val complex_mod_triangle_ineq2 = thm"complex_mod_triangle_ineq2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1810
val complex_mod_diff_commute = thm"complex_mod_diff_commute";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1811
val complex_mod_add_less = thm"complex_mod_add_less";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1812
val complex_mod_mult_less = thm"complex_mod_mult_less";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1813
val complex_mod_diff_ineq = thm"complex_mod_diff_ineq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1814
val complex_Re_le_cmod = thm"complex_Re_le_cmod";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1815
val complex_mod_gt_zero = thm"complex_mod_gt_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1816
val complex_mod_complexpow = thm"complex_mod_complexpow";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1817
val complexpow_minus = thm"complexpow_minus";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1818
val complex_inverse_minus = thm"complex_inverse_minus";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1819
val complex_divide_one = thm"complex_divide_one";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1820
val complex_mod_inverse = thm"complex_mod_inverse";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1821
val complex_mod_divide = thm"complex_mod_divide";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1822
val complex_inverse_divide = thm"complex_inverse_divide";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1823
val complexpow_mult = thm"complexpow_mult";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1824
val complexpow_zero = thm"complexpow_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1825
val complexpow_not_zero = thm"complexpow_not_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1826
val complexpow_zero_zero = thm"complexpow_zero_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1827
val complexpow_i_squared = thm"complexpow_i_squared";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1828
val complex_i_not_zero = thm"complex_i_not_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1829
val complex_mult_eq_zero_cancel1 = thm"complex_mult_eq_zero_cancel1";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1830
val complex_mult_eq_zero_cancel2 = thm"complex_mult_eq_zero_cancel2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1831
val complex_mult_not_eq_zero_iff = thm"complex_mult_not_eq_zero_iff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1832
val complexpow_inverse = thm"complexpow_inverse";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1833
val sgn_zero = thm"sgn_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1834
val sgn_one = thm"sgn_one";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1835
val sgn_minus = thm"sgn_minus";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1836
val sgn_eq = thm"sgn_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1837
val complex_split = thm"complex_split";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1838
val Re_complex_i = thm"Re_complex_i";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1839
val Im_complex_i = thm"Im_complex_i";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1840
val i_mult_eq = thm"i_mult_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1841
val i_mult_eq2 = thm"i_mult_eq2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1842
val cmod_i = thm"cmod_i";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1843
val complex_eq_Re_eq = thm"complex_eq_Re_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1844
val complex_eq_Im_eq = thm"complex_eq_Im_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1845
val complex_eq_cancel_iff = thm"complex_eq_cancel_iff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1846
val complex_eq_cancel_iffA = thm"complex_eq_cancel_iffA";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1847
val complex_eq_cancel_iffB = thm"complex_eq_cancel_iffB";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1848
val complex_eq_cancel_iffC = thm"complex_eq_cancel_iffC";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1849
val complex_eq_cancel_iff2 = thm"complex_eq_cancel_iff2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1850
val complex_eq_cancel_iff2a = thm"complex_eq_cancel_iff2a";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1851
val complex_eq_cancel_iff3 = thm"complex_eq_cancel_iff3";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1852
val complex_eq_cancel_iff3a = thm"complex_eq_cancel_iff3a";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1853
val complex_split_Re_zero = thm"complex_split_Re_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1854
val complex_split_Im_zero = thm"complex_split_Im_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1855
val Re_sgn = thm"Re_sgn";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1856
val Im_sgn = thm"Im_sgn";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1857
val complex_inverse_complex_split = thm"complex_inverse_complex_split";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1858
val Re_mult_i_eq = thm"Re_mult_i_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1859
val Im_mult_i_eq = thm"Im_mult_i_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1860
val complex_mod_mult_i = thm"complex_mod_mult_i";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1861
val cos_arg_i_mult_zero = thm"cos_arg_i_mult_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1862
val cos_arg_i_mult_zero2 = thm"cos_arg_i_mult_zero2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1863
val complex_of_real_not_zero_iff = thm"complex_of_real_not_zero_iff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1864
val complex_of_real_zero_iff = thm"complex_of_real_zero_iff";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1865
val cos_arg_i_mult_zero3 = thm"cos_arg_i_mult_zero3";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1866
val complex_split_polar = thm"complex_split_polar";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1867
val rcis_Ex = thm"rcis_Ex";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1868
val Re_complex_polar = thm"Re_complex_polar";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1869
val Re_rcis = thm"Re_rcis";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1870
val Im_complex_polar = thm"Im_complex_polar";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1871
val Im_rcis = thm"Im_rcis";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1872
val complex_mod_complex_polar = thm"complex_mod_complex_polar";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1873
val complex_mod_rcis = thm"complex_mod_rcis";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1874
val complex_mod_sqrt_Re_mult_cnj = thm"complex_mod_sqrt_Re_mult_cnj";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1875
val complex_Re_cnj = thm"complex_Re_cnj";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1876
val complex_Im_cnj = thm"complex_Im_cnj";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1877
val complex_In_mult_cnj_zero = thm"complex_In_mult_cnj_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1878
val complex_Re_mult = thm"complex_Re_mult";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1879
val complex_Re_mult_complex_of_real = thm"complex_Re_mult_complex_of_real";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1880
val complex_Im_mult_complex_of_real = thm"complex_Im_mult_complex_of_real";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1881
val complex_Re_mult_complex_of_real2 = thm"complex_Re_mult_complex_of_real2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1882
val complex_Im_mult_complex_of_real2 = thm"complex_Im_mult_complex_of_real2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1883
val cis_rcis_eq = thm"cis_rcis_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1884
val rcis_mult = thm"rcis_mult";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1885
val cis_mult = thm"cis_mult";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1886
val cis_zero = thm"cis_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1887
val cis_zero2 = thm"cis_zero2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1888
val rcis_zero_mod = thm"rcis_zero_mod";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1889
val rcis_zero_arg = thm"rcis_zero_arg";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1890
val complex_of_real_minus_one = thm"complex_of_real_minus_one";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1891
val complex_i_mult_minus = thm"complex_i_mult_minus";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1892
val complex_i_mult_minus2 = thm"complex_i_mult_minus2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1893
val cis_real_of_nat_Suc_mult = thm"cis_real_of_nat_Suc_mult";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1894
val DeMoivre = thm"DeMoivre";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1895
val DeMoivre2 = thm"DeMoivre2";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1896
val cis_inverse = thm"cis_inverse";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1897
val rcis_inverse = thm"rcis_inverse";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1898
val cis_divide = thm"cis_divide";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1899
val rcis_divide = thm"rcis_divide";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1900
val Re_cis = thm"Re_cis";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1901
val Im_cis = thm"Im_cis";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1902
val cos_n_Re_cis_pow_n = thm"cos_n_Re_cis_pow_n";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1903
val sin_n_Im_cis_pow_n = thm"sin_n_Im_cis_pow_n";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1904
val expi_Im_split = thm"expi_Im_split";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1905
val expi_Im_cis = thm"expi_Im_cis";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1906
val expi_add = thm"expi_add";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1907
val expi_complex_split = thm"expi_complex_split";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1908
val expi_zero = thm"expi_zero";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1909
val complex_Re_mult_eq = thm"complex_Re_mult_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1910
val complex_Im_mult_eq = thm"complex_Im_mult_eq";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1911
val complex_expi_Ex = thm"complex_expi_Ex";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1912
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1913
val complex_add_ac = thms"complex_add_ac";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1914
val complex_mult_ac = thms"complex_mult_ac";
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1915
*}
27724f528f82 converting Complex/Complex.ML to Isar
paulson
parents: 13957
diff changeset
  1916
13957
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1917
end
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1918
10dbf16be15f new session Complex for the complex numbers
paulson
parents:
diff changeset
  1919