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

Lemma count_occ_app A eq_dec (a :A) l l' :
count_occ eq_dec (l ++ l') a = count_occ eq_dec l a + count_occ eq_dec l' a.