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_repeated n I x:
I ⊆ nats n -> select I (repeat x n) = repeat x (length I).