adding a lemma about nth_error and map.