induction 1; intuition; simpl in *.
econstructor.
econstructor.
econstructor.
eapply list_pred_flatten_both.
eapply list_pred_map_both'.
eapply list_pred_impl.
eauto.
intuition.
eapply addInAllLocations_pred; intuition.
Qed.

Theorem nth_error_app_Some :
forall (A : Set)(ls : list A) n (a a' : A),
nth_error ls n = Some a ->
nth_error (ls ++ (a' :: nil)) n = Some a.