Proof using.
induction l; intros; simpl in *; [congruence|].
repeat break_match; find_inversion.
- do_bool.
match goal with
| H : forall _, Some ?a = Some _ -> _ |- _ =>
specialize (H a)
end. intuition; subst; auto.
find_apply_hyp_hyp. omega.
- do_bool.
match goal with
| H : forall _, Some ?a = Some _ -> _ |- _ =>
specialize (H a)
end. intuition; subst; auto.
find_apply_hyp_hyp. omega.
- intuition; subst; auto.
find_apply_lem_hyp argmax_None.
subst. solve_by_inversion.
Qed.

Lemma argmax_in :
forall A (f : A -> nat) l a,
argmax f l = Some a ->
In a l.