Fixpoint revflatten {A: Type} (xss: list (list A)) : list A :=
match xss with
| []       => []
| xs::xss' => revflatten xss' ++ xs
end.

Lemma suml_map_count_occ_remove A eq_dec (a: A) l1 l2 :
~In a l2 ->
suml (map (count_occ eq_dec (remove eq_dec a l1)) l2) =
suml (map (count_occ eq_dec l1) l2).