Section two_lists_rect.
Variables (T: Type) (P: list T -> list T -> Type)
(Pnil_l: forall x, P nil x) (Pnil_r: forall x, P x nil)
(Pcons: forall x x' y y', P x' (y :: y') -> P (x :: x') y' -> P (x :: x') (y :: y')).
Let R: relation (list T * list T) := pair_rel (ltof (list T) (@length _)) (ltof (list T) (@length _)).
Let wf_R: well_founded R.
*)
Proof with auto.
induction l...
simpl.
rewrite <- IHl.
unfold Basics.compose.
rewrite map_app.
rewrite concat_app...
Qed.
Proof with auto.
induction l...
simpl.
intros.
rewrite IHl...
rewrite H...
Qed.
Hint Resolve Permutation_concat.

Lemma Permutation_concat_map_app T A (f g: A -> list T) l:
Permutation (concat (map (fun x => f x ++ g x) l)) (concat (map f l ++ map g l)).