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 thinning_n : forall (n : nat) (e f : env), trunc n e f -> forall t T : term, typ f t T -> wf e -> typ e (lift n t) (lift n T).