Inductive eqP : list (Term A n) -> list (Term A n) -> Prop :=
  | eqP0 : eqP (pO A n) (pO A n)
  | eqpP1 :
      forall ma mb p q,
      eqTerm (A:=A) eqA (n:=n) ma mb -> eqP p q -> eqP (pX ma p) (pX mb q).Inductive eqP : list (Term A n) -> list (Term A n) -> Prop :=
  | eqP0 : eqP (pO A n) (pO A n)
  | eqpP1 :
      forall ma mb p q,
      eqTerm (A:=A) eqA (n:=n) ma mb -> eqP p q -> eqP (pX ma p) (pX mb q).Inductive eqP : list (Term A n) -> list (Term A n) -> Prop :=
  | eqP0 : eqP (pO A n) (pO A n)
  | eqpP1 :
      forall ma mb p q,
      eqTerm (A:=A) eqA (n:=n) ma mb -> eqP p q -> eqP (pX ma p) (pX mb q).

Theorem ltp_eqp_comp : forall p q r s, ltP (A:=A) (n:=n) ltM p q -> canonical A0 eqA ltM p -> canonical A0 eqA ltM q -> eqP p r -> eqP q s -> ltP (A:=A) (n:=n) ltM r s.