src/HOL/Complex/Fundamental_Theorem_Algebra.thy
changeset 27445 0829a2c4b287
parent 27108 e447b3107696
child 27514 6fcf6864d703
equal deleted inserted replaced
27444:a487aa892540 27445:0829a2c4b287
     7 
     7 
     8 theory Fundamental_Theorem_Algebra
     8 theory Fundamental_Theorem_Algebra
     9 imports Univ_Poly Dense_Linear_Order Complex
     9 imports Univ_Poly Dense_Linear_Order Complex
    10 begin
    10 begin
    11 
    11 
    12 section {* Square root of complex numbers *}
    12 subsection {* Square root of complex numbers *}
    13 definition csqrt :: "complex \<Rightarrow> complex" where
    13 definition csqrt :: "complex \<Rightarrow> complex" where
    14 "csqrt z = (if Im z = 0 then
    14 "csqrt z = (if Im z = 0 then
    15             if 0 \<le> Re z then Complex (sqrt(Re z)) 0
    15             if 0 \<le> Re z then Complex (sqrt(Re z)) 0
    16             else Complex 0 (sqrt(- Re z))
    16             else Complex 0 (sqrt(- Re z))
    17            else Complex (sqrt((cmod z + Re z) /2))
    17            else Complex (sqrt((cmod z + Re z) /2))
    54       using th1 th2  ..}
    54       using th1 th2  ..}
    55   ultimately show ?thesis by blast
    55   ultimately show ?thesis by blast
    56 qed
    56 qed
    57 
    57 
    58 
    58 
    59 section{* More lemmas about module of complex numbers *}
    59 subsection{* More lemmas about module of complex numbers *}
    60 
    60 
    61 lemma complex_of_real_power: "complex_of_real x ^ n = complex_of_real (x^n)"
    61 lemma complex_of_real_power: "complex_of_real x ^ n = complex_of_real (x^n)"
    62   by (induct n, auto)
    62   by (induct n, auto)
    63 
    63 
    64 lemma cmod_pos: "cmod z \<ge> 0" by simp
    64 lemma cmod_pos: "cmod z \<ge> 0" by simp
   106 
   106 
   107 text{* The triangle inequality for cmod *}
   107 text{* The triangle inequality for cmod *}
   108 lemma complex_mod_triangle_sub: "cmod w \<le> cmod (w + z) + norm z"
   108 lemma complex_mod_triangle_sub: "cmod w \<le> cmod (w + z) + norm z"
   109   using complex_mod_triangle_ineq2[of "w + z" "-z"] by auto
   109   using complex_mod_triangle_ineq2[of "w + z" "-z"] by auto
   110 
   110 
   111 section{* Basic lemmas about complex polynomials *}
   111 subsection{* Basic lemmas about complex polynomials *}
   112 
   112 
   113 lemma poly_bound_exists:
   113 lemma poly_bound_exists:
   114   shows "\<exists>m. m > 0 \<and> (\<forall>z. cmod z <= r \<longrightarrow> cmod (poly p z) \<le> m)"
   114   shows "\<exists>m. m > 0 \<and> (\<forall>z. cmod z <= r \<longrightarrow> cmod (poly p z) \<le> m)"
   115 proof(induct p)
   115 proof(induct p)
   116   case Nil thus ?case by (rule exI[where x=1], simp) 
   116   case Nil thus ?case by (rule exI[where x=1], simp) 
   194     ultimately have "(\<exists>x. P x \<and> y < x) \<longleftrightarrow> y < L" by blast}
   194     ultimately have "(\<exists>x. P x \<and> y < x) \<longleftrightarrow> y < L" by blast}
   195   thus ?thesis by blast
   195   thus ?thesis by blast
   196 qed
   196 qed
   197 
   197 
   198 
   198 
   199 section{* Some theorems about Sequences*}
   199 subsection{* Some theorems about Sequences*}
   200 text{* Given a binary function @{text "f:: nat \<Rightarrow> 'a \<Rightarrow> 'a"}, its values are uniquely determined by a function g *}
   200 text{* Given a binary function @{text "f:: nat \<Rightarrow> 'a \<Rightarrow> 'a"}, its values are uniquely determined by a function g *}
   201 
   201 
   202 lemma num_Axiom: "EX! g. g 0 = e \<and> (\<forall>n. g (Suc n) = f n (g n))"
   202 lemma num_Axiom: "EX! g. g 0 = e \<and> (\<forall>n. g (Suc n) = f n (g n))"
   203   unfolding Ex1_def
   203   unfolding Ex1_def
   204   apply (rule_tac x="nat_rec e f" in exI)
   204   apply (rule_tac x="nat_rec e f" in exI)
   358   from sf[unfolded subseq_Suc_iff, rule_format, of n] Suc.hyps
   358   from sf[unfolded subseq_Suc_iff, rule_format, of n] Suc.hyps
   359   have "n < f (Suc n)" by arith 
   359   have "n < f (Suc n)" by arith 
   360   thus ?case by arith
   360   thus ?case by arith
   361 qed
   361 qed
   362 
   362 
   363 section {* Fundamental theorem of algebra *}
   363 subsection {* Fundamental theorem of algebra *}
   364 lemma  unimodular_reduce_norm:
   364 lemma  unimodular_reduce_norm:
   365   assumes md: "cmod z = 1"
   365   assumes md: "cmod z = 1"
   366   shows "cmod (z + 1) < 1 \<or> cmod (z - 1) < 1 \<or> cmod (z + ii) < 1 \<or> cmod (z - ii) < 1"
   366   shows "cmod (z + 1) < 1 \<or> cmod (z - 1) < 1 \<or> cmod (z + ii) < 1 \<or> cmod (z - ii) < 1"
   367 proof-
   367 proof-
   368   obtain x y where z: "z = Complex x y " by (cases z, auto)
   368   obtain x y where z: "z = Complex x y " by (cases z, auto)
   982 	by blast
   982 	by blast
   983       from fundamental_theorem_of_algebra[OF nc] have ?case .}
   983       from fundamental_theorem_of_algebra[OF nc] have ?case .}
   984   ultimately show ?case by blast  
   984   ultimately show ?case by blast  
   985 qed simp
   985 qed simp
   986 
   986 
   987 section{* Nullstellenstatz, degrees and divisibility of polynomials *}
   987 subsection{* Nullstellenstatz, degrees and divisibility of polynomials *}
   988 
   988 
   989 lemma nullstellensatz_lemma:
   989 lemma nullstellensatz_lemma:
   990   fixes p :: "complex list"
   990   fixes p :: "complex list"
   991   assumes "\<forall>x. poly p x = 0 \<longrightarrow> poly q x = 0"
   991   assumes "\<forall>x. poly p x = 0 \<longrightarrow> poly q x = 0"
   992   and "degree p = n" and "n \<noteq> 0"
   992   and "degree p = n" and "n \<noteq> 0"