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 Qsum_zero_in {X} (f : X -> Q) (xs : list X) : (forall x, In x xs -> f x == 0) -> Qsum (map f xs) == 0.