src/HOL/Analysis/Poly_Roots.thy
author paulson <lp15@cam.ac.uk>
Wed, 23 May 2018 21:31:41 +0100
changeset 68257 e6e131577536
parent 67968 a5ad4c015d1c
child 68833 fde093888c16
permissions -rw-r--r--
small tidy-up of Complex_Transcendental
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     1
(*  Author: John Harrison and Valentina Bruno
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     2
    Ported from "hol_light/Multivariate/complexes.ml" by L C Paulson
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     3
*)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     4
61560
7c985fd653c5 tuned imports;
wenzelm
parents: 60420
diff changeset
     5
section \<open>polynomial functions: extremal behaviour and root counts\<close>
7c985fd653c5 tuned imports;
wenzelm
parents: 60420
diff changeset
     6
63594
bd218a9320b5 HOL-Multivariate_Analysis: rename theories for more descriptive names
hoelzl
parents: 62626
diff changeset
     7
theory Poly_Roots
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     8
imports Complex_Main
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
     9
begin
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    10
67968
a5ad4c015d1c removed dots at the end of (sub)titles
nipkow
parents: 65578
diff changeset
    11
subsection\<open>Basics about polynomial functions: extremal behaviour and root counts\<close>
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    12
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    13
lemma sub_polyfun:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    14
  fixes x :: "'a::{comm_ring,monoid_mult}"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
    15
  shows   "(\<Sum>i\<le>n. a i * x^i) - (\<Sum>i\<le>n. a i * y^i) =
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    16
           (x - y) * (\<Sum>j<n. \<Sum>k= Suc j..n. a k * y^(k - Suc j) * x^j)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    17
proof -
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
    18
  have "(\<Sum>i\<le>n. a i * x^i) - (\<Sum>i\<le>n. a i * y^i) =
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    19
        (\<Sum>i\<le>n. a i * (x^i - y^i))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63918
diff changeset
    20
    by (simp add: algebra_simps sum_subtractf [symmetric])
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    21
  also have "... = (\<Sum>i\<le>n. a i * (x - y) * (\<Sum>j<i. y^(i - Suc j) * x^j))"
57514
bdc2c6b40bf2 prefer ac_simps collections over separate name bindings for add and mult
haftmann
parents: 57512
diff changeset
    22
    by (simp add: power_diff_sumr2 ac_simps)
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    23
  also have "... = (x - y) * (\<Sum>i\<le>n. (\<Sum>j<i. a i * y^(i - Suc j) * x^j))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63918
diff changeset
    24
    by (simp add: sum_distrib_left ac_simps)
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    25
  also have "... = (x - y) * (\<Sum>j<n. (\<Sum>i=Suc j..n. a i * y^(i - Suc j) * x^j))"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63918
