Definition pos_el (X : eqType) (x : X) (A : list X) (H : x el A) := proj1_sig (pos_el' H).Definition index (X : finType) (x : X) := pos_el (elem_spec x).

Lemma map_app_inv X Y (f : X -> Y) x y z : map f x = y ++ z -> exists x' x'', x = x' ++ x'' /\ map f x' = y /\ map f x'' = z.