Notation "[ ]" := nil (format "[ ]") : list_scope.Notation "[ x ]" := (cons x nil) : list_scope.Notation "[ x ; y ; .. ; z ]" :=  (cons x (cons y .. (cons z nil) ..))
  (format "[ '[' x ;  '/' y ;  '/' .. ;  '/' z ']' ]") : list_scope.(** Head and tail *)

  Definition hd (default:A) (l:list A) :=
    match l with
      | [] => default
      | x :: _ => x
    end.Definition hd_error (l:list A) :=
    match l with
      | [] => None
      | x :: _ => Some x
    end.Definition tl (l:list A) :=
    match l with
      | [] => []
      | _ :: l' => l'
    end.(** The [In] predicate *)
  Fixpoint In (a:A) (l:list A) : Prop :=
    match l with
      | [] => False
      | b :: l' => b = a \/ In a l'
    end.

Lemma elt_eq_unit l1 l2 (a b : A) : l1 ++ a :: l2 = [b] -> a = b /\ l1 = [] /\ l2 = [].