src/HOL/Complex/NSComplex.thy
changeset 14323 27724f528f82
parent 14320 fb7a114826be
child 14331 8dbbb7cf3637
equal deleted inserted replaced
14322:fa78e7eb1dac 14323:27724f528f82
   864 done
   864 done
   865 declare hcomplex_hcnj_zero_iff [iff]
   865 declare hcomplex_hcnj_zero_iff [iff]
   866 
   866 
   867 lemma hcomplex_mult_hcnj: "z * hcnj z = hcomplex_of_hypreal (hRe(z) ^ 2 + hIm(z) ^ 2)"
   867 lemma hcomplex_mult_hcnj: "z * hcnj z = hcomplex_of_hypreal (hRe(z) ^ 2 + hIm(z) ^ 2)"
   868 apply (rule_tac z = "z" in eq_Abs_hcomplex)
   868 apply (rule_tac z = "z" in eq_Abs_hcomplex)
   869 apply (auto simp add: hcnj hcomplex_mult hcomplex_of_hypreal hRe hIm hypreal_add hypreal_mult complex_mult_cnj two_eq_Suc_Suc)
   869 apply (auto simp add: hcnj hcomplex_mult hcomplex_of_hypreal hRe hIm hypreal_add hypreal_mult complex_mult_cnj numeral_2_eq_2)
   870 done
   870 done
   871 
   871 
   872 
   872 
   873 (*---------------------------------------------------------------------------*)
   873 (*---------------------------------------------------------------------------*)
   874 (*  some algebra etc.                                                        *)
   874 (*  some algebra etc.                                                        *)
   949 done
   949 done
   950 declare hcmod_minus [simp]
   950 declare hcmod_minus [simp]
   951 
   951 
   952 lemma hcmod_mult_hcnj: "hcmod(z * hcnj(z)) = hcmod(z) ^ 2"
   952 lemma hcmod_mult_hcnj: "hcmod(z * hcnj(z)) = hcmod(z) ^ 2"
   953 apply (rule_tac z = "z" in eq_Abs_hcomplex)
   953 apply (rule_tac z = "z" in eq_Abs_hcomplex)
   954 apply (auto simp add: hcmod hcomplex_mult hcnj hypreal_mult complex_mod_mult_cnj two_eq_Suc_Suc)
   954 apply (auto simp add: hcmod hcomplex_mult hcnj hypreal_mult complex_mod_mult_cnj numeral_2_eq_2)
   955 done
   955 done
   956 
   956 
   957 lemma hcmod_ge_zero: "(0::hypreal) <= hcmod x"
   957 lemma hcmod_ge_zero: "(0::hypreal) <= hcmod x"
   958 apply (rule_tac z = "x" in eq_Abs_hcomplex)
   958 apply (rule_tac z = "x" in eq_Abs_hcomplex)
   959 apply (auto simp add: hcmod hypreal_zero_num hypreal_le)
   959 apply (auto simp add: hcmod hypreal_zero_num hypreal_le)
   974 lemma hcmod_add_squared_eq:
   974 lemma hcmod_add_squared_eq:
   975      "hcmod(x + y) ^ 2 = hcmod(x) ^ 2 + hcmod(y) ^ 2 + 2 * hRe(x * hcnj y)"
   975      "hcmod(x + y) ^ 2 = hcmod(x) ^ 2 + hcmod(y) ^ 2 + 2 * hRe(x * hcnj y)"
   976 apply (rule_tac z = "x" in eq_Abs_hcomplex)
   976 apply (rule_tac z = "x" in eq_Abs_hcomplex)
   977 apply (rule_tac z = "y" in eq_Abs_hcomplex)
   977 apply (rule_tac z = "y" in eq_Abs_hcomplex)
   978 apply (auto simp add: hcmod hcomplex_add hypreal_mult hRe hcnj hcomplex_mult
   978 apply (auto simp add: hcmod hcomplex_add hypreal_mult hRe hcnj hcomplex_mult
   979                       two_eq_Suc_Suc realpow_two [symmetric] 
   979                       numeral_2_eq_2 realpow_two [symmetric] 
   980                  simp del: realpow_Suc)
   980                  simp del: realpow_Suc)
   981 apply (auto simp add: two_eq_Suc_Suc [symmetric] complex_mod_add_squared_eq
   981 apply (auto simp add: numeral_2_eq_2 [symmetric] complex_mod_add_squared_eq
   982                  hypreal_add [symmetric] hypreal_mult [symmetric] 
   982                  hypreal_add [symmetric] hypreal_mult [symmetric] 
   983                  hypreal_of_real_def [symmetric])
   983                  hypreal_of_real_def [symmetric])
   984 done
   984 done
   985 
   985 
   986 lemma hcomplex_hRe_mult_hcnj_le_hcmod: "hRe(x * hcnj y) <= hcmod(x * hcnj y)"
   986 lemma hcomplex_hRe_mult_hcnj_le_hcmod: "hRe(x * hcnj y) <= hcmod(x * hcnj y)"
   998 
   998 
   999 lemma hcmod_triangle_squared: "hcmod (x + y) ^ 2 <= (hcmod(x) + hcmod(y)) ^ 2"
   999 lemma hcmod_triangle_squared: "hcmod (x + y) ^ 2 <= (hcmod(x) + hcmod(y)) ^ 2"
  1000 apply (rule_tac z = "x" in eq_Abs_hcomplex)
  1000 apply (rule_tac z = "x" in eq_Abs_hcomplex)
  1001 apply (rule_tac z = "y" in eq_Abs_hcomplex)
  1001 apply (rule_tac z = "y" in eq_Abs_hcomplex)
  1002 apply (auto simp add: hcmod hcnj hcomplex_add hypreal_mult hypreal_add
  1002 apply (auto simp add: hcmod hcnj hcomplex_add hypreal_mult hypreal_add
  1003                       hypreal_le realpow_two [symmetric] two_eq_Suc_Suc
  1003                       hypreal_le realpow_two [symmetric] numeral_2_eq_2
  1004             simp del: realpow_Suc)
  1004             simp del: realpow_Suc)
  1005 apply (simp (no_asm) add: two_eq_Suc_Suc [symmetric])
  1005 apply (simp (no_asm) add: numeral_2_eq_2 [symmetric])
  1006 done
  1006 done
  1007 declare hcmod_triangle_squared [simp]
  1007 declare hcmod_triangle_squared [simp]
  1008 
  1008 
  1009 lemma hcmod_triangle_ineq: "hcmod (x + y) <= hcmod(x) + hcmod(y)"
  1009 lemma hcmod_triangle_ineq: "hcmod (x + y) <= hcmod(x) + hcmod(y)"
  1010 apply (rule_tac z = "x" in eq_Abs_hcomplex)
  1010 apply (rule_tac z = "x" in eq_Abs_hcomplex)
  1189 apply (auto simp add: hcomplex_mult hcomplex_one_def hcomplex_minus)
  1189 apply (auto simp add: hcomplex_mult hcomplex_one_def hcomplex_minus)
  1190 done
  1190 done
  1191 declare hcomplex_i_mult_eq [simp]
  1191 declare hcomplex_i_mult_eq [simp]
  1192 
  1192 
  1193 lemma hcomplexpow_i_squared: "iii ^ 2 = - 1"
  1193 lemma hcomplexpow_i_squared: "iii ^ 2 = - 1"
  1194 apply (simp (no_asm) add: two_eq_Suc_Suc)
  1194 apply (simp (no_asm) add: numeral_2_eq_2)
  1195 done
  1195 done
  1196 declare hcomplexpow_i_squared [simp]
  1196 declare hcomplexpow_i_squared [simp]
  1197 
  1197 
  1198 lemma hcomplex_i_not_zero: "iii ~= 0"
  1198 lemma hcomplex_i_not_zero: "iii ~= 0"
  1199 apply (unfold iii_def hcomplex_zero_def)
  1199 apply (unfold iii_def hcomplex_zero_def)
  1294 
  1294 
  1295 lemma hcmod_i: "hcmod (hcomplex_of_hypreal(x) + iii * hcomplex_of_hypreal(y)) =
  1295 lemma hcmod_i: "hcmod (hcomplex_of_hypreal(x) + iii * hcomplex_of_hypreal(y)) =
  1296       ( *f* sqrt) (x ^ 2 + y ^ 2)"
  1296       ( *f* sqrt) (x ^ 2 + y ^ 2)"
  1297 apply (rule_tac z = "x" in eq_Abs_hypreal)
  1297 apply (rule_tac z = "x" in eq_Abs_hypreal)
  1298 apply (rule_tac z = "y" in eq_Abs_hypreal)
  1298 apply (rule_tac z = "y" in eq_Abs_hypreal)
  1299 apply (auto simp add: hcomplex_of_hypreal iii_def hcomplex_add hcomplex_mult starfun hypreal_mult hypreal_add hcmod cmod_i two_eq_Suc_Suc)
  1299 apply (auto simp add: hcomplex_of_hypreal iii_def hcomplex_add hcomplex_mult starfun hypreal_mult hypreal_add hcmod cmod_i numeral_2_eq_2)
  1300 done
  1300 done
  1301 
  1301 
  1302 lemma hcomplex_eq_hRe_eq:
  1302 lemma hcomplex_eq_hRe_eq:
  1303      "hcomplex_of_hypreal xa + iii * hcomplex_of_hypreal ya =
  1303      "hcomplex_of_hypreal xa + iii * hcomplex_of_hypreal ya =
  1304       hcomplex_of_hypreal xb + iii * hcomplex_of_hypreal yb
  1304       hcomplex_of_hypreal xb + iii * hcomplex_of_hypreal yb
  1418 lemma hcomplex_inverse_complex_split: "inverse(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y) =
  1418 lemma hcomplex_inverse_complex_split: "inverse(hcomplex_of_hypreal x + iii * hcomplex_of_hypreal y) =
  1419       hcomplex_of_hypreal(x/(x ^ 2 + y ^ 2)) -
  1419       hcomplex_of_hypreal(x/(x ^ 2 + y ^ 2)) -
  1420       iii * hcomplex_of_hypreal(y/(x ^ 2 + y ^ 2))"
  1420       iii * hcomplex_of_hypreal(y/(x ^ 2 + y ^ 2))"
  1421 apply (rule_tac z = "x" in eq_Abs_hypreal)
  1421 apply (rule_tac z = "x" in eq_Abs_hypreal)
  1422 apply (rule_tac z = "y" in eq_Abs_hypreal)
  1422 apply (rule_tac z = "y" in eq_Abs_hypreal)
  1423 apply (auto simp add: hcomplex_of_hypreal hcomplex_mult hcomplex_add iii_def starfun hypreal_mult hypreal_add hcomplex_inverse hypreal_divide hcomplex_diff complex_inverse_complex_split two_eq_Suc_Suc)
  1423 apply (auto simp add: hcomplex_of_hypreal hcomplex_mult hcomplex_add iii_def starfun hypreal_mult hypreal_add hcomplex_inverse hypreal_divide hcomplex_diff complex_inverse_complex_split numeral_2_eq_2)
  1424 done
  1424 done
  1425 
  1425 
  1426 lemma hRe_mult_i_eq:
  1426 lemma hRe_mult_i_eq:
  1427     "hRe (iii * hcomplex_of_hypreal y) = 0"
  1427     "hRe (iii * hcomplex_of_hypreal y) = 0"
  1428 apply (unfold iii_def)
  1428 apply (unfold iii_def)