src/HOL/Complex.thy
changeset 44724 0b900a9d8023
parent 44715 1a17d8913976
child 44748 7f6838b3474a
     1.1 --- a/src/HOL/Complex.thy	Mon Sep 05 14:42:31 2011 +0200
     1.2 +++ b/src/HOL/Complex.thy	Mon Sep 05 08:38:50 2011 -0700
     1.3 @@ -12,15 +12,11 @@
     1.4  
     1.5  datatype complex = Complex real real
     1.6  
     1.7 -primrec
     1.8 -  Re :: "complex \<Rightarrow> real"
     1.9 -where
    1.10 -  Re: "Re (Complex x y) = x"
    1.11 +primrec Re :: "complex \<Rightarrow> real"
    1.12 +  where Re: "Re (Complex x y) = x"
    1.13  
    1.14 -primrec
    1.15 -  Im :: "complex \<Rightarrow> real"
    1.16 -where
    1.17 -  Im: "Im (Complex x y) = y"
    1.18 +primrec Im :: "complex \<Rightarrow> real"
    1.19 +  where Im: "Im (Complex x y) = y"
    1.20  
    1.21  lemma complex_surj [simp]: "Complex (Re z) (Im z) = z"
    1.22    by (induct z) simp
    1.23 @@ -37,17 +33,17 @@
    1.24  instantiation complex :: ab_group_add
    1.25  begin
    1.26  
    1.27 -definition
    1.28 -  complex_zero_def: "0 = Complex 0 0"
    1.29 +definition complex_zero_def:
    1.30 +  "0 = Complex 0 0"
    1.31  
    1.32 -definition
    1.33 -  complex_add_def: "x + y = Complex (Re x + Re y) (Im x + Im y)"
    1.34 +definition complex_add_def:
    1.35 +  "x + y = Complex (Re x + Re y) (Im x + Im y)"
    1.36  
    1.37 -definition
    1.38 -  complex_minus_def: "- x = Complex (- Re x) (- Im x)"
    1.39 +definition complex_minus_def:
    1.40 +  "- x = Complex (- Re x) (- Im x)"
    1.41  
    1.42 -definition
    1.43 -  complex_diff_def: "x - (y\<Colon>complex) = x + - y"
    1.44 +definition complex_diff_def:
    1.45 +  "x - (y\<Colon>complex) = x + - y"
    1.46  
    1.47  lemma Complex_eq_0 [simp]: "Complex a b = 0 \<longleftrightarrow> a = 0 \<and> b = 0"
    1.48    by (simp add: complex_zero_def)
    1.49 @@ -94,25 +90,23 @@
    1.50  end
    1.51  
    1.52  
    1.53 -
    1.54  subsection {* Multiplication and Division *}
    1.55  
    1.56  instantiation complex :: field_inverse_zero
    1.57  begin
    1.58  
    1.59 -definition
    1.60 -  complex_one_def: "1 = Complex 1 0"
    1.61 +definition complex_one_def:
    1.62 +  "1 = Complex 1 0"
    1.63  
    1.64 -definition
    1.65 -  complex_mult_def: "x * y =
    1.66 -    Complex (Re x * Re y - Im x * Im y) (Re x * Im y + Im x * Re y)"
    1.67 +definition complex_mult_def:
    1.68 +  "x * y = Complex (Re x * Re y - Im x * Im y) (Re x * Im y + Im x * Re y)"
    1.69  
    1.70 -definition
    1.71 -  complex_inverse_def: "inverse x =
    1.72 +definition complex_inverse_def:
    1.73 +  "inverse x =
    1.74      Complex (Re x / ((Re x)\<twosuperior> + (Im x)\<twosuperior>)) (- Im x / ((Re x)\<twosuperior> + (Im x)\<twosuperior>))"
    1.75  
    1.76 -definition
    1.77 -  complex_divide_def: "x / (y\<Colon>complex) = x * inverse y"
    1.78 +definition complex_divide_def:
    1.79 +  "x / (y\<Colon>complex) = x * inverse y"
    1.80  
    1.81  lemma Complex_eq_1 [simp]: "(Complex a b = 1) = (a = 1 \<and> b = 0)"
    1.82    by (simp add: complex_one_def)
    1.83 @@ -147,10 +141,10 @@
    1.84  
    1.85  instance
    1.86    by intro_classes (simp_all add: complex_mult_def
    1.87 -  right_distrib left_distrib right_diff_distrib left_diff_distrib
    1.88 -  complex_inverse_def complex_divide_def
    1.89 -  power2_eq_square add_divide_distrib [symmetric]
    1.90 -  complex_eq_iff)
    1.91 +    right_distrib left_distrib right_diff_distrib left_diff_distrib
    1.92 +    complex_inverse_def complex_divide_def
    1.93 +    power2_eq_square add_divide_distrib [symmetric]
    1.94 +    complex_eq_iff)
    1.95  
    1.96  end
    1.97  
    1.98 @@ -160,8 +154,8 @@
    1.99  instantiation complex :: number_ring
   1.100  begin
   1.101  
   1.102 -definition number_of_complex where
   1.103 -  complex_number_of_def: "number_of w = (of_int w \<Colon> complex)"
   1.104 +definition complex_number_of_def:
   1.105 +  "number_of w = (of_int w \<Colon> complex)"
   1.106  
   1.107  instance
   1.108    by intro_classes (simp only: complex_number_of_def)
   1.109 @@ -169,26 +163,26 @@
   1.110  end
   1.111  
   1.112  lemma complex_Re_of_nat [simp]: "Re (of_nat n) = of_nat n"
   1.113 -by (induct n) simp_all
   1.114 +  by (induct n) simp_all
   1.115  
   1.116  lemma complex_Im_of_nat [simp]: "Im (of_nat n) = 0"
   1.117 -by (induct n) simp_all
   1.118 +  by (induct n) simp_all
   1.119  
   1.120  lemma complex_Re_of_int [simp]: "Re (of_int z) = of_int z"
   1.121 -by (cases z rule: int_diff_cases) simp
   1.122 +  by (cases z rule: int_diff_cases) simp
   1.123  
   1.124  lemma complex_Im_of_int [simp]: "Im (of_int z) = 0"
   1.125 -by (cases z rule: int_diff_cases) simp
   1.126 +  by (cases z rule: int_diff_cases) simp
   1.127  
   1.128  lemma complex_Re_number_of [simp]: "Re (number_of v) = number_of v"
   1.129 -unfolding number_of_eq by (rule complex_Re_of_int)
   1.130 +  unfolding number_of_eq by (rule complex_Re_of_int)
   1.131  
   1.132  lemma complex_Im_number_of [simp]: "Im (number_of v) = 0"
   1.133 -unfolding number_of_eq by (rule complex_Im_of_int)
   1.134 +  unfolding number_of_eq by (rule complex_Im_of_int)
   1.135  
   1.136  lemma Complex_eq_number_of [simp]:
   1.137    "(Complex a b = number_of w) = (a = number_of w \<and> b = 0)"
   1.138 -by (simp add: complex_eq_iff)
   1.139 +  by (simp add: complex_eq_iff)
   1.140  
   1.141  
   1.142  subsection {* Scalar Multiplication *}
   1.143 @@ -196,8 +190,8 @@
   1.144  instantiation complex :: real_field
   1.145  begin
   1.146  
   1.147 -definition
   1.148 -  complex_scaleR_def: "scaleR r x = Complex (r * Re x) (r * Im x)"
   1.149 +definition complex_scaleR_def:
   1.150 +  "scaleR r x = Complex (r * Re x) (r * Im x)"
   1.151  
   1.152  lemma complex_scaleR [simp]:
   1.153    "scaleR r (Complex a b) = Complex (r * a) (r * b)"
   1.154 @@ -231,34 +225,33 @@
   1.155  
   1.156  subsection{* Properties of Embedding from Reals *}
   1.157  
   1.158 -abbreviation
   1.159 -  complex_of_real :: "real \<Rightarrow> complex" where
   1.160 -    "complex_of_real \<equiv> of_real"
   1.161 +abbreviation complex_of_real :: "real \<Rightarrow> complex"
   1.162 +  where "complex_of_real \<equiv> of_real"
   1.163  
   1.164  lemma complex_of_real_def: "complex_of_real r = Complex r 0"
   1.165 -by (simp add: of_real_def complex_scaleR_def)
   1.166 +  by (simp add: of_real_def complex_scaleR_def)
   1.167  
   1.168  lemma Re_complex_of_real [simp]: "Re (complex_of_real z) = z"
   1.169 -by (simp add: complex_of_real_def)
   1.170 +  by (simp add: complex_of_real_def)
   1.171  
   1.172  lemma Im_complex_of_real [simp]: "Im (complex_of_real z) = 0"
   1.173 -by (simp add: complex_of_real_def)
   1.174 +  by (simp add: complex_of_real_def)
   1.175  
   1.176  lemma Complex_add_complex_of_real [simp]:
   1.177 -     "Complex x y + complex_of_real r = Complex (x+r) y"
   1.178 -by (simp add: complex_of_real_def)
   1.179 +  shows "Complex x y + complex_of_real r = Complex (x+r) y"
   1.180 +  by (simp add: complex_of_real_def)
   1.181  
   1.182  lemma complex_of_real_add_Complex [simp]:
   1.183 -     "complex_of_real r + Complex x y = Complex (r+x) y"
   1.184 -by (simp add: complex_of_real_def)
   1.185 +  shows "complex_of_real r + Complex x y = Complex (r+x) y"
   1.186 +  by (simp add: complex_of_real_def)
   1.187  
   1.188  lemma Complex_mult_complex_of_real:
   1.189 -     "Complex x y * complex_of_real r = Complex (x*r) (y*r)"
   1.190 -by (simp add: complex_of_real_def)
   1.191 +  shows "Complex x y * complex_of_real r = Complex (x*r) (y*r)"
   1.192 +  by (simp add: complex_of_real_def)
   1.193  
   1.194  lemma complex_of_real_mult_Complex:
   1.195 -     "complex_of_real r * Complex x y = Complex (r*x) (r*y)"
   1.196 -by (simp add: complex_of_real_def)
   1.197 +  shows "complex_of_real r * Complex x y = Complex (r*x) (r*y)"
   1.198 +  by (simp add: complex_of_real_def)
   1.199  
   1.200  
   1.201  subsection {* Vector Norm *}
   1.202 @@ -269,9 +262,8 @@
   1.203  definition complex_norm_def:
   1.204    "norm z = sqrt ((Re z)\<twosuperior> + (Im z)\<twosuperior>)"
   1.205  
   1.206 -abbreviation
   1.207 -  cmod :: "complex \<Rightarrow> real" where
   1.208 -  "cmod \<equiv> norm"
   1.209 +abbreviation cmod :: "complex \<Rightarrow> real"
   1.210 +  where "cmod \<equiv> norm"
   1.211  
   1.212  definition complex_sgn_def:
   1.213    "sgn x = x /\<^sub>R cmod x"
   1.214 @@ -313,29 +305,30 @@
   1.215  end
   1.216  
   1.217  lemma cmod_unit_one [simp]: "cmod (Complex (cos a) (sin a)) = 1"
   1.218 -by simp
   1.219 +  by simp
   1.220  
   1.221  lemma cmod_complex_polar [simp]:
   1.222 -     "cmod (complex_of_real r * Complex (cos a) (sin a)) = abs r"
   1.223 -by (simp add: norm_mult)
   1.224 +  "cmod (complex_of_real r * Complex (cos a) (sin a)) = abs r"
   1.225 +  by (simp add: norm_mult)
   1.226  
   1.227  lemma complex_Re_le_cmod: "Re x \<le> cmod x"
   1.228 -unfolding complex_norm_def
   1.229 -by (rule real_sqrt_sum_squares_ge1)
   1.230 +  unfolding complex_norm_def
   1.231 +  by (rule real_sqrt_sum_squares_ge1)
   1.232  
   1.233  lemma complex_mod_minus_le_complex_mod [simp]: "- cmod x \<le> cmod x"
   1.234 -by (rule order_trans [OF _ norm_ge_zero], simp)
   1.235 +  by (rule order_trans [OF _ norm_ge_zero], simp)
   1.236  
   1.237  lemma complex_mod_triangle_ineq2 [simp]: "cmod(b + a) - cmod b \<le> cmod a"
   1.238 -by (rule ord_le_eq_trans [OF norm_triangle_ineq2], simp)
   1.239 +  by (rule ord_le_eq_trans [OF norm_triangle_ineq2], simp)
   1.240  
   1.241  lemmas real_sum_squared_expand = power2_sum [where 'a=real]
   1.242  
   1.243  lemma abs_Re_le_cmod: "\<bar>Re x\<bar> \<le> cmod x"
   1.244 -by (cases x) simp
   1.245 +  by (cases x) simp
   1.246  
   1.247  lemma abs_Im_le_cmod: "\<bar>Im x\<bar> \<le> cmod x"
   1.248 -by (cases x) simp
   1.249 +  by (cases x) simp
   1.250 +
   1.251  
   1.252  subsection {* Completeness of the Complexes *}
   1.253  
   1.254 @@ -357,25 +350,25 @@
   1.255  lemmas Cauchy_Im = bounded_linear.Cauchy [OF bounded_linear_Im]
   1.256  
   1.257  lemma tendsto_Complex [tendsto_intros]:
   1.258 -  assumes "(f ---> a) net" and "(g ---> b) net"
   1.259 -  shows "((\<lambda>x. Complex (f x) (g x)) ---> Complex a b) net"
   1.260 +  assumes "(f ---> a) F" and "(g ---> b) F"
   1.261 +  shows "((\<lambda>x. Complex (f x) (g x)) ---> Complex a b) F"
   1.262  proof (rule tendstoI)
   1.263    fix r :: real assume "0 < r"
   1.264    hence "0 < r / sqrt 2" by (simp add: divide_pos_pos)
   1.265 -  have "eventually (\<lambda>x. dist (f x) a < r / sqrt 2) net"
   1.266 -    using `(f ---> a) net` and `0 < r / sqrt 2` by (rule tendstoD)
   1.267 +  have "eventually (\<lambda>x. dist (f x) a < r / sqrt 2) F"
   1.268 +    using `(f ---> a) F` and `0 < r / sqrt 2` by (rule tendstoD)
   1.269    moreover
   1.270 -  have "eventually (\<lambda>x. dist (g x) b < r / sqrt 2) net"
   1.271 -    using `(g ---> b) net` and `0 < r / sqrt 2` by (rule tendstoD)
   1.272 +  have "eventually (\<lambda>x. dist (g x) b < r / sqrt 2) F"
   1.273 +    using `(g ---> b) F` and `0 < r / sqrt 2` by (rule tendstoD)
   1.274    ultimately
   1.275 -  show "eventually (\<lambda>x. dist (Complex (f x) (g x)) (Complex a b) < r) net"
   1.276 +  show "eventually (\<lambda>x. dist (Complex (f x) (g x)) (Complex a b) < r) F"
   1.277      by (rule eventually_elim2)
   1.278         (simp add: dist_norm real_sqrt_sum_squares_less)
   1.279  qed
   1.280  
   1.281  lemma LIMSEQ_Complex:
   1.282    "\<lbrakk>X ----> a; Y ----> b\<rbrakk> \<Longrightarrow> (\<lambda>n. Complex (X n) (Y n)) ----> Complex a b"
   1.283 -by (rule tendsto_Complex)
   1.284 +  by (rule tendsto_Complex)
   1.285  
   1.286  instance complex :: banach
   1.287  proof
   1.288 @@ -394,133 +387,131 @@
   1.289  
   1.290  subsection {* The Complex Number @{term "\<i>"} *}
   1.291  
   1.292 -definition
   1.293 -  "ii" :: complex  ("\<i>") where
   1.294 -  i_def: "ii \<equiv> Complex 0 1"
   1.295 +definition "ii" :: complex  ("\<i>")
   1.296 +  where i_def: "ii \<equiv> Complex 0 1"
   1.297  
   1.298  lemma complex_Re_i [simp]: "Re ii = 0"
   1.299 -by (simp add: i_def)
   1.300 +  by (simp add: i_def)
   1.301  
   1.302  lemma complex_Im_i [simp]: "Im ii = 1"
   1.303 -by (simp add: i_def)
   1.304 +  by (simp add: i_def)
   1.305  
   1.306  lemma Complex_eq_i [simp]: "(Complex x y = ii) = (x = 0 \<and> y = 1)"
   1.307 -by (simp add: i_def)
   1.308 +  by (simp add: i_def)
   1.309  
   1.310  lemma complex_i_not_zero [simp]: "ii \<noteq> 0"
   1.311 -by (simp add: complex_eq_iff)
   1.312 +  by (simp add: complex_eq_iff)
   1.313  
   1.314  lemma complex_i_not_one [simp]: "ii \<noteq> 1"
   1.315 -by (simp add: complex_eq_iff)
   1.316 +  by (simp add: complex_eq_iff)
   1.317  
   1.318  lemma complex_i_not_number_of [simp]: "ii \<noteq> number_of w"
   1.319 -by (simp add: complex_eq_iff)
   1.320 +  by (simp add: complex_eq_iff)
   1.321  
   1.322  lemma i_mult_Complex [simp]: "ii * Complex a b = Complex (- b) a"
   1.323 -by (simp add: complex_eq_iff)
   1.324 +  by (simp add: complex_eq_iff)
   1.325  
   1.326  lemma Complex_mult_i [simp]: "Complex a b * ii = Complex (- b) a"
   1.327 -by (simp add: complex_eq_iff)
   1.328 +  by (simp add: complex_eq_iff)
   1.329  
   1.330  lemma i_complex_of_real [simp]: "ii * complex_of_real r = Complex 0 r"
   1.331 -by (simp add: i_def complex_of_real_def)
   1.332 +  by (simp add: i_def complex_of_real_def)
   1.333  
   1.334  lemma complex_of_real_i [simp]: "complex_of_real r * ii = Complex 0 r"
   1.335 -by (simp add: i_def complex_of_real_def)
   1.336 +  by (simp add: i_def complex_of_real_def)
   1.337  
   1.338  lemma i_squared [simp]: "ii * ii = -1"
   1.339 -by (simp add: i_def)
   1.340 +  by (simp add: i_def)
   1.341  
   1.342  lemma power2_i [simp]: "ii\<twosuperior> = -1"
   1.343 -by (simp add: power2_eq_square)
   1.344 +  by (simp add: power2_eq_square)
   1.345  
   1.346  lemma inverse_i [simp]: "inverse ii = - ii"
   1.347 -by (rule inverse_unique, simp)
   1.348 +  by (rule inverse_unique, simp)
   1.349  
   1.350  
   1.351  subsection {* Complex Conjugation *}
   1.352  
   1.353 -definition
   1.354 -  cnj :: "complex \<Rightarrow> complex" where
   1.355 +definition cnj :: "complex \<Rightarrow> complex" where
   1.356    "cnj z = Complex (Re z) (- Im z)"
   1.357  
   1.358  lemma complex_cnj [simp]: "cnj (Complex a b) = Complex a (- b)"
   1.359 -by (simp add: cnj_def)
   1.360 +  by (simp add: cnj_def)
   1.361  
   1.362  lemma complex_Re_cnj [simp]: "Re (cnj x) = Re x"
   1.363 -by (simp add: cnj_def)
   1.364 +  by (simp add: cnj_def)
   1.365  
   1.366  lemma complex_Im_cnj [simp]: "Im (cnj x) = - Im x"
   1.367 -by (simp add: cnj_def)
   1.368 +  by (simp add: cnj_def)
   1.369  
   1.370  lemma complex_cnj_cancel_iff [simp]: "(cnj x = cnj y) = (x = y)"
   1.371 -by (simp add: complex_eq_iff)
   1.372 +  by (simp add: complex_eq_iff)
   1.373  
   1.374  lemma complex_cnj_cnj [simp]: "cnj (cnj z) = z"
   1.375 -by (simp add: cnj_def)
   1.376 +  by (simp add: cnj_def)
   1.377  
   1.378  lemma complex_cnj_zero [simp]: "cnj 0 = 0"
   1.379 -by (simp add: complex_eq_iff)
   1.380 +  by (simp add: complex_eq_iff)
   1.381  
   1.382  lemma complex_cnj_zero_iff [iff]: "(cnj z = 0) = (z = 0)"
   1.383 -by (simp add: complex_eq_iff)
   1.384 +  by (simp add: complex_eq_iff)
   1.385  
   1.386  lemma complex_cnj_add: "cnj (x + y) = cnj x + cnj y"
   1.387 -by (simp add: complex_eq_iff)
   1.388 +  by (simp add: complex_eq_iff)
   1.389  
   1.390  lemma complex_cnj_diff: "cnj (x - y) = cnj x - cnj y"
   1.391 -by (simp add: complex_eq_iff)
   1.392 +  by (simp add: complex_eq_iff)
   1.393  
   1.394  lemma complex_cnj_minus: "cnj (- x) = - cnj x"
   1.395 -by (simp add: complex_eq_iff)
   1.396 +  by (simp add: complex_eq_iff)
   1.397  
   1.398  lemma complex_cnj_one [simp]: "cnj 1 = 1"
   1.399 -by (simp add: complex_eq_iff)
   1.400 +  by (simp add: complex_eq_iff)
   1.401  
   1.402  lemma complex_cnj_mult: "cnj (x * y) = cnj x * cnj y"
   1.403 -by (simp add: complex_eq_iff)
   1.404 +  by (simp add: complex_eq_iff)
   1.405  
   1.406  lemma complex_cnj_inverse: "cnj (inverse x) = inverse (cnj x)"
   1.407 -by (simp add: complex_inverse_def)
   1.408 +  by (simp add: complex_inverse_def)
   1.409  
   1.410  lemma complex_cnj_divide: "cnj (x / y) = cnj x / cnj y"
   1.411 -by (simp add: complex_divide_def complex_cnj_mult complex_cnj_inverse)
   1.412 +  by (simp add: complex_divide_def complex_cnj_mult complex_cnj_inverse)
   1.413  
   1.414  lemma complex_cnj_power: "cnj (x ^ n) = cnj x ^ n"
   1.415 -by (induct n, simp_all add: complex_cnj_mult)
   1.416 +  by (induct n, simp_all add: complex_cnj_mult)
   1.417  
   1.418  lemma complex_cnj_of_nat [simp]: "cnj (of_nat n) = of_nat n"
   1.419 -by (simp add: complex_eq_iff)
   1.420 +  by (simp add: complex_eq_iff)
   1.421  
   1.422  lemma complex_cnj_of_int [simp]: "cnj (of_int z) = of_int z"
   1.423 -by (simp add: complex_eq_iff)
   1.424 +  by (simp add: complex_eq_iff)
   1.425  
   1.426  lemma complex_cnj_number_of [simp]: "cnj (number_of w) = number_of w"
   1.427 -by (simp add: complex_eq_iff)
   1.428 +  by (simp add: complex_eq_iff)
   1.429  
   1.430  lemma complex_cnj_scaleR: "cnj (scaleR r x) = scaleR r (cnj x)"
   1.431 -by (simp add: complex_eq_iff)
   1.432 +  by (simp add: complex_eq_iff)
   1.433  
   1.434  lemma complex_mod_cnj [simp]: "cmod (cnj z) = cmod z"
   1.435 -by (simp add: complex_norm_def)
   1.436 +  by (simp add: complex_norm_def)
   1.437  
   1.438  lemma complex_cnj_complex_of_real [simp]: "cnj (of_real x) = of_real x"
   1.439 -by (simp add: complex_eq_iff)
   1.440 +  by (simp add: complex_eq_iff)
   1.441  
   1.442  lemma complex_cnj_i [simp]: "cnj ii = - ii"
   1.443 -by (simp add: complex_eq_iff)
   1.444 +  by (simp add: complex_eq_iff)
   1.445  
   1.446  lemma complex_add_cnj: "z + cnj z = complex_of_real (2 * Re z)"
   1.447 -by (simp add: complex_eq_iff)
   1.448 +  by (simp add: complex_eq_iff)
   1.449  
   1.450  lemma complex_diff_cnj: "z - cnj z = complex_of_real (2 * Im z) * ii"
   1.451 -by (simp add: complex_eq_iff)
   1.452 +  by (simp add: complex_eq_iff)
   1.453  
   1.454  lemma complex_mult_cnj: "z * cnj z = complex_of_real ((Re z)\<twosuperior> + (Im z)\<twosuperior>)"
   1.455 -by (simp add: complex_eq_iff power2_eq_square)
   1.456 +  by (simp add: complex_eq_iff power2_eq_square)
   1.457  
   1.458  lemma complex_mod_mult_cnj: "cmod (z * cnj z) = (cmod z)\<twosuperior>"
   1.459 -by (simp add: norm_mult power2_eq_square)
   1.460 +  by (simp add: norm_mult power2_eq_square)
   1.461  
   1.462  lemma bounded_linear_cnj: "bounded_linear cnj"
   1.463    using complex_cnj_add complex_cnj_scaleR
   1.464 @@ -537,34 +528,33 @@
   1.465  
   1.466  text {*------------ Argand -------------*}
   1.467  
   1.468 -definition
   1.469 -  arg :: "complex => real" where
   1.470 +definition arg :: "complex => real" where
   1.471    "arg z = (SOME a. Re(sgn z) = cos a & Im(sgn z) = sin a & -pi < a & a \<le> pi)"
   1.472  
   1.473  lemma sgn_eq: "sgn z = z / complex_of_real (cmod z)"
   1.474 -by (simp add: complex_sgn_def divide_inverse scaleR_conv_of_real mult_commute)
   1.475 +  by (simp add: sgn_div_norm divide_inverse scaleR_conv_of_real mult_commute)
   1.476  
   1.477  lemma i_mult_eq: "ii * ii = complex_of_real (-1)"
   1.478 -by (simp add: i_def complex_of_real_def)
   1.479 +  by (simp add: i_def complex_of_real_def)
   1.480  
   1.481  lemma i_mult_eq2 [simp]: "ii * ii = -(1::complex)"
   1.482 -by (simp add: i_def complex_one_def)
   1.483 +  by (simp add: i_def complex_one_def)
   1.484  
   1.485  lemma complex_eq_cancel_iff2 [simp]:
   1.486 -     "(Complex x y = complex_of_real xa) = (x = xa & y = 0)"
   1.487 -by (simp add: complex_of_real_def)
   1.488 +  shows "(Complex x y = complex_of_real xa) = (x = xa & y = 0)"
   1.489 +  by (simp add: complex_of_real_def)
   1.490  
   1.491  lemma Re_sgn [simp]: "Re(sgn z) = Re(z)/cmod z"
   1.492 -by (simp add: complex_sgn_def divide_inverse)
   1.493 +  by (simp add: complex_sgn_def divide_inverse)
   1.494  
   1.495  lemma Im_sgn [simp]: "Im(sgn z) = Im(z)/cmod z"
   1.496 -by (simp add: complex_sgn_def divide_inverse)
   1.497 +  by (simp add: complex_sgn_def divide_inverse)
   1.498  
   1.499  lemma complex_inverse_complex_split:
   1.500       "inverse(complex_of_real x + ii * complex_of_real y) =
   1.501        complex_of_real(x/(x ^ 2 + y ^ 2)) -
   1.502        ii * complex_of_real(y/(x ^ 2 + y ^ 2))"
   1.503 -by (simp add: complex_of_real_def i_def diff_minus divide_inverse)
   1.504 +  by (simp add: complex_of_real_def i_def diff_minus divide_inverse)
   1.505  
   1.506  (*----------------------------------------------------------------------------*)
   1.507  (* Many of the theorems below need to be moved elsewhere e.g. Transc. Also *)
   1.508 @@ -638,10 +628,10 @@
   1.509  done
   1.510  
   1.511  lemma Re_rcis [simp]: "Re(rcis r a) = r * cos a"
   1.512 -by (simp add: rcis_def cis_def)
   1.513 +  by (simp add: rcis_def cis_def)
   1.514  
   1.515  lemma Im_rcis [simp]: "Im(rcis r a) = r * sin a"
   1.516 -by (simp add: rcis_def cis_def)
   1.517 +  by (simp add: rcis_def cis_def)
   1.518  
   1.519  lemma sin_cos_squared_add2_mult: "(r * cos a)\<twosuperior> + (r * sin a)\<twosuperior> = r\<twosuperior>"
   1.520  proof -
   1.521 @@ -651,44 +641,44 @@
   1.522  qed
   1.523  
   1.524  lemma complex_mod_rcis [simp]: "cmod(rcis r a) = abs r"
   1.525 -by (simp add: rcis_def cis_def sin_cos_squared_add2_mult)
   1.526 +  by (simp add: rcis_def cis_def sin_cos_squared_add2_mult)
   1.527  
   1.528  lemma complex_mod_sqrt_Re_mult_cnj: "cmod z = sqrt (Re (z * cnj z))"
   1.529 -by (simp add: cmod_def power2_eq_square)
   1.530 +  by (simp add: cmod_def power2_eq_square)
   1.531  
   1.532  lemma complex_In_mult_cnj_zero [simp]: "Im (z * cnj z) = 0"
   1.533 -by simp
   1.534 +  by simp
   1.535  
   1.536  lemma cis_rcis_eq: "cis a = rcis 1 a"
   1.537 -by (simp add: rcis_def)
   1.538 +  by (simp add: rcis_def)
   1.539  
   1.540  lemma rcis_mult: "rcis r1 a * rcis r2 b = rcis (r1*r2) (a + b)"
   1.541 -by (simp add: rcis_def cis_def cos_add sin_add right_distrib right_diff_distrib
   1.542 -              complex_of_real_def)
   1.543 +  by (simp add: rcis_def cis_def cos_add sin_add right_distrib
   1.544 +    right_diff_distrib complex_of_real_def)
   1.545  
   1.546  lemma cis_mult: "cis a * cis b = cis (a + b)"
   1.547 -by (simp add: cis_rcis_eq rcis_mult)
   1.548 +  by (simp add: cis_rcis_eq rcis_mult)
   1.549  
   1.550  lemma cis_zero [simp]: "cis 0 = 1"
   1.551 -by (simp add: cis_def complex_one_def)
   1.552 +  by (simp add: cis_def complex_one_def)
   1.553  
   1.554  lemma rcis_zero_mod [simp]: "rcis 0 a = 0"
   1.555 -by (simp add: rcis_def)
   1.556 +  by (simp add: rcis_def)
   1.557  
   1.558  lemma rcis_zero_arg [simp]: "rcis r 0 = complex_of_real r"
   1.559 -by (simp add: rcis_def)
   1.560 +  by (simp add: rcis_def)
   1.561  
   1.562  lemma complex_of_real_minus_one:
   1.563     "complex_of_real (-(1::real)) = -(1::complex)"
   1.564 -by (simp add: complex_of_real_def complex_one_def)
   1.565 +  by (simp add: complex_of_real_def complex_one_def)
   1.566  
   1.567  lemma complex_i_mult_minus [simp]: "ii * (ii * x) = - x"
   1.568 -by (simp add: mult_assoc [symmetric])
   1.569 +  by (simp add: mult_assoc [symmetric])
   1.570  
   1.571  
   1.572  lemma cis_real_of_nat_Suc_mult:
   1.573     "cis (real (Suc n) * a) = cis a * cis (real n * a)"
   1.574 -by (simp add: cis_def real_of_nat_Suc left_distrib cos_add sin_add right_distrib)
   1.575 +  by (simp add: cis_def real_of_nat_Suc left_distrib cos_add sin_add right_distrib)
   1.576  
   1.577  lemma DeMoivre: "(cis a) ^ n = cis (real n * a)"
   1.578  apply (induct_tac "n")
   1.579 @@ -696,16 +686,16 @@
   1.580  done
   1.581  
   1.582  lemma DeMoivre2: "(rcis r a) ^ n = rcis (r ^ n) (real n * a)"
   1.583 -by (simp add: rcis_def power_mult_distrib DeMoivre)
   1.584 +  by (simp add: rcis_def power_mult_distrib DeMoivre)
   1.585  
   1.586  lemma cis_inverse [simp]: "inverse(cis a) = cis (-a)"
   1.587 -by (simp add: cis_def complex_inverse_complex_split diff_minus)
   1.588 +  by (simp add: cis_def complex_inverse_complex_split diff_minus)
   1.589  
   1.590  lemma rcis_inverse: "inverse(rcis r a) = rcis (1/r) (-a)"
   1.591 -by (simp add: divide_inverse rcis_def)
   1.592 +  by (simp add: divide_inverse rcis_def)
   1.593  
   1.594  lemma cis_divide: "cis a / cis b = cis (a - b)"
   1.595 -by (simp add: complex_divide_def cis_mult diff_minus)
   1.596 +  by (simp add: complex_divide_def cis_mult diff_minus)
   1.597  
   1.598  lemma rcis_divide: "rcis r1 a / rcis r2 b = rcis (r1/r2) (a - b)"
   1.599  apply (simp add: complex_divide_def)
   1.600 @@ -714,16 +704,16 @@
   1.601  done
   1.602  
   1.603  lemma Re_cis [simp]: "Re(cis a) = cos a"
   1.604 -by (simp add: cis_def)
   1.605 +  by (simp add: cis_def)
   1.606  
   1.607  lemma Im_cis [simp]: "Im(cis a) = sin a"
   1.608 -by (simp add: cis_def)
   1.609 +  by (simp add: cis_def)
   1.610  
   1.611  lemma cos_n_Re_cis_pow_n: "cos (real n * a) = Re(cis a ^ n)"
   1.612 -by (auto simp add: DeMoivre)
   1.613 +  by (auto simp add: DeMoivre)
   1.614  
   1.615  lemma sin_n_Im_cis_pow_n: "sin (real n * a) = Im(cis a ^ n)"
   1.616 -by (auto simp add: DeMoivre)
   1.617 +  by (auto simp add: DeMoivre)
   1.618  
   1.619  lemma complex_expi_Ex: "\<exists>a r. z = complex_of_real r * expi a"
   1.620  apply (insert rcis_Ex [of z])
   1.621 @@ -732,7 +722,7 @@
   1.622  done
   1.623  
   1.624  lemma expi_two_pi_i [simp]: "expi((2::complex) * complex_of_real pi * ii) = 1"
   1.625 -by (simp add: expi_def cis_def)
   1.626 +  by (simp add: expi_def cis_def)
   1.627  
   1.628  text {* Legacy theorem names *}
   1.629