Proof using.
intros. induction l; simpl in *; intuition.
conclude IHl intuition.
conclude IHl intuition. intuition.
- find_rewrite. break_match; intuition.
repeat break_if; intuition.
+ do_bool. right.
find_apply_lem_hyp argmax_in; intuition.
destruct (A_eq_dec a a1); destruct (A_eq_dec a a0); repeat subst; intuition;
specialize (H0 a1); specialize (H a0); intuition; repeat find_rewrite; omega.
+ do_bool. right.
find_apply_lem_hyp argmax_in; intuition.
destruct (A_eq_dec a a1); destruct (A_eq_dec a a0); repeat subst; intuition.
* specialize (H a1); specialize (H0 a0); intuition. repeat find_rewrite. omega.
* specialize (H a1); specialize (H0 a0); intuition. repeat find_rewrite. omega.
- find_rewrite. repeat break_match; subst; intuition.
do_bool.
repeat find_apply_lem_hyp argmax_elim; intuition.
destruct (A_eq_dec a a1); destruct (A_eq_dec a a0); repeat subst; intuition.
+ specialize (H a0); specialize (H0 a1); intuition. repeat find_rewrite. omega.
+ pose proof H a0; pose proof H a1; intuition. repeat find_rewrite.
specialize (H3 a1). intuition. omega.
Qed.

(* Specifications: *)
Lemma argmin_fun_ext :
forall A (f : A -> nat) g l,
(forall a, f a = g a) ->
argmin f l = argmin g l.