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/reduction/cpr_lift.ma".
16 include "basic_2/reduction/cnr.ma".
18 (* CONTEXT-SENSITIVE NORMAL TERMS *******************************************)
20 (* Advanced properties ******************************************************)
22 (* Basic_1: was only: nf2_csort_lref *)
23 lemma cnr_lref_atom: ∀G,L,i. ⇩[0, i] L ≡ ⋆ → ⦃G, L⦄ ⊢ 𝐍⦃#i⦄.
25 elim (cpr_inv_lref1 … H) -H // *
27 lapply (ldrop_mono … HL … HLK) -L #H destruct
30 (* Basic_1: was: nf2_lref_abst *)
31 lemma cnr_lref_abst: ∀G,L,K,V,i. ⇩[0, i] L ≡ K. ⓛV → ⦃G, L⦄ ⊢ 𝐍⦃#i⦄.
32 #G #L #K #V #i #HLK #X #H
33 elim (cpr_inv_lref1 … H) -H // *
34 #K0 #V1 #V2 #HLK0 #_ #_
35 lapply (ldrop_mono … HLK … HLK0) -L #H destruct
38 (* Relocation properties ****************************************************)
40 (* Basic_1: was: nf2_lift *)
41 lemma cnr_lift: ∀G,L0,L,T,T0,d,e. ⦃G, L⦄ ⊢ 𝐍⦃T⦄ →
42 ⇩[d, e] L0 ≡ L → ⇧[d, e] T ≡ T0 → ⦃G, L0⦄ ⊢ 𝐍⦃T0⦄.
43 #G #L0 #L #T #T0 #d #e #HLT #HL0 #HT0 #X #H
44 elim (cpr_inv_lift1 … H … HL0 … HT0) -L0 #T1 #HT10 #HT1
45 <(HLT … HT1) in HT0; -L #HT0
46 >(lift_mono … HT10 … HT0) -T1 -X //
49 (* Note: this was missing in basic_1 *)
50 lemma cnr_inv_lift: ∀G,L0,L,T,T0,d,e. ⦃G, L0⦄ ⊢ 𝐍⦃T0⦄ →
51 ⇩[d, e] L0 ≡ L → ⇧[d, e] T ≡ T0 → ⦃G, L⦄ ⊢ 𝐍⦃T⦄.
52 #G #L0 #L #T #T0 #d #e #HLT0 #HL0 #HT0 #X #H
53 elim (lift_total X d e) #X0 #HX0
54 lapply (cpr_lift … H … HL0 … HT0 … HX0) -L #HTX0
55 >(HLT0 … HTX0) in HX0; -L0 -X0 #H
56 >(lift_inj … H … HT0) -T0 -X -d -e //