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.

(* Specifications: *)
Lemma wf_lessP : well_founded lessP.
Theorem pX_inj : forall (n1 n2 : Term A n) l1 l2, n1 = n2 -> l1 = l2 -> pX n1 l1 = pX n2 l2.
Lemma pX_invl : forall (a b : Term A n) p q, pX a p = pX b q -> a = b.
Lemma pX_invr : forall p q (a b : Term A n), pX a p = pX b q -> p = q.
Theorem canonicalpO : canonical A0 eqA ltM (pO A n).
Theorem canonicalp1 : forall a, ~ zeroP (A:=A) A0 eqA (n:=n) a -> canonical A0 eqA ltM (pX a (pO A n)).