Definition setd {T} (f : M.elt -> T) (g : T -> T -> T) (b : T) (s : M.t) :=
  listd f g b (M.elements s).

Lemma listd_inter_map: forall {A B C} (l:list A) (f:B -> C -> Prop) h s, (forall x, In x l -> f (h x) s) -> inter (listd f inter TT (map h l)) TT s.