Fixpoint map s := if s is x :: s' then f x :: map s' else [::].

(* Specifications: *)
Lemma map_cons x s : map (x :: s) = f x :: map s.
Lemma map_nseq x : map (nseq n0 x) = nseq n0 (f x).
Lemma map_cat s1 s2 : map (s1 ++ s2) = map s1 ++ map s2.
Lemma size_map s : size (map s) = size s.
Lemma behead_map s : behead (map s) = map (behead s).
Lemma nth_map n s : n < size s -> nth x2 (map s) n = f (nth x1 s n).
Lemma map_rcons s x : map (rcons s x) = rcons (map s) (f x).
Lemma last_map s x : last (f x) (map s) = f (last x s).
Lemma belast_map s x : belast (f x) (map s) = map (belast x s).
Lemma filter_map a s : filter a (map s) = map (filter (preim f a) s).
Lemma find_map a s : find a (map s) = find (preim f a) s.
Lemma has_map a s : has a (map s) = has (preim f a) s.
Lemma all_map a s : all a (map s) = all (preim f a) s.
Lemma count_map a s : count a (map s) = count (preim f a) s.
Lemma map_take s : map (take n0 s) = take n0 (map s).
Lemma map_drop s : map (drop n0 s) = drop n0 (map s).
Lemma map_rot s : map (rot n0 s) = rot n0 (map s).
Lemma map_rotr s : map (rotr n0 s) = rotr n0 (map s).
Lemma map_rev s : map (rev s) = rev (map s).
Lemma map_mask m s : map (mask m s) = mask m (map s).
Lemma inj_map : injective f -> injective map.
Lemma filter_mask T a (s : seq T) : filter a s = mask (map a s) s.
Lemma filter_subseq a s : subseq (filter a s) s.
Lemma subseq_filter s1 s2 a : subseq s1 (filter a s2) = all a s1 && subseq s1 s2.
Lemma subseq_uniqP s1 s2 : uniq s2 -> reflect (s1 = filter (mem s1) s2) (subseq s1 s2).
Lemma perm_to_subseq s1 s2 : subseq s1 s2 -> {s3 | perm_eq s2 (s1 ++ s3)}.
Lemma map_uniq s : uniq (map f s) -> uniq s.
Lemma map_subseq s1 s2 : subseq s1 s2 -> subseq (map f s1) (map f s2).
Lemma perm_map s t : perm_eq s t -> perm_eq (map f s) (map f t).
Lemma index_map s x : index (f x) (map f s) = index x s.
Lemma map_inj_uniq s : uniq (map f s) = uniq s.
Lemma perm_map_inj s t : perm_eq (map f s) (map f t) -> perm_eq s t.
Lemma map_of_seq (T1 : eqType) T2 (s : seq T1) (fs : seq T2) (y0 : T2) : {f | uniq s -> size fs = size s -> map f s = fs}.
Lemma map_id (s : seq T1) : map id s = s.
Lemma eq_map (f1 f2 : T1 -> T2) : f1 =1 f2 -> map f1 =1 map f2.
Lemma mapK (f1 : T1 -> T2) (f2 : T2 -> T1) : cancel f1 f2 -> cancel (map f1) (map f2).