(** 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).

Lemma max_elt_Above : forall m x e, max_elt m = Some (x,e) -> Above x (remove x m).