induction ls; intuition; simpl in *.
omega.
destruct i; simpl in *.
trivial.
f_equal.
eapply IHls.
omega.
Qed.

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