Definition Map (K V : Type) : Type :=
  list (K * V).Definition well_formed {K V} (m : Map K V) : Prop :=
  NoDup (map fst m).(* no repeat keys *)

Class DecEq (X : Type) := {
  dec_eq : forall x x' : X, { x = x' } + { x <> x' }
  }.(* no repeat keys *)

Class DecEq (X : Type) := {
  dec_eq : forall x x' : X, { x = x' } + { x <> x' }
  }.

(* Specifications: *)
Lemma In_insert_invert {K V} `{DecEq K} {p : K * V} {k : K} {v : V} {m : Map K V} : In p (insert k v m) -> p = (k, v) \/ In p m.
Lemma well_formed_insert {K V} `{DecEq K} (k : K) (v : V) (m : Map K V) : well_formed m -> well_formed (insert k v m).
Lemma lookup_insert {K V} `{DecEq K} (k : K) (v : V) (m : Map K V) : well_formed m -> lookup k (insert k v m) = Some v.
Lemma In_insert_invert {K V} `{DecEq K} {p : K * V} {k : K} {v : V} {m : Map K V} : In p (insert k v m) -> p = (k, v) \/ In p m.
Lemma well_formed_insert {K V} `{DecEq K} (k : K) (v : V) (m : Map K V) : well_formed m -> well_formed (insert k v m).
Lemma lookup_insert {K V} `{DecEq K} (k : K) (v : V) (m : Map K V) : well_formed m -> lookup k (insert k v m) = Some v.