Definition respectful {X} (P : dist X -> Prop) : Prop :=
  forall d1 d2, d1 ==d d2 -> P d1 <-> P d2.

Lemma hoare_bind {X Y} (Pre : dist PosMap -> Prop) (Mid : dist (X * PosMap) -> Prop) (Post : dist (Y * PosMap) -> Prop) (m : M X) (f : X -> M Y) : respectful Post -> hoare Pre Mid m -> (forall d, Mid d -> Post (f_apply f d)) -> hoare Pre Post (mbind m f).