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.
intuition.
eapply H5.
rewrite matchOrder_firstn; eauto.
eauto.
eauto.
eauto.
Grab Existential Variables.
trivial.
Qed.

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