Definition normalize {X} `{Finite X} (d : dist X) : dist X.
refine {|
dist_pmf := map (fun x => (x, eval_dist d (Classes.eqb x))) enum;
dist_law := _;
|}.

Lemma double_sumQ {X Y} (xs : list X) (ys : list Y) (f : X * Y -> Q) :
Qsum (map (fun x => Qsum (map (fun y => f (x, y)) ys)) xs) ==
Qsum (map f (list_prod xs ys)).