diff -r 048bbe0bf807 -r 1d2222800ecd src/HOL/Groups_List.thy --- a/src/HOL/Groups_List.thy Sat Jul 23 12:19:45 2022 +0200 +++ b/src/HOL/Groups_List.thy Mon Jul 25 12:19:59 2022 +0200 @@ -252,6 +252,15 @@ qed qed +text \A much more general version of this monotonicity lemma +can be formulated with multisets and the multiset order\ + +lemma sum_list_mono2: fixes xs :: "'a ::ordered_comm_monoid_add list" +shows "\ length xs = length ys; \i. i < length xs \ xs!i \ ys!i \ + \ sum_list xs \ sum_list ys" +apply(induction xs ys rule: list_induct2) +by(auto simp: nth_Cons' less_Suc_eq_0_disj imp_ex add_mono) + lemma (in monoid_add) sum_list_distinct_conv_sum_set: "distinct xs \ sum_list (map f xs) = sum f (set xs)" by (induct xs) simp_all