Definition bijection {X Y} (f : X -> Y) : Prop :=
  exists g : Y -> X,
    (forall x, g (f x) = x) /\
    (forall y, f (g y) = y).

Lemma uniform_bind_bijection_rev {X Y} `{EqDec X, EqDec Y} (f : X -> Y) (d : dist X) : uniform (mbind d (fun x => mreturn (f x))) -> bijection f -> uniform d.