Definition from_elements A (l : list (key * A))
: t A (List.fold_left (fun acc xv => Dom.add (fst xv) acc) l Dom.empty) :=
exist (OK (List.fold_left (fun acc xv => Dom.add (fst xv) acc) l Dom.empty))
(List.fold_left (fun acc xv => S.add (fst xv) (snd xv) acc) l (@S.empty A))
(from_elements_OK l).
(** ***  Specifications  **)

Lemma constant_aux : forall A v x u l (m : S.t A), NoDupA X.eq l ->
S.find x (fold_left (fun a e => S.add e v a) l m) = Some u <->
InA X.eq x l ∧ u = v ∨ ¬InA X.eq x l ∧ S.find x m = Some u.