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 typ_weak : forall (g : env) (d : decl) (e : env) (t T : term), typ e t T -> forall (n : nat) (f : env), ins_in_env g d n e f -> wf f -> typ f (lift_rec 1 t n) (lift_rec 1 T n).