636 by (simp add: power_add [symmetric] mult.commute) |
636 by (simp add: power_add [symmetric] mult.commute) |
637 have *: "(\<Sum>i<n. z ^ i * ((z + h) ^ (n - i) - z ^ (n - i))) = |
637 have *: "(\<Sum>i<n. z ^ i * ((z + h) ^ (n - i) - z ^ (n - i))) = |
638 (\<Sum>i<n. \<Sum>j<n - i. h * ((z + h) ^ j * z ^ (n - Suc j)))" |
638 (\<Sum>i<n. \<Sum>j<n - i. h * ((z + h) ^ j * z ^ (n - Suc j)))" |
639 apply (rule sum.cong [OF refl]) |
639 apply (rule sum.cong [OF refl]) |
640 apply (clarsimp simp add: less_iff_Suc_add sum_distrib_left diff_power_eq_sum ac_simps 0 |
640 apply (clarsimp simp add: less_iff_Suc_add sum_distrib_left diff_power_eq_sum ac_simps 0 |
641 simp del: sum_lessThan_Suc power_Suc) |
641 simp del: sum.lessThan_Suc power_Suc) |
642 done |
642 done |
643 have "h * ?lhs = h * ?rhs" |
643 have "h * ?lhs = h * ?rhs" |
644 apply (simp add: right_diff_distrib diff_divide_distrib h mult.assoc [symmetric]) |
644 apply (simp add: right_diff_distrib diff_divide_distrib h mult.assoc [symmetric]) |
645 using Suc |
645 using Suc |
646 apply (simp add: diff_power_eq_sum h right_diff_distrib [symmetric] mult.assoc |
646 apply (simp add: diff_power_eq_sum h right_diff_distrib [symmetric] mult.assoc |
647 del: power_Suc sum_lessThan_Suc of_nat_Suc) |
647 del: power_Suc sum.lessThan_Suc of_nat_Suc) |
648 apply (subst lemma_realpow_rev_sumr) |
648 apply (subst lemma_realpow_rev_sumr) |
649 apply (subst sumr_diff_mult_const2) |
649 apply (subst sumr_diff_mult_const2) |
650 apply (simp add: lemma_termdiff1 sum_distrib_left *) |
650 apply (simp add: lemma_termdiff1 sum_distrib_left *) |
651 done |
651 done |
652 then show ?thesis |
652 then show ?thesis |
6295 |
6295 |
6296 lemma root_polyfun: |
6296 lemma root_polyfun: |
6297 fixes z :: "'a::idom" |
6297 fixes z :: "'a::idom" |
6298 assumes "1 \<le> n" |
6298 assumes "1 \<le> n" |
6299 shows "z^n = a \<longleftrightarrow> (\<Sum>i\<le>n. (if i = 0 then -a else if i=n then 1 else 0) * z^i) = 0" |
6299 shows "z^n = a \<longleftrightarrow> (\<Sum>i\<le>n. (if i = 0 then -a else if i=n then 1 else 0) * z^i) = 0" |
6300 using assms by (cases n) (simp_all add: sum_head_Suc atLeast0AtMost [symmetric]) |
6300 using assms by (cases n) (simp_all add: sum.atLeast_Suc_atMost atLeast0AtMost [symmetric]) |
6301 |
6301 |
6302 lemma |
6302 lemma |
6303 assumes "SORT_CONSTRAINT('a::{idom,real_normed_div_algebra})" |
6303 assumes "SORT_CONSTRAINT('a::{idom,real_normed_div_algebra})" |
6304 and "1 \<le> n" |
6304 and "1 \<le> n" |
6305 shows finite_roots_unity: "finite {z::'a. z^n = 1}" |
6305 shows finite_roots_unity: "finite {z::'a. z^n = 1}" |