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.

Lemma select_S I (x: X) A:
select (map S I) (x :: A) = select I A.