(** Membership *)

Definition inlist (A : Set) (a : A) := exlist A (fun b : A => a = b).

(* Specifications: *)
Lemma inlist_head_eq : forall (A : Set) (x y : A) (l : list A), x = y -> inlist A x (Cons A y l).
Lemma inlist_head_neq : forall (A : Set) (x y : A) (l : list A), x <> y -> (inlist A x (Cons A y l) <-> inlist A x l).
Lemma inlist_tail : forall (A : Set) (x y : A) (l : list A), inlist A x l -> inlist A x (Cons A y l).
Lemma inlist_dec : forall (A : Set) (x : A) (l : list A), (forall a b : A, a = b \/ a <> b) -> inlist A x l \/ ~ inlist A x l.
Theorem alllist_ok : forall (A : Set) (P : A -> Prop) (qlist : list A), alllist A P qlist <-> (forall q : A, inlist A q qlist -> P q).
Theorem exlist_ok : forall (A : Set) (P : A -> Prop) (qlist : list A), exlist A P qlist <-> (exists q : A, inlist A q qlist /\ P q).