fact
stringlengths 2
32.6k
| type
stringclasses 10
values | library
stringclasses 5
values | imports
stringclasses 205
values | filename
stringclasses 216
values | symbolic_name
stringlengths 1
67
| index_level
int64 0
10.5k
|
---|---|---|---|---|---|---|
R R' : RelationClasses.subrelation R R' -> forall u u', cmp_universe_instance R u u' -> cmp_universe_instance R' u u'. Proof. intros H x y xy. eapply Forall2_impl; tea; unfold on_rel; auto. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | cmp_universe_instance_impl' | 10,200 |
R R' pb pb' v : RelationClasses.subrelation (R Conv) (R' Conv) -> RelationClasses.subrelation (R pb) (R' pb') -> RelationClasses.subrelation (cmp_universe_instance_variance R pb v) (cmp_universe_instance_variance R' pb' v). Proof. intros HConv Hpb x y xy. eapply Forall3_impl; tea. clear v x y xy. intros v u u'. destruct v => //=. all: unfold on_rel; now auto. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | cmp_universe_instance_variance_impl | 10,201 |
context_decl -> context_decl -> Type := | compare_vass {na na' T} : eq_binder_annot na na' -> eq_decl_upto_names (vass na T) (vass na' T) | compare_vdef {na na' b T} : eq_binder_annot na na' -> eq_decl_upto_names (vdef na b T) (vdef na' b T). | Inductive | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_decl_upto_names | 10,202 |
{Γ Δ} : eq_context_upto_names Γ Δ -> context_assumptions Γ = context_assumptions Δ. Proof. induction 1 in |- *; cbn; auto. destruct r; subst; cbn; auto. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | alpha_eq_context_assumptions | 10,203 |
{Γ Δ k} : eq_context_upto_names Γ Δ -> extended_subst Γ k = extended_subst Δ k. Proof. induction 1 in k |- *; cbn; auto. destruct r; subst; cbn; f_equal; auto. rewrite IHX. now rewrite (alpha_eq_context_assumptions X). Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | alpha_eq_extended_subst | 10,204 |
{Γ Δ t} : eq_context_upto_names Γ Δ -> expand_lets Γ t = expand_lets Δ t. Proof. intros. rewrite /expand_lets /expand_lets_k. now rewrite (All2_length X) (alpha_eq_context_assumptions X) (alpha_eq_extended_subst X). Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | expand_lets_eq | 10,205 |
{Γ Δ s k} : eq_context_upto_names Γ Δ -> eq_context_upto_names (subst_context s k Γ) (subst_context s k Δ). Proof. intros. rewrite /subst_context. induction X. - cbn; auto. - rewrite !fold_context_k_snoc0. constructor; auto. rewrite -(All2_length X). destruct r; subst; constructor; cbn; auto. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | alpha_eq_subst_context | 10,206 |
Σ (cmp_universe : conv_pb -> Universe.t -> Universe.t -> Prop) (cmp_sort : conv_pb -> sort -> sort -> Prop) (pb : conv_pb) (napp : nat) : term -> term -> Type := | eq_Rel n : eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tRel n) (tRel n) | eq_Evar e args args' : All2 (eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0) args args' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tEvar e args) (tEvar e args') | eq_Var id : eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tVar id) (tVar id) | eq_Sort s s' : cmp_sort pb s s' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tSort s) (tSort s') | eq_App t t' u u' : eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb (#|u| + napp) t t' -> All2 (eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0) u u' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tApp t u) (tApp t' u') | eq_Const c u u' : cmp_universe_instance (cmp_universe Conv) u u' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tConst c u) (tConst c u') | eq_Ind i u u' : cmp_global_instance Σ cmp_universe pb (IndRef i) napp u u' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tInd i u) (tInd i u') | eq_Construct i k u u' : cmp_global_instance Σ cmp_universe pb (ConstructRef i k) napp u u' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tConstruct i k u) (tConstruct i k u') | eq_Lambda na na' ty ty' t t' : eq_binder_annot na na' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 ty ty' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb 0 t t' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tLambda na ty t) (tLambda na' ty' t') | eq_Prod na na' a a' b b' : eq_binder_annot na na' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 a a' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb 0 b b' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tProd na a b) (tProd na' a' b') | eq_LetIn na na' t t' ty ty' u u' : eq_binder_annot na na' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 t t' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 ty ty' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb 0 u u' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tLetIn na t ty u) (tLetIn na' t' ty' u') | eq_Case ind p p' c c' brs brs' : All2 (eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0) p.(pparams) p'.(pparams) -> cmp_universe_instance (cmp_universe Conv) p.(puinst) p'.(puinst) -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 p.(preturn) p'.(preturn) -> All2 eq_binder_annot p.(pcontext) p'.(pcontext) -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 c c' -> All2 (fun x y => All2 (eq_binder_annot) (bcontext x) (bcontext y) * eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 (bbody x) (bbody y) ) brs brs' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tCase ind p c brs) (tCase ind p' c' brs') | eq_Proj p c c' : eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 c c' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tProj p c) (tProj p c') | eq_Fix mfix mfix' idx : All2 (fun x y => eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 x.(dtype) y.(dtype) * eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 x.(dbody) y.(dbody) * (x.(rarg) = y.(rarg)) * eq_binder_annot x.(dname) y.(dname) )%type mfix mfix' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tFix mfix idx) (tFix mfix' idx) | eq_CoFix mfix mfix' idx : All2 (fun x y => eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 x.(dtype) y.(dtype) * eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 x.(dbody) y.(dbody) * (x.(rarg) = y.(rarg)) * eq_binder_annot x.(dname) y.(dname) ) mfix mfix' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tCoFix mfix idx) (tCoFix mfix' idx) | eq_Cast t1 c t2 t1' c' t2' : eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 t1 t1' -> eq_cast_kind c c' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 t2 t2' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tCast t1 c t2) (tCast t1' c' t2') | eq_Int i : eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tInt i) (tInt i) | eq_Float f : eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tFloat f) (tFloat f) | eq_String s : eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tString s) (tString s) | eq_Array u u' arr arr' def def' ty ty' : cmp_universe_instance (cmp_universe Conv) [u] [u'] -> All2 (eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0) arr arr' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 def def' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv 0 ty ty' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (tArray u arr def ty) (tArray u' arr' def' ty'). | Inductive | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_term_upto_univ_napp | 10,207 |
`{checker_flags} Σ φ (pb : conv_pb) := eq_term_upto_univ Σ (compare_universe φ) (compare_sort φ) pb. | Definition | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | compare_term | 10,208 |
cmp_universe : RelationClasses.Reflexive cmp_universe -> forall u, cmp_universe_instance cmp_universe u u. Proof. intros refl_univ u. apply Forall2_same; reflexivity. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | cmp_universe_instance_refl | 10,209 |
Σ cmp_universe pb gr napp : RelationClasses.Reflexive (cmp_universe Conv) -> RelationClasses.Reflexive (cmp_universe pb) -> forall u, cmp_global_instance Σ cmp_universe pb gr napp u u. Proof. intros rRE rRle. unfold cmp_global_instance_gen. destruct global_variance_gen as [| |v] => //= u. - now apply cmp_universe_instance_refl. - left. now apply cmp_universe_instance_refl. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | cmp_global_instance_refl | 10,210 |
{A} : RelationClasses.Equivalence (@eq_binder_annot A A). Proof. split. - red. reflexivity. - red; now symmetry. - intros x y z; unfold eq_binder_annot. congruence. Qed. | Instance | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_binder_annot_equiv | 10,211 |
{A} x : @eq_binder_annot A A x x. Proof. reflexivity. Qed. | Definition | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_binder_annot_refl | 10,212 |
{A} : CRelationClasses.Equivalence (All2 (@eq_binder_annot A A)). Proof. split. intros x. apply All2_reflexivity; tc. * intros l. reflexivity. * intros l l' H. eapply All2_symmetry => //. * intros l l' H. eapply All2_transitivity => //. intros ? ? ? ? ?. now etransitivity. Qed. | Instance | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_binder_annots_refl | 10,213 |
Σ cmp_universe cmp_sort pb : RelationClasses.Reflexive (cmp_universe Conv) -> RelationClasses.Reflexive (cmp_universe pb) -> RelationClasses.Reflexive (cmp_sort Conv) -> RelationClasses.Reflexive (cmp_sort pb) -> forall napp t, eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp t t. Proof. intros refl_univ refl_univ' refl_sort refl_sort' napp t. induction t in napp, pb, refl_univ', refl_sort' |- * using term_forall_list_rect; simpl; try constructor; try apply Forall_Forall2; try apply All_All2 ; try easy; try now (try apply Forall_All ; apply Forall_True). - eapply All_All2. 1: eassumption. intros. simpl in X0. easy. - destruct c; constructor. - eapply All_All2. 1: eassumption. intros. easy. - now apply cmp_global_instance_refl. - now apply cmp_global_instance_refl. - destruct X as [Ppars Preturn]. eapply All_All2. 1:eassumption. intros; easy. - destruct X as [Ppars Preturn]. now apply Preturn. - red in X0. eapply All_All2_refl. solve_all. reflexivity. - eapply All_All2. 1: eassumption. intros x [? ?]. repeat split ; auto. - eapply All_All2. 1: eassumption. intros x [? ?]. repeat split ; auto. - eapply All_All2; tea. cbn. eauto. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_term_upto_univ_refl | 10,214 |
`{checker_flags} Σ φ t : eq_term Σ φ t t. Proof. apply eq_term_upto_univ_refl. - apply eq_universe_refl. - apply eq_universe_refl. - apply eq_sort_refl. - apply eq_sort_refl. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_term_refl | 10,215 |
`{checker_flags} Σ φ t : leq_term Σ φ t t. Proof. apply eq_term_upto_univ_refl. - apply eq_universe_refl. - apply leq_universe_refl. - intro; apply eq_sort_refl. - intro; apply leq_sort_refl. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | leq_term_refl | 10,216 |
`{checker_flags} Σ φ napp t u : eq_term_upto_univ_napp Σ napp φ t u -> leq_term Σ φ t u. Proof. induction t in u |- * using term_forall_list_rect; simpl; inversion 1; subst; constructor; try (now unfold eq_term, leq_term in * ); try eapply Forall2_impl' ; try eapply All2_impl' ; try easy. now apply eq_sort_leq_sort. all: try (apply Forall_True, eq_sort_leq_sort). apply IHt. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_term_leq_term | 10,217 |
Σ cmp_universe cmp_universe' pb pb' gr napp : RelationClasses.subrelation (cmp_universe Conv) (cmp_universe' Conv) -> RelationClasses.subrelation (cmp_universe pb) (cmp_universe' pb') -> subrelation (cmp_global_instance Σ cmp_universe pb gr napp) (cmp_global_instance Σ cmp_universe' pb' gr napp). Proof. intros sub_conv sub_pb u u'. unfold cmp_global_instance_gen, cmp_opt_variance. destruct global_variance_gen as [| |v] => //. 1: now apply cmp_universe_instance_impl. intros [H | H]; [left | right]. 1: eapply cmp_universe_instance_impl; tea. eapply Forall3_impl; tea. clear v u u' H. intros v u u'. destruct v => //=. all: unfold on_rel; now auto. Qed. | Instance | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | cmp_global_instance_impl_same_napp | 10,218 |
Σ gr {napp napp'} : napp <= napp' -> match global_variance Σ gr napp with | Variance v => global_variance Σ gr napp' = Variance v | AllEqual => True | AllIrrelevant => global_variance Σ gr napp' = AllIrrelevant end. Proof. intros hnapp. rewrite /global_variance_gen. destruct gr => //=. - destruct lookup_inductive_gen as [[mdecl idec]|] => //=. destruct destArity as [[ctx s]|] => //=. elim: Nat.leb_spec => // cass. destruct ind_variance => //=. elim: Nat.leb_spec => //. lia. - destruct lookup_constructor_gen as [[[mdecl idecl] cdecl]|] => //=. elim: Nat.leb_spec => // cass. elim: Nat.leb_spec => //. lia. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | global_variance_napp_mon | 10,219 |
Σ cmp_universe cmp_universe' pb pb' gr napp napp' : RelationClasses.subrelation (cmp_universe Conv) (cmp_universe' Conv) -> RelationClasses.subrelation (cmp_universe pb) (cmp_universe' pb') -> napp <= napp' -> subrelation (cmp_global_instance Σ cmp_universe pb gr napp) (cmp_global_instance Σ cmp_universe' pb' gr napp'). Proof. intros sub_conv sub_pb lenapp u u'. unfold cmp_global_instance_gen. move: (global_variance_napp_mon Σ gr lenapp). destruct global_variance_gen as [| |v] => //. all: [> intros _ | intros ->; cbn ..]; auto. 1: intro H; apply: cmp_instance_opt_variance; move: H => /=. - now apply cmp_universe_instance_impl. - intros [H | H]; [left | right]. 1: eapply cmp_universe_instance_impl; tea. eapply cmp_universe_instance_variance_impl; eassumption. Qed. | Instance | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | cmp_global_instance_impl | 10,220 |
Σ cmp_universe cmp_universe' cmp_sort cmp_sort' pb pb' napp napp' : RelationClasses.subrelation (cmp_universe Conv) (cmp_universe' Conv) -> RelationClasses.subrelation (cmp_universe pb) (cmp_universe' pb') -> RelationClasses.subrelation (cmp_sort Conv) (cmp_sort' Conv) -> RelationClasses.subrelation (cmp_sort pb) (cmp_sort' pb') -> napp <= napp' -> subrelation (eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp) (eq_term_upto_univ_napp Σ cmp_universe' cmp_sort' pb' napp'). Proof. intros univ_sub_conv univ_sub_pb sort_sub_conv sort_sub_pb hnapp t t'. induction t in napp, napp', hnapp, pb, pb', univ_sub_pb, sort_sub_pb, t' |- * using term_forall_list_rect; try (inversion 1; subst; constructor; eauto using cmp_universe_instance_impl'; fail). - inversion 1; subst; constructor. eapply All2_impl'; tea. eapply All_impl; eauto. - inversion 1; subst; constructor. eapply IHt. 4:eauto. all:auto with arith. eauto. solve_all. - inversion 1; subst; constructor. eapply cmp_global_instance_impl. 4:eauto. all:auto. - inversion 1; subst; constructor. eapply cmp_global_instance_impl. 4:eauto. all:eauto. - destruct X as [IHpars IHret]. inversion 1; subst; constructor; eauto. eapply All2_impl'; tea. eapply All_impl; eauto. eapply cmp_universe_instance_impl; eauto. eapply All2_impl'; eauto. cbn. eapply All_impl; eauto. intros x ? y [? ?]. split; eauto. - inversion 1; subst; constructor. eapply All2_impl'; tea. eapply All_impl; eauto. cbn. intros x [? ?] y [[[? ?] ?] ?]. repeat split; eauto. - inversion 1; subst; constructor. eapply All2_impl'; tea. eapply All_impl; eauto. cbn. intros x [? ?] y [[[? ?] ?] ?]. repeat split; eauto. - inversion 1; subst; constructor; eauto. 1: eapply cmp_universe_instance_impl; eauto. eapply All2_impl'; tea. eapply All_impl; eauto. Qed. | Instance | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_term_upto_univ_impl | 10,221 |
Σ cmp_universe cmp_universe' cmp_sort cmp_sort' : RelationClasses.subrelation (cmp_universe Conv) (cmp_universe' Conv) -> RelationClasses.subrelation (cmp_sort Conv) (cmp_sort' Conv) -> forall t u napp, eq_term_upto_univ_napp Σ cmp_universe cmp_sort Conv napp t u -> eq_term_upto_univ_napp Σ cmp_universe' cmp_sort' Conv napp t u. Proof. intros univ_sub sort_sub t u napp. apply eq_term_upto_univ_impl. 5: auto with arith. all: auto. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_term_upto_univ_morphism0 | 10,222 |
Σ cmp_universe cmp_universe' cmp_sort cmp_sort' pb pb' : RelationClasses.subrelation (cmp_universe Conv) (cmp_universe' Conv) -> RelationClasses.subrelation (cmp_universe pb) (cmp_universe' pb') -> RelationClasses.subrelation (cmp_sort Conv) (cmp_sort' Conv) -> RelationClasses.subrelation (cmp_sort pb) (cmp_sort' pb') -> forall t u napp, eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp t u -> eq_term_upto_univ_napp Σ cmp_universe' cmp_sort' pb' napp t u. Proof. intros univ_sub univ_sub_pb sort_sub sort_sub_pb t u napp. apply eq_term_upto_univ_impl. 5: auto with arith. all: auto. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_term_upto_univ_morphism | 10,223 |
`{checker_flags} Σ φ t u : eq_term Σ φ t u -> leq_term Σ φ t u. Proof. eapply eq_term_upto_univ_morphism. - reflexivity. - apply eq_leq_universe. - reflexivity. - apply eq_leq_sort. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_term_leq_term | 10,224 |
`{checker_flags} Σ cmp_universe cmp_sort pb napp f f' : eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp f f' -> isApp f = isApp f'. Proof. inversion 1; reflexivity. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_term_upto_univ_App | 10,225 |
`{checker_flags} Σ φ f f' : eq_term Σ φ f f' -> isApp f = isApp f'. Proof. inversion 1; reflexivity. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_term_App | 10,226 |
`{checker_flags} Σ cmp_universe cmp_sort pb napp f l f' l' : eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb (#|l| + napp) f f' -> All2 (eq_term_upto_univ Σ cmp_universe cmp_sort Conv) l l' -> eq_term_upto_univ_napp Σ cmp_universe cmp_sort pb napp (mkApps f l) (mkApps f' l'). Proof. induction l in f, f' |- *; intro e; inversion_clear 1. - assumption. - pose proof (eq_term_upto_univ_App _ _ _ _ _ _ _ e). case_eq (isApp f). + intro X; rewrite X in H0. destruct f; try discriminate. destruct f'; try discriminate. cbn. inversion_clear e. constructor. rewrite length_app /= -Nat.add_assoc //. apply All2_app. assumption. now constructor. + intro X; rewrite X in H0. eapply negbT in X. symmetry in H0; eapply negbT in H0. rewrite - !mkApps_tApp //. constructor. simpl. now simpl in e. now constructor. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | eq_term_upto_univ_mkApps | 10,227 |
`{checker_flags} Σ φ f l f' l' : leq_term Σ φ f f' -> All2 (eq_term Σ φ) l l' -> leq_term Σ φ (mkApps f l) (mkApps f' l'). Proof. intros. eapply eq_term_upto_univ_mkApps. 2: assumption. eapply eq_term_upto_univ_impl. 6:eauto. 5:auto with arith. all:typeclasses eauto. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | leq_term_mkApps | 10,228 |
`{checker_flags} Σ φ f f' : leq_term Σ φ f f' -> isApp f = isApp f'. Proof. inversion 1; reflexivity. Qed. | Lemma | template-coq | From Coq Require Import CMorphisms. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect Environment EnvironmentTyping. From MetaCoq.Template Require Import Ast AstUtils Induction. Require Import ssreflect ssrbool. From Equations.Prop Require Import DepElim. From Equations Require Import Equations. | template-coq\theories\TermEquality.v | leq_term_App | 10,229 |
for reduction, conversion and typing of CIC terms. | Inductive | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | relations | 10,230 |
T := match T with | tSort u => true | _ => false end. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | isSort | 10,231 |
T := match T with | tSort u => true | tProd _ _ codom => isArity codom | tLetIn _ _ _ codom => isArity codom | _ => false end. | Fixpoint | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | isArity | 10,232 |
mdecl cdecl (c : inductive * nat) (u : list Level.t) := let mind := inductive_mind (fst c) in subst0 (inds mind u mdecl.(ind_bodies)) (subst_instance u cdecl.(cstr_type)). | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | type_of_constructor | 10,233 |
(l : mfixpoint term) := let fix aux n := match n with | 0 => [] | S n => tFix l n :: aux n end in aux (List.length l). | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | fix_subst | 10,234 |
(mfix : mfixpoint term) (idx : nat) := match List.nth_error mfix idx with | Some d => Some (d.(rarg), subst0 (fix_subst mfix) d.(dbody)) | None => None end. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | unfold_fix | 10,235 |
(l : mfixpoint term) := let fix aux n := match n with | 0 => [] | S n => tCoFix l n :: aux n end in aux (List.length l). | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | cofix_subst | 10,236 |
(mfix : mfixpoint term) (idx : nat) := match List.nth_error mfix idx with | Some d => Some (d.(rarg), subst0 (cofix_subst mfix) d.(dbody)) | None => None end. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | unfold_cofix | 10,237 |
n ts := match List.nth_error ts n with | Some a => isConstruct_app a | None => false end. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | is_constructor | 10,238 |
mfix : #|fix_subst mfix| = #|mfix|. Proof. unfold fix_subst. generalize (tFix mfix). intros. induction mfix; simpl; auto. Qed. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | fix_subst_length | 10,239 |
mfix : #|cofix_subst mfix| = #|mfix|. Proof. unfold cofix_subst. generalize (tCoFix mfix). intros. induction mfix; simpl; auto. Qed. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | cofix_subst_length | 10,240 |
(m : mfixpoint term) : context := List.rev (mapi (fun i d => vass d.(dname) (lift0 i d.(dtype))) m). | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | fix_context | 10,241 |
mfix : #|fix_context mfix| = #|mfix|. Proof. unfold fix_context. now rewrite List.length_rev mapi_length. Qed. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | fix_context_length | 10,242 |
branch term := mk_branch [] tDummy. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | dummy_branch | 10,243 |
npar args bctx br := subst (List.rev (List.skipn npar args)) 0 (expand_lets bctx br.(bbody)). | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | iota_red | 10,244 |
context -> list term -> list term -> term -> list term -> term -> Prop := | instantiate_params_subst_nil s ty : instantiate_params_subst_spec [] [] s ty s ty | instantiate_params_subst_vass na ty params pari pars s na' ty' pty s' pty' : instantiate_params_subst_spec params pars (pari :: s) pty s' pty' -> instantiate_params_subst_spec (vass na ty :: params) (pari :: pars) s (tProd na' ty' pty) s' pty' | instantiate_params_subst_vdef na b ty params pars s na' b' ty' pty s' pty' : instantiate_params_subst_spec params pars (subst s 0 b :: s) pty s' pty' -> instantiate_params_subst_spec (vdef na b ty :: params) pars s (tLetIn na' b' ty' pty) s' pty'. | Inductive | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | instantiate_params_subst_spec | 10,245 |
(params : context) (pars s : list term) (ty : term) : option (list term × term) := match params with | [] => match pars with | [] => Some (s, ty) | _ :: _ => None end | d :: params => match d.(decl_body), ty with | None, tProd _ _ B => match pars with | hd :: tl => instantiate_params_subst params tl (hd :: s) B | [] => None end | Some b, tLetIn _ _ _ b' => instantiate_params_subst params pars (subst0 s b :: s) b' | _, _ => None end end. | Fixpoint | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | instantiate_params_subst | 10,246 |
params pars s ty s' ty' : instantiate_params_subst params pars s ty = Some (s', ty') <-> instantiate_params_subst_spec params pars s ty s' ty'. Proof. induction params in pars, s, ty |- *. - split. destruct pars => /= // => [= -> ->]. constructor. intros. depelim H. reflexivity. - split. * destruct a as [na [b|] ?] => /=. destruct ty => //. move/IHparams. intros. now constructor. destruct ty => //. destruct pars => //. move/IHparams. now constructor. * intros H; depelim H; simpl. now apply IHparams. now apply IHparams. Qed. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | instantiate_params_substP | 10,247 |
(Σ : global_env) (Γ : context) : term -> term -> Type := | red_beta na t b a l : red1 Σ Γ (tApp (tLambda na t b) (a :: l)) (mkApps (subst10 a b) l) | red_zeta na b t b' : red1 Σ Γ (tLetIn na b t b') (subst10 b b') | red_rel i body : option_map decl_body (nth_error Γ i) = Some (Some body) -> red1 Σ Γ (tRel i) (lift0 (S i) body) | red_iota ci mdecl idecl cdecl c u args p brs br : nth_error brs c = Some br -> declared_constructor Σ (ci.(ci_ind), c) mdecl idecl cdecl -> let bctx := case_branch_context ci.(ci_ind) mdecl cdecl p br in #|args| = (ci.(ci_npar) + context_assumptions bctx)%nat -> red1 Σ Γ (tCase ci p (mkApps (tConstruct ci.(ci_ind) c u) args) brs) (iota_red ci.(ci_npar) args bctx br) | red_fix mfix idx args narg fn : unfold_fix mfix idx = Some (narg, fn) -> is_constructor narg args = true -> red1 Σ Γ (tApp (tFix mfix idx) args) (mkApps fn args) | red_cofix_case ip p mfix idx args narg fn brs : unfold_cofix mfix idx = Some (narg, fn) -> red1 Σ Γ (tCase ip p (mkApps (tCoFix mfix idx) args) brs) (tCase ip p (mkApps fn args) brs) | red_cofix_proj p mfix idx args narg fn : unfold_cofix mfix idx = Some (narg, fn) -> red1 Σ Γ (tProj p (mkApps (tCoFix mfix idx) args)) (tProj p (mkApps fn args)) | red_delta c decl body (isdecl : declared_constant Σ c decl) u : decl.(cst_body) = Some body -> red1 Σ Γ (tConst c u) (subst_instance u body) | red_proj p u args arg: nth_error args (p.(proj_npars) + p.(proj_arg)) = Some arg -> red1 Σ Γ (tProj p (mkApps (tConstruct p.(proj_ind) 0 u) args)) arg | abs_red_l na M M' N : red1 Σ Γ M M' -> red1 Σ Γ (tLambda na M N) (tLambda na M' N) | abs_red_r na M M' N : red1 Σ (Γ ,, vass na N) M M' -> red1 Σ Γ (tLambda na N M) (tLambda na N M') | letin_red_def na b t b' r : red1 Σ Γ b r -> red1 Σ Γ (tLetIn na b t b') (tLetIn na r t b') | letin_red_ty na b t b' r : red1 Σ Γ t r -> red1 Σ Γ (tLetIn na b t b') (tLetIn na b r b') | letin_red_body na b t b' r : red1 Σ (Γ ,, vdef na b t) b' r -> red1 Σ Γ (tLetIn na b t b') (tLetIn na b t r) | case_red_pred_param ind params params' puinst pcontext preturn c brs : OnOne2 (red1 Σ Γ) params params' -> red1 Σ Γ (tCase ind (mk_predicate puinst params pcontext preturn) c brs) (tCase ind (mk_predicate puinst params' pcontext preturn) c brs) | case_red_pred_return ind mdecl idecl (isdecl : declared_inductive Σ ind.(ci_ind) mdecl idecl) params puinst pcontext preturn preturn' c brs : let p := {| pparams := params; puinst := puinst; pcontext := pcontext; preturn := preturn |} in let p' := {| pparams := params; puinst := puinst; pcontext := pcontext; preturn := preturn' |} in red1 Σ (Γ ,,, case_predicate_context ind.(ci_ind) mdecl idecl p) preturn preturn' -> red1 Σ Γ (tCase ind p c brs) (tCase ind p' c brs) | case_red_discr ind p c c' brs : red1 Σ Γ c c' -> red1 Σ Γ (tCase ind p c brs) (tCase ind p c' brs) | case_red_brs ind mdecl idecl (isdecl : declared_inductive Σ ind.(ci_ind) mdecl idecl) p c brs brs' : OnOne2All (fun brctx br br' => on_Trel_eq (red1 Σ (Γ ,,, brctx)) bbody bcontext br br') (case_branches_contexts ind.(ci_ind) mdecl idecl p brs) brs brs' -> red1 Σ Γ (tCase ind p c brs) (tCase ind p c brs') | proj_red p c c' : red1 Σ Γ c c' -> red1 Σ Γ (tProj p c) (tProj p c') | app_red_l M1 N1 M2 : red1 Σ Γ M1 N1 -> red1 Σ Γ (tApp M1 M2) (mkApps N1 M2) | app_red_r M2 N2 M1 : OnOne2 (red1 Σ Γ) M2 N2 -> red1 Σ Γ (tApp M1 M2) (tApp M1 N2) | prod_red_l na M1 M2 N1 : red1 Σ Γ M1 N1 -> red1 Σ Γ (tProd na M1 M2) (tProd na N1 M2) | prod_red_r na M2 N2 M1 : red1 Σ (Γ ,, vass na M1) M2 N2 -> red1 Σ Γ (tProd na M1 M2) (tProd na M1 N2) | evar_red ev l l' : OnOne2 (red1 Σ Γ) l l' -> red1 Σ Γ (tEvar ev l) (tEvar ev l') | cast_red_l M1 k M2 N1 : red1 Σ Γ M1 N1 -> red1 Σ Γ (tCast M1 k M2) (tCast N1 k M2) | cast_red_r M2 k N2 M1 : red1 Σ Γ M2 N2 -> red1 Σ Γ (tCast M1 k M2) (tCast M1 k N2) | cast_red M1 k M2 : red1 Σ Γ (tCast M1 k M2) M1 | fix_red_ty mfix0 mfix1 idx : OnOne2 (on_Trel_eq (red1 Σ Γ) dtype (fun x => (dname x, dbody x, rarg x))) mfix0 mfix1 -> red1 Σ Γ (tFix mfix0 idx) (tFix mfix1 idx) | fix_red_body mfix0 mfix1 idx : OnOne2 (on_Trel_eq (red1 Σ (Γ ,,, fix_context mfix0)) dbody (fun x => (dname x, dtype x, rarg x))) mfix0 mfix1 -> red1 Σ Γ (tFix mfix0 idx) (tFix mfix1 idx) | cofix_red_ty mfix0 mfix1 idx : OnOne2 (on_Trel_eq (red1 Σ Γ) dtype (fun x => (dname x, dbody x, rarg x))) mfix0 mfix1 -> red1 Σ Γ (tCoFix mfix0 idx) (tCoFix mfix1 idx) | cofix_red_body mfix0 mfix1 idx : OnOne2 (on_Trel_eq (red1 Σ (Γ ,,, fix_context mfix0)) dbody (fun x => (dname x, dtype x, rarg x))) mfix0 mfix1 -> red1 Σ Γ (tCoFix mfix0 idx) (tCoFix mfix1 idx) | array_red_val l v v' d ty : OnOne2 (fun t u => red1 Σ Γ t u) v v' -> red1 Σ Γ (tArray l v d ty) (tArray l v' d ty) | array_red_def l v d d' ty : red1 Σ Γ d d' -> red1 Σ Γ (tArray l v d ty) (tArray l v d' ty) | array_red_type l v d ty ty' : red1 Σ Γ ty ty' -> red1 Σ Γ (tArray l v d ty) (tArray l v d ty'). | Inductive | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | red1 | 10,248 |
forall (Σ : global_env) (P : context -> term -> term -> Type), (forall (Γ : context) (na : aname) (t b a : term) (l : list term), P Γ (tApp (tLambda na t b) (a :: l)) (mkApps (b {0 := a}) l)) -> (forall (Γ : context) (na : aname) (b t b' : term), P Γ (tLetIn na b t b') (b' {0 := b})) -> (forall (Γ : context) (i : nat) (body : term), option_map decl_body (nth_error Γ i) = Some (Some body) -> P Γ (tRel i) ((lift0 (S i)) body)) -> (forall (Γ : context) (ci : case_info) mdecl idecl cdecl (c : nat) (u : Instance.t) (args : list term) (p : predicate term) (brs : list (branch term)) br, nth_error brs c = Some br -> declared_constructor Σ (ci.(ci_ind), c) mdecl idecl cdecl -> let bctx := case_branch_context ci.(ci_ind) mdecl cdecl p br in #|args| = (ci.(ci_npar) + context_assumptions bctx)%nat -> P Γ (tCase ci p (mkApps (tConstruct ci.(ci_ind) c u) args) brs) (iota_red ci.(ci_npar) args bctx br)) -> (forall (Γ : context) (mfix : mfixpoint term) (idx : nat) (args : list term) (narg : nat) (fn : term), unfold_fix mfix idx = Some (narg, fn) -> is_constructor narg args = true -> P Γ (tApp (tFix mfix idx) args) (mkApps fn args)) -> (forall (Γ : context) (ip : case_info) (p : predicate term) (mfix : mfixpoint term) (idx : nat) (args : list term) (narg : nat) (fn : term) (brs : list (branch term)), unfold_cofix mfix idx = Some (narg, fn) -> P Γ (tCase ip p (mkApps (tCoFix mfix idx) args) brs) (tCase ip p (mkApps fn args) brs)) -> (forall (Γ : context) (p : projection) (mfix : mfixpoint term) (idx : nat) (args : list term) (narg : nat) (fn : term), unfold_cofix mfix idx = Some (narg, fn) -> P Γ (tProj p (mkApps (tCoFix mfix idx) args)) (tProj p (mkApps fn args))) -> (forall (Γ : context) c (decl : constant_body) (body : term), declared_constant Σ c decl -> forall u : Instance.t, cst_body decl = Some body -> P Γ (tConst c u) (subst_instance u body)) -> (forall (Γ : context) p (args : list term) (u : Instance.t) (arg : term), nth_error args (p.(proj_npars) + p.(proj_arg)) = Some arg -> P Γ (tProj p (mkApps (tConstruct p.(proj_ind) 0 u) args)) arg) -> (forall (Γ : context) (na : aname) (M M' N : term), red1 Σ Γ M M' -> P Γ M M' -> P Γ (tLambda na M N) (tLambda na M' N)) -> (forall (Γ : context) (na : aname) (M M' N : term), red1 Σ (Γ,, vass na N) M M' -> P (Γ,, vass na N) M M' -> P Γ (tLambda na N M) (tLambda na N M')) -> (forall (Γ : context) (na : aname) (b t b' r : term), red1 Σ Γ b r -> P Γ b r -> P Γ (tLetIn na b t b') (tLetIn na r t b')) -> (forall (Γ : context) (na : aname) (b t b' r : term), red1 Σ Γ t r -> P Γ t r -> P Γ (tLetIn na b t b') (tLetIn na b r b')) -> (forall (Γ : context) (na : aname) (b t b' r : term), red1 Σ (Γ,, vdef na b t) b' r -> P (Γ,, vdef na b t) b' r -> P Γ (tLetIn na b t b') (tLetIn na b t r)) -> (forall (Γ : context) (ind : case_info) params params' puinst pcontext preturn c brs, OnOne2 (Trel_conj (red1 Σ Γ) (P Γ)) params params' -> P Γ (tCase ind (mk_predicate puinst params pcontext preturn) c brs) (tCase ind (mk_predicate puinst params' pcontext preturn) c brs)) -> (forall (Γ : context) (ci : case_info) idecl mdecl (isdecl : declared_inductive Σ ci.(ci_ind) mdecl idecl) params puinst pcontext preturn preturn' c brs, let p := (mk_predicate puinst params pcontext preturn) in red1 Σ (Γ ,,, case_predicate_context ci.(ci_ind) mdecl idecl p) preturn preturn' -> P (Γ ,,, case_predicate_context ci.(ci_ind) mdecl idecl p) preturn preturn' -> P Γ (tCase ci p c brs) (tCase ci (mk_predicate puinst params pcontext preturn') c brs)) -> (forall (Γ : context) (ind : case_info) (p : predicate term) (c c' : term) (brs : list (branch term)), red1 Σ Γ c c' -> P Γ c c' -> P Γ (tCase ind p c brs) (tCase ind p c' brs)) -> (forall (Γ : context) ind mdecl idecl (isdecl : declared_inductive Σ ind.(ci_ind) mdecl idecl) p c brs brs', OnOne2All (fun brctx br br' => on_Trel_eq (Trel_conj (red1 Σ (Γ ,,, brctx)) (P (Γ ,,, brctx))) bbody bcontext br br') (case_branches_contexts ind.(ci_ind) mdecl idecl p brs) brs brs' -> P Γ (tCase ind p c brs) (tCase ind p c brs')) -> (forall (Γ : context) (p : projection) (c c' : term), red1 Σ Γ c c' -> P Γ c c' -> P Γ (tProj p c) (tProj p c')) -> (forall (Γ : context) (M1 N1 : term) (M2 : list term), red1 Σ Γ M1 N1 -> P Γ M1 N1 -> P Γ (tApp M1 M2) (mkApps N1 M2)) -> (forall (Γ : context) (M2 N2 : list term) (M1 : term), OnOne2 (fun x y => red1 Σ Γ x y * P Γ x y)%type M2 N2 -> P Γ (tApp M1 M2) (tApp M1 N2)) -> (forall (Γ : context) (na : aname) (M1 M2 N1 : term), red1 Σ Γ M1 N1 -> P Γ M1 N1 -> P Γ (tProd na M1 M2) (tProd na N1 M2)) -> (forall (Γ : context) (na : aname) (M2 N2 M1 : term), red1 Σ (Γ,, vass na M1) M2 N2 -> P (Γ,, vass na M1) M2 N2 -> P Γ (tProd na M1 M2) (tProd na M1 N2)) -> (forall (Γ : context) (ev : nat) (l l' : list term), OnOne2 (fun x y => red1 Σ Γ x y * P Γ x y) l l' -> P Γ (tEvar ev l) (tEvar ev l')) -> (forall (Γ : context) (M1 : term) (k : cast_kind) (M2 N1 : term), red1 Σ Γ M1 N1 -> P Γ M1 N1 -> P Γ (tCast M1 k M2) (tCast N1 k M2)) -> (forall (Γ : context) (M2 : term) (k : cast_kind) (N2 M1 : term), red1 Σ Γ M2 N2 -> P Γ M2 N2 -> P Γ (tCast M1 k M2) (tCast M1 k N2)) -> (forall (Γ : context) (M1 : term) (k : cast_kind) (M2 : term), P Γ (tCast M1 k M2) M1) -> (forall (Γ : context) (mfix0 mfix1 : list (def term)) (idx : nat), OnOne2 (on_Trel_eq (Trel_conj (red1 Σ Γ) (P Γ)) dtype (fun x => (dname x, dbody x, rarg x))) mfix0 mfix1 -> P Γ (tFix mfix0 idx) (tFix mfix1 idx)) -> (forall (Γ : context) (mfix0 mfix1 : list (def term)) (idx : nat), OnOne2 (on_Trel_eq (Trel_conj (red1 Σ (Γ ,,, fix_context mfix0)) (P (Γ ,,, fix_context mfix0))) dbody (fun x => (dname x, dtype x, rarg x))) mfix0 mfix1 -> P Γ (tFix mfix0 idx) (tFix mfix1 idx)) -> (forall (Γ : context) (mfix0 mfix1 : list (def term)) (idx : nat), OnOne2 (on_Trel_eq (Trel_conj (red1 Σ Γ) (P Γ)) dtype (fun x => (dname x, dbody x, rarg x))) mfix0 mfix1 -> P Γ (tCoFix mfix0 idx) (tCoFix mfix1 idx)) -> (forall (Γ : context) (mfix0 mfix1 : list (def term)) (idx : nat), OnOne2 (on_Trel_eq (Trel_conj (red1 Σ (Γ ,,, fix_context mfix0)) (P (Γ ,,, fix_context mfix0))) dbody (fun x => (dname x, dtype x, rarg x))) mfix0 mfix1 -> P Γ (tCoFix mfix0 idx) (tCoFix mfix1 idx)) -> (forall Γ l v v' d ty, OnOne2 (fun t u => Trel_conj (red1 Σ Γ) (P Γ) t u) v v' -> P Γ (tArray l v d ty) (tArray l v' d ty)) -> (forall Γ l v d d' ty, red1 Σ Γ d d' -> P Γ d d' -> P Γ (tArray l v d ty) (tArray l v d' ty)) -> (forall Γ l v d ty ty', red1 Σ Γ ty ty' -> P Γ ty ty' -> P Γ (tArray l v d ty) (tArray l v d ty')) -> forall (Γ : context) (t t0 : term), red1 Σ Γ t t0 -> P Γ t t0. Proof. intros. rename X33 into Xlast. revert Γ t t0 Xlast. fix aux 4. intros Γ t T. move aux at top. destruct 1; try solve [ match goal with | H : _ |- _ => eapply H; eauto; fail end]. - apply X13. revert params params' o. fix auxl 3. intros params params' []. + constructor. split; auto. + constructor. auto. - eapply X16; eauto. revert brs brs' o. intros brs. generalize (case_branches_contexts (ci_ind ind) mdecl idecl p brs). revert brs. fix auxl 4. intros i l l' Hl. destruct Hl. + constructor; intros. intuition auto. auto. + constructor. eapply auxl. apply Hl. - apply X19. revert M2 N2 o. fix auxl 3. intros l l' Hl. destruct Hl. + constructor. split; auto. + constructor. auto. - apply X22. revert l l' o. fix auxl 3. intros l l' Hl. destruct Hl. constructor. split; auto. constructor. auto. - apply X26. revert mfix0 mfix1 o; fix auxl 3; intros l l' Hl; destruct Hl; constructor; try split; auto; intuition. - apply X27. revert o. generalize (fix_context mfix0). intros c H28. revert mfix0 mfix1 H28; fix auxl 3; intros l l' Hl; destruct Hl; constructor; try split; auto; intuition. - eapply X28. revert mfix0 mfix1 o; fix auxl 3; intros l l' Hl; destruct Hl; constructor; try split; auto; intuition. - eapply X29. revert o. generalize (fix_context mfix0). intros c H28. revert mfix0 mfix1 H28; fix auxl 3; intros l l' Hl; destruct Hl; constructor; try split; auto; intuition. - eapply X30. revert v v' o. fix auxl 3; intros ? ? Hl; destruct Hl; constructor; try split; auto; intuition. Defined. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | red1_ind_all | 10,249 |
Σ Γ M : term -> Type := | refl_red : red Σ Γ M M | trans_red : forall (P : term) N, red Σ Γ M P -> red1 Σ Γ P N -> red Σ Γ M N. | Inductive | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | red | 10,250 |
`{checker_flags} (Σ : global_env) (φ : ConstraintSet.t) (t u : term) := eq_term Σ φ (strip_casts t) (strip_casts u). | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | eq_term_nocast | 10,251 |
`{checker_flags} (Σ : global_env) (φ : ConstraintSet.t) (t u : term) := leq_term Σ φ (strip_casts t) (strip_casts u). | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | leq_term_nocast | 10,252 |
`{checker_flags} (Σ : global_env_ext) (Γ : context) (pb : conv_pb) : term -> term -> Type := | cumul_refl t u : compare_term Σ (global_ext_constraints Σ) pb t u -> Σ ;;; Γ |- t <=[pb] u | cumul_red_l t u v : red1 Σ.1 Γ t v -> Σ ;;; Γ |- v <=[pb] u -> Σ ;;; Γ |- t <=[pb] u | cumul_red_r t u v : Σ ;;; Γ |- t <=[pb] v -> red1 Σ.1 Γ u v -> Σ ;;; Γ |- t <=[pb] u where "Σ ;;; Γ |- t <=[ pb ] u " := (cumul_gen Σ Γ pb t u). | Inductive | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | cumul_gen | 10,253 |
`{checker_flags} : forall Σ Γ t, Σ ;;; Γ |- t = t. intros. constructor. apply eq_term_refl. Defined. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | conv_refl' | 10,254 |
`{checker_flags} : forall Σ Γ t, Σ ;;; Γ |- t <= t. intros. constructor. apply leq_term_refl. Defined. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | cumul_refl' | 10,255 |
`{checker_flags} Σ φ (t u : option term) := match t, u with | Some t, Some u => eq_term Σ φ t u | None, None => True | _, _ => False end. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | eq_opt_term | 10,256 |
`{checker_flags} Σ φ (d d' : context_decl) := eq_opt_term Σ φ d.(decl_body) d'.(decl_body) * eq_term Σ φ d.(decl_type) d'.(decl_type). | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | eq_decl | 10,257 |
`{checker_flags} Σ φ (Γ Δ : context) := All2 (eq_decl Σ φ) Γ Δ. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | eq_context | 10,258 |
@cumul_gen. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | cumul_gen | 10,259 |
GuardChecker. | Axiom | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | guard_checking | 10,260 |
ind mdecl (cty: term) p : option context := let inds := inds ind.(inductive_mind) p.(puinst) mdecl.(ind_bodies) in let ty := subst0 inds (subst_instance p.(puinst) cty) in match instantiate_params (subst_instance p.(puinst) mdecl.(ind_params)) p.(pparams) ty with | Some ty => let '(sign, ccl) := decompose_prod_assum [] ty in Some sign | None => None end. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | build_branch_context | 10,261 |
ind mdecl idecl params u p : list (option (nat * context * term)) := let inds := inds ind.(inductive_mind) u mdecl.(ind_bodies) in let branch_type i '(id, t, ar) := let ty := subst0 inds (subst_instance u t) in match instantiate_params (subst_instance u mdecl.(ind_params)) params ty with | Some ty => let '(sign, ccl) := decompose_prod_assum [] ty in let nargs := List.length sign in let allargs := snd (decompose_app ccl) in let '(paramrels, args) := chop mdecl.(ind_npars) allargs in let cstr := tConstruct ind i u in let args := (args ++ [mkApps cstr (paramrels ++ to_extended_list sign)]) in Some (ar, sign, mkApps (lift0 nargs p) args) | None => None end in mapi branch_type idecl.(ind_ctors). | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | build_branches_type | 10,262 |
ind mdecl idecl params u p : build_branches_type ind mdecl idecl params u p = let inds := inds ind.(inductive_mind) u mdecl.(ind_bodies) in let branch_type i '(id, t, ar) := let ty := subst0 inds (subst_instance u t) in option_map (fun ty => let '(sign, ccl) := decompose_prod_assum [] ty in let nargs := List.length sign in let allargs := snd (decompose_app ccl) in let '(paramrels, args) := chop mdecl.(ind_npars) allargs in let cstr := tConstruct ind i u in let args := (args ++ [mkApps cstr (paramrels ++ to_extended_list sign)]) in (ar, sign, (mkApps (lift0 nargs p) args))) (instantiate_params (subst_instance u mdecl.(ind_params)) params ty) in mapi branch_type idecl.(ind_ctors). Proof. apply mapi_ext. intros ? [[? ?] ?]; cbnr. repeat (destruct ?; cbnr). Qed. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | build_branches_type_ | 10,263 |
(t : term) := match t with | tInd ind u => Some (ind, u) | _ => None end. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | destInd | 10,264 |
(r : recursivity_kind) := match r with | Finite => true | _ => false end. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | isFinite | 10,265 |
(r : recursivity_kind) := match r with | CoFinite => true | _ => false end. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | isCoFinite | 10,266 |
(Σ : global_env) ind r := match lookup_env Σ ind with | Some (InductiveDecl mib) => eqb mib.(ind_finite) r | _ => false end. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | check_recursivity_kind | 10,267 |
d := let '{| dname := na; dtype := ty; dbody := b; rarg := arg |} := d in let '(ctx, ty) := decompose_prod_assum [] ty in match nth_error (List.rev (smash_context [] ctx)) arg with | Some argd => let (hd, args) := decompose_app argd.(decl_type) in match destInd hd with | Some (mkInd mind _, u) => Some mind | None => None end | None => None end. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | check_one_fix | 10,268 |
(Σ : global_env) mfix := forallb (isLambda ∘ dbody) mfix && let checks := map check_one_fix mfix in match map_option_out checks with | Some (ind :: inds) => forallb (eqb ind) inds && check_recursivity_kind Σ ind Finite | _ => false end. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | wf_fixpoint | 10,269 |
d := let '{| dname := na; dtype := ty; dbody := b; rarg := arg |} := d in let '(ctx, ty) := decompose_prod_assum [] ty in let (hd, args) := decompose_app ty in match destInd hd with | Some (mkInd ind _, u) => Some ind | None => None end. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | check_one_cofix | 10,270 |
(Σ : global_env) mfix := let checks := map check_one_cofix mfix in match map_option_out checks with | Some (ind :: inds) => forallb (eqb ind) inds && check_recursivity_kind Σ ind CoFinite | _ => false end. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | wf_cofixpoint | 10,271 |
`{checker_flags} (Σ : global_env_ext) (Γ : context) : term -> term -> Type := | type_Rel n decl : wf_local Σ Γ -> nth_error Γ n = Some decl -> Σ ;;; Γ |- tRel n : lift0 (S n) decl.(decl_type) | type_Sort s : wf_local Σ Γ -> wf_sort Σ s -> Σ ;;; Γ |- tSort s : tSort (Sort.super s) | type_Cast c k t s : Σ ;;; Γ |- t : tSort s -> Σ ;;; Γ |- c : t -> Σ ;;; Γ |- tCast c k t : t | type_Prod na t b s1 s2 : lift_typing typing Σ Γ (j_vass_s na t s1) -> Σ ;;; Γ ,, vass na t |- b : tSort s2 -> Σ ;;; Γ |- tProd na t b : tSort (Sort.sort_of_product s1 s2) | type_Lambda na t b bty : lift_typing typing Σ Γ (j_vass na t) -> Σ ;;; Γ ,, vass na t |- b : bty -> Σ ;;; Γ |- tLambda na t b : tProd na t bty | type_LetIn na b b_ty b' b'_ty : lift_typing typing Σ Γ (j_vdef na b b_ty) -> Σ ;;; Γ ,, vdef na b b_ty |- b' : b'_ty -> Σ ;;; Γ |- tLetIn na b b_ty b' : tLetIn na b b_ty b'_ty | type_App t l t_ty t' : Σ ;;; Γ |- t : t_ty -> isApp t = false -> l <> [] -> typing_spine Σ Γ t_ty l t' -> Σ ;;; Γ |- tApp t l : t' | type_Const cst u : wf_local Σ Γ -> forall decl (isdecl : declared_constant Σ.1 cst decl), consistent_instance_ext Σ decl.(cst_universes) u -> Σ ;;; Γ |- (tConst cst u) : subst_instance u decl.(cst_type) | type_Ind ind u : wf_local Σ Γ -> forall mdecl idecl (isdecl : declared_inductive Σ.1 ind mdecl idecl), consistent_instance_ext Σ mdecl.(ind_universes) u -> Σ ;;; Γ |- (tInd ind u) : subst_instance u idecl.(ind_type) | type_Construct ind i u : wf_local Σ Γ -> forall mdecl idecl cdecl (isdecl : declared_constructor Σ.1 (ind, i) mdecl idecl cdecl), consistent_instance_ext Σ mdecl.(ind_universes) u -> Σ ;;; Γ |- (tConstruct ind i u) : type_of_constructor mdecl cdecl (ind, i) u | type_Case (ci : case_info) p c brs indices ps : forall mdecl idecl (isdecl : declared_inductive Σ.1 ci.(ci_ind) mdecl idecl), mdecl.(ind_npars) = ci.(ci_npar) -> wf_nactx p.(pcontext) (ind_predicate_context ci.(ci_ind) mdecl idecl) -> context_assumptions mdecl.(ind_params) = #|p.(pparams)| -> consistent_instance_ext Σ (ind_universes mdecl) p.(puinst) -> let predctx := case_predicate_context ci.(ci_ind) mdecl idecl p in ctx_inst (typing Σ) Γ (p.(pparams) ++ indices) (List.rev (ind_params mdecl ,,, ind_indices idecl : context)@[p.(puinst)]) -> Σ ;;; Γ ,,, predctx |- p.(preturn) : tSort ps -> is_allowed_elimination Σ idecl.(ind_kelim) ps -> Σ ;;; Γ |- c : mkApps (tInd ci.(ci_ind) p.(puinst)) (p.(pparams) ++ indices) -> isCoFinite mdecl.(ind_finite) = false -> let ptm := it_mkLambda_or_LetIn predctx p.(preturn) in All2i (fun i cdecl br => let brctxty := case_branch_type ci.(ci_ind) mdecl p ptm i cdecl br in (wf_nactx br.(bcontext) (cstr_branch_context ci.(ci_ind) mdecl cdecl)) * (Σ ;;; Γ ,,, brctxty.1 |- br.(bbody) : brctxty.2) * (Σ ;;; Γ ,,, brctxty.1 |- brctxty.2 : tSort ps)) 0 idecl.(ind_ctors) brs -> Σ ;;; Γ |- tCase ci p c brs : mkApps ptm (indices ++ [c]) | type_Proj p c u : forall mdecl idecl cdecl pdecl (isdecl : declared_projection Σ.1 p mdecl idecl cdecl pdecl) args, Σ ;;; Γ |- c : mkApps (tInd p.(proj_ind) u) args -> #|args| = ind_npars mdecl -> Σ ;;; Γ |- tProj p c : subst0 (c :: List.rev args) (subst_instance u pdecl.(proj_type)) | type_Fix mfix n decl : fix_guard Σ Γ mfix -> nth_error mfix n = Some decl -> wf_local Σ Γ -> All (on_def_type (lift_typing1 (typing Σ)) Γ) mfix -> All (on_def_body (lift_typing1 (typing Σ)) (fix_context mfix) Γ) mfix -> wf_fixpoint Σ mfix -> Σ ;;; Γ |- tFix mfix n : decl.(dtype) | type_CoFix mfix n decl : cofix_guard Σ Γ mfix -> nth_error mfix n = Some decl -> wf_local Σ Γ -> All (on_def_type (lift_typing1 (typing Σ)) Γ) mfix -> All (on_def_body (lift_typing1 (typing Σ)) (fix_context mfix) Γ) mfix -> wf_cofixpoint Σ mfix -> Σ ;;; Γ |- tCoFix mfix n : decl.(dtype) | type_Int p prim_ty cdecl : wf_local Σ Γ -> primitive_constant Σ primInt = Some prim_ty -> declared_constant Σ prim_ty cdecl -> primitive_invariants primInt cdecl -> Σ ;;; Γ |- tInt p : tConst prim_ty [] | type_Float p prim_ty cdecl : wf_local Σ Γ -> primitive_constant Σ primFloat = Some prim_ty -> declared_constant Σ prim_ty cdecl -> primitive_invariants primFloat cdecl -> Σ ;;; Γ |- tFloat p : tConst prim_ty [] | type_String p prim_ty cdecl : wf_local Σ Γ -> primitive_constant Σ primString = Some prim_ty -> declared_constant Σ prim_ty cdecl -> primitive_invariants primString cdecl -> Σ ;;; Γ |- tString p : tConst prim_ty [] | type_Array prim_ty cdecl u arr def ty : wf_local Σ Γ -> primitive_constant Σ primArray = Some prim_ty -> declared_constant Σ prim_ty cdecl -> primitive_invariants primArray cdecl -> let s := sType (Universe.make' u) in Σ ;;; Γ |- ty : tSort s -> Σ ;;; Γ |- def : ty -> All (fun t => Σ ;;; Γ |- t : ty) arr -> Σ ;;; Γ |- tArray u arr def ty : tApp (tConst prim_ty [u]) [ty] | type_Conv t A B s : Σ ;;; Γ |- t : A -> Σ ;;; Γ |- B : tSort s -> Σ ;;; Γ |- A <= B -> Σ ;;; Γ |- t : B where " Σ ;;; Γ |- t : T " := (typing Σ Γ t T) : type_scope and "'wf_local' Σ Γ " := (All_local_env (lift_typing1 (typing Σ)) Γ) : type_scope with typing_spine `{checker_flags} (Σ : global_env_ext) (Γ : context) : term -> list term -> term -> Type := | type_spine_nil ty : typing_spine Σ Γ ty [] ty | type_spine_cons hd tl na A B s T B' : Σ ;;; Γ |- tProd na A B : tSort s -> Σ ;;; Γ |- T <= tProd na A B -> Σ ;;; Γ |- hd : A -> typing_spine Σ Γ (subst10 hd B) tl B' -> typing_spine Σ Γ T (cons hd tl) B'. | Inductive | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | typing | 10,272 |
npars ty := decompose_prod_n_assum [] npars ty <> None. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | has_nparams | 10,273 |
(P : global_env_ext -> context -> option term -> term -> Type) : (global_env_ext -> context -> term -> term -> Type) := fun Σ Γ t T => P Σ Γ (Some t) T. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | unlift_opt_pred | 10,274 |
@typing. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | typing | 10,275 |
t T U (s : typing_spine Σ Γ t T U) : size := match s with | type_spine_nil _ => 0 | type_spine_cons hd tl na A B s T B' typrod cumul ty s' => (fn _ _ _ _ ty + fn _ _ _ _ typrod + typing_spine_size _ _ _ s')%nat end. | Fixpoint | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | typing_spine_size | 10,276 |
{Σ Γ args Δ} (c : ctx_inst (typing Σ) Γ args Δ) : size := match c with | ctx_inst_nil => 0 | ctx_inst_ass na t i inst Δ ty ctxi => ((typing_size _ _ _ _ ty) + (ctx_inst_size ctxi))%nat | ctx_inst_def na b t inst Δ ctxi => S (ctx_inst_size ctxi) end. | Fixpoint | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | ctx_inst_size | 10,277 |
`{checker_flags} {Σ Γ t T} (d : Σ ;;; Γ |- t : T) : size. Proof. revert Σ Γ t T d. fix typing_size 5. destruct 1 ; repeat match goal with | H : typing _ _ _ _ |- _ => apply typing_size in H end; match goal with | H : All2 _ _ _ |- _ => idtac | H : All2i _ _ _ _ |- _ => idtac | H : All_local_env _ _ |- _ => idtac | H : All _ _ |- _ => idtac | H : Alli _ _ _ |- _ => idtac | H : typing_spine _ _ _ _ _ |- _ => idtac | H : _ + _ |- _ => idtac | H : lift_typing0 _ _ |- _ => idtac | H1 : size, H2 : size, H3 : size |- _ => exact (S (Nat.max H1 (Nat.max H2 H3))) | H1 : size, H2 : size |- _ => exact (S (Nat.max H1 H2)) | H1 : size |- _ => exact (S H1) | _ => exact 1 end. - exact (S (All_local_env_size (typing_size _) _ a)). - exact (S (All_local_env_size (typing_size _) _ a)). - exact (S (Nat.max d (lift_typing_size (typing_size _ _) _ l))). - exact (S (Nat.max d (lift_typing_size (typing_size _ _) _ l))). - exact (S (Nat.max d (lift_typing_size (typing_size _ _) _ l))). - exact (S (Nat.max d (typing_spine_size typing_size _ _ _ _ _ t0))). - exact (S (S (All_local_env_size (typing_size _) _ a))). - exact (S (S (All_local_env_size (typing_size _) _ a))). - exact (S (S (All_local_env_size (typing_size _) _ a))). - exact (S (Nat.max d1 (Nat.max d2 (Nat.max (ctx_inst_size _ typing_size c1) (all2i_size _ (fun _ x y p => Nat.max (typing_size _ _ _ _ p.1.2) (typing_size _ _ _ _ p.2)) a0))))). - exact (S (Nat.max (Nat.max (All_local_env_size (typing_size _) _ a) (all_size _ (fun x p => on_def_type_size (typing_size Σ) _ _ p) a0)) (all_size (on_def_body (lift_typing typing _) _ _) (fun x p => on_def_body_size (typing_size Σ) _ _ _ p) a1))). - exact (S (Nat.max (Nat.max (All_local_env_size (typing_size _) _ a) (all_size _ (fun x p => on_def_type_size (typing_size Σ) _ _ p) a0)) (all_size (on_def_body (lift_typing typing _) _ _) (fun x p => on_def_body_size (typing_size Σ) _ _ _ p) a1))). - exact (S (All_local_env_size (typing_size _) _ a)). - exact (S (All_local_env_size (typing_size _) _ a)). - exact (S (All_local_env_size (typing_size _) _ a)). - exact (S (Nat.max (All_local_env_size (typing_size _) _ a) (Nat.max d2 (Nat.max d3 (all_size _ (fun t p => typing_size Σ Γ t ty p) a0))))). Defined. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | typing_size | 10,278 |
`{checker_flags} {Σ Γ t T} (d : Σ ;;; Γ |- t : T) : typing_size d > 0. Proof. induction d; simpl; try lia. Qed. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | typing_size_pos | 10,279 |
(Σ : global_declarations) : size := match Σ with | [] => 1 | d :: Σ => S (globdecls_size Σ) end. | Fixpoint | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | globdecls_size | 10,280 |
(Σ : global_env) : size := globdecls_size Σ.(declarations). | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | globenv_size | 10,281 |
`{checker_flags} Σ := on_global_env cumul_gen (lift_typing typing) Σ. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | wf | 10,282 |
`{checker_flags} := on_global_env_ext cumul_gen (lift_typing typing). | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | wf_ext | 10,283 |
`{cf : checker_flags} {Σ} {Γ t T} : Σ ;;; Γ |- t : T -> wf_local Σ Γ. Proof. revert Σ Γ t T. fix f 5. destruct 1; eauto. all: exact (f _ _ _ _ l.2.π2.1). Defined. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | typing_wf_local | 10,284 |
`{checker_flags} Σ : Σ ;;; [] |- tSort sProp : tSort Sort.type1. change ( Σ ;;; [] |- tSort (sProp) : tSort Sort.type1); constructor;auto. constructor. constructor. Defined. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | type_Prop | 10,285 |
`{checker_flags} Σ Γ : wf_local Σ Γ -> Σ ;;; Γ |- tSort sProp : tSort Sort.type1. Proof. constructor;auto. constructor. Defined. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | type_Prop_wf | 10,286 |
`{checker_flags} (P : forall Σ Γ t T, Type) (Pj : forall Σ Γ j, Type) (PΓ : forall Σ Γ (wfΓ : wf_local Σ Γ), Type):= forall (Σ : global_env_ext) (wfΣ : wf Σ) Γ (wfΓ : wf_local Σ Γ) t T (ty : Σ ;;; Γ |- t : T), on_global_env cumul_gen Pj Σ * (PΓ Σ Γ (typing_wf_local ty) * P Σ Γ t T). | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | env_prop | 10,287 |
`{checker_flags} {P Pj PΓ} : env_prop P Pj PΓ -> forall (Σ : global_env_ext) (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) (t T : term), Σ ;;; Γ |- t : T -> P Σ Γ t T. Proof. intros. now apply X. Qed. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | env_prop_typing | 10,288 |
`{checker_flags} {P Pj PΓ} : env_prop P Pj PΓ -> forall (Σ : global_env_ext) (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ), PΓ Σ Γ wfΓ. Proof. intros. red in X. now apply (X _ wfΣ _ wfΓ _ _ (type_Prop_wf Σ Γ wfΓ)). Qed. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | env_prop_wf_local | 10,289 |
`{checker_flags} {P Pj PΓ} : env_prop P Pj PΓ -> forall Σ (wfΣ : wf Σ), on_global_env cumul_gen Pj Σ. Proof. intros. eapply (X (empty_ext Σ)). apply wfΣ. constructor. apply type_Prop. Defined. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | env_prop_sigma | 10,290 |
`{checker_flags} Σ (Γ Γ' : context) : wf_local Σ (Γ ,,, Γ') -> wf_local Σ Γ. Proof. induction Γ'. auto. simpl. intros H'; inv H'; eauto. Defined. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | wf_local_app_l | 10,291 |
`{cf : checker_flags} {Σ} {Γ t T} (d :Σ ;;; Γ |- t : T) : All_local_env_size (@typing_size _ _) _ (typing_wf_local d) < typing_size d. Proof. revert Σ Γ t T d. fix f 5. induction d; simpl; change (fun Γ t T (Hty : Σ;;; Γ |- t : T) => typing_size Hty) with (@typing_size cf Σ); try lia. 1-3: pose proof (f _ _ _ _ l.2.π2.1); unfold lift_sorting_size; cbn in *; try lia. Qed. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | typing_wf_local_size | 10,292 |
`{checker_flags} {Σ Γ'} (w : wf_local Σ Γ') : forall d Γ, Γ' = d :: Γ -> ∑ (w' : wf_local Σ Γ) u, { ty : lift_typing1 (typing Σ) Γ (Judge d.(decl_body) d.(decl_type) (Some u)) | All_local_env_size (@typing_size _ Σ) _ w' < All_local_env_size (@typing_size _ _) _ w /\ lift_typing_size (@typing_size _ _ _) _ ty <= All_local_env_size (@typing_size _ _) _ w }. Proof. intros d Γ ->. depelim w; cbn. all: exists w, l.2.π1, (lift_sorting_extract l). all: pose proof (typing_size_pos l.2.π2.1). 2: pose proof (typing_size_pos l.1). all: simpl in *. all: simpl; split. all: try lia. Qed. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | wf_local_inv | 10,293 |
`{checker_flags} Σ Γ (P : term -> term -> Type) : forall (T : term) (t : list term) (U : term), typing_spine Σ Γ T t U -> Type := | Forall_type_spine_nil T : Forall_typing_spine Σ Γ P T [] T (type_spine_nil Σ Γ T) | Forall_type_spine_cons hd tl na A B s T B' tls (typrod : Σ ;;; Γ |- tProd na A B : tSort s) (cumul : Σ ;;; Γ |- T <= tProd na A B) (ty : Σ ;;; Γ |- hd : A) : P (tProd na A B) (tSort s) -> P hd A -> Forall_typing_spine Σ Γ P (B {0 := hd}) tl B' tls -> Forall_typing_spine Σ Γ P T (hd :: tl) B' (type_spine_cons Σ Γ hd tl na A B s T B' typrod cumul ty tls). | Inductive | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | Forall_typing_spine | 10,294 |
`{cf : checker_flags} : forall (P : global_env_ext -> context -> term -> term -> Type) (Pj : global_env_ext -> context -> judgment -> Type) (Pdecl := fun Σ Γ wfΓ t T tyT => P Σ Γ t T) (PΓ : forall Σ Γ, wf_local Σ Γ -> Type), (forall Σ (wfΣ : wf Σ) (Γ : context) j, lift_typing_conj (typing Σ) (P Σ) Γ j -> Pj Σ Γ j) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ), All_local_env_over (typing Σ) (Pdecl Σ) Γ wfΓ -> All_local_env (Pj Σ) Γ -> PΓ Σ Γ wfΓ) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) (n : nat) decl, nth_error Γ n = Some decl -> PΓ Σ Γ wfΓ -> P Σ Γ (tRel n) (lift0 (S n) decl.(decl_type))) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) (u : sort), PΓ Σ Γ wfΓ -> wf_sort Σ u -> P Σ Γ (tSort u) (tSort (Sort.super u))) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) (c : term) (k : cast_kind) (t : term) (s : sort), Σ ;;; Γ |- t : tSort s -> P Σ Γ t (tSort s) -> Σ ;;; Γ |- c : t -> P Σ Γ c t -> P Σ Γ (tCast c k t) t) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) (na : aname) (t b : term) (s1 s2 : sort), PΓ Σ Γ wfΓ -> lift_typing typing Σ Γ (j_vass_s na t s1) -> Pj Σ Γ (j_vass_s na t s1) -> Σ ;;; Γ,, vass na t |- b : tSort s2 -> P Σ (Γ,, vass na t) b (tSort s2) -> P Σ Γ (tProd na t b) (tSort (Sort.sort_of_product s1 s2))) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) (na : aname) (t b : term) (bty : term), PΓ Σ Γ wfΓ -> lift_typing typing Σ Γ (j_vass na t) -> Pj Σ Γ (j_vass na t) -> Σ ;;; Γ,, vass na t |- b : bty -> P Σ (Γ,, vass na t) b bty -> P Σ Γ (tLambda na t b) (tProd na t bty)) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) (na : aname) (b b_ty b' b'_ty : term), PΓ Σ Γ wfΓ -> lift_typing typing Σ Γ (j_vdef na b b_ty) -> Pj Σ Γ (j_vdef na b b_ty) -> Σ ;;; Γ,, vdef na b b_ty |- b' : b'_ty -> P Σ (Γ,, vdef na b b_ty) b' b'_ty -> P Σ Γ (tLetIn na b b_ty b') (tLetIn na b b_ty b'_ty)) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) (t : term) (l : list term) (t_ty t' : term), Σ ;;; Γ |- t : t_ty -> P Σ Γ t t_ty -> isApp t = false -> l <> [] -> forall (s : typing_spine Σ Γ t_ty l t'), Forall_typing_spine Σ Γ (fun t T => P Σ Γ t T) t_ty l t' s -> P Σ Γ (tApp t l) t') -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) cst u (decl : constant_body), on_global_env cumul_gen Pj Σ.1 -> PΓ Σ Γ wfΓ -> declared_constant Σ.1 cst decl -> consistent_instance_ext Σ decl.(cst_universes) u -> P Σ Γ (tConst cst u) (subst_instance u (cst_type decl))) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) (ind : inductive) u mdecl idecl (isdecl : declared_inductive Σ.1 ind mdecl idecl), on_global_env cumul_gen Pj Σ.1 -> PΓ Σ Γ wfΓ -> consistent_instance_ext Σ mdecl.(ind_universes) u -> P Σ Γ (tInd ind u) (subst_instance u (ind_type idecl))) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) (ind : inductive) (i : nat) u mdecl idecl cdecl (isdecl : declared_constructor Σ.1 (ind, i) mdecl idecl cdecl), on_global_env cumul_gen Pj Σ.1 -> PΓ Σ Γ wfΓ -> consistent_instance_ext Σ mdecl.(ind_universes) u -> P Σ Γ (tConstruct ind i u) (type_of_constructor mdecl cdecl (ind, i) u)) -> (forall (Σ : global_env_ext) (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ), forall (ci : case_info) p c brs indices ps mdecl idecl (isdecl : declared_inductive Σ.1 ci.(ci_ind) mdecl idecl), on_global_env cumul_gen Pj Σ.1 -> PΓ Σ Γ wfΓ -> mdecl.(ind_npars) = ci.(ci_npar) -> wf_nactx p.(pcontext) (ind_predicate_context ci.(ci_ind) mdecl idecl) -> context_assumptions mdecl.(ind_params) = #|p.(pparams)| -> consistent_instance_ext Σ (ind_universes mdecl) p.(puinst) -> let predctx := case_predicate_context ci.(ci_ind) mdecl idecl p in ctx_inst (Prop_conj typing P Σ) Γ (p.(pparams) ++ indices) (List.rev (ind_params mdecl ,,, ind_indices idecl : context)@[p.(puinst)]) -> forall pret : Σ ;;; Γ ,,, predctx |- p.(preturn) : tSort ps, P Σ (Γ ,,, predctx) p.(preturn) (tSort ps) -> PΓ Σ (Γ ,,, predctx) (typing_wf_local pret) -> is_allowed_elimination Σ idecl.(ind_kelim) ps -> Σ ;;; Γ |- c : mkApps (tInd ci.(ci_ind) p.(puinst)) (p.(pparams) ++ indices) -> P Σ Γ c (mkApps (tInd ci.(ci_ind) p.(puinst)) (p.(pparams) ++ indices)) -> isCoFinite mdecl.(ind_finite) = false -> let ptm := it_mkLambda_or_LetIn predctx p.(preturn) in All2i (fun i cdecl br => let brctxty := case_branch_type ci.(ci_ind) mdecl p ptm i cdecl br in wf_nactx br.(bcontext) (cstr_branch_context ci.(ci_ind) mdecl cdecl) * Prop_conj typing P Σ (Γ ,,, brctxty.1) br.(bbody) brctxty.2 * Prop_conj typing P Σ (Γ ,,, brctxty.1) brctxty.2 (tSort ps)) 0 idecl.(ind_ctors) brs -> P Σ Γ (tCase ci p c brs) (mkApps ptm (indices ++ [c]))) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) (p : projection) (c : term) u mdecl idecl cdecl pdecl (isdecl : declared_projection Σ.1 p mdecl idecl cdecl pdecl) args, on_global_env cumul_gen Pj Σ.1 -> PΓ Σ Γ wfΓ -> Σ ;;; Γ |- c : mkApps (tInd p.(proj_ind) u) args -> P Σ Γ c (mkApps (tInd p.(proj_ind) u) args) -> #|args| = ind_npars mdecl -> P Σ Γ (tProj p c) (subst0 (c :: List.rev args) (subst_instance u pdecl.(proj_type)))) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) (mfix : list (def term)) (n : nat) decl, let types := fix_context mfix in fix_guard Σ Γ mfix -> nth_error mfix n = Some decl -> PΓ Σ Γ wfΓ -> All (on_def_type (lift_typing typing Σ) Γ) mfix -> All (on_def_type (Pj Σ) Γ) mfix -> All (on_def_body (lift_typing typing Σ) types Γ) mfix -> All (on_def_body (Pj Σ) types Γ) mfix -> wf_fixpoint Σ.1 mfix -> P Σ Γ (tFix mfix n) decl.(dtype)) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) (mfix : list (def term)) (n : nat) decl, let types := fix_context mfix in cofix_guard Σ Γ mfix -> nth_error mfix n = Some decl -> PΓ Σ Γ wfΓ -> All (on_def_type (lift_typing typing Σ) Γ) mfix -> All (on_def_type (Pj Σ) Γ) mfix -> All (on_def_body (lift_typing typing Σ) types Γ) mfix -> All (on_def_body (Pj Σ) types Γ) mfix -> wf_cofixpoint Σ.1 mfix -> P Σ Γ (tCoFix mfix n) decl.(dtype)) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) p prim_ty cdecl, PΓ Σ Γ wfΓ -> primitive_constant Σ primInt = Some prim_ty -> declared_constant Σ prim_ty cdecl -> primitive_invariants primInt cdecl -> P Σ Γ (tInt p) (tConst prim_ty [])) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) p prim_ty cdecl, PΓ Σ Γ wfΓ -> primitive_constant Σ primFloat = Some prim_ty -> declared_constant Σ prim_ty cdecl -> primitive_invariants primFloat cdecl -> P Σ Γ (tFloat p) (tConst prim_ty [])) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) p prim_ty cdecl, PΓ Σ Γ wfΓ -> primitive_constant Σ primString = Some prim_ty -> declared_constant Σ prim_ty cdecl -> primitive_invariants primString cdecl -> P Σ Γ (tString p) (tConst prim_ty [])) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) u arr def ty prim_ty cdecl, PΓ Σ Γ wfΓ -> primitive_constant Σ primArray = Some prim_ty -> declared_constant Σ prim_ty cdecl -> primitive_invariants primArray cdecl -> let s := sType (Universe.make' u) in Σ ;;; Γ |- ty : tSort s -> P Σ Γ ty (tSort s) -> Σ ;;; Γ |- def : ty -> P Σ Γ def ty -> All (fun t => Σ ;;; Γ |- t : ty × P Σ Γ t ty) arr -> P Σ Γ (tArray u arr def ty) (tApp (tConst prim_ty [u]) [ty])) -> (forall Σ (wfΣ : wf Σ) (Γ : context) (wfΓ : wf_local Σ Γ) (t A B : term) s, PΓ Σ Γ wfΓ -> Σ ;;; Γ |- t : A -> P Σ Γ t A -> Σ ;;; Γ |- B : tSort s -> P Σ Γ B (tSort s) -> Σ ;;; Γ |- A <= B -> P Σ Γ t B) -> env_prop P Pj PΓ. | Lemma | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | typing_ind_env | 10,295 |
`{checker_flags} Σ : wf_ext Σ -> wf Σ := fst. | Definition | template-coq | From Equations.Type Require Import Relation. From Equations Require Import Equations. From Coq Require Import ssreflect Wellfounded Relation_Operators CRelationClasses. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Environment Primitive EnvironmentTyping Reflect. From MetaCoq.Template Require Import Ast AstUtils LiftSubst UnivSubst ReflectAst TermEquality WfAst. Import MCMonadNotation. | template-coq\theories\Typing.v | wf_ext_wf | 10,296 |
Σ : forall (Γ : context), All (wf_decl Σ) Γ -> All_local_env (wf_decl_pred Σ) Γ. Proof. intros Γ X. induction Γ in X |- *. - constructor; eauto. - destruct a as [na [body|] ty]. + econstructor. * apply IHΓ. inv X; eauto. * red. inv X. apply X0. + econstructor. * apply IHΓ. inv X; eauto. * red. inv X. apply X0. Qed. | Lemma | template-coq | Require Import ssreflect ssrbool. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect. From MetaCoq.Template Require Import Ast AstUtils Induction UnivSubst WfAst Typing. From Equations Require Import Equations. | template-coq\theories\TypingWf.v | All_local_env_wf_decl | 10,297 |
`{checker_flags} Σ P Q kn d : (forall Σ Γ j, on_global_env cumul_gen P Σ.1 -> P Σ Γ j -> Q Σ Γ j) -> on_global_env cumul_gen P Σ.1 -> on_global_decl cumul_gen P Σ kn d -> on_global_decl cumul_gen Q Σ kn d. Proof. intro HPQ. eapply on_global_decl_impl_simple. apply HPQ. Qed. | Lemma | template-coq | Require Import ssreflect ssrbool. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect. From MetaCoq.Template Require Import Ast AstUtils Induction UnivSubst WfAst Typing. From Equations Require Import Equations. | template-coq\theories\TypingWf.v | on_global_decl_impl | 10,298 |
`{checker_flags} Σ P Q : (forall Σ Γ j, on_global_env cumul_gen P Σ.1 -> P Σ Γ j -> Q Σ Γ j) -> on_global_env cumul_gen P Σ -> on_global_env cumul_gen Q Σ. Proof. destruct Σ as [univs Σ]; cbn. intros X [cu X0]; split => /= //. cbn in *. induction X0; try destruct o; constructor; auto; constructor; eauto. clear IHX0. eapply on_global_decl_impl; tea. split => //. Qed. | Lemma | template-coq | Require Import ssreflect ssrbool. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import config Reflect. From MetaCoq.Template Require Import Ast AstUtils Induction UnivSubst WfAst Typing. From Equations Require Import Equations. | template-coq\theories\TypingWf.v | on_global_env_impl | 10,299 |