Proof using A_eq_dec.
induction xs; intros.
- simpl. omega.
- specialize (IHxs (remove A_eq_dec a ys)).
invc_NoDup.
concludes.
forward IHxs.
intros.
apply remove_preserve; [congruence|intuition].
concludes.
pose proof remove_length_lt a ys A_eq_dec.
conclude_using intuition.
simpl. omega.
Qed.

(* Specifications: *)
Lemma app_cons_singleton_inv :
forall xs (y : A) zs w,
xs ++ y :: zs = [w] ->
xs = [] /\ y = w /\ zs = [].