(** [removelast l] remove the last element of [l] *)

  Fixpoint removelast (l:list A) : list A :=
    match l with
      | [] =>  []
      | [a] => []
      | a :: l' => a :: removelast l'
    end.

Lemma removelast_app : forall l l', l' <> [] -> removelast (l++l') = l ++ removelast l'.