induction ls; intuition; simpl in *.
intuition; subst.
destruct (EqDec_dec eqd a0 a0); intuition.
destruct (EqDec_dec eqd a0 a); subst.
trivial.
simpl.
rewrite IHls.
destruct ls; simpl in *; intuition.
trivial.
Qed.
Fixpoint addInAllLocations(A : Type)(a : A)(ls : list A) :=
match ls with
| nil =>  (a :: nil) :: nil
| a' :: ls' =>
(a :: ls) :: map (fun x => a' :: x) (addInAllLocations a ls')
end.
Fixpoint getAllPermutations(A : Type)(ls : list A) :=
match ls with
| nil => nil :: nil
| a :: ls' =>
let perms' := getAllPermutations ls' in
flatten (map (addInAllLocations a) perms')
end.

Theorem addInAllLocations_not_nil :
forall (A : Type) l (a : A),
addInAllLocations a l = nil -> False.