induction 1; intuition.
eapply perm_trans.
eapply listReplace_None_Permutation.
trivial.
rewrite <- H.
eapply Permutation_refl.
eapply perm_trans.
eapply listReplace_None_Permutation.
trivial.
rewrite <- H0.
eapply perm_skip.
eapply perm_skip.
trivial.
eapply perm_trans.
eapply listReplace_None_Permutation.
trivial.
rewrite <- H.
eapply perm_skip.
eapply perm_swap.
eapply perm_trans.
eapply listReplace_None_Permutation.
trivial.
rewrite <- H1.
eapply perm_skip.
eapply perm_trans.
eapply H.
trivial.
Qed.

Theorem listReplace_getSomes_Permutation :
forall (A : Set) l1 l2 n2 (y : A),
nth n2 l1 None = None ->
Permutation (getSomes l1) l2 ->
Permutation
(getSomes
(listReplace l1 n2
(Some y) None))
(y :: l2).