(* -------------- name swapping ------------------------ *)

(* Specifications: *)
Axiom AnnTyping_tm_swap : forall c c0 B G a A,
c `notin` fv_tm_tm_tm A ->
c `notin` fv_tm_tm_tm a ->
c0 `notin` dom G \u {{ c }} ->
AnnTyping ([(c, Tm B)] ++ G) (open_tm_wrt_tm a (a_Var_f c))
(open_tm_wrt_tm A (a_Var_f c)) ->
AnnTyping ([(c0, Tm B)] ++ G) (open_tm_wrt_tm a (a_Var_f c0))
(open_tm_wrt_tm A (a_Var_f c0)).
Axiom AnnDefEq_tm_swap : forall x1 x G A1 D g2 b1 b2,
x1 `notin` fv_tm_tm_co g2 \u fv_tm_tm_tm b1 \u fv_tm_tm_tm b2
-> x `notin` dom G \u {{ x1 }}
-> AnnDefEq ([(x1, Tm A1)] ++ G) D  (open_co_wrt_tm g2 (a_Var_f x1))
(open_tm_wrt_tm b1 (a_Var_f x1)) (open_tm_wrt_tm b2 (a_Var_f x1))
-> 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)).
Axiom AnnTyping_co_swap : forall c c0 phi G a A,
c `notin` fv_co_co_tm A ->
c `notin` fv_co_co_tm a ->
c0 `notin` dom G \u {{ c }} ->
AnnTyping ([(c, Co phi)] ++ G) (open_tm_wrt_co a (g_Var_f c))
(open_tm_wrt_co A (g_Var_f c)) ->
AnnTyping ([(c0, Co phi)] ++ G) (open_tm_wrt_co a (g_Var_f c0))
(open_tm_wrt_co A (g_Var_f c0)).
Axiom AnnDefEq_co_swap : forall c1 c phi1 G D g3 B1 B2,
c1 `notin` D \u fv_co_co_tm B1 \u fv_co_co_tm B2 \u fv_co_co_co g3 ->
c `notin` dom G \u {{ c1 }} ->
(AnnDefEq ([(c1, Co phi1)] ++ G) D (open_co_wrt_co g3 (g_Var_f c1))
(open_tm_wrt_co B1 (g_Var_f c1)) (open_tm_wrt_co B2 (g_Var_f c1)))
-> (AnnDefEq ([(c, Co phi1)] ++ G) D (open_co_wrt_co g3 (g_Var_f c))
(open_tm_wrt_co B1 (g_Var_f c)) (open_tm_wrt_co B2 (g_Var_f c))).