induction ls2; intuition; simpl in *.
unfold setLet in *.
destruct (in_dec eqd a0 ls1).
eauto.
simpl in *.
intuition; subst.
intuition.
Qed.
Ltac hypInv :=
try (match goal with
| [H: Some _ = Some _ |-_ ] => inversion H; clear H; subst
end); try pairInv.
Fixpoint lookupIndex (A : Set)(eqd : eq_dec A)(ls : list A)(a : A) def :=
match ls with
| nil => def
| a' :: ls' =>
if (eqd a a') then O else S (lookupIndex eqd ls' a def)
end.

(* Specifications: *)
Lemma nth_lookupIndex :
forall (A : Set)(eqd : eq_dec A)(ls : list A) n (a a': A),
In a ls ->
nth (lookupIndex eqd ls a n ) ls a' = a.