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 subtype_in_env : forall (e : env) (t T : term), typ e t T -> forall f : env, R_in_env ge_type e f -> wf f -> typ f t T.