(************************)
(** *** Facts about [In] *)
(************************)
(** Characterization of [In] *)

(* Specifications: *)
Theorem in_eq : forall (a:A) (l:list A), In a (a :: l).
Theorem in_cons : forall (a b:A) (l:list A), In b l -> In b (a :: l).
Theorem not_in_cons (x a : A) (l : list A):
~ In x (a::l) <-> x<>a /\ ~ In x l.
Theorem in_nil : forall a:A, ~ In a [].
Lemma in_app_or : forall (l m:list A) (a:A), In a (l ++ m) -> In a l \/ In a m.
Lemma in_or_app : forall (l m:list A) (a:A), In a l \/ In a m -> In a (l ++ m).
Lemma in_app_iff : forall l l' (a:A), In a (l++l') <-> In a l \/ In a l'.
Theorem in_split : forall x (l:list A), In x l -> exists l1 l2, l = l1++x::l2.
Lemma in_elt : forall (x:A) l1 l2, In x (l1 ++ x :: l2).
Lemma in_elt_inv : forall (x y : A) l1 l2,
In x (l1 ++ y :: l2) -> x = y \/ In x (l1 ++ l2).
Lemma app_inj_pivot x1 x2 y1 y2 (a : A): x1 ++ a :: x2 = y1 ++ a :: y2 ->
((In a x1 /\ In a y2) \/ (In a x2 /\ In a y1)) \/ (x1 = y1 /\ x2 = y2).
(** Inversion *)
Lemma in_inv : forall (a b:A) (l:list A), In b (a :: l) -> a = b \/ In b l.
Lemma nth_S_cons :
forall (n:nat) (l:list A) (d a:A),
In (nth n l d) l -> In (nth (S n) (a :: l) d) (a :: l).