induction ls; intuition; simpl in *;
intuition.
subst.
inversion H; clear H; subst.
trivial.
inversion H; clear H; subst.
eauto.
Qed.

Lemma nth_lt_length :
forall (A : Set)(ls : list A)(i : nat) a def,
nth i ls def = a ->
def <> a ->
i < length ls.