Proof using.
intros l1 l2 H; apply all_permutations_aux_permutation with (n := length l2);
auto.
Qed.

Lemma permutation_all_permutations_aux :
forall (n : nat) (l1 l2 : list A),
n = length l2 -> permutation l1 l2 -> In l1 (all_permutations_aux l2 n).