Definition indicate (b : bool) : Q :=
  if b then 1 else 0.Definition indicate_nat (b : bool) : nat :=
  if b then 1 else O.

Lemma filter_dist_app {X} (xs xs' : list (X * Q)) (p : X -> bool) : filter_dist (xs ++ xs') p = filter_dist xs p ++ filter_dist xs' p.