Fixpoint pmap s :=
  if s is x :: s' then let r := pmap s' in oapp (cons^~ r) r (f x) else [::].

(* Specifications: *)
Lemma map_pK : pcancel g f -> cancel (map g) pmap.
Lemma pmap_cat s t : pmap (s ++ t) = pmap s ++ pmap t.
Lemma eq_pmap (f1 f2 : aT -> option rT) : f1 =1 f2 -> pmap f1 =1 pmap f2.
Lemma pmap_uniq s : uniq s -> uniq (pmap f s).
Lemma perm_pmap s t : perm_eq s t -> perm_eq (pmap f s) (pmap f t).
Lemma size_pmap_sub s : size (pmap (insub : T -> option sT) s) = count p s.
Lemma pmap_sub_uniq s : uniq s -> uniq (pmap insT s).
Lemma size_iota m n : size (iota m n) = n.
Lemma iota_add m n1 n2 : iota m (n1 + n2) = iota m n1 ++ iota (m + n1) n2.
Lemma iota_addl m1 m2 n : iota (m1 + m2) n = map (addn m1) (iota m2 n).
Lemma nth_iota p m n i : i < n -> nth p (iota m n) i = m + i.
Lemma iota_uniq m n : uniq (iota m n).