Require Export FcEtt.tactics.
Require Export FcEtt.ett_inf.
Set Bullet Behavior "Strict Subproofs".
Set Implicit Arguments.
(* --------------------------------------------------------------------------- *)
Hint Resolve AnnCtx_uniq.
Hint Unfold AtomSetImpl.Subset.
Ltac solve_binds :=
match goal with
| [ b : binds ?v _ ?G
, H : forall v' _, binds v' _ ?G -> _ [<=] dom ?G ∧ _ [<=] dom ?G
|- _ ] =>
apply H in b; simpl in b; split_hyp; (done || fsetdec)
end.

(* Specifications: *)
Theorem ann_context_fv_mutual :
(forall G (a : tm) A (H: AnnTyping G a A),
fv_tm_tm_tm a [<=] dom G /\ fv_co_co_tm a [<=] dom G /\
fv_tm_tm_tm A [<=] dom G /\ fv_co_co_tm A [<=] dom G)
/\
(forall G phi (H : AnnPropWff G phi),
fv_tm_tm_constraint phi [<=] dom G /\ fv_co_co_constraint phi [<=] dom G)
/\
(forall G D g p1 p2 (H : AnnIso G D g p1 p2),
fv_tm_tm_co         g  [<=] dom G /\ fv_co_co_co         g  [<=] dom G /\
fv_tm_tm_constraint p1 [<=] dom G /\ fv_co_co_constraint p1 [<=] dom G /\
fv_tm_tm_constraint p2 [<=] dom G /\ fv_co_co_constraint p2 [<=] dom G)
/\
(forall G D g A B (H : AnnDefEq G D g A B),
fv_tm_tm_co g [<=] dom G /\ fv_co_co_co g [<=] dom G /\
fv_tm_tm_tm A [<=] dom G /\ fv_co_co_tm A [<=] dom G /\
fv_tm_tm_tm B [<=] dom G /\ fv_co_co_tm B [<=] dom G)
/\
(forall G (H : AnnCtx G),
(forall x A,
binds x (Tm A)   G ->
fv_tm_tm_tm         A   [<=] dom G /\ fv_co_co_tm         A   [<=] dom G) /\
(forall c phi,
binds c (Co phi) G ->
fv_tm_tm_constraint phi [<=] dom G /\ fv_co_co_constraint phi [<=] dom G)).