Global Instance Finite_unit : Finite unit.Global Instance Finite_bool_vec {n} : Finite (vec n bool).Definition transform_pair {X Y Z} (tp : X * Y * Z) : X * (Y * Z) :=
  (fst (fst tp), (snd (fst tp), snd tp)).

Lemma pres_uniform_lemma {Y Z} `{Finite Y, Finite Z} (f : Y -> dist Z) (d : dist Y) (ud : uniform d) : (forall dy : dist Y, uniform dy -> uniform (mbind dy f)) -> forall z, sumFQ (fun y => eval_dist (f y) (Classes.eqb z)) == Q_of_nat (card Y) / Q_of_nat (card Z).