Definition e_P2 (b : wsort) (U : TS b) : nat :=
  (fix F (w : wsort) (t : TS w) {struct t} : nat :=
     match t with
     | var _ => 1
     | app t0 t1 => S (F wt t0 + F wt t1)
     | lambda t0 => 2 * F wt t0
     | env t0 t1 => F wt t0 * S (F ws t1)
     | id => 1
     | shift => 1
     | cons t0 t1 => S (F wt t0 + F ws t1)
     | comp t0 t1 => F ws t0 * S (F ws t1)
     | lift t0 => 4 * F ws t0
     | meta_X _ => 1
     | meta_x _ => 1
     end) b U.(* var *) 
(* app *) 
(* lam *) 
(* env *) 
(*  id *) 
(*  |  *) 
(*  .  *) 
(*  o  *) 
(*  || *) 
(*  X  *) 
(*  x  *) 


Notation P2 := (e_P2 _) (only parsing).

(* Specifications: *)
Theorem P2_pos : forall (b : wsort) (M : TS b), e_P2 _ M > 0.
Theorem P2_app : forall M N : terms, reg_app M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_lambda : forall M N : terms, reg_lambda M N -> e_P2 _ M < e_P2 _ N.
Theorem P2_clos : forall M N : terms, reg_clos M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_varshift1 : forall M N : terms, reg_varshift1 M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_varshift2 : forall M N : terms, reg_varshift2 M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_fvarcons : forall M N : terms, reg_fvarcons M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_fvarlift1 : forall M N : terms, reg_fvarlift1 M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_fvarlift2 : forall M N : terms, reg_fvarlift2 M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_rvarcons : forall M N : terms, reg_rvarcons M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_rvarlift1 : forall M N : terms, reg_rvarlift1 M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_rvarlift2 : forall M N : terms, reg_rvarlift2 M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_assenv : forall M N : sub_explicits, reg_assenv M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_mapenv : forall M N : sub_explicits, reg_mapenv M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_shiftcons : forall M N : sub_explicits, reg_shiftcons M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_shiftlift1 : forall M N : sub_explicits, reg_shiftlift1 M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_shiftlift2 : forall M N : sub_explicits, reg_shiftlift2 M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_lift1 : forall M N : sub_explicits, reg_lift1 M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_lift2 : forall M N : sub_explicits, reg_lift2 M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_liftenv : forall M N : sub_explicits, reg_liftenv M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_idl : forall M N : sub_explicits, reg_idl M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_idr : forall M N : sub_explicits, reg_idr M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_liftid : forall M N : sub_explicits, reg_liftid M N -> e_P2 _ M > e_P2 _ N.
Theorem P2_id : forall M N : terms, reg_id M N -> e_P2 _ M > e_P2 _ N.