Section filter_map.
Variables A B C : Type.
Proof using.
induction l; intros; simpl in *.
- auto.
- repeat break_match; simpl; auto using f_equal.
Qed.
Proof using.
induction l; intros; simpl in *.
- auto.
- repeat find_higher_order_rewrite; auto.
Qed.
Proof using.
simpl. auto.
Qed.
Proof using.
intros.
induction xs; simpl in *; intuition.
break_match.
- simpl in *. intuition; subst; eauto.
break_exists_exists; intuition.
- concludes. break_exists_exists; intuition.
Qed.
Proof using.
induction xs; intros; simpl in *; repeat break_match; simpl in *; intuition auto using f_equal.
Qed.
Proof using.
induction xs; simpl; repeat break_match; simpl; intuition (auto; try congruence).
Qed.
Proof using.
induction xs; simpl; intuition.
repeat break_match; simpl; repeat find_rewrite; auto.
Qed.
Proof using.
induction xs; intros; simpl in *; intuition.
rewrite H; auto.
Qed.

Lemma filterMap_NoDup_inj :
forall (f : A -> option B) l,
(forall x1 x2 y,
f x1 = Some y ->
f x2 = Some y ->
x1 = x2) ->
NoDup l ->
NoDup (filterMap f l).