intros.
unfold merges at 1.
destruct_call merges_ex.
simpl in *.
induction m...
rewrite merges_nil_r...
rewrite IHm1.
rewrite IHm2.
rewrite (merges_real_eq (h :: t) (x :: y)).
apply Permutation_app_swap.
Qed.
Hint Immediate merges_sym.

Lemma perms_app (a b: list T): Permutation (perms (a ++ b)) (concat (map (uncurry merges) (product (perms a) (perms b)))).
Proof with auto.