src/HOL/SetInterval.thy
changeset 22713 3ea6c1cb3dab
parent 21502 7f3ea2b3bab6
child 23277 aa158e145ea3
equal deleted inserted replaced
22712:8f2ba236918b 22713:3ea6c1cb3dab
   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 *}