Global Instance Proper_map {A B} :
Proper (pointwise_relation _ eq ==> eq ==> eq) (@map A B).

Lemma nth_nth_nth_map A : forall (l : list A) n d ln dn, n < length ln \/ length l <= dn ->
nth (nth n ln dn) l d = nth n (map (fun x => nth x l d) ln) d.