Definition sumF {X} `{Finite X} (f : X -> nat) : nat :=
  list_sum (map f enum).Definition sumFQ {X} `{Finite X} (f : X -> Q) : Q :=
  Qsum(map f enum).

Lemma count_sumF_lst {X} (l : list X) (p : X -> bool): length (filter p l) = list_sum (map (fun x : X => indicate_nat (p x)) l).