(* --------------------------------------------------- *)
Inductive context_DefEq : available_props -> context -> context -> Prop :=
| Nul_Eqcontext: forall D, context_DefEq D nil nil
| Factor_Eqcontext_tm: forall G1 G2 D A A' x,
context_DefEq D G1 G2 ->
DefEq G1 D A A' a_Star ->
DefEq G2 D A A' a_Star ->
context_DefEq D ([(x, Tm A)] ++ G1) ([(x, Tm A')] ++ G2)
| Factor_Eqcontext_co: forall D G1 G2 Phi1 Phi2 c,
context_DefEq D G1 G2 ->
Iso G1 D Phi1 Phi2 ->
Iso G2 D Phi1 Phi2 ->
context_DefEq D ([(c, Co Phi1)] ++ G1) ([(c, Co Phi2)] ++ G2).
Hint Constructors context_DefEq.

Lemma context_DefEq_mutual:
(forall G1  a A,   Typing G1 a A -> forall D G2,
Ctx G2 -> context_DefEq D G1 G2 -> Typing G2 a A) /\
(forall G1  phi,   PropWff G1 phi -> forall D G2,
Ctx G2 -> context_DefEq D G1 G2 -> PropWff G2 phi) /\
(forall G1 D p1 p2, Iso G1 D p1 p2 ->
forall G2, Ctx G2 -> context_DefEq D G1 G2 -> Iso G2 D p1 p2) /\
(forall G1 D1 A B T,   DefEq G1 D1 A B T -> forall G2, Ctx G2 -> context_DefEq D1 G1 G2 ->
DefEq G2 D1 A B T) /\
(forall G1 ,       Ctx G1 -> forall G2 D x A, Ctx G2 -> context_DefEq D G1 G2
-> binds x (Tm A) G1 -> Typing G2 A a_Star).