author | paulson <lp15@cam.ac.uk> |
Tue, 23 Feb 2016 15:47:39 +0000 | |
changeset 62381 | a6479cb85944 |
parent 61945 | 1135b8de26c3 |
child 62626 | de25474ce728 |
permissions | -rw-r--r-- |
56215 | 1 |
(* Author: John Harrison and Valentina Bruno |
2 |
Ported from "hol_light/Multivariate/complexes.ml" by L C Paulson |
|
3 |
*) |
|
4 |
||
61560 | 5 |
section \<open>polynomial functions: extremal behaviour and root counts\<close> |
6 |
||
56215 | 7 |
theory PolyRoots |
8 |
imports Complex_Main |
|
9 |
begin |
|
10 |
||
60420 | 11 |
subsection\<open>Geometric progressions\<close> |
56215 | 12 |
|
13 |
lemma setsum_gp_basic: |
|
14 |
fixes x :: "'a::{comm_ring,monoid_mult}" |
|
15 |
shows "(1 - x) * (\<Sum>i\<le>n. x^i) = 1 - x^Suc n" |
|
16 |
by (simp only: one_diff_power_eq [of "Suc n" x] lessThan_Suc_atMost) |
|
17 |
||
18 |
lemma setsum_gp0: |
|
59867
58043346ca64
given up separate type classes demanding `inverse 0 = 0`
haftmann
parents:
59615
diff
changeset
|
19 |
fixes x :: "'a::{comm_ring,division_ring}" |
59615
fdfdf89a83a6
A few new lemmas and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
58877
diff
changeset
|
20 |
shows "(\<Sum>i\<le>n. x^i) = (if x = 1 then of_nat(n + 1) else (1 - x^Suc n) / (1 - x))" |
fdfdf89a83a6
A few new lemmas and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
58877
diff
changeset
|
21 |
using setsum_gp_basic[of x 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
|
22 |
by (simp add: mult.commute divide_simps) |
59615
fdfdf89a83a6
A few new lemmas and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
58877
diff
changeset
|
23 |
|
fdfdf89a83a6
A few new lemmas and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
58877
diff
changeset
|
24 |
lemma setsum_power_add: |
fdfdf89a83a6
A few new lemmas and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
58877
diff
changeset
|
25 |
fixes x :: "'a::{comm_ring,monoid_mult}" |
fdfdf89a83a6
A few new lemmas and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
58877
diff
changeset
|
26 |
shows "(\<Sum>i\<in>I. x^(m+i)) = x^m * (\<Sum>i\<in>I. x^i)" |
fdfdf89a83a6
A few new lemmas and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
58877
diff
changeset
|
27 |
by (simp add: setsum_right_distrib power_add) |
56215 | 28 |
|
29 |
lemma setsum_power_shift: |
|
30 |
fixes x :: "'a::{comm_ring,monoid_mult}" |
|
31 |
assumes "m \<le> n" |
|
32 |
shows "(\<Sum>i=m..n. x^i) = x^m * (\<Sum>i\<le>n-m. x^i)" |
|
33 |
proof - |
|
34 |
have "(\<Sum>i=m..n. x^i) = x^m * (\<Sum>i=m..n. x^(i-m))" |
|
35 |
by (simp add: setsum_right_distrib power_add [symmetric]) |
|
57129
7edb7550663e
introduce more powerful reindexing rules for big operators
hoelzl
parents:
56215
diff
changeset
|
36 |
also have "(\<Sum>i=m..n. x^(i-m)) = (\<Sum>i\<le>n-m. x^i)" |
60420 | 37 |
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 |
56215 | 38 |
finally show ?thesis . |
39 |
qed |
|
40 |
||
41 |
lemma setsum_gp_multiplied: |
|
42 |
fixes x :: "'a::{comm_ring,monoid_mult}" |
|
43 |
assumes "m \<le> n" |
|
44 |
shows "(1 - x) * (\<Sum>i=m..n. x^i) = x^m - x^Suc n" |
|
45 |
proof - |
|
46 |
have "(1 - x) * (\<Sum>i=m..n. x^i) = x^m * (1 - x) * (\<Sum>i\<le>n-m. x^i)" |
|
57514
bdc2c6b40bf2
prefer ac_simps collections over separate name bindings for add and mult
haftmann
parents:
57512
diff
changeset
|
47 |
by (metis mult.assoc mult.commute assms setsum_power_shift) |
56215 | 48 |
also have "... =x^m * (1 - x^Suc(n-m))" |
57514
bdc2c6b40bf2
prefer ac_simps collections over separate name bindings for add and mult
haftmann
parents:
57512
diff
changeset
|
49 |
by (metis mult.assoc setsum_gp_basic) |
56215 | 50 |
also have "... = x^m - x^Suc n" |
51 |
using assms |
|
52 |
by (simp add: algebra_simps) (metis le_add_diff_inverse power_add) |
|
53 |
finally show ?thesis . |
|
54 |
qed |
|
55 |
||
56 |
lemma setsum_gp: |
|
59867
58043346ca64
given up separate type classes demanding `inverse 0 = 0`
haftmann
parents:
59615
diff
changeset
|
57 |
fixes x :: "'a::{comm_ring,division_ring}" |
56215 | 58 |
shows "(\<Sum>i=m..n. x^i) = |
59 |
(if n < m then 0 |
|
60 |
else if x = 1 then of_nat((n + 1) - m) |
|
61 |
else (x^m - x^Suc n) / (1 - x))" |
|
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
|
62 |
using setsum_gp_multiplied [of m n x] |
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
|
63 |
apply auto |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57129
diff
changeset
|
64 |
by (metis eq_iff_diff_eq_0 mult.commute nonzero_divide_eq_eq) |
56215 | 65 |
|
66 |
lemma setsum_gp_offset: |
|
59867
58043346ca64
given up separate type classes demanding `inverse 0 = 0`
haftmann
parents:
59615
diff
changeset
|
67 |
fixes x :: "'a::{comm_ring,division_ring}" |
56215 | 68 |
shows "(\<Sum>i=m..m+n. x^i) = |
69 |
(if x = 1 then of_nat n + 1 else x^m * (1 - x^Suc n) / (1 - x))" |
|
70 |
using setsum_gp [of x m "m+n"] |
|
71 |
by (auto simp: power_add algebra_simps) |
|
72 |
||
59615
fdfdf89a83a6
A few new lemmas and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
58877
diff
changeset
|
73 |
lemma setsum_gp_strict: |
59867
58043346ca64
given up separate type classes demanding `inverse 0 = 0`
haftmann
parents:
59615
diff
changeset
|
74 |
fixes x :: "'a::{comm_ring,division_ring}" |
59615
fdfdf89a83a6
A few new lemmas and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
58877
diff
changeset
|
75 |
shows "(\<Sum>i<n. x^i) = (if x = 1 then of_nat n else (1 - x^n) / (1 - x))" |
fdfdf89a83a6
A few new lemmas and a bit of tidying up
paulson <lp15@cam.ac.uk>
parents:
58877
diff
changeset
|
76 |
by (induct n) (auto simp: algebra_simps divide_simps) |
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
|
77 |
|
60420 | 78 |
subsection\<open>Basics about polynomial functions: extremal behaviour and root counts.\<close> |
56215 | 79 |
|
80 |
lemma sub_polyfun: |
|
81 |
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
|
82 |
shows "(\<Sum>i\<le>n. a i * x^i) - (\<Sum>i\<le>n. a i * y^i) = |
56215 | 83 |
(x - y) * (\<Sum>j<n. \<Sum>k= Suc j..n. a k * y^(k - Suc j) * x^j)" |
84 |
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
|
85 |
have "(\<Sum>i\<le>n. a i * x^i) - (\<Sum>i\<le>n. a i * y^i) = |
56215 | 86 |
(\<Sum>i\<le>n. a i * (x^i - y^i))" |
87 |
by (simp add: algebra_simps setsum_subtractf [symmetric]) |
|
88 |
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
|
89 |
by (simp add: power_diff_sumr2 ac_simps) |
56215 | 90 |
also have "... = (x - y) * (\<Sum>i\<le>n. (\<Sum>j<i. a 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
|
91 |
by (simp add: setsum_right_distrib ac_simps) |
56215 | 92 |
also have "... = (x - y) * (\<Sum>j<n. (\<Sum>i=Suc j..n. a i * y^(i - Suc j) * x^j))" |
93 |
by (simp add: nested_setsum_swap') |
|
94 |
finally show ?thesis . |
|
95 |
qed |
|
96 |
||
97 |
lemma sub_polyfun_alt: |
|
98 |
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
|
99 |
shows "(\<Sum>i\<le>n. a i * x^i) - (\<Sum>i\<le>n. a i * y^i) = |
56215 | 100 |
(x - y) * (\<Sum>j<n. \<Sum>k<n-j. a (j+k+1) * y^k * x^j)" |
101 |
proof - |
|
102 |
{ fix j |
|
103 |
have "(\<Sum>k = Suc j..n. a k * y^(k - Suc j) * x^j) = |
|
104 |
(\<Sum>k <n - j. a (Suc (j + k)) * y^k * x^j)" |
|
57129
7edb7550663e
introduce more powerful reindexing rules for big operators
hoelzl
parents:
56215
diff
changeset
|
105 |
by (rule setsum.reindex_bij_witness[where i="\<lambda>i. i + Suc j" and j="\<lambda>i. i - Suc j"]) auto } |
56215 | 106 |
then show ?thesis |
107 |
by (simp add: sub_polyfun) |
|
108 |
qed |
|
109 |
||
110 |
lemma polyfun_linear_factor: |
|
111 |
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
|
112 |
shows "\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z^i) = |
56215 | 113 |
(z-a) * (\<Sum>i<n. b i * z^i) + (\<Sum>i\<le>n. c i * a^i)" |
114 |
proof - |
|
115 |
{ 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
|
116 |
have "(\<Sum>i\<le>n. c i * z^i) - (\<Sum>i\<le>n. c i * a^i) = |
56215 | 117 |
(z - a) * (\<Sum>j<n. (\<Sum>k = Suc j..n. c k * a^(k - Suc j)) * z^j)" |
118 |
by (simp add: sub_polyfun setsum_left_distrib) |
|
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
|
119 |
then have "(\<Sum>i\<le>n. c i * z^i) = |
56215 | 120 |
(z - a) * (\<Sum>j<n. (\<Sum>k = Suc j..n. c k * a^(k - Suc j)) * z^j) |
121 |
+ (\<Sum>i\<le>n. c i * a^i)" |
|
122 |
by (simp add: algebra_simps) } |
|
123 |
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
|
124 |
by (intro exI allI) |
56215 | 125 |
qed |
126 |
||
127 |
lemma polyfun_linear_factor_root: |
|
128 |
fixes a :: "'a::{comm_ring,monoid_mult}" |
|
129 |
assumes "(\<Sum>i\<le>n. c i * a^i) = 0" |
|
130 |
shows "\<exists>b. \<forall>z. (\<Sum>i\<le>n. c i * z^i) = (z-a) * (\<Sum>i<n. b i * z^i)" |
|
131 |
using polyfun_linear_factor [of c n a] assms |
|
132 |
by simp |
|
133 |
||
134 |
lemma adhoc_norm_triangle: "a + norm(y) \<le> b ==> norm(x) \<le> a ==> norm(x + y) \<le> b" |
|
135 |
by (metis norm_triangle_mono order.trans order_refl) |
|
136 |
||
137 |
lemma polyfun_extremal_lemma: |
|
138 |
fixes c :: "nat \<Rightarrow> 'a::real_normed_div_algebra" |
|
139 |
assumes "e > 0" |
|
140 |
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" |
|
141 |
proof (induction n) |
|
142 |
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
|
143 |
show ?case |
57512
cc97b347b301
reduced name variants for assoc and commute on plus and mult
haftmann
parents:
57129
diff
changeset
|
144 |
by (rule exI [where x="norm (c 0) / e"]) (auto simp: mult.commute pos_divide_le_eq assms) |
56215 | 145 |
next |
146 |
case (Suc n) |
|
147 |
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" .. |
|
148 |
show ?case |
|
149 |
proof (rule exI [where x="max 1 (max M ((e + norm(c(Suc n))) / e))"], clarify) |
|
150 |
fix z::'a |
|
151 |
assume "max 1 (max M ((e + norm (c (Suc n))) / e)) \<le> norm z" |
|
152 |
then have norm1: "0 < norm z" "M \<le> norm z" "(e + norm (c (Suc n))) / e \<le> norm z" |
|
153 |
by auto |
|
154 |
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
|
155 |
apply (metis assms less_divide_eq mult.commute not_le) |
56215 | 156 |
using norm1 apply (metis mult_pos_pos zero_less_power) |
157 |
done |
|
158 |
have "e * (norm z * norm z ^ n) + norm (c (Suc n) * (z * z ^ n)) = |
|
159 |
(e + norm (c (Suc n))) * (norm z * norm z ^ n)" |
|
160 |
by (simp add: norm_mult norm_power algebra_simps) |
|
161 |
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
|
162 |
using norm2 by (metis real_mult_le_cancel_iff1) |
56215 | 163 |
also have "... = e * (norm z * (norm z * norm z ^ n))" |
164 |
by (simp add: algebra_simps) |
|
165 |
finally have "e * (norm z * norm z ^ n) + norm (c (Suc n) * (z * z ^ n)) |
|
166 |
\<le> e * (norm z * (norm z * norm z ^ n))" . |
|
167 |
then show "norm (\<Sum>i\<le>Suc n. c i * z^i) \<le> e * norm z ^ Suc (Suc n)" using M norm1 |
|
168 |
by (drule_tac x=z in spec) (auto simp: intro!: adhoc_norm_triangle) |
|
169 |
qed |
|
170 |
qed |
|
171 |
||
61945 | 172 |
lemma norm_lemma_xy: "\<lbrakk>\<bar>b\<bar> + 1 \<le> norm(y) - a; norm(x) \<le> a\<rbrakk> \<Longrightarrow> b \<le> norm(x + y)" |
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
|
173 |
by (metis abs_add_one_not_less_self add.commute diff_le_eq dual_order.trans le_less_linear |
56215 | 174 |
norm_diff_ineq) |
175 |
||
176 |
lemma polyfun_extremal: |
|
177 |
fixes c :: "nat \<Rightarrow> 'a::real_normed_div_algebra" |
|
178 |
assumes "\<exists>k. k \<noteq> 0 \<and> k \<le> n \<and> c k \<noteq> 0" |
|
179 |
shows "eventually (\<lambda>z. norm(\<Sum>i\<le>n. c i * z^i) \<ge> B) at_infinity" |
|
180 |
using assms |
|
181 |
proof (induction n) |
|
182 |
case 0 then show ?case |
|
183 |
by simp |
|
184 |
next |
|
185 |
case (Suc n) |
|
186 |
show ?case |
|
187 |
proof (cases "c (Suc n) = 0") |
|
188 |
case True |
|
189 |
with Suc show ?thesis |
|
190 |
by auto (metis diff_is_0_eq diffs0_imp_equal less_Suc_eq_le not_less_eq) |
|
191 |
next |
|
192 |
case False |
|
193 |
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
|
194 |
obtain M where M: "\<And>z. M \<le> norm z \<Longrightarrow> |
56215 | 195 |
norm (\<Sum>i\<le>n. c i * z^i) \<le> norm (c (Suc n)) / 2 * norm z ^ Suc n" |
196 |
by auto |
|
197 |
show ?thesis |
|
198 |
unfolding eventually_at_infinity |
|
61945 | 199 |
proof (rule exI [where x="max M (max 1 ((\<bar>B\<bar> + 1) / (norm (c (Suc n)) / 2)))"], clarsimp) |
56215 | 200 |
fix z::'a |
201 |
assume les: "M \<le> norm z" "1 \<le> norm z" "(\<bar>B\<bar> * 2 + 2) / norm (c (Suc n)) \<le> norm z" |
|
202 |
then have "\<bar>B\<bar> * 2 + 2 \<le> norm z * norm (c (Suc n))" |
|
203 |
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
|
204 |
then have "\<bar>B\<bar> * 2 + 2 \<le> norm z ^ (Suc n) * norm (c (Suc n))" |
60420 | 205 |
by (metis \<open>1 \<le> norm z\<close> order.trans mult_right_mono norm_ge_zero self_le_power zero_less_Suc) |
56215 | 206 |
then show "B \<le> norm ((\<Sum>i\<le>n. c i * z^i) + c (Suc n) * (z * z ^ n))" using M les |
207 |
apply auto |
|
208 |
apply (rule norm_lemma_xy [where a = "norm (c (Suc n)) * norm z ^ (Suc n) / 2"]) |
|
209 |
apply (simp_all add: norm_mult norm_power) |
|
210 |
done |
|
211 |
qed |
|
212 |
qed |
|
213 |
qed |
|
214 |
||
215 |
lemma polyfun_rootbound: |
|
216 |
fixes c :: "nat \<Rightarrow> 'a::{comm_ring,real_normed_div_algebra}" |
|
217 |
assumes "\<exists>k. k \<le> n \<and> c k \<noteq> 0" |
|
218 |
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" |
|
219 |
using assms |
|
220 |
proof (induction n arbitrary: c) |
|
221 |
case (Suc n) show ?case |
|
222 |
proof (cases "{z. (\<Sum>i\<le>Suc n. c i * z^i) = 0} = {}") |
|
223 |
case False |
|
224 |
then obtain a where a: "(\<Sum>i\<le>Suc n. c i * a^i) = 0" |
|
225 |
by auto |
|
226 |
from polyfun_linear_factor_root [OF this] |
|
227 |
obtain b where "\<And>z. (\<Sum>i\<le>Suc n. c i * z^i) = (z - a) * (\<Sum>i< Suc n. b i * z^i)" |
|
228 |
by auto |
|
229 |
then have b: "\<And>z. (\<Sum>i\<le>Suc n. c i * z^i) = (z - a) * (\<Sum>i\<le>n. b i * z^i)" |
|
230 |
by (metis lessThan_Suc_atMost) |
|
231 |
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}" |
|
232 |
by auto |
|
233 |
have c0: "c 0 = - (a * b 0)" using b [of 0] |
|
234 |
by simp |
|
235 |
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" |
|
236 |
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
|
237 |
have "\<exists>k\<le>n. b k \<noteq> 0" |
56215 | 238 |
apply (rule ccontr) |
239 |
using polyfun_extremal [OF extr_prem, of 1] |
|
240 |
apply (auto simp: eventually_at_infinity b simp del: setsum_atMost_Suc) |
|
241 |
apply (drule_tac x="of_real ba" in spec, simp) |
|
242 |
done |
|
243 |
then show ?thesis using Suc.IH [of b] ins_ab |
|
244 |
by (auto simp: card_insert_if) |
|
245 |
qed simp |
|
246 |
qed simp |
|
247 |
||
248 |
corollary |
|
249 |
fixes c :: "nat \<Rightarrow> 'a::{comm_ring,real_normed_div_algebra}" |
|
250 |
assumes "\<exists>k. k \<le> n \<and> c k \<noteq> 0" |
|
251 |
shows polyfun_rootbound_finite: "finite {z. (\<Sum>i\<le>n. c i * z^i) = 0}" |
|
252 |
and polyfun_rootbound_card: "card {z. (\<Sum>i\<le>n. c i * z^i) = 0} \<le> n" |
|
253 |
using polyfun_rootbound [OF assms] by auto |
|
254 |
||
255 |
lemma polyfun_finite_roots: |
|
256 |
fixes c :: "nat \<Rightarrow> 'a::{comm_ring,real_normed_div_algebra}" |
|
257 |
shows "finite {z. (\<Sum>i\<le>n. c i * z^i) = 0} \<longleftrightarrow> (\<exists>k. k \<le> n \<and> c k \<noteq> 0)" |
|
258 |
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
|
259 |
case True then show ?thesis |
56215 | 260 |
by (blast intro: polyfun_rootbound_finite) |
261 |
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
|
262 |
case False then show ?thesis |
56215 | 263 |
by (auto simp: infinite_UNIV_char_0) |
264 |
qed |
|
265 |
||
266 |
lemma polyfun_eq_0: |
|
267 |
fixes c :: "nat \<Rightarrow> 'a::{comm_ring,real_normed_div_algebra}" |
|
268 |
shows "(\<forall>z. (\<Sum>i\<le>n. c i * z^i) = 0) \<longleftrightarrow> (\<forall>k. k \<le> n \<longrightarrow> c k = 0)" |
|
269 |
proof (cases "(\<forall>z. (\<Sum>i\<le>n. c i * z^i) = 0)") |
|
270 |
case True |
|
271 |
then have "~ finite {z. (\<Sum>i\<le>n. c i * z^i) = 0}" |
|
272 |
by (simp add: infinite_UNIV_char_0) |
|
273 |
with True show ?thesis |
|
274 |
by (metis (poly_guards_query) polyfun_rootbound_finite) |
|
275 |
next |
|
276 |
case False |
|
277 |
then show ?thesis |
|
278 |
by auto |
|
279 |
qed |
|
280 |
||
281 |
lemma polyfun_eq_const: |
|
282 |
fixes c :: "nat \<Rightarrow> 'a::{comm_ring,real_normed_div_algebra}" |
|
283 |
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)" |
|
284 |
proof - |
|
285 |
{fix z |
|
286 |
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" |
|
287 |
by (induct n) auto |
|
288 |
} then |
|
289 |
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)" |
|
290 |
by auto |
|
291 |
also have "... \<longleftrightarrow> c 0 = k \<and> (\<forall>k. k \<noteq> 0 \<and> k \<le> n \<longrightarrow> c k = 0)" |
|
292 |
by (auto simp: polyfun_eq_0) |
|
293 |
finally show ?thesis . |
|
294 |
qed |
|
295 |
||
296 |
end |
|
297 |