src/HOL/Complex/Complex.thy
changeset 23123 e2e370bccde1
parent 22972 3e96b98d37c6
child 23124 892e0a4551da
equal deleted inserted replaced
23122:3d853d6f2f7d 23123:e2e370bccde1
   455 by (rule ord_le_eq_trans [OF norm_triangle_ineq2], simp)
   455 by (rule ord_le_eq_trans [OF norm_triangle_ineq2], simp)
   456 
   456 
   457 lemmas real_sum_squared_expand = power2_sum [where 'a=real]
   457 lemmas real_sum_squared_expand = power2_sum [where 'a=real]
   458 
   458 
   459 
   459 
       
   460 subsection {* Completeness of the Complexes *}
       
   461 
       
   462 interpretation Re: bounded_linear ["Re"]
       
   463 apply (unfold_locales, simp, simp)
       
   464 apply (rule_tac x=1 in exI)
       
   465 apply (simp add: complex_norm_def)
       
   466 done
       
   467 
       
   468 interpretation Im: bounded_linear ["Im"]
       
   469 apply (unfold_locales, simp, simp)
       
   470 apply (rule_tac x=1 in exI)
       
   471 apply (simp add: complex_norm_def)
       
   472 done
       
   473 
       
   474 lemma LIMSEQ_Complex:
       
   475   "\<lbrakk>X ----> a; Y ----> b\<rbrakk> \<Longrightarrow> (\<lambda>n. Complex (X n) (Y n)) ----> Complex a b"
       
   476 apply (rule LIMSEQ_I)
       
   477 apply (subgoal_tac "0 < r / sqrt 2")
       
   478 apply (drule_tac r="r / sqrt 2" in LIMSEQ_D, safe)
       
   479 apply (drule_tac r="r / sqrt 2" in LIMSEQ_D, safe)
       
   480 apply (rename_tac M N, rule_tac x="max M N" in exI, safe)
       
   481 apply (simp add: complex_diff)
       
   482 apply (simp add: real_sqrt_sum_squares_less)
       
   483 apply (simp add: divide_pos_pos)
       
   484 done
       
   485 
       
   486 instance complex :: banach
       
   487 proof
       
   488   fix X :: "nat \<Rightarrow> complex"
       
   489   assume X: "Cauchy X"
       
   490   from Re.Cauchy [OF X] have 1: "(\<lambda>n. Re (X n)) ----> lim (\<lambda>n. Re (X n))"
       
   491     by (simp add: Cauchy_convergent_iff convergent_LIMSEQ_iff)
       
   492   from Im.Cauchy [OF X] have 2: "(\<lambda>n. Im (X n)) ----> lim (\<lambda>n. Im (X n))"
       
   493     by (simp add: Cauchy_convergent_iff convergent_LIMSEQ_iff)
       
   494   have "X ----> Complex (lim (\<lambda>n. Re (X n))) (lim (\<lambda>n. Im (X n)))"
       
   495     using LIMSEQ_Complex [OF 1 2] by simp
       
   496   thus "convergent X"
       
   497     by (rule convergentI)
       
   498 qed
       
   499 
       
   500 
   460 subsection{*Exponentiation*}
   501 subsection{*Exponentiation*}
   461 
   502 
   462 primrec
   503 primrec
   463      complexpow_0:   "z ^ 0       = 1"
   504      complexpow_0:   "z ^ 0       = 1"
   464      complexpow_Suc: "z ^ (Suc n) = (z::complex) * (z ^ n)"
   505      complexpow_Suc: "z ^ (Suc n) = (z::complex) * (z ^ n)"