End lt_spec.

(* Specifications: *)
Lemma lt_trans: forall s s' s'', lt s s' -> lt s' s'' -> lt s s''.
Lemma lt_not_eq: forall s s', lt s s' -> ~ eq s s'.
(** Specification of [add] *)
Lemma add_spec: forall x y s, In y (add x s) <-> x=y \/ In y s.
Lemma add_1: forall s x y, x = y -> In y (add x s).
(** Specification of [remove] *)
Lemma remove_spec: forall x y s, In y (remove x s) <-> x<>y /\ In y s.
Lemma remove_1: forall s x y, x=y -> ~ In y (remove x s).
Lemma singleton_2: forall x y, x = y -> In y (singleton x).
(** Specification of [union] *)
Lemma union_spec: forall x s s', In x (union s s') <-> In x s \/ In x s'.
Lemma union_1: forall s s' x, In x (union s s') -> In x s \/ In x s'.
Lemma inter_1: forall s s' x, In x (inter s s') -> In x s.
Lemma diff_1: forall s s' x, In x (diff s s') -> In x s.
(** Specification of [cardinal] *)
Lemma cardinal_1: forall s, cardinal s = length (elements s).
(** Specification of [filter] *)
Lemma xfilter_spec: forall f s x i,
In x (xfilter f s i) <-> In x s /\ f (i@x) = true.
Lemma filter_1 : forall s x f, @compat_bool elt E.eq f ->
In x (filter f s) -> In x s.
Lemma for_all_1 : forall s f, @compat_bool elt E.eq f ->
For_all (fun x => f x = true) s -> for_all f s = true.
Lemma exists_1 : forall s f, @compat_bool elt E.eq f ->
Exists (fun x => f x = true) s -> exists_ f s = true.
Lemma partition_1 : forall s f, @compat_bool elt E.eq f ->
Equal (fst (partition f s)) (filter f s).
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_3w: forall s, NoDupA E.eq (elements s).
(** Specification of [choose] *)
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_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.
(** Specification of [max_elt] *)
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.
End PositiveSet.