proposition: Theorem map_length_decompose: forall l1 l2 l3 l4, length l1 = length l2 -> map f (app l1 l3) = app l2 l4 -> map f l1 = l2 /\ map f l3 = l4.
proof: Proof. intros l1; elim l1; simpl; auto; clear l1. intros l2; case l2; simpl; auto. intros; discriminate. intros a l1 Rec l2; case l2; simpl; clear l2; auto. intros; discriminate. intros b l2 l3 l4 H1 H2. injection H2; clear H2; intros H2 H3. case (Rec l2 l3 l4); auto. intros H4 H5; split; auto. f_equal; auto. Qed.
imports: List Arith Tactic Inverse_Image Wf_nat