Section neList.
Variable X : Type.
Variable P : list X -> Prop.
Hypothesis B : (forall x : X, P [x]).
Hypothesis S : (forall x A, P A -> P (x :: A)).
End neList.
Fixpoint omap X Y (f : X -> option Y) l :=
match l with
| nil => nil
| x :: l => match f x with Some y => y :: omap f l | None => omap f l end
end.

Lemma in_omap_iff X Y (f : X -> option Y) l y : y el omap f l <-> exists x, x el l /\ f x = Some y.