Fixpoint getSomes(A : Type)(ls : list (option A)) :=
  match ls with
    | nil => nil
    | o :: ls' =>
      match o with
        | None => getSomes ls'
        | Some x => x :: (getSomes ls')
      end
  end.

Theorem listReplace_None_Permutation : forall (A : Set) n ls (y : A), nth n ls None = None -> Permutation (getSomes (listReplace ls n (Some y) None)) (y :: (getSomes ls)).