Definition nZterm : list (Term A n) -> Prop.Definition canonical (a : list (Term A n)) : Prop := olist a /\ nZterm a.

(* Specifications: *)
Theorem canonical_imp_olist : forall a, canonical a -> olist a.
Theorem canonical0 : forall a b, ltT b a -> ~ zeroP (A:=A) A0 eqA (n:=n) a -> ~ zeroP (A:=A) A0 eqA (n:=n) b -> canonical (pX a (pX b pO)).
Theorem canonical_ltT : forall l a b, canonical (l ++ pX a (pX b pO)) -> ltT b a.
Theorem canonical_nzeroP : forall a p, canonical (pX a p) -> ~ zeroP (A:=A) A0 eqA (n:=n) a.
Theorem canonical_cons : forall l a b, ltT b a -> ~ zeroP (A:=A) A0 eqA (n:=n) a -> canonical (pX b l) -> canonical (pX a (pX b l)).
Theorem canonical_pX_eqT : forall a b p, canonical (pX a p) -> eqT a b -> ~ zeroP (A:=A) A0 eqA (n:=n) b -> canonical (pX b p).
Theorem canonical_pX_order : forall l a b, canonical (pX a (pX b l)) -> ltT b a.
Theorem canonical_imp_canonical : forall l a, canonical (pX a l) -> canonical l.
Theorem canonical_skip_fst : forall l a b, canonical (pX a (pX b l)) -> canonical (pX a l).
Theorem canonical_pX_ltP : forall a p, canonical (pX a p) -> ltP p (pX a pO).
Theorem ltP_pX_canonical : forall a p, canonical p -> ~ zeroP (A:=A) A0 eqA (n:=n) a -> ltP p (pX a pO) -> canonical (pX a p).
Theorem not_double_canonical : forall (a : Term A n) (p : list (Term A n)), ~ canonical (pX a (pX a p)).
Theorem canonical_imp_in_nzero : forall p : list (Term A n), canonical p -> forall a : Term A n, In a p -> ~ zeroP (A:=A) A0 eqA (n:=n) a.