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 : forall (e : env) (t T : term) (d : decl), typ e t T -> wf (d :: e) -> typ (d :: e) (lift 1 t) (lift 1 T).