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 type_correctness : forall (e : env) (t T : term), typ e t T -> wf_type e T.