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.
Proof with try tauto.
intros H; revert n m; induction A; simpl; intros n m H1 H2.
- destruct n; inv H1.
- destruct n, m; inv H...
+ inv H1. simpl in H2. eapply elAt_el in H2...
+ inv H2. simpl in H1. eapply elAt_el in H1...
+ inv H1. inv H2. rewrite IHA with n m...
Qed.

Lemma pos_length (e : X) n E : pos e E = Some n -> n < |E|.