Section Select.
Context {X: Type}.
Fixpoint select (A: list nat) (B: list X)  :=
match A with
| nil => nil
| i :: A => match nth B i with
| Some x => x :: select A B
| None => select A B
end
end.
End Select.

Lemma select_map X Y (f: X -> Y) I A:
map f (select I A) = select I (map f A).