intuition.
erewrite <- matchOrder_firstn at 1.
eapply eqRat_symm.
eapply eqRat_trans.
eapply fold_add_rat_perm.
eapply matchOrder_permutation.
eapply H0.
eauto.
intuition.
eapply eqRat_refl.
intuition.
eapply eqRat_refl.
eapply eqRat_symm.
eapply fold_add_matchOrder; intuition.
eapply permutation_NoDup.
eapply matchOrder_permutation; eauto.
eauto.
eapply H3.
eapply matchOrder_In.
eapply H0.
trivial.
intuition.
eauto.
intuition.
eapply H5.
rewrite matchOrder_firstn; trivial.
trivial.
trivial.
trivial.
Grab Existential Variables.
trivial.
Qed.

Lemma sumList_subset'
: forall A : Set,
eq_dec A ->
forall (ls1 ls2 : list A) (f : A -> Rat),
NoDup ls1 ->
NoDup ls2 ->
(forall a : A, In a ls1 -> In a ls2) ->
(forall a : A, In a ls2 -> ~ In a ls1 -> f a == 0) ->
sumList ls1 f == sumList ls2 f.