equal
deleted
inserted
replaced
32 using assms by (meson diff_le_self order_trans le_add1 mult_le_mono) |
32 using assms by (meson diff_le_self order_trans le_add1 mult_le_mono) |
33 hence "int(\<Sum> {m..n}) = int((n*(n+1) - m*(m-1)) div 2)" using assms |
33 hence "int(\<Sum> {m..n}) = int((n*(n+1) - m*(m-1)) div 2)" using assms |
34 by (auto simp: Setsum_Icc_int[transferred, OF assms] zdiv_int int_mult simp del: of_nat_setsum |
34 by (auto simp: Setsum_Icc_int[transferred, OF assms] zdiv_int int_mult simp del: of_nat_setsum |
35 split: zdiff_int_split) |
35 split: zdiff_int_split) |
36 thus ?thesis |
36 thus ?thesis |
37 by blast |
37 using int_int_eq by blast |
38 qed |
38 qed |
39 |
39 |
40 lemma Setsum_Ico_nat: assumes "(m::nat) \<le> n" |
40 lemma Setsum_Ico_nat: assumes "(m::nat) \<le> n" |
41 shows "\<Sum> {m..<n} = (n*(n-1) - m*(m-1)) div 2" |
41 shows "\<Sum> {m..<n} = (n*(n-1) - m*(m-1)) div 2" |
42 proof cases |
42 proof cases |