1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/relocation/lsubr.ma".
17 (* LOCAL ENVIRONMENT REFINEMENT FOR SUBSTITUTION ****************************)
19 (* bottom element of the refinement *)
20 definition lbotr: nat → nat → predicate lenv ≝
21 λd,e. NF_sn … (lsubr d e) (lsubr d e …).
24 "local environment full refinement (substitution)"
25 'SubEqBottom d e L = (lbotr d e L).
27 (* Basic properties *********************************************************)
29 lemma lbotr_atom: ∀d,e. ⊒[d, e] ⋆.
31 elim (lsubr_inv_atom2 … H) -H
33 | * #H1 #H2 destruct //
37 lemma lbotr_OO: ∀L. ⊒[0, 0] L.
40 lemma lbotr_abbr: ∀L,V,e. ⊒[0, e] L → ⊒[0, e + 1] L.ⓓV.
42 elim (lsubr_inv_abbr2 … H ?) -H // <minus_plus_m_m #X #HLX #H destruct
43 lapply (HL … HLX) -HL -HLX /2 width=1/
46 lemma lbotr_abbr_O: ∀L,V. ⊒[0,1] L.ⓓV.
51 lemma lbotr_skip: ∀I,L,V,d,e. ⊒[d, e] L → ⊒[d + 1, e] L.ⓑ{I}V.
52 #I #L #V #d #e #HL #K #H
53 elim (lsubr_inv_skip2 … H ?) -H // <minus_plus_m_m #J #X #W #HLX #H destruct
54 lapply (HL … HLX) -HL -HLX /2 width=1/
57 (* Basic inversion lemmas ***************************************************)
59 lemma lbotr_inv_bind: ∀I,L,V,e. ⊒[0, e] L.ⓑ{I}V → 0 < e →
60 ⊒[0, e - 1] L ∧ I = Abbr.
62 lapply (HL (L.ⓓV) ?) /2 width=1/ #H
63 elim (lsubr_inv_abbr2 … H ?) -H // #K #_ #H destruct
65 lapply (HL (L.ⓓV) ?) -HL /2 width=1/ -HKL #H
66 elim (lsubr_inv_abbr2 … H ?) -H // -He #X #HLX #H destruct //
69 lemma lbotr_inv_skip: ∀I,L,V,d,e. ⊒[d, e] L.ⓑ{I}V → 0 < d → ⊒[d - 1, e] L.
70 #I #L #V #d #e #HL #Hd #K #HLK
71 lapply (HL (K.ⓑ{I}V) ?) -HL /2 width=1/ -HLK #H
72 elim (lsubr_inv_skip2 … H ?) -H // -Hd #J #X #W #HKX #H destruct //