2 ||M|| This file is part of HELM, an Hypertextual, Electronic
3 ||A|| Library of Mathematics, developed at the Computer Science
4 ||T|| Department of the University of Bologna, Italy.
7 ||A|| This file is distributed under the terms of the
8 \ / GNU General Public License Version 2
10 V_______________________________________________________________ *)
12 include "lambda-delta/syntax/lenv.ma".
13 include "lambda-delta/substitution/lift_defs.ma".
15 (* TELESCOPIC SUBSTITUTION **************************************************)
17 inductive subst: lenv → term → nat → nat → term → Prop ≝
18 | subst_sort : ∀L,k,d,e. subst L (⋆k) d e (⋆k)
19 | subst_lref_lt: ∀L,i,d,e. i < d → subst L (#i) d e (#i)
20 | subst_lref_O : ∀L,V1,V2,e. subst L V1 0 e V2 →
21 subst (L. 𝕓{Abbr} V1) #0 0 (e + 1) V2
22 | subst_lref_S : ∀L,I,V,i,T1,T2,d,e.
23 d ≤ i → i < d + e → subst L #i d e T1 → ↑[d,1] T1 ≡ T2 →
24 subst (L. 𝕓{I} V) #(i + 1) (d + 1) e T2
25 | subst_lref_ge: ∀L,i,d,e. d + e ≤ i → subst L (#i) d e (#(i - e))
26 | subst_bind : ∀L,I,V1,V2,T1,T2,d,e.
27 subst L V1 d e V2 → subst (L. 𝕓{I} V1) T1 (d + 1) e T2 →
28 subst L (𝕓{I} V1. T1) d e (𝕓{I} V2. T2)
29 | subst_flat : ∀L,I,V1,V2,T1,T2,d,e.
30 subst L V1 d e V2 → subst L T1 d e T2 →
31 subst L (𝕗{I} V1. T1) d e (𝕗{I} V2. T2)
34 interpretation "telescopic substritution" 'RSubst L T1 d e T2 = (subst L T1 d e T2).
36 (* The basic properties *****************************************************)
38 lemma subst_lift_inv: ∀d,e,T1,T2. ↑[d,e] T1 ≡ T2 → ∀L. L ⊢ ↓[d,e] T2 ≡ T1.
39 #d #e #T1 #T2 #H elim H -H d e T1 T2 /2/
40 #i #d #e #Hdi #L >(minus_plus_m_m i e) in ⊢ (? ? ? ? ? %) /3/ (**) (* use \ldots *)