Global Instance Finite_unit : Finite unit.
Global Hint Resolve transform_pair_bijection : core.

Lemma key_lemma {X Y Z} `{Finite X, Finite Y, Finite Z} (d : dist (X * Y)) (f : Y -> dist Z) :
uniform d ->
(forall dy : dist Y, uniform dy -> uniform (mbind dy f)) ->
uniform (
p <- d;;
z <- f (snd p);;
mreturn (fst p, z)).