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

Lemma Qsum_ext {X} (xs : list X) (f g : X -> Q) : (forall x, In x xs -> f x == g x) -> Qsum (map f xs) == Qsum (map g xs).