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. *)
(* -----  exists forms of the binding constructors ----------- *)

Axiom An_AbsCong_inversion :
forall G D rho g1 g2 B1 B2,
AnnDefEq G D (g_AbsCong rho g1 g2) B1 B2 ->
exists A1 A2 b1 b2 b3 B,
B1 = (a_Abs rho A1 b1) /\
B2 = (a_Abs rho A2 b3) /\
AnnTyping G A1 a_Star  /\
AnnTyping G A2 a_Star  /\
AnnDefEq G D g1 A1 A2  /\
AnnTyping G (a_Abs rho A1 b2) B /\
(forall x, x \notin dom G  (* \u fv_tm_tm_tm b1 \u fv_tm_tm_tm b2 \u fv_tm_tm_tm b3 *) ->
AnnDefEq  (( x ~ Tm A1) ++  G) D (open_co_wrt_tm g2 (a_Var_f x)) (open_tm_wrt_tm b1 (a_Var_f x))  ((open_tm_wrt_tm b2 (a_Var_f x))) /\
(open_tm_wrt_tm b3 (a_Var_f x)) = (open_tm_wrt_tm b2 (a_Conv (a_Var_f x) (g_Sym g1))) /\
(RhoCheck rho x  (erase_tm (open_tm_wrt_tm b1 (a_Var_f x)))) /\
(RhoCheck rho x  (erase_tm (open_tm_wrt_tm b3 (a_Var_f x))))).