Definition AnnTyping_weakening  := first  ann_typing_weakening_mutual.
Definition AnnPropWff_weakening := second ann_typing_weakening_mutual.
Definition AnnIso_weakening     := third  ann_typing_weakening_mutual.
Definition AnnDefEq_weakening   := fourth ann_typing_weakening_mutual.
Definition AnnCtx_weakening     := fifth  ann_typing_weakening_mutual.
End fc_weak_sig.
(**************** FC Substitution ****************)
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. *)

(* Specifications: *)
Axiom AnnCtx_strengthen : forall G1 G2, AnnCtx (G2 ++ G1) -> AnnCtx G1.
Axiom binds_to_AnnTyping :
forall G x A, AnnCtx G -> binds x (Tm A) G -> AnnTyping G A a_Star.
Axiom binds_to_AnnPropWff: forall G0 a b A c,
AnnCtx G0 -> binds c (Co (Eq a b A)) G0 -> AnnPropWff G0 (Eq a b A).
Axiom tm_subst_fresh_1 :
forall G a A a0 x s,
AnnTyping G a A -> AnnCtx ((x ~ s) ++ G) -> tm_subst_tm_tm a0 x A = A.
Axiom tm_subst_fresh_2 :
forall G a A a0 x s,
AnnTyping G a A -> AnnCtx ((x ~ s) ++ G) -> tm_subst_tm_tm a0 x a = a.
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)).
Axiom AnnTyping_tm_subst : forall G x A b B (H : AnnTyping ((x ~ Tm A) ++ G) b B),
forall a, AnnTyping G a A ->
AnnTyping G (tm_subst_tm_tm a x b) (tm_subst_tm_tm a x B).
Axiom AnnTyping_tm_subst_nondep : forall L G a A b B,
AnnTyping G a A ->
(forall x, x `notin` L -> AnnTyping ([(x,Tm A)] ++ G) (open_tm_wrt_tm b (a_Var_f x)) B) ->
AnnTyping G (open_tm_wrt_tm b a) B.
Axiom AnnTyping_co_subst : forall G x A1 A2 A3 b B
(H : AnnTyping ((x ~ Co (Eq A1 A2 A3)) ++ G) b B),
forall D a, AnnDefEq G D a A1 A2 ->
AnnTyping G (co_subst_co_tm a x b) (co_subst_co_tm a x B).
Axiom AnnTyping_co_subst_nondep : forall L G D g A1 A2 A3 b B,
AnnDefEq G D g A1 A2 ->
(forall x, x `notin` L -> AnnTyping ([(x,Co (Eq A1 A2 A3))] ++ G) (open_tm_wrt_co b (g_Var_f x)) B) ->
AnnTyping G (open_tm_wrt_co b g) B.