Definition AnnTyping_AnnCtx  := first  ann_ctx_wff_mutual.
Definition AnnPropWff_AnnCtx := second ann_ctx_wff_mutual.
Definition AnnIso_AnnCtx     := third  ann_ctx_wff_mutual.
Definition AnnDefEq_AnnCtx   := fourth ann_ctx_wff_mutual.
Hint Resolve AnnTyping_AnnCtx AnnPropWff_AnnCtx AnnIso_AnnCtx
AnnDefEq_AnnCtx : ctx_wff.
(* Look for an extended context that we can derive information from *)
Ltac sort_inversion :=
let h0 := fresh in
match goal with
| [ H : AnnTyping ([(?x,?s)] ++ ?G) _ _ |- _ ] =>
have h0: AnnCtx (x ~ s ++ G); eauto with ctx_wff;
inversion h0; subst; auto
| [ H : AnnDefEq ([(?x,?s)] ++ ?G) _ _ _ |- _ ] =>
have h0: AnnCtx (x ~ s ++ G); eauto with ctx_wff;
inversion h0; subst; auto
| [ H : AnnIso ([(?x,?s)] ++ ?G) _ _ _ |- _ ] =>
have h0: AnnCtx (x ~ s ++ G); eauto with ctx_wff;
inversion h0; subst; auto
end.
(* ---------------------------------------------------- *)

Lemma AnnCtx_uniq G : AnnCtx G -> uniq G.
Definition AnnTyping_lc  := first lc_mutual.