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

Lemma count_occ_remove_neq A eq_dec (a a': A) l :
a<>a' -> count_occ eq_dec (remove eq_dec a' l) a = count_occ eq_dec l a.