Section Fix_X.
Variable X : eqType.
Fixpoint pos (s : X) (A : list X) :=
match A with
| nil => None
| a :: A => if Dec (s = a) then Some 0 else match pos s A with None => None | Some n => Some (S n) end
end.

Lemma elAt_app (A : list X) i B s : A .[i] = Some s -> (A ++ B).[i] = Some s.