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 list_sum_map_ext {X} `{EqDec X} (f : X -> nat) (l : list X) : forall (l' : list X),
NoDup l -> NoDup l' ->
(forall x, In x l -> In x l') ->
(forall x, In x l' -> In x l) ->
list_sum (map f l) = list_sum (map f l').