Instance Equal_Equivalence : Equivalence Equal := {
  Equivalence_Reflexive := Equal_refl;
  Equivalence_Symmetric := Equal_sym;
  Equivalence_Transitive := Equal_trans
}.Program Definition Equal_dec (m1 m2: T.t A) : { m1 === m2 } + { m1 =/= m2 } :=
  match T.beq (fun a1 a2 => proj_sumbool (a1 == a2)) m1 m2 with
  | true => left _
  | false => right _
  end.Instance Equal_EqDec : EqDec (T.t A) Equal := Equal_dec.Definition of_list (l: list (T.elt * A)) : T.t A :=
  List.fold_left f l (T.empty _).

(* Specifications: *)
Lemma in_of_list: forall l k v, T.get k (of_list l) = Some v -> In (k, v) l.
Lemma of_list_dom: forall l k, In k (map fst l) -> exists v, T.get k (of_list l) = Some v.