Global Instance Finite_prod {X Y} `{Finite X, Finite Y} : Finite (X * Y).
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_update_probs {X} (l : list (X * Q)) (q : Q) (p : X -> bool) :
filter_dist (update_probs q l) p =
update_probs q (filter_dist l p).