(** We emulate two [max_elt] and [min_elt] functions. *)

  Fixpoint max_elt_aux (l:list (key*elt)) := match l with
    | nil => None
    | (x,e)::nil => Some (x,e)
    | (x,e)::l => max_elt_aux l
    end.Definition max_elt m := max_elt_aux (elements m).

(* Specifications: *)
Lemma max_elt_Above : forall m x e, max_elt m = Some (x,e) -> Above x (remove x m).
Lemma max_elt_MapsTo : forall m x e, max_elt m = Some (x,e) -> MapsTo x e m.
Lemma max_elt_Empty : forall m, max_elt m = None -> Empty m.