Definition Forall_tl (A : Type) (P : A -> Prop) (a : A) (l : list A)
           (H : Forall P (a :: l)): Forall P l.

Lemma map_nth_error_inv {A B}: forall n (l:list A) (f: A -> B) fd, nth_error (map f l) n = Some fd -> exists d, nth_error l n = Some d /\ fd = f d.