(* -----  inversion lemmas for some typing judgments (with maximal co-finite quantification) ----------- *)

(* Specifications: *)
Axiom An_Pi_inversion :
∀ (G:context) rho A B T,
AnnTyping G (a_Pi rho A B) T ->
T = a_Star /\
AnnTyping G A a_Star /\
∀ x, x \notin dom G -> AnnTyping (( x ~ Tm  A) ++ G) (open_tm_wrt_tm B (a_Var_f x)) a_Star.
Axiom An_Abs_inversion :
∀ (G:context) rho (a:tm) A A1,
AnnTyping G (a_Abs rho A a) A1 ->
(exists B, A1 = a_Pi rho A B /\
AnnTyping G A a_Star /\
∀ x, x \notin dom G ->
RhoCheck rho x (erase_tm (open_tm_wrt_tm a (a_Var_f x))) /\
AnnTyping (( x ~ Tm  A) ++ G)
(open_tm_wrt_tm a (a_Var_f x))
(open_tm_wrt_tm B (a_Var_f x))).
Axiom An_CPi_inversion :
∀ (G:context) (phi : constraint) (B T : tm),
AnnTyping G (a_CPi phi B) T ->
T = a_Star /\
AnnPropWff G phi /\
∀ c, c \notin dom G -> AnnTyping ([(c, Co phi)] ++ G) (open_tm_wrt_co B (g_Var_f c)) a_Star.