Module Type fc_subst_sig.
(* Axiom 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)).  Definition AnnTyping_context_fv  := @first  _ _ _ _ _ context_fv_mutual. Definition AnnPropWff_context_fv := @second _ _ _ _ _ context_fv_mutual. Definition AnnIso_context_fv     := @third  _ _ _ _ _ context_fv_mutual. Definition AnnDefEq_context_fv   := @fourth _ _ _ _ _ context_fv_mutual. Definition AnnCtx_context_fv     := @fifth  _ _ _ _ _ context_fv_mutual. *)

Axiom ann_tm_substitution_mutual :
(forall G0 b B (H : AnnTyping G0 b B),
forall G a A, AnnTyping G a A ->
forall F x, G0 = (F ++ (x ~ Tm A) ++ G) ->
AnnTyping (map (tm_subst_tm_sort a x) F ++ G)
(tm_subst_tm_tm a x b)
(tm_subst_tm_tm a x B)) /\
(forall G0 phi (H : AnnPropWff G0 phi),
forall G a A, AnnTyping G a A ->
forall F x, G0 = (F ++ (x ~ Tm A) ++ G) ->
AnnPropWff (map (tm_subst_tm_sort a x) F ++ G)
(tm_subst_tm_constraint a x phi)) /\
(forall G0 D g p1 p2 (H : AnnIso G0 D g p1 p2),
forall G a A, AnnTyping G a A ->
forall F x, G0 = (F ++ (x ~ Tm A) ++ G) ->
AnnIso (map (tm_subst_tm_sort a x) F ++ G)
D
(tm_subst_tm_co a x g)
(tm_subst_tm_constraint a x p1)
(tm_subst_tm_constraint a x p2)) /\
(forall  G0 D g A B (H : AnnDefEq G0 D g A B),
forall G a A0, AnnTyping G a A0 ->
forall F x, G0 = (F ++ (x ~ Tm A0) ++ G) ->
AnnDefEq (map (tm_subst_tm_sort a x) F ++ G)
D
(tm_subst_tm_co a x g)
(tm_subst_tm_tm a x A)
(tm_subst_tm_tm a x B)) /\
(forall G0 (H : AnnCtx G0),
forall G a A, AnnTyping G a A ->
forall F x, G0 = (F ++ (x ~ Tm A) ++ G) ->
AnnCtx (map (tm_subst_tm_sort a x) F ++ G)).