Definition size := length (A:=Term A n).Definition sizel m := match m with
                      | (l1, l2) => size l1 + size l2
                      end.Definition lessP m1 m2 := sizel m1 < sizel m2.

Lemma pX_invl : forall (a b : Term A n) p q, pX a p = pX b q -> a = b.