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.

Lemma listReplace_in_nil : forall (A : Set)(i : nat)(a1 a2 def : A), In a1 (listReplace nil i a2 def) -> a1 = a2 \/ a1 = def.