-
De Bruijn lift on variable indices
lift n k tm
-
lift on all types and bodies of a context :
lift_context n k Γ
-
We go from
Σ ; Γ ,,, [] ,,, Γ'' ,,, Γ''' |- tm
toΣ ; Γ ,,, Γ' ,,, lift_context #|Γ'| #|Γ'''| Γ'' ,,, lift_context #|Γ'| 0 Γ''' |- lift #|Γ'| #|Γ'' ,,, Γ'''| tm
-
Substitution of variables
subst s k tm
-
subst on all types and bodies of a context :
subst_context s k Γ
-
(subst on all types and bodies of a telescope or reverse context :
subst_telescope s k Γ
) -
Assuming
Γ |- s : Γ'
, we go fromΣ ; Γ ,,, Γ' ,,, Γ'' ,,, Γ''' |- tm
toΣ ; Γ ,,, Γ'[:= s] ,,, Γ'' ,,, Γ''' |- tm
toΣ ; Γ ,,, subst_context s #|Γ'''| Γ' ,,, subst_context s 0 Γ''' |- subst s #|Γ'' ,,, Γ'''| tm
-
Substitution of universe variables
tm@[u]
orsubst_instance_constr u tm
-
Substitution of universe variables in all types and bodies of a context
Γ@[u]
orsubst_instance_context u Γ
- Whether the highest variable index is less than
k
closedn k tm
- Whether the highest universe variable index is less than
k
closedu k tm
- Whether variables between k and n are not present in term (e.g. forall vs arrow)
noccur_between k n tm
- Number of lambdas (as opposed to lets) in the context
- Is there only lambdas in this context
smash_context Δ Γ
: TransformΓ ,,, Δ
intoΓΔ
where we successively expand the lets from Γ in Δ and append the lambdas- Single argument
smash_context Γ
issmash_context [] Γ
: we expand the lets in the rest of the context only
The following 3 give Γ |- s : Δ
: terms s
in context Γ
(plus previous s
) can replace context Δ
-
untyped_subslet Γ s Δ
:s
has any term when no def, the exact body of the def substituted with the previous entries when def -
subslet Σ Γ s Δ
:untyped_subslet
but the terms ins
have the type of the [substituted with the previous entries] context_decl -
subs Σ Γ s Δ
:subslet
but there is no def inΔ
-
ctx_inst Σ Γ s Δ
: TelescopeΔ
can be replaced by the terms ins
and the defs inΔ
;s
has a term with the type of the [substituted with the previous entries] context_decl when no def, no entry when def
-
extended_subst Γ n
:Γ ,,, smash_context Γ' ,,, Γ'' |- extended_subst Γ' #|Γ''| : Γ'
extended_subst Γ n
:Γ ,,, smash_context Γ' ,,, Γ'' |- extended_subst Γ' #|Γ''| : lift_context #|smash_context Γ'| #|Γ''| Γ'
is a corollary when Γ'' = []
-
expand_lets_k Γ k t
:- from
Γ ,,, Γ' ,,, Γ'' |- tm
, inserting smashedΓ'
usinglift #|smash_context Γ'| #|Γ' ,,, Γ''| tm
, reaches Γ ,,, smash_context Γ' ,,, lift_context #|smash_context Γ'| #|Γ''| Γ' ,,, lift_context #|smash_context Γ'| 0 Γ'' |- lift #|smash_context Γ'| #|Γ' ,,, Γ''| tm
, from which usingsubst (extended_subst Γ' 0) #|Γ''|
reachesΓ ,,, smash_context Γ' ,,, expand_lets_k_ctx Γ' #|[]| Γ'' |- expand_lets_k Γ' #|Γ''| tm
- from
-
to_extended_list_k Γ k
: under contextΓ ,,, Γ'
, pointers to Γ in order