equal
deleted
inserted
replaced
736 |
736 |
737 subsection {* The formula for geometric sums *} |
737 subsection {* The formula for geometric sums *} |
738 |
738 |
739 lemma geometric_sum: |
739 lemma geometric_sum: |
740 "x ~= 1 ==> (\<Sum>i=0..<n. x ^ i) = |
740 "x ~= 1 ==> (\<Sum>i=0..<n. x ^ i) = |
741 (x ^ n - 1) / (x - 1::'a::{field, recpower, division_by_zero})" |
741 (x ^ n - 1) / (x - 1::'a::{field, recpower})" |
742 apply (induct "n", auto) |
742 apply (induct "n", auto) |
743 apply (rule_tac c = "x - 1" in field_mult_cancel_right_lemma) |
743 apply (rule_tac c = "x - 1" in field_mult_cancel_right_lemma) |
744 apply (auto simp add: mult_assoc left_distrib) |
744 apply (auto simp add: mult_assoc left_distrib) |
|
745 apply (simp add: times_divide_eq_right [symmetric] divide_self) |
745 apply (simp add: right_distrib diff_minus mult_commute power_Suc) |
746 apply (simp add: right_distrib diff_minus mult_commute power_Suc) |
746 done |
747 done |
747 |
748 |
748 |
749 |
749 subsection {* The formula for arithmetic sums *} |
750 subsection {* The formula for arithmetic sums *} |