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_sum {X Y} (xs : list X) (ys : list Y) (f : X * Y -> nat) :
list_sum (map (fun x => list_sum (map (fun y => f (x, y)) ys)) xs) =
list_sum (map f (list_prod xs ys)).