induction ls; intuition; simpl in *.
inversion H.
case_eq (getAllPermutations ls); intuition.
rewrite H0 in H.
simpl in *.
apply app_eq_nil in H.
intuition.
eapply addInAllLocations_not_nil; eauto.
Qed.

Theorem addInAllLocations_perm :
forall (A : Type) x0 (a : A) ls2,
In ls2 (addInAllLocations a x0) ->
Permutation ls2 (a :: x0).