Require Export FcEtt.imports.
Require Export FcEtt.ett_inf.
Require Export FcEtt.ett_ind.
Set Bullet Behavior "Strict Subproofs".
Set Implicit Arguments.
(* ---------------------------------------------------- *)
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.
(* ---------------------------------------------------- *)
Definition AnnTyping_lc  := first lc_mutual.
Definition AnnPropWff_lc := second lc_mutual.
Definition AnnIso_lc     := third lc_mutual.
Definition AnnDefEq_lc   := fourth lc_mutual.
Definition AnnCtx_lc     := fifth lc_mutual.

Lemma AnnTyping_lc1 : forall G a A, AnnTyping G a A -> lc_tm a.
Lemma AnnTyping_lc2 : forall G a A, AnnTyping G a A -> lc_tm A.