diff changeset
    26
    by (simp add: nested_sum_swap')
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    27
  finally show ?thesis .
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    28
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    29
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    30
lemma sub_polyfun_alt:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    31
  fixes x :: "'a::{comm_ring,monoid_mult}"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
    32
  shows   "(\<Sum>i\<le>n. a i * x^i) - (\<Sum>i\<le>n. a i * y^i) =
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    33
           (x - y) * (\<Sum>j<n. \<Sum>k<n-j. a (j+k+1) * y^k * x^j)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    34
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    35
  { fix j
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    36
    have "(\<Sum>k = Suc j..n. a k * y^(k - Suc j) * x^j) =
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    37
          (\<Sum>k <n - j. a (Suc (j + k)) * y^k * x^j)"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63918
diff changeset
    38
      by (rule sum.reindex_bij_witness[where i="\<lambda>i. i + Suc j" and j="\<lambda>i. i - Suc j"]) auto }
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    39
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    40
    by (simp add: sub_polyfun)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    41
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    42
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    43
lemma polyfun_linear_factor:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    44
  fixes a :: "'a::{comm_ring,monoid_mult}"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
    45
  shows  "\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z^i) =
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    46
                  (z-a) * (\<Sum>i<n. b i * z^i) + (\<Sum>i\<le>n. c i * a^i)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    47
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    48
  { fix z
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
    49
    have "(\<Sum>i\<le>n. c i * z^i) - (\<Sum>i\<le>n. c i * a^i) =
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    50
          (z - a) * (\<Sum>j<n. (\<Sum>k = Suc j..n. c k * a^(k - Suc j)) * z^j)"
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63918
diff changeset
    51
      by (simp add: sub_polyfun sum_distrib_right)
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
    52
    then have "(\<Sum>i\<le>n. c i * z^i) =
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    53
          (z - a) * (\<Sum>j<n. (\<Sum>k = Suc j..n. c k * a^(k - Suc j)) * z^j)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    54
          + (\<Sum>i\<le>n. c i * a^i)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    55
      by (simp add: algebra_simps) }
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    56
  then show ?thesis
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
    57
    by (intro exI allI)
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    58
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    59
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    60
lemma polyfun_linear_factor_root:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    61
  fixes a :: "'a::{comm_ring,monoid_mult}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    62
  assumes "(\<Sum>i\<le>n. c i * a^i) = 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    63
  shows  "\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z^i) = (z-a) * (\<Sum>i<n. b i * z^i)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    64
  using polyfun_linear_factor [of c n a] assms
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    65
  by simp
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    66
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    67
lemma adhoc_norm_triangle: "a + norm(y) \<le> b ==> norm(x) \<le> a ==> norm(x + y) \<le> b"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    68
  by (metis norm_triangle_mono order.trans order_refl)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    69
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    70
lemma polyfun_extremal_lemma:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    71
  fixes c :: "nat \<Rightarrow> 'a::real_normed_div_algebra"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    72
  assumes "e > 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    73
    shows "\<exists>M. \<forall>z. M \<le> norm z \<longrightarrow> norm(\<Sum>i\<le>n. c i * z^i) \<le> e * norm(z) ^ Suc n"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    74
proof (induction n)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    75
  case 0
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
    76
  show ?case
57512
cc97b347b301 reduced name variants for assoc and commute on plus and mult
haftmann
parents: 57129
diff changeset
    77
    by (rule exI [where x="norm (c 0) / e"]) (auto simp: mult.commute pos_divide_le_eq assms)
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    78
next
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    79
  case (Suc n)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    80
  then obtain M where M: "\<forall>z. M \<le> norm z \<longrightarrow> norm (\<Sum>i\<le>n. c i * z^i) \<le> e * norm z ^ Suc n" ..
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    81
  show ?case
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    82
  proof (rule exI [where x="max 1 (max M ((e + norm(c(Suc n))) / e))"], clarify)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    83
    fix z::'a
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    84
    assume "max 1 (max M ((e + norm (c (Suc n))) / e)) \<le> norm z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    85
    then have norm1: "0 < norm z" "M \<le> norm z" "(e + norm (c (Suc n))) / e \<le> norm z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    86
      by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    87
    then have norm2: "(e + norm (c (Suc n))) \<le> e * norm z"  "(norm z * norm z ^ n) > 0"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
    88
      apply (metis assms less_divide_eq mult.commute not_le)
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    89
      using norm1 apply (metis mult_pos_pos zero_less_power)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    90
      done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    91
    have "e * (norm z * norm z ^ n) + norm (c (Suc n) * (z * z ^ n)) =
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    92
          (e + norm (c (Suc n))) * (norm z * norm z ^ n)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    93
      by (simp add: norm_mult norm_power algebra_simps)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    94
    also have "... \<le> (e * norm z) * (norm z * norm z ^ n)"
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
    95
      using norm2 by (metis real_mult_le_cancel_iff1)
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    96
    also have "... = e * (norm z * (norm z * norm z ^ n))"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    97
      by (simp add: algebra_simps)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    98
    finally have "e * (norm z * norm z ^ n) + norm (c (Suc n) * (z * z ^ n))
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
    99
                  \<le> e * (norm z * (norm z * norm z ^ n))" .
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   100
    then show "norm (\<Sum>i\<le>Suc n. c i * z^i) \<le> e * norm z ^ Suc (Suc n)" using M norm1
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   101
      by (drule_tac x=z in spec) (auto simp: intro!: adhoc_norm_triangle)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   102
    qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   103
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   104
62626
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 61945
diff changeset
   105
lemma norm_lemma_xy: assumes "\<bar>b\<bar> + 1 \<le> norm(y) - a" "norm(x) \<le> a" shows "b \<le> norm(x + y)"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 61945
diff changeset
   106
proof -
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 61945
diff changeset
   107
  have "b \<le> norm y - norm x"
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 61945
diff changeset
   108
    using assms by linarith
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 61945
diff changeset
   109
  then show ?thesis
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 61945
diff changeset
   110
    by (metis (no_types) add.commute norm_diff_ineq order_trans)
de25474ce728 Contractible sets. Also removal of obsolete theorems and refactoring
paulson <lp15@cam.ac.uk>
parents: 61945
diff changeset
   111
qed
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   112
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   113
lemma polyfun_extremal:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   114
  fixes c :: "nat \<Rightarrow> 'a::real_normed_div_algebra"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   115
  assumes "\<exists>k. k \<noteq> 0 \<and> k \<le> n \<and> c k \<noteq> 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   116
    shows "eventually (\<lambda>z. norm(\<Sum>i\<le>n. c i * z^i) \<ge> B) at_infinity"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   117
using assms
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   118
proof (induction n)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   119
  case 0 then show ?case
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   120
    by simp
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   121
next
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   122
  case (Suc n)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   123
  show ?case
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   124
  proof (cases "c (Suc n) = 0")
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   125
    case True
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   126
    with Suc show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   127
      by auto (metis diff_is_0_eq diffs0_imp_equal less_Suc_eq_le not_less_eq)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   128
  next
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   129
    case False
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   130
    with polyfun_extremal_lemma [of "norm(c (Suc n)) / 2" c n]
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   131
    obtain M where M: "\<And>z. M \<le> norm z \<Longrightarrow>
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   132
               norm (\<Sum>i\<le>n. c i * z^i) \<le> norm (c (Suc n)) / 2 * norm z ^ Suc n"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   133
      by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   134
    show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   135
    unfolding eventually_at_infinity
61945
1135b8de26c3 more symbols;
wenzelm
parents: 61610
diff changeset
   136
    proof (rule exI [where x="max M (max 1 ((\<bar>B\<bar> + 1) / (norm (c (Suc n)) / 2)))"], clarsimp)
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   137
      fix z::'a
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   138
      assume les: "M \<le> norm z"  "1 \<le> norm z"  "(\<bar>B\<bar> * 2 + 2) / norm (c (Suc n)) \<le> norm z"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   139
      then have "\<bar>B\<bar> * 2 + 2 \<le> norm z * norm (c (Suc n))"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   140
        by (metis False pos_divide_le_eq zero_less_norm_iff)
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   141
      then have "\<bar>B\<bar> * 2 + 2 \<le> norm z ^ (Suc n) * norm (c (Suc n))"
60420
884f54e01427 isabelle update_cartouches;
wenzelm
parents: 59867
diff changeset
   142
        by (metis \<open>1 \<le> norm z\<close> order.trans mult_right_mono norm_ge_zero self_le_power zero_less_Suc)
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   143
      then show "B \<le> norm ((\<Sum>i\<le>n. c i * z^i) + c (Suc n) * (z * z ^ n))" using M les
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   144
        apply auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   145
        apply (rule norm_lemma_xy [where a = "norm (c (Suc n)) * norm z ^ (Suc n) / 2"])
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   146
        apply (simp_all add: norm_mult norm_power)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   147
        done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   148
    qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   149
  qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   150
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   151
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   152
lemma polyfun_rootbound:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   153
 fixes c :: "nat \<Rightarrow> 'a::{comm_ring,real_normed_div_algebra}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   154
 assumes "\<exists>k. k \<le> n \<and> c k \<noteq> 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   155
   shows "finite {z. (\<Sum>i\<le>n. c i * z^i) = 0} \<and> card {z. (\<Sum>i\<le>n. c i * z^i) = 0} \<le> n"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   156
using assms
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   157
proof (induction n arbitrary: c)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   158
 case (Suc n) show ?case
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   159
 proof (cases "{z. (\<Sum>i\<le>Suc n. c i * z^i) = 0} = {}")
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   160
   case False
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   161
   then obtain a where a: "(\<Sum>i\<le>Suc n. c i * a^i) = 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   162
     by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   163
   from polyfun_linear_factor_root [OF this]
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   164
   obtain b where "\<And>z. (\<Sum>i\<le>Suc n. c i * z^i) = (z - a) * (\<Sum>i< Suc n. b i * z^i)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   165
     by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   166
   then have b: "\<And>z. (\<Sum>i\<le>Suc n. c i * z^i) = (z - a) * (\<Sum>i\<le>n. b i * z^i)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   167
     by (metis lessThan_Suc_atMost)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   168
   then have ins_ab: "{z. (\<Sum>i\<le>Suc n. c i * z^i) = 0} = insert a {z. (\<Sum>i\<le>n. b i * z^i) = 0}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   169
     by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   170
   have c0: "c 0 = - (a * b 0)" using  b [of 0]
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   171
     by simp
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   172
   then have extr_prem: "~ (\<exists>k\<le>n. b k \<noteq> 0) \<Longrightarrow> \<exists>k. k \<noteq> 0 \<and> k \<le> Suc n \<and> c k \<noteq> 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   173
     by (metis Suc.prems le0 minus_zero mult_zero_right)
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   174
   have "\<exists>k\<le>n. b k \<noteq> 0"
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   175
     apply (rule ccontr)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   176
     using polyfun_extremal [OF extr_prem, of 1]
64267
b9a1486e79be setsum -> sum
nipkow
parents: 63918
diff changeset
   177
     apply (auto simp: eventually_at_infinity b simp del: sum_atMost_Suc)
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   178
     apply (drule_tac x="of_real ba" in spec, simp)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   179
     done
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   180
   then show ?thesis using Suc.IH [of b] ins_ab
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   181
     by (auto simp: card_insert_if)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   182
   qed simp
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   183
qed simp
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   184
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   185
corollary
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   186
  fixes c :: "nat \<Rightarrow> 'a::{comm_ring,real_normed_div_algebra}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   187
  assumes "\<exists>k. k \<le> n \<and> c k \<noteq> 0"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   188
    shows polyfun_rootbound_finite: "finite {z. (\<Sum>i\<le>n. c i * z^i) = 0}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   189
      and polyfun_rootbound_card:   "card {z. (\<Sum>i\<le>n. c i * z^i) = 0} \<le> n"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   190
using polyfun_rootbound [OF assms] by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   191
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   192
lemma polyfun_finite_roots:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   193
  fixes c :: "nat \<Rightarrow> 'a::{comm_ring,real_normed_div_algebra}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   194
    shows  "finite {z. (\<Sum>i\<le>n. c i * z^i) = 0} \<longleftrightarrow> (\<exists>k. k \<le> n \<and> c k \<noteq> 0)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   195
proof (cases " \<exists>k\<le>n. c k \<noteq> 0")
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   196
  case True then show ?thesis
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   197
    by (blast intro: polyfun_rootbound_finite)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   198
next
61609
77b453bd616f Coercion "real" now has type nat => real only and is no longer overloaded. Type class "real_of" is gone. Many duplicate theorems removed.
paulson <lp15@cam.ac.uk>
parents: 60420
diff changeset
   199
  case False then show ?thesis
56215
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   200
    by (auto simp: infinite_UNIV_char_0)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   201
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   202
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   203
lemma polyfun_eq_0:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   204
  fixes c :: "nat \<Rightarrow> 'a::{comm_ring,real_normed_div_algebra}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   205
    shows  "(\<forall>z. (\<Sum>i\<le>n. c i * z^i) = 0) \<longleftrightarrow> (\<forall>k. k \<le> n \<longrightarrow> c k = 0)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   206
proof (cases "(\<forall>z. (\<Sum>i\<le>n. c i * z^i) = 0)")
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   207
  case True
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   208
  then have "~ finite {z. (\<Sum>i\<le>n. c i * z^i) = 0}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   209
    by (simp add: infinite_UNIV_char_0)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   210
  with True show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   211
    by (metis (poly_guards_query) polyfun_rootbound_finite)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   212
next
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   213
  case False
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   214
  then show ?thesis
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   215
    by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   216
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   217
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   218
lemma polyfun_eq_const:
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   219
  fixes c :: "nat \<Rightarrow> 'a::{comm_ring,real_normed_div_algebra}"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   220
    shows  "(\<forall>z. (\<Sum>i\<le>n. c i * z^i) = k) \<longleftrightarrow> c 0 = k \<and> (\<forall>k. k \<noteq> 0 \<and> k \<le> n \<longrightarrow> c k = 0)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   221
proof -
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   222
  {fix z
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   223
    have "(\<Sum>i\<le>n. c i * z^i) = (\<Sum>i\<le>n. (if i = 0 then c 0 - k else c i) * z^i) + k"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   224
      by (induct n) auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   225
  } then
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   226
  have "(\<forall>z. (\<Sum>i\<le>n. c i * z^i) = k) \<longleftrightarrow> (\<forall>z. (\<Sum>i\<le>n. (if i = 0 then c 0 - k else c i) * z^i) = 0)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   227
    by auto
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   228
  also have "... \<longleftrightarrow>  c 0 = k \<and> (\<forall>k. k \<noteq> 0 \<and> k \<le> n \<longrightarrow> c k = 0)"
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   229
    by (auto simp: polyfun_eq_0)
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   230
  finally show ?thesis .
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   231
qed
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   232
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   233
end
fcf90317383d New complex analysis material
paulson <lp15@cam.ac.uk>
parents:
diff changeset
   234