(** Specification of [elements] *)

  Notation InL := (InA E.eq).

(* Specifications: *)
Lemma xelements_spec: forall s j acc y, InL y (xelements s j acc) <-> InL y acc \/ exists x, y=(j@x) /\ mem x s = true.
Lemma elements_1: forall s x, In x s -> InL x (elements s).
Lemma elements_2: forall s x, InL x (elements s) -> In x s.
Lemma lt_rev_append: forall j x y, E.lt x y -> E.lt (j@x) (j@y).
Lemma elements_3: forall s, sort E.lt (elements s).
Lemma elements_3w: forall s, NoDupA E.eq (elements s).
Lemma choose_1: forall s x, choose s = Some x -> In x s.
Lemma choose_2: forall s, choose s = None -> Empty s.
Lemma choose_empty: forall s, is_empty s = true -> choose s = None.
Lemma choose_3': forall s s', Equal s s' -> choose s = choose s'.
Lemma choose_3: forall s s' x y, choose s = Some x -> choose s' = Some y -> Equal s s' -> E.eq x y.
Lemma min_elt_1: forall s x, min_elt s = Some x -> In x s.
Lemma min_elt_3: forall s, min_elt s = None -> Empty s.
Lemma min_elt_2: forall s x y, min_elt s = Some x -> In y s -> ~ E.lt y x.
Lemma max_elt_1: forall s x, max_elt s = Some x -> In x s.
Lemma max_elt_3: forall s, max_elt s = None -> Empty s.
Lemma max_elt_2: forall s x y, max_elt s = Some x -> In y s -> ~ E.lt x y.
Lemma xelements_spec: forall s j acc y, InL y (xelements s j acc) <-> InL y acc \/ exists x, y=(j@x) /\ mem x s = true.
Lemma elements_spec1: forall s x, InL x (elements s) <-> In x s.
Lemma lt_rev_append: forall j x y, E.lt x y -> E.lt (j@x) (j@y).
Lemma elements_spec2: forall s, sort E.lt (elements s).
Lemma elements_spec2w: forall s, NoDupA E.eq (elements s).
Lemma choose_spec1: forall s x, choose s = Some x -> In x s.
Lemma choose_spec2: forall s, choose s = None -> Empty s.
Lemma choose_empty: forall s, is_empty s = true -> choose s = None.
Lemma choose_spec3': forall s s', Equal s s' -> choose s = choose s'.
Lemma choose_spec3: forall s s' x y, choose s = Some x -> choose s' = Some y -> Equal s s' -> E.eq x y.
Lemma min_elt_spec1: forall s x, min_elt s = Some x -> In x s.
Lemma min_elt_spec3: forall s, min_elt s = None -> Empty s.
Lemma min_elt_spec2: forall s x y, min_elt s = Some x -> In y s -> ~ E.lt y x.
Lemma max_elt_spec1: forall s x, max_elt s = Some x -> In x s.
Lemma max_elt_spec3: forall s, max_elt s = None -> Empty s.
Lemma max_elt_spec2: forall s x y, max_elt s = Some x -> In y s -> ~ E.lt x y.