Module congruence
(ext_weak : ext_weak_sig)
(wf : fc_wf_sig)
(weak : fc_weak_sig)
(subst : fc_subst_sig)
(ext_invert : ext_invert_sig).
Module unique := fc_unique wf subst.
Module invert := fc_invert wf weak subst.
Module erasem := erase wf weak subst ext_invert.
Set Bullet Behavior "Strict Subproofs".
Set Implicit Arguments.
(* ------------------------------------------------------------- *)

Lemma congruence :
(forall G a A, Typing G a A ->
forall G1 G2 x A1 a1 a2 D,
G = G2 ++ [(x, Tm A1)] ++ G1 ->
Typing G1 a1 A1 ->
DefEq G1 D a1 a2 A1 ->
DefEq (map (tm_subst_tm_sort a1 x) G2 ++ G1)
D (tm_subst_tm_tm a1 x a) (tm_subst_tm_tm a2 x a)
(tm_subst_tm_tm a1 x A)) /\
(forall G phi,     PropWff G phi       ->
forall G1 G2 x A1 a1 a2 D,
G = G2 ++ [(x, Tm A1)] ++ G1 ->
Typing G1 a1 A1 ->
DefEq G1 D a1 a2 A1 ->
Iso (map (tm_subst_tm_sort a1 x) G2 ++ G1)
D (tm_subst_tm_constraint a1 x phi) (tm_subst_tm_constraint a2 x phi) ) /\
(forall G D p1 p2, Iso G D p1 p2      -> True) /\
(forall G D A B T,   DefEq G D A B T  -> True) /\
(forall G,           Ctx G            -> True).