Qed.

(** if l and l' are well-formed and (refactor l)=(refactor l') then l' is a permutation of l *)
Lemma factorisation_unique_upto_perm : forall (l l':list (nat*nat)),(is_wf l)->(is_wf l')->(refactor l)=(refactor l')->(is_permutation (nat*nat) l l').
intros.