(** ** Lemmas for list *)
Definition concat_list_string(xs:list string) :=
fold_right (fun s s' : string => (s ++ s')%string) ""%string xs.

(* Specifications: *)
Lemma concat_list_string_x_xs : forall (x:string)(xs:list string),
concat_list_string (x :: xs) = (x ++ (concat_list_string xs))%string.
Lemma concat_list_string_xs_x : forall (xs:list string)(x:string),
concat_list_string (xs ++ x::nil) = ((concat_list_string xs) ++ x)%string.
Lemma In_list_append_left : forall A (a:A) l l', In a l -> In a (l ++ l')%list.
Lemma In_list_append_right : forall A (a:A) l l', In a l' -> In a (l ++ l')%list.
Lemma In_snoc : forall A (a:A) l, In a (l ++ a::nil)%list.
(* Other useful lemmas are: Lemma forallb_forall : forall l, forallb l = true <-> (forall x, In x l -> f x = true). Lemma forallb_app : forall l1 l2, forallb (l1++l2) = forallb l1 && forallb l2. *)
Lemma forallb_divide_left : forall (A:Type)(f:A -> bool) (l l':list A),
forallb f (l ++ l') = true -> forallb f l = true.
Lemma forallb_divide_right : forall (A:Type)(f:A -> bool) (l l':list A),
forallb f (l ++ l') = true -> forallb f l' = true.
Lemma forallb_list_x_xs : forall A (f:A -> bool)(x:A)(xs:list A),
f x = true -> forallb f xs = true -> forallb f (x::xs) = true.
Lemma forallb_list_xs_x : forall A (f:A -> bool)(xs:list A)(x:A),
forallb f xs = true -> f x = true -> forallb f (xs ++ x::nil)%list = true.