intros p q H'; elim H'; auto.
intros ma mb p0 q0 H'0 H'1 H'2 H'3.
apply canonical_pX_eqT with (a := ma); auto.
apply ltP_pX_canonical; auto.
apply H'2.
apply canonical_imp_canonical with (a := ma); auto.
apply (canonical_nzeroP A A0 eqA n ltM ma p0); auto.
apply ltp_eqp_comp with (p := p0) (q := pX ma (pO A n)); auto.
apply canonical_pX_ltP with (1 := H'3).
apply canonical_imp_canonical with (a := ma); auto.
apply canonicalp1; auto.
apply (canonical_nzeroP A A0 eqA n ltM ma p0); auto.
apply nzeroP_comp_eqTerm with (1 := cs) (a := ma); auto.
apply (canonical_nzeroP A A0 eqA n ltM ma p0); auto.
Qed.
Definition sizel3
(m : list (Term A n) * (list (Term A n) * list (Term A n))) :=
match m with
| (l1, (l2, l3)) => size l1 + (size l2 + size l3)
end.
Definition lessP3
(m1 m2 : list (Term A n) * (list (Term A n) * list (Term A n))) :=
sizel3 m1 < sizel3 m2.

(* Specifications: *)
Lemma wf_lessP3 : well_founded lessP3.
red in |- *.