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

Lemma filter_split {X} (part : X -> bool) (f : X -> Q) : forall xs, Qsum (map f xs) == Qsum (map f (filter part xs)) + Qsum (map f (filter (fun x => negb (part x)) xs)).