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 sum_2D_flip {X Y} `{Finite X, Finite Y} (f : X -> Y -> nat) :
sumF (fun x => sumF (f x)) =
sumF (fun y => sumF (fun x => f x y)).