src/HOL/Multivariate_Analysis/PolyRoots.thy
changeset 60420 884f54e01427
parent 59867 58043346ca64
child 61560 7c985fd653c5
child 61609 77b453bd616f
equal deleted inserted replaced
60419:7c2404ca7f49 60420:884f54e01427
     1 section {* polynomial functions: extremal behaviour and root counts *}
     1 section \<open>polynomial functions: extremal behaviour and root counts\<close>
     2 
     2 
     3 (*  Author: John Harrison and Valentina Bruno
     3 (*  Author: John Harrison and Valentina Bruno
     4     Ported from "hol_light/Multivariate/complexes.ml" by L C Paulson
     4     Ported from "hol_light/Multivariate/complexes.ml" by L C Paulson
     5 *)
     5 *)
     6 
     6 
     7 theory PolyRoots
     7 theory PolyRoots
     8 imports Complex_Main
     8 imports Complex_Main
     9 
     9 
    10 begin
    10 begin
    11 
    11 
    12 subsection{*Geometric progressions*}
    12 subsection\<open>Geometric progressions\<close>
    13 
    13 
    14 lemma setsum_gp_basic:
    14 lemma setsum_gp_basic:
    15   fixes x :: "'a::{comm_ring,monoid_mult}"
    15   fixes x :: "'a::{comm_ring,monoid_mult}"
    16   shows "(1 - x) * (\<Sum>i\<le>n. x^i) = 1 - x^Suc n"
    16   shows "(1 - x) * (\<Sum>i\<le>n. x^i) = 1 - x^Suc n"
    17   by (simp only: one_diff_power_eq [of "Suc n" x] lessThan_Suc_atMost)
    17   by (simp only: one_diff_power_eq [of "Suc n" x] lessThan_Suc_atMost)
    33   shows "(\<Sum>i=m..n. x^i) = x^m * (\<Sum>i\<le>n-m. x^i)"
    33   shows "(\<Sum>i=m..n. x^i) = x^m * (\<Sum>i\<le>n-m. x^i)"
    34 proof -
    34 proof -
    35   have "(\<Sum>i=m..n. x^i) = x^m * (\<Sum>i=m..n. x^(i-m))"
    35   have "(\<Sum>i=m..n. x^i) = x^m * (\<Sum>i=m..n. x^(i-m))"
    36     by (simp add: setsum_right_distrib power_add [symmetric])
    36     by (simp add: setsum_right_distrib power_add [symmetric])
    37   also have "(\<Sum>i=m..n. x^(i-m)) = (\<Sum>i\<le>n-m. x^i)"
    37   also have "(\<Sum>i=m..n. x^(i-m)) = (\<Sum>i\<le>n-m. x^i)"
    38     using `m \<le> n` by (intro setsum.reindex_bij_witness[where j="\<lambda>i. i - m" and i="\<lambda>i. i + m"]) auto
    38     using \<open>m \<le> n\<close> by (intro setsum.reindex_bij_witness[where j="\<lambda>i. i - m" and i="\<lambda>i. i + m"]) auto
    39   finally show ?thesis .
    39   finally show ?thesis .
    40 qed
    40 qed
    41 
    41 
    42 lemma setsum_gp_multiplied:
    42 lemma setsum_gp_multiplied:
    43   fixes x :: "'a::{comm_ring,monoid_mult}"
    43   fixes x :: "'a::{comm_ring,monoid_mult}"
    74 lemma setsum_gp_strict:
    74 lemma setsum_gp_strict:
    75   fixes x :: "'a::{comm_ring,division_ring}"
    75   fixes x :: "'a::{comm_ring,division_ring}"
    76   shows "(\<Sum>i<n. x^i) = (if x = 1 then of_nat n else (1 - x^n) / (1 - x))"
    76   shows "(\<Sum>i<n. x^i) = (if x = 1 then of_nat n else (1 - x^n) / (1 - x))"
    77   by (induct n) (auto simp: algebra_simps divide_simps)
    77   by (induct n) (auto simp: algebra_simps divide_simps)
    78     
    78     
    79 subsection{*Basics about polynomial functions: extremal behaviour and root counts.*}
    79 subsection\<open>Basics about polynomial functions: extremal behaviour and root counts.\<close>
    80 
    80 
    81 lemma sub_polyfun:
    81 lemma sub_polyfun:
    82   fixes x :: "'a::{comm_ring,monoid_mult}"
    82   fixes x :: "'a::{comm_ring,monoid_mult}"
    83   shows   "(\<Sum>i\<le>n. a i * x^i) - (\<Sum>i\<le>n. a i * y^i) = 
    83   shows   "(\<Sum>i\<le>n. a i * x^i) - (\<Sum>i\<le>n. a i * y^i) = 
    84            (x - y) * (\<Sum>j<n. \<Sum>k= Suc j..n. a k * y^(k - Suc j) * x^j)"
    84            (x - y) * (\<Sum>j<n. \<Sum>k= Suc j..n. a k * y^(k - Suc j) * x^j)"
   201       fix z::'a
   201       fix z::'a
   202       assume les: "M \<le> norm z"  "1 \<le> norm z"  "(\<bar>B\<bar> * 2 + 2) / norm (c (Suc n)) \<le> norm z"
   202       assume les: "M \<le> norm z"  "1 \<le> norm z"  "(\<bar>B\<bar> * 2 + 2) / norm (c (Suc n)) \<le> norm z"
   203       then have "\<bar>B\<bar> * 2 + 2 \<le> norm z * norm (c (Suc n))"
   203       then have "\<bar>B\<bar> * 2 + 2 \<le> norm z * norm (c (Suc n))"
   204         by (metis False pos_divide_le_eq zero_less_norm_iff)
   204         by (metis False pos_divide_le_eq zero_less_norm_iff)
   205       then have "\<bar>B\<bar> * 2 + 2 \<le> norm z ^ (Suc n) * norm (c (Suc n))" 
   205       then have "\<bar>B\<bar> * 2 + 2 \<le> norm z ^ (Suc n) * norm (c (Suc n))" 
   206         by (metis `1 \<le> norm z` order.trans mult_right_mono norm_ge_zero self_le_power zero_less_Suc)
   206         by (metis \<open>1 \<le> norm z\<close> order.trans mult_right_mono norm_ge_zero self_le_power zero_less_Suc)
   207       then show "B \<le> norm ((\<Sum>i\<le>n. c i * z^i) + c (Suc n) * (z * z ^ n))" using M les
   207       then show "B \<le> norm ((\<Sum>i\<le>n. c i * z^i) + c (Suc n) * (z * z ^ n))" using M les
   208         apply auto
   208         apply auto
   209         apply (rule norm_lemma_xy [where a = "norm (c (Suc n)) * norm z ^ (Suc n) / 2"])
   209         apply (rule norm_lemma_xy [where a = "norm (c (Suc n)) * norm z ^ (Suc n) / 2"])
   210         apply (simp_all add: norm_mult norm_power)
   210         apply (simp_all add: norm_mult norm_power)
   211         done
   211         done