Require Export Metalib.Metatheory.
Require Export Metalib.LibLNgen.
Require Export ett_ott.
(** NOTE: Auxiliary theorems are hidden in generated documentation. In general, there is a [_rec] version of every lemma involving [open] and [close]. *)
(* *********************************************************************** *)
(** * Induction principles for nonterminals *)
Scheme relflag_ind' := Induction for relflag Sort Prop.
Definition relflag_mutind :=
fun H1 H2 H3 =>
relflag_ind' H1 H2 H3.
Scheme relflag_rec' := Induction for relflag Sort Set.
Definition relflag_mutrec :=
fun H1 H2 H3 =>
relflag_rec' H1 H2 H3.
Scheme tm_ind' := Induction for tm Sort Prop
with brs_ind' := Induction for brs Sort Prop
with co_ind' := Induction for co Sort Prop
with constraint_ind' := Induction for constraint Sort Prop.
Definition tm_brs_co_constraint_mutind :=
fun H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49 =>
(conj (tm_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)
((conj (brs_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)
((conj (co_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)
(constraint_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)))))).
Scheme tm_rec' := Induction for tm Sort Set
with brs_rec' := Induction for brs Sort Set
with co_rec' := Induction for co Sort Set
with constraint_rec' := Induction for constraint Sort Set.
Definition tm_brs_co_constraint_mutrec :=
fun H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49 =>
(pair ((pair ((pair (tm_rec' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)
(brs_rec' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)))
(co_rec' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)))
(constraint_rec' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)).
(* *********************************************************************** *)
(** * Close *)
Fixpoint close_tm_wrt_tm_rec (n1 : nat) (x1 : tmvar) (a1 : tm) {struct a1} : tm :=
match a1 with
| a_Star => a_Star
| a_Var_f x2 => if (x1 == x2) then (a_Var_b n1) else (a_Var_f x2)
| a_Var_b n2 => if (lt_ge_dec n2 n1) then (a_Var_b n2) else (a_Var_b (S n2))
| a_Abs rho1 A1 b1 => a_Abs rho1 (close_tm_wrt_tm_rec n1 x1 A1) (close_tm_wrt_tm_rec (S n1) x1 b1)
| a_UAbs rho1 b1 => a_UAbs rho1 (close_tm_wrt_tm_rec (S n1) x1 b1)
| a_App a2 rho1 b1 => a_App (close_tm_wrt_tm_rec n1 x1 a2) rho1 (close_tm_wrt_tm_rec n1 x1 b1)
| a_Fam F1 => a_Fam F1
| a_Const T1 => a_Const T1
| a_Pi rho1 A1 B1 => a_Pi rho1 (close_tm_wrt_tm_rec n1 x1 A1) (close_tm_wrt_tm_rec (S n1) x1 B1)
| a_Conv a2 g1 => a_Conv (close_tm_wrt_tm_rec n1 x1 a2) (close_co_wrt_tm_rec n1 x1 g1)
| a_CPi phi1 B1 => a_CPi (close_constraint_wrt_tm_rec n1 x1 phi1) (close_tm_wrt_tm_rec n1 x1 B1)
| a_CAbs phi1 b1 => a_CAbs (close_constraint_wrt_tm_rec n1 x1 phi1) (close_tm_wrt_tm_rec n1 x1 b1)
| a_UCAbs b1 => a_UCAbs (close_tm_wrt_tm_rec n1 x1 b1)
| a_CApp a2 g1 => a_CApp (close_tm_wrt_tm_rec n1 x1 a2) (close_co_wrt_tm_rec n1 x1 g1)
| a_Bullet => a_Bullet
| a_DataCon K1 => a_DataCon K1
| a_Case a2 brs1 => a_Case (close_tm_wrt_tm_rec n1 x1 a2) (close_brs_wrt_tm_rec n1 x1 brs1)
end
with close_brs_wrt_tm_rec (n1 : nat) (x1 : tmvar) (brs1 : brs) {struct brs1} : brs :=
match brs1 with
| br_None => br_None
| br_One K1 a1 brs2 => br_One K1 (close_tm_wrt_tm_rec n1 x1 a1) (close_brs_wrt_tm_rec n1 x1 brs2)
end
with close_co_wrt_tm_rec (n1 : nat) (x1 : tmvar) (g1 : co) {struct g1} : co :=
match g1 with
| g_Triv => g_Triv
| g_Var_f c1 => g_Var_f c1
| g_Var_b n2 => g_Var_b n2
| g_Beta a1 b1 => g_Beta (close_tm_wrt_tm_rec n1 x1 a1) (close_tm_wrt_tm_rec n1 x1 b1)
| g_Refl a1 => g_Refl (close_tm_wrt_tm_rec n1 x1 a1)
| g_Refl2 a1 b1 g2 => g_Refl2 (close_tm_wrt_tm_rec n1 x1 a1) (close_tm_wrt_tm_rec n1 x1 b1) (close_co_wrt_tm_rec n1 x1 g2)
| g_Sym g2 => g_Sym (close_co_wrt_tm_rec n1 x1 g2)
| g_Trans g2 g3 => g_Trans (close_co_wrt_tm_rec n1 x1 g2) (close_co_wrt_tm_rec n1 x1 g3)
| g_PiCong rho1 g2 g3 => g_PiCong rho1 (close_co_wrt_tm_rec n1 x1 g2) (close_co_wrt_tm_rec (S n1) x1 g3)
| g_AbsCong rho1 g2 g3 => g_AbsCong rho1 (close_co_wrt_tm_rec n1 x1 g2) (close_co_wrt_tm_rec (S n1) x1 g3)
| g_AppCong g2 rho1 g3 => g_AppCong (close_co_wrt_tm_rec n1 x1 g2) rho1 (close_co_wrt_tm_rec n1 x1 g3)
| g_PiFst g2 => g_PiFst (close_co_wrt_tm_rec n1 x1 g2)
| g_CPiFst g2 => g_CPiFst (close_co_wrt_tm_rec n1 x1 g2)
| g_IsoSnd g2 => g_IsoSnd (close_co_wrt_tm_rec n1 x1 g2)
| g_PiSnd g2 g3 => g_PiSnd (close_co_wrt_tm_rec n1 x1 g2) (close_co_wrt_tm_rec n1 x1 g3)
| g_CPiCong g2 g3 => g_CPiCong (close_co_wrt_tm_rec n1 x1 g2) (close_co_wrt_tm_rec n1 x1 g3)
| g_CAbsCong g2 g3 g4 => g_CAbsCong (close_co_wrt_tm_rec n1 x1 g2) (close_co_wrt_tm_rec n1 x1 g3) (close_co_wrt_tm_rec n1 x1 g4)
| g_CAppCong g2 g3 g4 => g_CAppCong (close_co_wrt_tm_rec n1 x1 g2) (close_co_wrt_tm_rec n1 x1 g3) (close_co_wrt_tm_rec n1 x1 g4)
| g_CPiSnd g2 g3 g4 => g_CPiSnd (close_co_wrt_tm_rec n1 x1 g2) (close_co_wrt_tm_rec n1 x1 g3) (close_co_wrt_tm_rec n1 x1 g4)
| g_Cast g2 g3 => g_Cast (close_co_wrt_tm_rec n1 x1 g2) (close_co_wrt_tm_rec n1 x1 g3)
| g_EqCong g2 A1 g3 => g_EqCong (close_co_wrt_tm_rec n1 x1 g2) (close_tm_wrt_tm_rec n1 x1 A1) (close_co_wrt_tm_rec n1 x1 g3)
| g_IsoConv phi1 phi2 g2 => g_IsoConv (close_constraint_wrt_tm_rec n1 x1 phi1) (close_constraint_wrt_tm_rec n1 x1 phi2) (close_co_wrt_tm_rec n1 x1 g2)
| g_Eta a1 => g_Eta (close_tm_wrt_tm_rec n1 x1 a1)
| g_Left g2 g3 => g_Left (close_co_wrt_tm_rec n1 x1 g2) (close_co_wrt_tm_rec n1 x1 g3)
| g_Right g2 g3 => g_Right (close_co_wrt_tm_rec n1 x1 g2) (close_co_wrt_tm_rec n1 x1 g3)
end
with close_constraint_wrt_tm_rec (n1 : nat) (x1 : tmvar) (phi1 : constraint) {struct phi1} : constraint :=
match phi1 with
| Eq a1 b1 A1 => Eq (close_tm_wrt_tm_rec n1 x1 a1) (close_tm_wrt_tm_rec n1 x1 b1) (close_tm_wrt_tm_rec n1 x1 A1)
end.
Fixpoint close_tm_wrt_co_rec (n1 : nat) (c1 : covar) (a1 : tm) {struct a1} : tm :=
match a1 with
| a_Star => a_Star
| a_Var_f x1 => a_Var_f x1
| a_Var_b n2 => a_Var_b n2
| a_Abs rho1 A1 b1 => a_Abs rho1 (close_tm_wrt_co_rec n1 c1 A1) (close_tm_wrt_co_rec n1 c1 b1)
| a_UAbs rho1 b1 => a_UAbs rho1 (close_tm_wrt_co_rec n1 c1 b1)
| a_App a2 rho1 b1 => a_App (close_tm_wrt_co_rec n1 c1 a2) rho1 (close_tm_wrt_co_rec n1 c1 b1)
| a_Fam F1 => a_Fam F1
| a_Const T1 => a_Const T1
| a_Pi rho1 A1 B1 => a_Pi rho1 (close_tm_wrt_co_rec n1 c1 A1) (close_tm_wrt_co_rec n1 c1 B1)
| a_Conv a2 g1 => a_Conv (close_tm_wrt_co_rec n1 c1 a2) (close_co_wrt_co_rec n1 c1 g1)
| a_CPi phi1 B1 => a_CPi (close_constraint_wrt_co_rec n1 c1 phi1) (close_tm_wrt_co_rec (S n1) c1 B1)
| a_CAbs phi1 b1 => a_CAbs (close_constraint_wrt_co_rec n1 c1 phi1) (close_tm_wrt_co_rec (S n1) c1 b1)
| a_UCAbs b1 => a_UCAbs (close_tm_wrt_co_rec (S n1) c1 b1)
| a_CApp a2 g1 => a_CApp (close_tm_wrt_co_rec n1 c1 a2) (close_co_wrt_co_rec n1 c1 g1)
| a_Bullet => a_Bullet
| a_DataCon K1 => a_DataCon K1
| a_Case a2 brs1 => a_Case (close_tm_wrt_co_rec n1 c1 a2) (close_brs_wrt_co_rec n1 c1 brs1)
end
with close_brs_wrt_co_rec (n1 : nat) (c1 : covar) (brs1 : brs) {struct brs1} : brs :=
match brs1 with
| br_None => br_None
| br_One K1 a1 brs2 => br_One K1 (close_tm_wrt_co_rec n1 c1 a1) (close_brs_wrt_co_rec n1 c1 brs2)
end
with close_co_wrt_co_rec (n1 : nat) (c1 : covar) (g1 : co) {struct g1} : co :=
match g1 with
| g_Triv => g_Triv
| g_Var_f c2 => if (c1 == c2) then (g_Var_b n1) else (g_Var_f c2)
| g_Var_b n2 => if (lt_ge_dec n2 n1) then (g_Var_b n2) else (g_Var_b (S n2))
| g_Beta a1 b1 => g_Beta (close_tm_wrt_co_rec n1 c1 a1) (close_tm_wrt_co_rec n1 c1 b1)
| g_Refl a1 => g_Refl (close_tm_wrt_co_rec n1 c1 a1)
| g_Refl2 a1 b1 g2 => g_Refl2 (close_tm_wrt_co_rec n1 c1 a1) (close_tm_wrt_co_rec n1 c1 b1) (close_co_wrt_co_rec n1 c1 g2)
| g_Sym g2 => g_Sym (close_co_wrt_co_rec n1 c1 g2)
| g_Trans g2 g3 => g_Trans (close_co_wrt_co_rec n1 c1 g2) (close_co_wrt_co_rec n1 c1 g3)
| g_PiCong rho1 g2 g3 => g_PiCong rho1 (close_co_wrt_co_rec n1 c1 g2) (close_co_wrt_co_rec n1 c1 g3)
| g_AbsCong rho1 g2 g3 => g_AbsCong rho1 (close_co_wrt_co_rec n1 c1 g2) (close_co_wrt_co_rec n1 c1 g3)
| g_AppCong g2 rho1 g3 => g_AppCong (close_co_wrt_co_rec n1 c1 g2) rho1 (close_co_wrt_co_rec n1 c1 g3)
| g_PiFst g2 => g_PiFst (close_co_wrt_co_rec n1 c1 g2)
| g_CPiFst g2 => g_CPiFst (close_co_wrt_co_rec n1 c1 g2)
| g_IsoSnd g2 => g_IsoSnd (close_co_wrt_co_rec n1 c1 g2)
| g_PiSnd g2 g3 => g_PiSnd (close_co_wrt_co_rec n1 c1 g2) (close_co_wrt_co_rec n1 c1 g3)
| g_CPiCong g2 g3 => g_CPiCong (close_co_wrt_co_rec n1 c1 g2) (close_co_wrt_co_rec (S n1) c1 g3)
| g_CAbsCong g2 g3 g4 => g_CAbsCong (close_co_wrt_co_rec n1 c1 g2) (close_co_wrt_co_rec (S n1) c1 g3) (close_co_wrt_co_rec n1 c1 g4)
| g_CAppCong g2 g3 g4 => g_CAppCong (close_co_wrt_co_rec n1 c1 g2) (close_co_wrt_co_rec n1 c1 g3) (close_co_wrt_co_rec n1 c1 g4)
| g_CPiSnd g2 g3 g4 => g_CPiSnd (close_co_wrt_co_rec n1 c1 g2) (close_co_wrt_co_rec n1 c1 g3) (close_co_wrt_co_rec n1 c1 g4)
| g_Cast g2 g3 => g_Cast (close_co_wrt_co_rec n1 c1 g2) (close_co_wrt_co_rec n1 c1 g3)
| g_EqCong g2 A1 g3 => g_EqCong (close_co_wrt_co_rec n1 c1 g2) (close_tm_wrt_co_rec n1 c1 A1) (close_co_wrt_co_rec n1 c1 g3)
| g_IsoConv phi1 phi2 g2 => g_IsoConv (close_constraint_wrt_co_rec n1 c1 phi1) (close_constraint_wrt_co_rec n1 c1 phi2) (close_co_wrt_co_rec n1 c1 g2)
| g_Eta a1 => g_Eta (close_tm_wrt_co_rec n1 c1 a1)
| g_Left g2 g3 => g_Left (close_co_wrt_co_rec n1 c1 g2) (close_co_wrt_co_rec n1 c1 g3)
| g_Right g2 g3 => g_Right (close_co_wrt_co_rec n1 c1 g2) (close_co_wrt_co_rec n1 c1 g3)
end
with close_constraint_wrt_co_rec (n1 : nat) (c1 : covar) (phi1 : constraint) {struct phi1} : constraint :=
match phi1 with
| Eq a1 b1 A1 => Eq (close_tm_wrt_co_rec n1 c1 a1) (close_tm_wrt_co_rec n1 c1 b1) (close_tm_wrt_co_rec n1 c1 A1)
end.
Definition close_tm_wrt_tm x1 a1 := close_tm_wrt_tm_rec 0 x1 a1.
Definition close_brs_wrt_tm x1 brs1 := close_brs_wrt_tm_rec 0 x1 brs1.
Definition close_co_wrt_tm x1 g1 := close_co_wrt_tm_rec 0 x1 g1.
Definition close_constraint_wrt_tm x1 phi1 := close_constraint_wrt_tm_rec 0 x1 phi1.
Definition close_tm_wrt_co c1 a1 := close_tm_wrt_co_rec 0 c1 a1.
Definition close_brs_wrt_co c1 brs1 := close_brs_wrt_co_rec 0 c1 brs1.
Definition close_co_wrt_co c1 g1 := close_co_wrt_co_rec 0 c1 g1.
Definition close_constraint_wrt_co c1 phi1 := close_constraint_wrt_co_rec 0 c1 phi1.
(* *********************************************************************** *)
(** * Size *)
Fixpoint size_relflag (rho1 : relflag) {struct rho1} : nat :=
match rho1 with
| Rel => 1
| Irrel => 1
end.
Fixpoint size_tm (a1 : tm) {struct a1} : nat :=
match a1 with
| a_Star => 1
| a_Var_f x1 => 1
| a_Var_b n1 => 1
| a_Abs rho1 A1 b1 => 1 + (size_relflag rho1) + (size_tm A1) + (size_tm b1)
| a_UAbs rho1 b1 => 1 + (size_relflag rho1) + (size_tm b1)
| a_App a2 rho1 b1 => 1 + (size_tm a2) + (size_relflag rho1) + (size_tm b1)
| a_Fam F1 => 1
| a_Const T1 => 1
| a_Pi rho1 A1 B1 => 1 + (size_relflag rho1) + (size_tm A1) + (size_tm B1)
| a_Conv a2 g1 => 1 + (size_tm a2) + (size_co g1)
| a_CPi phi1 B1 => 1 + (size_constraint phi1) + (size_tm B1)
| a_CAbs phi1 b1 => 1 + (size_constraint phi1) + (size_tm b1)
| a_UCAbs b1 => 1 + (size_tm b1)
| a_CApp a2 g1 => 1 + (size_tm a2) + (size_co g1)
| a_Bullet => 1
| a_DataCon K1 => 1
| a_Case a2 brs1 => 1 + (size_tm a2) + (size_brs brs1)
end
with size_brs (brs1 : brs) {struct brs1} : nat :=
match brs1 with
| br_None => 1
| br_One K1 a1 brs2 => 1 + (size_tm a1) + (size_brs brs2)
end
with size_co (g1 : co) {struct g1} : nat :=
match g1 with
| g_Triv => 1
| g_Var_f c1 => 1
| g_Var_b n1 => 1
| g_Beta a1 b1 => 1 + (size_tm a1) + (size_tm b1)
| g_Refl a1 => 1 + (size_tm a1)
| g_Refl2 a1 b1 g2 => 1 + (size_tm a1) + (size_tm b1) + (size_co g2)
| g_Sym g2 => 1 + (size_co g2)
| g_Trans g2 g3 => 1 + (size_co g2) + (size_co g3)
| g_PiCong rho1 g2 g3 => 1 + (size_relflag rho1) + (size_co g2) + (size_co g3)
| g_AbsCong rho1 g2 g3 => 1 + (size_relflag rho1) + (size_co g2) + (size_co g3)
| g_AppCong g2 rho1 g3 => 1 + (size_co g2) + (size_relflag rho1) + (size_co g3)
| g_PiFst g2 => 1 + (size_co g2)
| g_CPiFst g2 => 1 + (size_co g2)
| g_IsoSnd g2 => 1 + (size_co g2)
| g_PiSnd g2 g3 => 1 + (size_co g2) + (size_co g3)
| g_CPiCong g2 g3 => 1 + (size_co g2) + (size_co g3)
| g_CAbsCong g2 g3 g4 => 1 + (size_co g2) + (size_co g3) + (size_co g4)
| g_CAppCong g2 g3 g4 => 1 + (size_co g2) + (size_co g3) + (size_co g4)
| g_CPiSnd g2 g3 g4 => 1 + (size_co g2) + (size_co g3) + (size_co g4)
| g_Cast g2 g3 => 1 + (size_co g2) + (size_co g3)
| g_EqCong g2 A1 g3 => 1 + (size_co g2) + (size_tm A1) + (size_co g3)
| g_IsoConv phi1 phi2 g2 => 1 + (size_constraint phi1) + (size_constraint phi2) + (size_co g2)
| g_Eta a1 => 1 + (size_tm a1)
| g_Left g2 g3 => 1 + (size_co g2) + (size_co g3)
| g_Right g2 g3 => 1 + (size_co g2) + (size_co g3)
end
with size_constraint (phi1 : constraint) {struct phi1} : nat :=
match phi1 with
| Eq a1 b1 A1 => 1 + (size_tm a1) + (size_tm b1) + (size_tm A1)
end.
(* *********************************************************************** *)
(** * Degree *)
(** These define only an upper bound, not a strict upper bound. *)
Inductive degree_tm_wrt_tm : nat -> tm -> Prop :=
| degree_wrt_tm_a_Star : forall n1,
degree_tm_wrt_tm n1 (a_Star)
| degree_wrt_tm_a_Var_f : forall n1 x1,
degree_tm_wrt_tm n1 (a_Var_f x1)
| degree_wrt_tm_a_Var_b : forall n1 n2,
lt n2 n1 ->
degree_tm_wrt_tm n1 (a_Var_b n2)
| degree_wrt_tm_a_Abs : forall n1 rho1 A1 b1,
degree_tm_wrt_tm n1 A1 ->
degree_tm_wrt_tm (S n1) b1 ->
degree_tm_wrt_tm n1 (a_Abs rho1 A1 b1)
| degree_wrt_tm_a_UAbs : forall n1 rho1 b1,
degree_tm_wrt_tm (S n1) b1 ->
degree_tm_wrt_tm n1 (a_UAbs rho1 b1)
| degree_wrt_tm_a_App : forall n1 a1 rho1 b1,
degree_tm_wrt_tm n1 a1 ->
degree_tm_wrt_tm n1 b1 ->
degree_tm_wrt_tm n1 (a_App a1 rho1 b1)
| degree_wrt_tm_a_Fam : forall n1 F1,
degree_tm_wrt_tm n1 (a_Fam F1)
| degree_wrt_tm_a_Const : forall n1 T1,
degree_tm_wrt_tm n1 (a_Const T1)
| degree_wrt_tm_a_Pi : forall n1 rho1 A1 B1,
degree_tm_wrt_tm n1 A1 ->
degree_tm_wrt_tm (S n1) B1 ->
degree_tm_wrt_tm n1 (a_Pi rho1 A1 B1)
| degree_wrt_tm_a_Conv : forall n1 a1 g1,
degree_tm_wrt_tm n1 a1 ->
degree_co_wrt_tm n1 g1 ->
degree_tm_wrt_tm n1 (a_Conv a1 g1)
| degree_wrt_tm_a_CPi : forall n1 phi1 B1,
degree_constraint_wrt_tm n1 phi1 ->
degree_tm_wrt_tm n1 B1 ->
degree_tm_wrt_tm n1 (a_CPi phi1 B1)
| degree_wrt_tm_a_CAbs : forall n1 phi1 b1,
degree_constraint_wrt_tm n1 phi1 ->
degree_tm_wrt_tm n1 b1 ->
degree_tm_wrt_tm n1 (a_CAbs phi1 b1)
| degree_wrt_tm_a_UCAbs : forall n1 b1,
degree_tm_wrt_tm n1 b1 ->
degree_tm_wrt_tm n1 (a_UCAbs b1)
| degree_wrt_tm_a_CApp : forall n1 a1 g1,
degree_tm_wrt_tm n1 a1 ->
degree_co_wrt_tm n1 g1 ->
degree_tm_wrt_tm n1 (a_CApp a1 g1)
| degree_wrt_tm_a_Bullet : forall n1,
degree_tm_wrt_tm n1 (a_Bullet)
| degree_wrt_tm_a_DataCon : forall n1 K1,
degree_tm_wrt_tm n1 (a_DataCon K1)
| degree_wrt_tm_a_Case : forall n1 a1 brs1,
degree_tm_wrt_tm n1 a1 ->
degree_brs_wrt_tm n1 brs1 ->
degree_tm_wrt_tm n1 (a_Case a1 brs1)
with degree_brs_wrt_tm : nat -> brs -> Prop :=
| degree_wrt_tm_br_None : forall n1,
degree_brs_wrt_tm n1 (br_None)
| degree_wrt_tm_br_One : forall n1 K1 a1 brs1,
degree_tm_wrt_tm n1 a1 ->
degree_brs_wrt_tm n1 brs1 ->
degree_brs_wrt_tm n1 (br_One K1 a1 brs1)
with degree_co_wrt_tm : nat -> co -> Prop :=
| degree_wrt_tm_g_Triv : forall n1,
degree_co_wrt_tm n1 (g_Triv)
| degree_wrt_tm_g_Var_f : forall n1 c1,
degree_co_wrt_tm n1 (g_Var_f c1)
| degree_wrt_tm_g_Var_b : forall n1 n2,
degree_co_wrt_tm n1 (g_Var_b n2)
| degree_wrt_tm_g_Beta : forall n1 a1 b1,
degree_tm_wrt_tm n1 a1 ->
degree_tm_wrt_tm n1 b1 ->
degree_co_wrt_tm n1 (g_Beta a1 b1)
| degree_wrt_tm_g_Refl : forall n1 a1,
degree_tm_wrt_tm n1 a1 ->
degree_co_wrt_tm n1 (g_Refl a1)
| degree_wrt_tm_g_Refl2 : forall n1 a1 b1 g1,
degree_tm_wrt_tm n1 a1 ->
degree_tm_wrt_tm n1 b1 ->
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 (g_Refl2 a1 b1 g1)
| degree_wrt_tm_g_Sym : forall n1 g1,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 (g_Sym g1)
| degree_wrt_tm_g_Trans : forall n1 g1 g2,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 g2 ->
degree_co_wrt_tm n1 (g_Trans g1 g2)
| degree_wrt_tm_g_PiCong : forall n1 rho1 g1 g2,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm (S n1) g2 ->
degree_co_wrt_tm n1 (g_PiCong rho1 g1 g2)
| degree_wrt_tm_g_AbsCong : forall n1 rho1 g1 g2,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm (S n1) g2 ->
degree_co_wrt_tm n1 (g_AbsCong rho1 g1 g2)
| degree_wrt_tm_g_AppCong : forall n1 g1 rho1 g2,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 g2 ->
degree_co_wrt_tm n1 (g_AppCong g1 rho1 g2)
| degree_wrt_tm_g_PiFst : forall n1 g1,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 (g_PiFst g1)
| degree_wrt_tm_g_CPiFst : forall n1 g1,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 (g_CPiFst g1)
| degree_wrt_tm_g_IsoSnd : forall n1 g1,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 (g_IsoSnd g1)
| degree_wrt_tm_g_PiSnd : forall n1 g1 g2,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 g2 ->
degree_co_wrt_tm n1 (g_PiSnd g1 g2)
| degree_wrt_tm_g_CPiCong : forall n1 g1 g2,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 g2 ->
degree_co_wrt_tm n1 (g_CPiCong g1 g2)
| degree_wrt_tm_g_CAbsCong : forall n1 g1 g2 g3,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 g2 ->
degree_co_wrt_tm n1 g3 ->
degree_co_wrt_tm n1 (g_CAbsCong g1 g2 g3)
| degree_wrt_tm_g_CAppCong : forall n1 g1 g2 g3,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 g2 ->
degree_co_wrt_tm n1 g3 ->
degree_co_wrt_tm n1 (g_CAppCong g1 g2 g3)
| degree_wrt_tm_g_CPiSnd : forall n1 g1 g2 g3,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 g2 ->
degree_co_wrt_tm n1 g3 ->
degree_co_wrt_tm n1 (g_CPiSnd g1 g2 g3)
| degree_wrt_tm_g_Cast : forall n1 g1 g2,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 g2 ->
degree_co_wrt_tm n1 (g_Cast g1 g2)
| degree_wrt_tm_g_EqCong : forall n1 g1 A1 g2,
degree_co_wrt_tm n1 g1 ->
degree_tm_wrt_tm n1 A1 ->
degree_co_wrt_tm n1 g2 ->
degree_co_wrt_tm n1 (g_EqCong g1 A1 g2)
| degree_wrt_tm_g_IsoConv : forall n1 phi1 phi2 g1,
degree_constraint_wrt_tm n1 phi1 ->
degree_constraint_wrt_tm n1 phi2 ->
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 (g_IsoConv phi1 phi2 g1)
| degree_wrt_tm_g_Eta : forall n1 a1,
degree_tm_wrt_tm n1 a1 ->
degree_co_wrt_tm n1 (g_Eta a1)
| degree_wrt_tm_g_Left : forall n1 g1 g2,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 g2 ->
degree_co_wrt_tm n1 (g_Left g1 g2)
| degree_wrt_tm_g_Right : forall n1 g1 g2,
degree_co_wrt_tm n1 g1 ->
degree_co_wrt_tm n1 g2 ->
degree_co_wrt_tm n1 (g_Right g1 g2)
with degree_constraint_wrt_tm : nat -> constraint -> Prop :=
| degree_wrt_tm_Eq : forall n1 a1 b1 A1,
degree_tm_wrt_tm n1 a1 ->
degree_tm_wrt_tm n1 b1 ->
degree_tm_wrt_tm n1 A1 ->
degree_constraint_wrt_tm n1 (Eq a1 b1 A1).
Inductive degree_tm_wrt_co : nat -> tm -> Prop :=
| degree_wrt_co_a_Star : forall n1,
degree_tm_wrt_co n1 (a_Star)
| degree_wrt_co_a_Var_f : forall n1 x1,
degree_tm_wrt_co n1 (a_Var_f x1)
| degree_wrt_co_a_Var_b : forall n1 n2,
degree_tm_wrt_co n1 (a_Var_b n2)
| degree_wrt_co_a_Abs : forall n1 rho1 A1 b1,
degree_tm_wrt_co n1 A1 ->
degree_tm_wrt_co n1 b1 ->
degree_tm_wrt_co n1 (a_Abs rho1 A1 b1)
| degree_wrt_co_a_UAbs : forall n1 rho1 b1,
degree_tm_wrt_co n1 b1 ->
degree_tm_wrt_co n1 (a_UAbs rho1 b1)
| degree_wrt_co_a_App : forall n1 a1 rho1 b1,
degree_tm_wrt_co n1 a1 ->
degree_tm_wrt_co n1 b1 ->
degree_tm_wrt_co n1 (a_App a1 rho1 b1)
| degree_wrt_co_a_Fam : forall n1 F1,
degree_tm_wrt_co n1 (a_Fam F1)
| degree_wrt_co_a_Const : forall n1 T1,
degree_tm_wrt_co n1 (a_Const T1)
| degree_wrt_co_a_Pi : forall n1 rho1 A1 B1,
degree_tm_wrt_co n1 A1 ->
degree_tm_wrt_co n1 B1 ->
degree_tm_wrt_co n1 (a_Pi rho1 A1 B1)
| degree_wrt_co_a_Conv : forall n1 a1 g1,
degree_tm_wrt_co n1 a1 ->
degree_co_wrt_co n1 g1 ->
degree_tm_wrt_co n1 (a_Conv a1 g1)
| degree_wrt_co_a_CPi : forall n1 phi1 B1,
degree_constraint_wrt_co n1 phi1 ->
degree_tm_wrt_co (S n1) B1 ->
degree_tm_wrt_co n1 (a_CPi phi1 B1)
| degree_wrt_co_a_CAbs : forall n1 phi1 b1,
degree_constraint_wrt_co n1 phi1 ->
degree_tm_wrt_co (S n1) b1 ->
degree_tm_wrt_co n1 (a_CAbs phi1 b1)
| degree_wrt_co_a_UCAbs : forall n1 b1,
degree_tm_wrt_co (S n1) b1 ->
degree_tm_wrt_co n1 (a_UCAbs b1)
| degree_wrt_co_a_CApp : forall n1 a1 g1,
degree_tm_wrt_co n1 a1 ->
degree_co_wrt_co n1 g1 ->
degree_tm_wrt_co n1 (a_CApp a1 g1)
| degree_wrt_co_a_Bullet : forall n1,
degree_tm_wrt_co n1 (a_Bullet)
| degree_wrt_co_a_DataCon : forall n1 K1,
degree_tm_wrt_co n1 (a_DataCon K1)
| degree_wrt_co_a_Case : forall n1 a1 brs1,
degree_tm_wrt_co n1 a1 ->
degree_brs_wrt_co n1 brs1 ->
degree_tm_wrt_co n1 (a_Case a1 brs1)
with degree_brs_wrt_co : nat -> brs -> Prop :=
| degree_wrt_co_br_None : forall n1,
degree_brs_wrt_co n1 (br_None)
| degree_wrt_co_br_One : forall n1 K1 a1 brs1,
degree_tm_wrt_co n1 a1 ->
degree_brs_wrt_co n1 brs1 ->
degree_brs_wrt_co n1 (br_One K1 a1 brs1)
with degree_co_wrt_co : nat -> co -> Prop :=
| degree_wrt_co_g_Triv : forall n1,
degree_co_wrt_co n1 (g_Triv)
| degree_wrt_co_g_Var_f : forall n1 c1,
degree_co_wrt_co n1 (g_Var_f c1)
| degree_wrt_co_g_Var_b : forall n1 n2,
lt n2 n1 ->
degree_co_wrt_co n1 (g_Var_b n2)
| degree_wrt_co_g_Beta : forall n1 a1 b1,
degree_tm_wrt_co n1 a1 ->
degree_tm_wrt_co n1 b1 ->
degree_co_wrt_co n1 (g_Beta a1 b1)
| degree_wrt_co_g_Refl : forall n1 a1,
degree_tm_wrt_co n1 a1 ->
degree_co_wrt_co n1 (g_Refl a1)
| degree_wrt_co_g_Refl2 : forall n1 a1 b1 g1,
degree_tm_wrt_co n1 a1 ->
degree_tm_wrt_co n1 b1 ->
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 (g_Refl2 a1 b1 g1)
| degree_wrt_co_g_Sym : forall n1 g1,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 (g_Sym g1)
| degree_wrt_co_g_Trans : forall n1 g1 g2,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 g2 ->
degree_co_wrt_co n1 (g_Trans g1 g2)
| degree_wrt_co_g_PiCong : forall n1 rho1 g1 g2,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 g2 ->
degree_co_wrt_co n1 (g_PiCong rho1 g1 g2)
| degree_wrt_co_g_AbsCong : forall n1 rho1 g1 g2,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 g2 ->
degree_co_wrt_co n1 (g_AbsCong rho1 g1 g2)
| degree_wrt_co_g_AppCong : forall n1 g1 rho1 g2,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 g2 ->
degree_co_wrt_co n1 (g_AppCong g1 rho1 g2)
| degree_wrt_co_g_PiFst : forall n1 g1,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 (g_PiFst g1)
| degree_wrt_co_g_CPiFst : forall n1 g1,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 (g_CPiFst g1)
| degree_wrt_co_g_IsoSnd : forall n1 g1,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 (g_IsoSnd g1)
| degree_wrt_co_g_PiSnd : forall n1 g1 g2,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 g2 ->
degree_co_wrt_co n1 (g_PiSnd g1 g2)
| degree_wrt_co_g_CPiCong : forall n1 g1 g2,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co (S n1) g2 ->
degree_co_wrt_co n1 (g_CPiCong g1 g2)
| degree_wrt_co_g_CAbsCong : forall n1 g1 g2 g3,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co (S n1) g2 ->
degree_co_wrt_co n1 g3 ->
degree_co_wrt_co n1 (g_CAbsCong g1 g2 g3)
| degree_wrt_co_g_CAppCong : forall n1 g1 g2 g3,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 g2 ->
degree_co_wrt_co n1 g3 ->
degree_co_wrt_co n1 (g_CAppCong g1 g2 g3)
| degree_wrt_co_g_CPiSnd : forall n1 g1 g2 g3,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 g2 ->
degree_co_wrt_co n1 g3 ->
degree_co_wrt_co n1 (g_CPiSnd g1 g2 g3)
| degree_wrt_co_g_Cast : forall n1 g1 g2,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 g2 ->
degree_co_wrt_co n1 (g_Cast g1 g2)
| degree_wrt_co_g_EqCong : forall n1 g1 A1 g2,
degree_co_wrt_co n1 g1 ->
degree_tm_wrt_co n1 A1 ->
degree_co_wrt_co n1 g2 ->
degree_co_wrt_co n1 (g_EqCong g1 A1 g2)
| degree_wrt_co_g_IsoConv : forall n1 phi1 phi2 g1,
degree_constraint_wrt_co n1 phi1 ->
degree_constraint_wrt_co n1 phi2 ->
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 (g_IsoConv phi1 phi2 g1)
| degree_wrt_co_g_Eta : forall n1 a1,
degree_tm_wrt_co n1 a1 ->
degree_co_wrt_co n1 (g_Eta a1)
| degree_wrt_co_g_Left : forall n1 g1 g2,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 g2 ->
degree_co_wrt_co n1 (g_Left g1 g2)
| degree_wrt_co_g_Right : forall n1 g1 g2,
degree_co_wrt_co n1 g1 ->
degree_co_wrt_co n1 g2 ->
degree_co_wrt_co n1 (g_Right g1 g2)
with degree_constraint_wrt_co : nat -> constraint -> Prop :=
| degree_wrt_co_Eq : forall n1 a1 b1 A1,
degree_tm_wrt_co n1 a1 ->
degree_tm_wrt_co n1 b1 ->
degree_tm_wrt_co n1 A1 ->
degree_constraint_wrt_co n1 (Eq a1 b1 A1).
Scheme degree_tm_wrt_tm_ind' := Induction for degree_tm_wrt_tm Sort Prop
with degree_brs_wrt_tm_ind' := Induction for degree_brs_wrt_tm Sort Prop
with degree_co_wrt_tm_ind' := Induction for degree_co_wrt_tm Sort Prop
with degree_constraint_wrt_tm_ind' := Induction for degree_constraint_wrt_tm Sort Prop.
Definition degree_tm_wrt_tm_degree_brs_wrt_tm_degree_co_wrt_tm_degree_constraint_wrt_tm_mutind :=
fun H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49 =>
(conj (degree_tm_wrt_tm_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)
((conj (degree_brs_wrt_tm_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)
((conj (degree_co_wrt_tm_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)
(degree_constraint_wrt_tm_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)))))).
Scheme degree_tm_wrt_co_ind' := Induction for degree_tm_wrt_co Sort Prop
with degree_brs_wrt_co_ind' := Induction for degree_brs_wrt_co Sort Prop
with degree_co_wrt_co_ind' := Induction for degree_co_wrt_co Sort Prop
with degree_constraint_wrt_co_ind' := Induction for degree_constraint_wrt_co Sort Prop.
Definition degree_tm_wrt_co_degree_brs_wrt_co_degree_co_wrt_co_degree_constraint_wrt_co_mutind :=
fun H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49 =>
(conj (degree_tm_wrt_co_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)
((conj (degree_brs_wrt_co_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)
((conj (degree_co_wrt_co_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)
(degree_constraint_wrt_co_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 H48 H49)))))).
Hint Constructors degree_tm_wrt_tm : core lngen.
Hint Constructors degree_brs_wrt_tm : core lngen.
Hint Constructors degree_co_wrt_tm : core lngen.
Hint Constructors degree_constraint_wrt_tm : core lngen.
Hint Constructors degree_tm_wrt_co : core lngen.
Hint Constructors degree_brs_wrt_co : core lngen.
Hint Constructors degree_co_wrt_co : core lngen.
Hint Constructors degree_constraint_wrt_co : core lngen.
(* *********************************************************************** *)
(** * Local closure (version in [Set], induction principles) *)
Inductive lc_set_tm : tm -> Set :=
| lc_set_a_Star :
lc_set_tm (a_Star)
| lc_set_a_Var_f : forall x1,
lc_set_tm (a_Var_f x1)
| lc_set_a_Abs : forall rho1 A1 b1,
lc_set_tm A1 ->
(forall x1 : tmvar, lc_set_tm (open_tm_wrt_tm b1 (a_Var_f x1))) ->
lc_set_tm (a_Abs rho1 A1 b1)
| lc_set_a_UAbs : forall rho1 b1,
(forall x1 : tmvar, lc_set_tm (open_tm_wrt_tm b1 (a_Var_f x1))) ->
lc_set_tm (a_UAbs rho1 b1)
| lc_set_a_App : forall a1 rho1 b1,
lc_set_tm a1 ->
lc_set_tm b1 ->
lc_set_tm (a_App a1 rho1 b1)
| lc_set_a_Fam : forall F1,
lc_set_tm (a_Fam F1)
| lc_set_a_Const : forall T1,
lc_set_tm (a_Const T1)
| lc_set_a_Pi : forall rho1 A1 B1,
lc_set_tm A1 ->
(forall x1 : tmvar, lc_set_tm (open_tm_wrt_tm B1 (a_Var_f x1))) ->
lc_set_tm (a_Pi rho1 A1 B1)
| lc_set_a_Conv : forall a1 g1,
lc_set_tm a1 ->
lc_set_co g1 ->
lc_set_tm (a_Conv a1 g1)
| lc_set_a_CPi : forall phi1 B1,
lc_set_constraint phi1 ->
(forall c1 : covar, lc_set_tm (open_tm_wrt_co B1 (g_Var_f c1))) ->
lc_set_tm (a_CPi phi1 B1)
| lc_set_a_CAbs : forall phi1 b1,
lc_set_constraint phi1 ->
(forall c1 : covar, lc_set_tm (open_tm_wrt_co b1 (g_Var_f c1))) ->
lc_set_tm (a_CAbs phi1 b1)
| lc_set_a_UCAbs : forall b1,
(forall c1 : covar, lc_set_tm (open_tm_wrt_co b1 (g_Var_f c1))) ->
lc_set_tm (a_UCAbs b1)
| lc_set_a_CApp : forall a1 g1,
lc_set_tm a1 ->
lc_set_co g1 ->
lc_set_tm (a_CApp a1 g1)
| lc_set_a_Bullet :
lc_set_tm (a_Bullet)
| lc_set_a_DataCon : forall K1,
lc_set_tm (a_DataCon K1)
| lc_set_a_Case : forall a1 brs1,
lc_set_tm a1 ->
lc_set_brs brs1 ->
lc_set_tm (a_Case a1 brs1)
with lc_set_brs : brs -> Set :=
| lc_set_br_None :
lc_set_brs (br_None)
| lc_set_br_One : forall K1 a1 brs1,
lc_set_tm a1 ->
lc_set_brs brs1 ->
lc_set_brs (br_One K1 a1 brs1)
with lc_set_co : co -> Set :=
| lc_set_g_Triv :
lc_set_co (g_Triv)
| lc_set_g_Var_f : forall c1,
lc_set_co (g_Var_f c1)
| lc_set_g_Beta : forall a1 b1,
lc_set_tm a1 ->
lc_set_tm b1 ->
lc_set_co (g_Beta a1 b1)
| lc_set_g_Refl : forall a1,
lc_set_tm a1 ->
lc_set_co (g_Refl a1)
| lc_set_g_Refl2 : forall a1 b1 g1,
lc_set_tm a1 ->
lc_set_tm b1 ->
lc_set_co g1 ->
lc_set_co (g_Refl2 a1 b1 g1)
| lc_set_g_Sym : forall g1,
lc_set_co g1 ->
lc_set_co (g_Sym g1)
| lc_set_g_Trans : forall g1 g2,
lc_set_co g1 ->
lc_set_co g2 ->
lc_set_co (g_Trans g1 g2)
| lc_set_g_PiCong : forall rho1 g1 g2,
lc_set_co g1 ->
(forall x1 : tmvar, lc_set_co (open_co_wrt_tm g2 (a_Var_f x1))) ->
lc_set_co (g_PiCong rho1 g1 g2)
| lc_set_g_AbsCong : forall rho1 g1 g2,
lc_set_co g1 ->
(forall x1 : tmvar, lc_set_co (open_co_wrt_tm g2 (a_Var_f x1))) ->
lc_set_co (g_AbsCong rho1 g1 g2)
| lc_set_g_AppCong : forall g1 rho1 g2,
lc_set_co g1 ->
lc_set_co g2 ->
lc_set_co (g_AppCong g1 rho1 g2)
| lc_set_g_PiFst : forall g1,
lc_set_co g1 ->
lc_set_co (g_PiFst g1)
| lc_set_g_CPiFst : forall g1,
lc_set_co g1 ->
lc_set_co (g_CPiFst g1)
| lc_set_g_IsoSnd : forall g1,
lc_set_co g1 ->
lc_set_co (g_IsoSnd g1)
| lc_set_g_PiSnd : forall g1 g2,
lc_set_co g1 ->
lc_set_co g2 ->
lc_set_co (g_PiSnd g1 g2)
| lc_set_g_CPiCong : forall g1 g2,
lc_set_co g1 ->
(forall c1 : covar, lc_set_co (open_co_wrt_co g2 (g_Var_f c1))) ->
lc_set_co (g_CPiCong g1 g2)
| lc_set_g_CAbsCong : forall g1 g2 g3,
lc_set_co g1 ->
(forall c1 : covar, lc_set_co (open_co_wrt_co g2 (g_Var_f c1))) ->
lc_set_co g3 ->
lc_set_co (g_CAbsCong g1 g2 g3)
| lc_set_g_CAppCong : forall g1 g2 g3,
lc_set_co g1 ->
lc_set_co g2 ->
lc_set_co g3 ->
lc_set_co (g_CAppCong g1 g2 g3)
| lc_set_g_CPiSnd : forall g1 g2 g3,
lc_set_co g1 ->
lc_set_co g2 ->
lc_set_co g3 ->
lc_set_co (g_CPiSnd g1 g2 g3)
| lc_set_g_Cast : forall g1 g2,
lc_set_co g1 ->
lc_set_co g2 ->
lc_set_co (g_Cast g1 g2)
| lc_set_g_EqCong : forall g1 A1 g2,
lc_set_co g1 ->
lc_set_tm A1 ->
lc_set_co g2 ->
lc_set_co (g_EqCong g1 A1 g2)
| lc_set_g_IsoConv : forall phi1 phi2 g1,
lc_set_constraint phi1 ->
lc_set_constraint phi2 ->
lc_set_co g1 ->
lc_set_co (g_IsoConv phi1 phi2 g1)
| lc_set_g_Eta : forall a1,
lc_set_tm a1 ->
lc_set_co (g_Eta a1)
| lc_set_g_Left : forall g1 g2,
lc_set_co g1 ->
lc_set_co g2 ->
lc_set_co (g_Left g1 g2)
| lc_set_g_Right : forall g1 g2,
lc_set_co g1 ->
lc_set_co g2 ->
lc_set_co (g_Right g1 g2)
with lc_set_constraint : constraint -> Set :=
| lc_set_Eq : forall a1 b1 A1,
lc_set_tm a1 ->
lc_set_tm b1 ->
lc_set_tm A1 ->
lc_set_constraint (Eq a1 b1 A1).
Scheme lc_tm_ind' := Induction for lc_tm Sort Prop
with lc_brs_ind' := Induction for lc_brs Sort Prop
with lc_co_ind' := Induction for lc_co Sort Prop
with lc_constraint_ind' := Induction for lc_constraint Sort Prop.
Definition lc_tm_lc_brs_lc_co_lc_constraint_mutind :=
fun H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 =>
(conj (lc_tm_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47)
((conj (lc_brs_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47)
((conj (lc_co_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47)
(lc_constraint_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47)))))).
Scheme lc_set_tm_ind' := Induction for lc_set_tm Sort Prop
with lc_set_brs_ind' := Induction for lc_set_brs Sort Prop
with lc_set_co_ind' := Induction for lc_set_co Sort Prop
with lc_set_constraint_ind' := Induction for lc_set_constraint Sort Prop.
Definition lc_set_tm_lc_set_brs_lc_set_co_lc_set_constraint_mutind :=
fun H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 =>
(conj (lc_set_tm_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47)
((conj (lc_set_brs_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47)
((conj (lc_set_co_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47)
(lc_set_constraint_ind' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47)))))).
Scheme lc_set_tm_rec' := Induction for lc_set_tm Sort Set
with lc_set_brs_rec' := Induction for lc_set_brs Sort Set
with lc_set_co_rec' := Induction for lc_set_co Sort Set
with lc_set_constraint_rec' := Induction for lc_set_constraint Sort Set.
Definition lc_set_tm_lc_set_brs_lc_set_co_lc_set_constraint_mutrec :=
fun H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47 =>
(pair ((pair ((pair (lc_set_tm_rec' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47)
(lc_set_brs_rec' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47)))
(lc_set_co_rec' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47)))
(lc_set_constraint_rec' H1 H2 H3 H4 H5 H6 H7 H8 H9 H10 H11 H12 H13 H14 H15 H16 H17 H18 H19 H20 H21 H22 H23 H24 H25 H26 H27 H28 H29 H30 H31 H32 H33 H34 H35 H36 H37 H38 H39 H40 H41 H42 H43 H44 H45 H46 H47)).
Hint Constructors lc_tm : core lngen.
Hint Constructors lc_brs : core lngen.
Hint Constructors lc_co : core lngen.
Hint Constructors lc_constraint : core lngen.
Hint Constructors lc_set_tm : core lngen.
Hint Constructors lc_set_brs : core lngen.
Hint Constructors lc_set_co : core lngen.
Hint Constructors lc_set_constraint : core lngen.
(* *********************************************************************** *)
(** * Body *)
Definition body_tm_wrt_tm a1 := forall x1, lc_tm (open_tm_wrt_tm a1 (a_Var_f x1)).
Definition body_brs_wrt_tm brs1 := forall x1, lc_brs (open_brs_wrt_tm brs1 (a_Var_f x1)).
Definition body_co_wrt_tm g1 := forall x1, lc_co (open_co_wrt_tm g1 (a_Var_f x1)).
Definition body_constraint_wrt_tm phi1 := forall x1, lc_constraint (open_constraint_wrt_tm phi1 (a_Var_f x1)).
Definition body_tm_wrt_co a1 := forall c1, lc_tm (open_tm_wrt_co a1 (g_Var_f c1)).
Definition body_brs_wrt_co brs1 := forall c1, lc_brs (open_brs_wrt_co brs1 (g_Var_f c1)).
Definition body_co_wrt_co g1 := forall c1, lc_co (open_co_wrt_co g1 (g_Var_f c1)).
Definition body_constraint_wrt_co phi1 := forall c1, lc_constraint (open_constraint_wrt_co phi1 (g_Var_f c1)).
Hint Unfold body_tm_wrt_tm.
Hint Unfold body_brs_wrt_tm.
Hint Unfold body_co_wrt_tm.
Hint Unfold body_constraint_wrt_tm.
Hint Unfold body_tm_wrt_co.
Hint Unfold body_brs_wrt_co.
Hint Unfold body_co_wrt_co.
Hint Unfold body_constraint_wrt_co.
(* *********************************************************************** *)
(** * Tactic support *)
(** Additional hint declarations. *)
Hint Resolve @plus_le_compat : lngen.
(** Redefine some tactics. *)
Ltac default_case_split ::=
first
[ progress destruct_notin
| progress destruct_sum
| progress safe_f_equal
].
(* *********************************************************************** *)
(** * Theorems about [size] *)
Ltac default_auto ::= auto with arith lngen; tauto.
Ltac default_autorewrite ::= fail.
(* begin hide *)

Lemma size_relflag_min_mutual :
(forall rho1, 1 <= size_relflag rho1).