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
(Σ : global_env) (kn : kername) := lookup_globals Σ.(declarations) kn.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
lookup_envs
200
(Σ Σ' : global_env) := [× Σ.(universes) ⊂_cs Σ'.(universes), extends_decls_part Σ Σ' & Retroknowledge.extends Σ.(retroknowledge) Σ'.(retroknowledge)].
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends
201
(Σ Σ' : global_env) := [× Σ.(universes) = Σ'.(universes), extends_decls_part Σ Σ' & Σ.(retroknowledge) = Σ'.(retroknowledge)].
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_decls
202
(Σ Σ' : global_env) := [× Σ.(universes) ⊂_cs Σ'.(universes), strictly_extends_decls_part Σ Σ' & Retroknowledge.extends Σ.(retroknowledge) Σ'.(retroknowledge)].
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_strictly_on_decls
203
(Σ Σ' : global_env) := [× Σ.(universes) = Σ'.(universes), strictly_extends_decls_part Σ Σ' & Σ.(retroknowledge) = Σ'.(retroknowledge)].
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls
204
Σ kn : ~In kn (List.map fst Σ) <-> lookup_global Σ kn = None. Proof. move: Σ; elim => //=; try tauto. move => ??; case: eqb_spec; intuition congruence. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
lookup_global_None
205
Σ kn : hd_error (lookup_globals Σ kn) = lookup_global Σ kn. Proof. move: Σ; elim => //= ?? <-. case: eqb_spec => //=. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
hd_error_lookup_globals
206
Σ kn : ~In kn (List.map fst Σ) <-> lookup_globals Σ kn = nil. Proof. rewrite lookup_global_None-hd_error_lookup_globals. case: lookup_globals => //. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
lookup_globals_nil
207
Σ : NoDup (List.map fst Σ) -> forall kn, List.length (lookup_globals Σ kn) = match lookup_global Σ kn with | Some _ => 1 | None => 0 end. Proof. move => H kn. move: Σ H; elim => //=; try lia. move => ?? H. inversion 1; subst. move: (H ltac:(assumption)). case: eqb_spec => //= ->. rewrite (proj1 (@lookup_global_None _ _)) => //= -> //=. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
NoDup_length_lookup_globals
208
Σ : NoDup (List.map fst Σ) -> forall kn, lookup_globals Σ kn = match lookup_global Σ kn with | Some v => [v] | None => [] end. Proof. move => H kn. move: (NoDup_length_lookup_globals Σ H kn) (hd_error_lookup_globals Σ kn). repeat destruct ?; subst. all: case: lookup_globals; cbn; try congruence. move => ? [|]; cbn; congruence. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
NoDup_lookup_globals_eq
209
Σ kn decl : In (kn, decl) Σ <-> In decl (lookup_globals Σ kn). Proof. move: Σ; elim => //=; try tauto. move => [??]?; case: eqb_spec => ? //=; subst => <-; cbn in *; firstorder (subst; auto). all: (idtac + constructor); congruence. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
lookup_globals_In
210
Σ kn decl : lookup_global Σ kn = Some decl -> In (kn, decl) Σ. Proof. move: Σ; elim => //=; try tauto. move => [??]?; case: eqb_spec => ? IH; inversion 1; subst; try rewrite <- IH by assumption. all: intuition try congruence; subst. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
lookup_global_Some_if_In
211
Σ kn decl (H : NoDup (List.map fst Σ)) : In (kn, decl) Σ <-> lookup_global Σ kn = Some decl. Proof. rewrite -hd_error_lookup_globals lookup_globals_In. apply NoDup_length_lookup_globals with (kn:=kn) in H; move: H. case: lookup_global; case: lookup_globals => [|?[]]; cbn. all: try lia. all: intuition congruence. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
lookup_global_Some_iff_In_NoDup
212
Σ Σ' k d : NoDup (List.map fst Σ') -> lookup_global Σ k = Some d -> extends_decls_part_globals Σ Σ' -> lookup_global Σ' k = Some d. Proof. rewrite /= -!hd_error_lookup_globals => Hnd. move: (@NoDup_length_lookup_globals _ Hnd k); clear Hnd. rewrite -hd_error_lookup_globals. move=> H Hd eq. move: (eq k); clear eq. case => ls eq. move: eq Hd H => ->. case: ls => //= ?. case => //=. case: lookup_globals => //=. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
lookup_global_extends_NoDup
213
Σ Σ' k d : NoDup (List.map fst Σ'.(declarations)) -> lookup_env Σ k = Some d -> extends Σ Σ' -> lookup_env Σ' k = Some d. Proof. move => Hnd Hd; case => *. eapply lookup_global_extends_NoDup; tea. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
lookup_env_extends_NoDup
214
Σ Σ' kn : lookup_globals (Σ ++ Σ') kn = lookup_globals Σ kn ++ lookup_globals Σ' kn. Proof. move: Σ. elim => //= ??. case: eqb_spec => //= -> -> //=. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
lookup_globals_app
215
Σ Σ' : strictly_extends_decls_part_globals Σ Σ' -> extends_decls_part_globals Σ Σ'. Proof. case => //= ? -> c. rewrite lookup_globals_app. eexists; reflexivity. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls_extends_part_globals
216
Σ Σ' : strictly_extends_decls_part Σ Σ' -> extends_decls_part Σ Σ'. Proof. apply strictly_extends_decls_extends_part_globals. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls_extends_part
217
Σ Σ' : strictly_extends_decls Σ Σ' -> extends_decls Σ Σ'. Proof. destruct Σ, Σ'; case => //= -> ? ->. rewrite /extends_decls; split; try reflexivity. now apply strictly_extends_decls_extends_part. Qed.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls_extends_decls
218
Σ Σ' : strictly_extends_decls Σ Σ' -> extends_strictly_on_decls Σ Σ'. Proof. destruct Σ, Σ'; intros []. cbn in *; subst. split => //=. split; [lsets|csets]. apply Retroknowledge.extends_refl. Qed.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls_extends_strictly_on_decls
219
Σ Σ' : extends_decls Σ Σ' -> extends Σ Σ'. Proof. destruct Σ, Σ'; intros []. cbn in *; subst. split => //=. split; [lsets|csets]. apply Retroknowledge.extends_refl. Qed.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_decls_extends
220
Σ Σ' : extends_strictly_on_decls Σ Σ' -> extends Σ Σ'. Proof. destruct Σ, Σ'; case => //= ? ? ?. rewrite /extends; split => //=. now apply strictly_extends_decls_extends_part. Qed.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_strictly_on_decls_extends
221
CRelationClasses.subrelation strictly_extends_decls extends_decls := strictly_extends_decls_extends_decls.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls_extends_decls_subrel
222
CRelationClasses.subrelation strictly_extends_decls extends_strictly_on_decls := strictly_extends_decls_extends_strictly_on_decls.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls_extends_strictly_on_decls_subrel
223
CRelationClasses.subrelation extends_decls extends := extends_decls_extends.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_decls_extends_subrel
224
CRelationClasses.subrelation extends_strictly_on_decls extends := extends_strictly_on_decls_extends.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_strictly_on_decls_extends_subrel
225
CRelationClasses.subrelation strictly_extends_decls extends := fun _ => _.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls_extends_subrel
226
CRelationClasses.Reflexive strictly_extends_decls. Proof. red. intros x. split => //; try exists [] => //. Qed.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls_refl
227
CRelationClasses.Reflexive extends_decls. Proof. red. intros x. split => //; try exists [] => //. Qed.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_decls_refl
228
CRelationClasses.Reflexive extends_strictly_on_decls. Proof. red. intros x. split; [apply incl_cs_refl | try exists [] => // | apply Retroknowledge.extends_refl]. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_strictly_on_decls_refl
229
CRelationClasses.Reflexive extends. Proof. red. intros x. split; [apply incl_cs_refl | try exists [] => // | apply Retroknowledge.extends_refl]. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_refl
230
CRelationClasses.Reflexive extends. Proof. apply extends_refl. Qed.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_refl
231
Σ : extends_decls_part_globals Σ Σ. Proof. now exists [] => //. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_decls_part_globals_refl
232
Σ : extends_decls_part Σ Σ. Proof. apply extends_decls_part_globals_refl. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_decls_part_refl
233
(Σ : global_declarations) : strictly_extends_decls_part_globals Σ Σ. Proof. now exists [] => //. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls_part_globals_refl
234
Σ : strictly_extends_decls_part Σ Σ. Proof. apply strictly_extends_decls_part_globals_refl. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls_part_refl
235
Σ Σ' Σ'' : extends_decls_part_globals Σ Σ' -> extends_decls_part_globals Σ' Σ'' -> extends_decls_part_globals Σ Σ''. Proof. move => H1 H2 c; move: (H1 c) (H2 c) => [? ->] [? ->]. now eexists; rewrite app_assoc. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_decls_part_globals_trans
236
Σ Σ' Σ'' : extends_decls_part Σ Σ' -> extends_decls_part Σ' Σ'' -> extends_decls_part Σ Σ''. Proof. apply extends_decls_part_globals_trans. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_decls_part_trans
237
(Σ Σ' Σ'' : global_declarations) : strictly_extends_decls_part_globals Σ Σ' -> strictly_extends_decls_part_globals Σ' Σ'' -> strictly_extends_decls_part_globals Σ Σ''. Proof. move => [? ->] [? ->]. now eexists; rewrite app_assoc. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls_part_globals_trans
238
Σ Σ' Σ'' : strictly_extends_decls_part Σ Σ' -> strictly_extends_decls_part Σ' Σ'' -> strictly_extends_decls_part Σ Σ''. Proof. apply strictly_extends_decls_part_globals_trans. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls_part_trans
239
CRelationClasses.Transitive strictly_extends_decls. Proof. extends_trans_t. Qed.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls_trans
240
CRelationClasses.Transitive extends_decls. Proof. extends_trans_t. Qed.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_decls_trans
241
CRelationClasses.Transitive extends_strictly_on_decls. Proof. extends_trans_t. Qed.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_strictly_on_decls_trans
242
CRelationClasses.Transitive extends. Proof. extends_trans_t. Qed.
Instance
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_trans
243
(Σ : global_declarations) : KernameSet.t := List.fold_right KernameSet.add KernameSet.empty (List.map fst Σ).
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
declared_kername_set
244
(Σ Σ' : global_declarations) : global_declarations := let known_kns := declared_kername_set Σ in List.filter (fun '(kn, _) => negb (KernameSet.mem kn known_kns)) Σ' ++ Σ.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
merge_globals
245
(Σ Σ' : global_env) : global_env := {| universes := ContextSet.union Σ.(universes) Σ'.(universes) ; declarations := merge_globals Σ.(declarations) Σ'.(declarations) ; retroknowledge := Retroknowledge.merge Σ.(retroknowledge) Σ'.(retroknowledge) |}.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
merge_global_envs
246
(Σ Σ' : global_declarations) : Prop := forall c, lookup_globals Σ c <> [] -> lookup_globals Σ' c <> [] -> lookup_globals Σ c = lookup_globals Σ' c.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
compatible_globals
247
(Σ Σ' : global_env) := Retroknowledge.compatible Σ.(retroknowledge) Σ'.(retroknowledge) /\ compatible_globals Σ.(declarations) Σ'.(declarations).
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
compatible
248
p Σ c : lookup_globals (filter (fun '(kn, _) => p kn) Σ) c = if p c then lookup_globals Σ c else []. Proof. induction Σ as [|?? IH]; cbn; rdest; cbn; try now repeat destruct ?. case: eqb_spec => ?; repeat destruct ?; subst => //=. all: rewrite ?eqb_refl. all: try case: eqb_spec => ?; subst. all: rewrite IH //=. all: try congruence. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
lookup_globals_filter
249
Σ Σ' : strictly_extends_decls_part_globals Σ (merge_globals Σ Σ'). Proof. now eexists. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
strictly_extends_decls_l_merge_globals
250
Σ Σ' : extends_decls_part_globals Σ (merge_globals Σ Σ'). Proof. rewrite /merge_globals. intro c. rewrite lookup_globals_app lookup_globals_filter. eexists; reflexivity. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_l_merge_globals
251
Σ Σ' : extends_strictly_on_decls Σ (merge_global_envs Σ Σ'). Proof. rewrite /extends_strictly_on_decls/merge_global_envs/merge_globals; cbn. split; try first [ apply ContextSet.union_spec | apply Retroknowledge.extends_l_merge | apply strictly_extends_decls_l_merge_globals ]. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_strictly_on_decls_l_merge
252
Σ Σ' : extends Σ (merge_global_envs Σ Σ'). Proof. exact _. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_l_merge
253
forall Σ c, KernameSet.In c (declared_kername_set Σ) <-> List.In c (map fst Σ). Proof. elim => //=; try setoid_rewrite KernameSetFact.empty_iff => //=. move => [? ?] ? IH c //=. rewrite KernameSet.add_spec. intuition auto with *. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
declared_kername_set_spec
254
Σ c : KernameSet.mem c (declared_kername_set Σ) <-> List.In c (map fst Σ). Proof. setoid_rewrite <- KernameSetFact.mem_iff. apply declared_kername_set_spec. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
declared_kername_set_mem_iff
255
Σ Σ' : compatible_globals Σ Σ' -> extends_decls_part_globals Σ' (merge_globals Σ Σ'). Proof. rewrite /merge_globals. intro H2; cbn. cbv [compatible_globals] in *. intro c. specialize (H2 c). rewrite lookup_globals_app lookup_globals_filter. destruct (in_dec eq_dec c (map fst Σ')) as [H'|H']; [ exists nil | exists (lookup_globals Σ c) ]. 2: apply lookup_globals_nil in H'; rewrite H'; clear H'. 2: now destruct ?; cbn; rewrite app_nil_r. pose proof (lookup_globals_nil Σ c) as Hc. rewrite <- !lookup_globals_nil in H2. rewrite <- (declared_kername_set_mem_iff Σ) in *. destruct KernameSet.mem; cbn in *. { intuition auto. } { destruct Hc as [Hc _]. rewrite Hc ?app_nil_r //=. } Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_r_merge_globals
256
Σ Σ' : compatible Σ Σ' -> extends Σ' (merge_global_envs Σ Σ'). Proof. rewrite /extends/compatible/merge_global_envs/lookup_envs. intros [H1 H2]. split; try first [ apply ContextSet.union_spec | now apply Retroknowledge.extends_r_merge | now apply extends_r_merge_globals ]. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
extends_r_merge
257
(Σ : global_env) (p : prim_tag) : option kername := match p with | primInt => Σ.(retroknowledge).(Retroknowledge.retro_int63) | primFloat => Σ.(retroknowledge).(Retroknowledge.retro_float64) | primString => Σ.(retroknowledge).(Retroknowledge.retro_string) | primArray => Σ.(retroknowledge).(Retroknowledge.retro_array) end.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
primitive_constant
258
(dom codom : term) : term := tProd {| binder_name := nAnon; binder_relevance := Relevant |} dom (lift 1 0 codom).
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
tImpl
259
([nAnon], ConstraintSet.empty).
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
array_uctx
260
(p : prim_tag) (cdecl : constant_body) := match p with | primInt | primFloat | primString => [/\ cdecl.(cst_type) = tSort Sort.type0, cdecl.(cst_body) = None & cdecl.(cst_universes) = Monomorphic_ctx] | primArray => let s := sType (Universe.make' (Level.lvar 0)) in [/\ cdecl.(cst_type) = tImpl (tSort s) (tSort s), cdecl.(cst_body) = None & cdecl.(cst_universes) = Polymorphic_ctx array_uctx] end.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
primitive_invariants
261
Type := global_env * universes_decl.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
global_env_ext
262
global_env_ext -> global_env := fst.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
fst_ctx
263
(Σ : global_env) : global_env_ext := (Σ, Monomorphic_ctx).
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
empty_ext
264
Type := global_env * term.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
program
265
d t := match d.(decl_body) with | None => tLambda d.(decl_name) d.(decl_type) t | Some b => tLetIn d.(decl_name) b d.(decl_type) t end.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
mkLambda_or_LetIn
266
(l : context) (t : term) := List.fold_left (fun acc d => mkLambda_or_LetIn d acc) l t.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
it_mkLambda_or_LetIn
267
d t := match d.(decl_body) with | None => tProd d.(decl_name) d.(decl_type) t | Some b => tLetIn d.(decl_name) b d.(decl_type) t end.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
mkProd_or_LetIn
268
(l : context) (t : term) := List.fold_left (fun acc d => mkProd_or_LetIn d acc) l t.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
it_mkProd_or_LetIn
269
l l' t : it_mkProd_or_LetIn (l ++ l') t = it_mkProd_or_LetIn l' (it_mkProd_or_LetIn l t). Proof. induction l in l', t |- *; simpl; auto. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
it_mkProd_or_LetIn_app
270
(l : list term) (p : nat) (Γ0 : list context_decl) {struct Γ0} : list term := match Γ0 with | [] => l | {| decl_body := Some _ |} :: hyps => reln l (p + 1) hyps | {| decl_body := None |} :: hyps => reln (tRel p :: l) (p + 1) hyps end.
Fixpoint
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
reln
271
Γ k := reln [] k Γ.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
to_extended_list_k
272
Γ := to_extended_list_k Γ 0.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
to_extended_list
273
f ctx n acc : reln acc n (fold_context_k f ctx) = reln acc n ctx. Proof. induction ctx as [|[na [b|] ty] ctx] in n, acc |- *; simpl; auto; rewrite fold_context_k_snoc0 /=; apply IHctx. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
reln_fold
274
l p Γ : Forall (fun x => exists n, x = tRel n /\ p <= n /\ n < p + length Γ) l -> Forall (fun x => exists n, x = tRel n /\ p <= n /\ n < p + length Γ) (reln l p Γ). Proof. generalize (Nat.le_refl p). generalize p at 1 3 5. induction Γ in p, l |- *. simpl. auto. intros. destruct a. destruct decl_body. simpl. assert(p0 <= S p) by lia. specialize (IHΓ l (S p) p0 H1). rewrite <- Nat.add_succ_comm, Nat.add_1_r. simpl in *. rewrite <- Nat.add_succ_comm in H0. eauto. simpl in *. specialize (IHΓ (tRel p :: l) (S p) p0 ltac:(lia)). rewrite <- Nat.add_succ_comm, Nat.add_1_r. eapply IHΓ. simpl in *. rewrite <- Nat.add_succ_comm in H0. auto. simpl in *. constructor. exists p. intuition lia. auto. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
reln_list_lift_above
275
Γ k : Forall (fun x => exists n, x = tRel n /\ k <= n /\ n < k + length Γ) (to_extended_list_k Γ k). Proof. pose (reln_list_lift_above [] k Γ). unfold to_extended_list_k. forward f. constructor. apply f. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
to_extended_list_k_spec
276
Γ : Forall (fun x => exists n, x = tRel n /\ n < length Γ) (to_extended_list Γ). Proof. pose (reln_list_lift_above [] 0 Γ). unfold to_extended_list. forward f. constructor. eapply Forall_impl; eauto. intros. destruct H; eexists; intuition eauto. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
to_extended_list_lift_above
277
p (Γ : context) := match Γ with | [] => [] | {| decl_body := Some _ |} :: Γ => reln_alt (p + 1) Γ | {| decl_body := None |} :: Γ => tRel p :: reln_alt (p + 1) Γ end.
Fixpoint
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
reln_alt
278
l Γ k : reln l k Γ = List.rev (reln_alt k Γ) ++ l. Proof. induction Γ in l, k |- *; simpl; auto. destruct a as [na [body|] ty]; simpl. now rewrite IHΓ. now rewrite IHΓ -app_assoc. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
reln_alt_eq
279
d Γ k : to_extended_list_k (d :: Γ) k = match d.(decl_body) with | None => to_extended_list_k Γ (S k) ++ [tRel k] | Some b => to_extended_list_k Γ (S k) end. Proof. unfold to_extended_list_k. rewrite reln_alt_eq. simpl. destruct d as [na [body|] ty]. simpl. now rewrite reln_alt_eq Nat.add_1_r. simpl. rewrite reln_alt_eq. now rewrite <- app_assoc, !app_nil_r, Nat.add_1_r. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
to_extended_list_k_cons
280
(l : list one_inductive_body) := rev_map (fun ind => vass (mkBindAnn (nNamed ind.(ind_name)) (ind.(ind_relevance))) ind.(ind_type)) l.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
arities_context
281
l : #|arities_context l| = #|l|. Proof. unfold arities_context. now rewrite length_rev_map. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
arities_context_length
282
f m := match m with | Build_mutual_inductive_body finite ind_npars ind_pars ind_bodies ind_universes ind_variance => let arities := arities_context ind_bodies in let pars := fold_context_k f ind_pars in Build_mutual_inductive_body finite ind_npars pars (map (map_one_inductive_body (context_assumptions pars) (length arities) f) ind_bodies) ind_universes ind_variance end.
Definition
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
map_mutual_inductive_body
283
f npars_ass arities oib : ind_type (map_one_inductive_body npars_ass arities f oib) = f 0 (ind_type oib). Proof. destruct oib. reflexivity. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
ind_type_map
284
f npars_ass arities oib : ind_ctors (map_one_inductive_body npars_ass arities f oib) = map (map_constructor_body npars_ass arities f) (ind_ctors oib). Proof. destruct oib; simpl; reflexivity. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
ind_ctors_map
285
f m : ind_params (map_mutual_inductive_body f m) = fold_context_k f (ind_params m). Proof. destruct m; simpl; reflexivity. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
ind_pars_map
286
f npars_ass arities oib : ind_projs (map_one_inductive_body npars_ass arities f oib) = map (map_projection_body npars_ass f) (ind_projs oib). Proof. destruct oib; simpl. reflexivity. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
ind_projs_map
287
ind npars k := match k with | 0 => [] | S k' => (tProj (mkProjection ind npars k') (tRel 0)) :: projs ind npars k' end.
Fixpoint
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
projs
288
ind npars k : #|projs ind npars k| = k. Proof. induction k; simpl; auto. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
projs_length
289
Γ f : context_assumptions (fold_context_k f Γ) = context_assumptions Γ. Proof. rewrite fold_context_k_alt. unfold mapi. generalize 0 (Nat.pred #|Γ|). induction Γ as [|[na [body|] ty] tl]; cbn; intros; eauto. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
context_assumptions_fold
290
(f : nat -> term -> term): forall (Γ' Γ'' : context) (v : nat), v < length Γ' -> forall nth, nth_error Γ' v = Some nth -> nth_error (fold_context_k f Γ') v = Some (map_decl (f (length Γ' - S v)) nth). Proof. induction Γ'; intros. - easy. - simpl. destruct v; rewrite fold_context_k_snoc0. + simpl. repeat f_equal; try lia. simpl in *. congruence. + simpl. apply IHΓ'; simpl in *; (lia || congruence). Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
nth_error_fold_context_k
291
forall (Γ' : context) (v : nat) (f : nat -> term -> term), nth_error (fold_context_k f Γ') v = option_map (map_decl (f (length Γ' - S v))) (nth_error Γ' v). Proof. induction Γ'; intros. - simpl. unfold fold_context_k; simpl. now rewrite nth_error_nil. - simpl. destruct v; rewrite fold_context_k_snoc0. + simpl. repeat f_equal; try lia. + simpl. apply IHΓ'; simpl in *; (lia || congruence). Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
nth_error_fold_context_k_eq
292
{Γ Γ' v Γ''} (f : nat -> term -> term) : length Γ' <= v -> nth_error (Γ' ++ Γ) v = nth_error (fold_context_k f Γ' ++ Γ'' ++ Γ) (length Γ'' + v). Proof. intros Hv. rewrite -> !nth_error_app_ge, ?fold_context_k_length. f_equal. lia. rewrite fold_context_k_length. lia. rewrite fold_context_k_length. lia. auto. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
nth_error_ge
293
{Γ Γ' Γ'' v} (f : nat -> term -> term) : v < length Γ' -> nth_error (fold_context_k f Γ' ++ Γ'' ++ Γ) v = option_map (map_decl (f (length Γ' - S v))) (nth_error (Γ' ++ Γ) v). Proof. simpl. intros Hv. rewrite -> !nth_error_app_lt. rewrite nth_error_fold_context_k_eq. do 2 f_equal. lia. now rewrite fold_context_k_length. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
nth_error_lt
294
Γ : context_assumptions Γ <= #|Γ|. Proof. induction Γ; simpl; auto. destruct a as [? [?|] ?]; simpl; auto. lia. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
context_assumptions_length_bound
295
f Γ : context_assumptions (map_context f Γ) = context_assumptions Γ. Proof. induction Γ as [|[? [?|] ?] ?]; simpl; auto. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
context_assumptions_map
296
Γ Δ : context_assumptions (Γ ++ Δ) = context_assumptions Γ + context_assumptions Δ. Proof. induction Γ as [|[? [] ?] ?]; simpl; auto. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
context_assumptions_app
297
Γ : context_assumptions (List.rev Γ) = context_assumptions Γ. Proof using Type. induction Γ; simpl; auto. rewrite context_assumptions_app IHΓ /=. destruct (decl_body a); simpl; lia. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
context_assumptions_rev
298
f Γ : context_assumptions (mapi (fun i => map_decl (f i)) Γ) = context_assumptions Γ. Proof. rewrite /mapi; generalize 0. induction Γ; simpl; intros; eauto. destruct a as [? [b|] ?]; simpl; auto. Qed.
Lemma
common
From Coq Require Import ssreflect ssrbool ssrfun Morphisms Setoid. From MetaCoq.Utils Require Import utils. From MetaCoq.Common Require Import BasicAst Primitive Universes. From Equations.Prop Require Import Classes EqDecInstances. Module Type TermDecide (Import T : Term). Module TermDecideReflectInstances (Import T : Term) (Import TDec : TermDecide T). Import T. Module Type EnvironmentDecide (T : Term) (Import E : EnvironmentSig T). Module EnvironmentDecideReflectInstances (T : Term) (Import E : EnvironmentSig T) (Import EDec : EnvironmentDecide T E). Import T E.
common\theories\Environment.v
context_assumptions_mapi
299