(* This file is distributed under the terms of the MIT License, also known as the X11 Licence.  A copy of this license is in the README file that accompanied the original distribution of this file.  Based on code written by: Brian Aydemir *)
(** Assorted facts about lists. *)
Open Scope list_scope.
(* ********************************************************************** *)
(** * List structure *)

Lemma app_eq_cons : forall (A : Type) (z : A) (xs ys zs : list A),
xs ++ ys = z :: zs ->
(exists qs, xs = z :: qs /\ zs = qs ++ ys) \/
(xs = nil /\ ys = z :: zs).