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_type_subst : forall (e : env) (v V T : term), wf_type (Ax V :: e) T -> typ e v V -> wf_type e (subst v T).