Ltac Inversion_typ T :=
    let INVTYP := fresh "INVTYP" in
    (generalize T; intro INVTYP; inversion INVTYP using inversion_lemma;
      unfold inv_typ in |- *; clear INVTYP; intros).

Theorem wf_sort_lift : forall (n : nat) (e : env) (t : term), wf e -> item_lift t e n -> exists s : sort, typ e t (Srt s).