induction ls; intuition; simpl in *.
inversion H; subst.
trivial.
inversion H; clear H; subst.
eapply le_n_S.
eapply IHls.
trivial.
econstructor.
eapply IHls.
trivial.
Qed.
(* listRepeat is used to show some interesting properties of rel_map and pred_count. *)
Fixpoint listRepeat(A : Type)(a : A) n :=
match n with
| 0 => nil
| S n' => a :: (listRepeat a n')
end.

Lemma listRepeat_length : forall n (A : Type) (a : A),
length (listRepeat a n) = n.