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/reducibility/cnf_lift.ma".
16 include "Basic_2/computation/acp.ma".
17 include "Basic_2/computation/csn.ma".
19 (* CONTEXT-SENSITIVE STRONGLY NORMALIZING TERMS *****************************)
21 (* Relocation properties ****************************************************)
23 (* Basic_1: was: sn3_lift *)
24 lemma csn_lift: ∀L2,L1,T1,d,e. L1 ⊢ ⬇* T1 →
25 ∀T2. ⇩[d, e] L2 ≡ L1 → ⇧[d, e] T1 ≡ T2 → L2 ⊢ ⬇* T2.
26 #L2 #L1 #T1 #d #e #H elim H -T1 #T1 #_ #IHT1 #T2 #HL21 #HT12
27 @csn_intro #T #HLT2 #HT2
28 elim (cpr_inv_lift … HL21 … HT12 … HLT2) -HLT2 #T0 #HT0 #HLT10
29 @(IHT1 … HLT10) // -L1 -L2 #H destruct
30 >(lift_mono … HT0 … HT12) in HT2; -T0 /2 width=1/
33 (* Basic_1: was: sn3_gen_lift *)
34 lemma csn_inv_lift: ∀L2,L1,T1,d,e. L1 ⊢ ⬇* T1 →
35 ∀T2. ⇩[d, e] L1 ≡ L2 → ⇧[d, e] T2 ≡ T1 → L2 ⊢ ⬇* T2.
36 #L2 #L1 #T1 #d #e #H elim H -T1 #T1 #_ #IHT1 #T2 #HL12 #HT21
37 @csn_intro #T #HLT2 #HT2
38 elim (lift_total T d e) #T0 #HT0
39 lapply (cpr_lift … HL12 … HT21 … HT0 HLT2) -HLT2 #HLT10
40 @(IHT1 … HLT10) // -L1 -L2 #H destruct
41 >(lift_inj … HT0 … HT21) in HT2; -T0 /2 width=1/
44 (* Advanced properties ******************************************************)
46 lemma csn_acp: acp cpr (eq …) (csn …).
55 (* Basic_1: was: sn3_abbr *)
56 lemma csn_lref_abbr: ∀L,K,V,i. ⇩[0, i] L ≡ K. ⓓV → K ⊢ ⬇* V → L ⊢ ⬇* #i.
59 elim (cpr_inv_lref1 … H) -H
60 [ #H destruct elim (Hi ?) //
61 | -Hi * #K0 #V0 #V1 #HLK0 #HV01 #HV1 #_
62 lapply (ldrop_mono … HLK0 … HLK) -HLK #H destruct
63 lapply (ldrop_fwd_ldrop2 … HLK0) -HLK0 #HLK
64 @(csn_lift … HLK HV1) -HLK -HV1
65 @(csn_cpr_trans … HV) -HV
66 @(cpr_intro … HV01) -HV01 //
70 lemma csn_abst: ∀L,W. L ⊢ ⬇* W → ∀I,V,T. L. ⓑ{I} V ⊢ ⬇* T → L ⊢ ⬇* ⓛW. T.
71 #L #W #HW elim HW -W #W #_ #IHW #I #V #T #HT @(csn_ind … HT) -T #T #HT #IHT
73 elim (cpr_inv_abst1 … H1 I V) -H1
74 #W0 #T0 #HLW0 #HLT0 #H destruct
75 elim (eq_false_inv_tpair_sn … H2) -H2
77 | -HLW0 * #H destruct /3 width=1/
81 (* Basic_1: was only: sn3_appl_appl *)
82 lemma csn_appl_simple: ∀L,V. L ⊢ ⬇* V → ∀T1.
83 (∀T2. L ⊢ T1 ➡ T2 → (T1 = T2 → False) → L ⊢ ⬇* ⓐV. T2) →
84 𝐒[T1] → L ⊢ ⬇* ⓐV. T1.
85 #L #V #H @(csn_ind … H) -V #V #_ #IHV #T1 #IHT1 #HT1
87 elim (cpr_inv_appl1_simple … H1 ?) // -H1
88 #V0 #T0 #HLV0 #HLT10 #H destruct
89 elim (eq_false_inv_tpair_dx … H2) -H2
91 @(csn_cpr_trans … (ⓐV.T0)) /2 width=1/ -HLV0
92 @IHT1 -IHT1 // /2 width=1/
93 | -HLT10 * #H #HV0 destruct
94 @IHV -IHV // -HT1 /2 width=1/ -HV0
96 @(csn_cpr_trans … (ⓐV.T2)) /2 width=1/ -HLV0
97 @IHT1 -IHT1 // -HLT02 /2 width=1/
101 (* Basic_1: was only: sn3_appl_appls *)
102 lemma csn_appl_appls_simple: ∀L,V. L ⊢ ⬇* V → ∀Vs,T1.
103 (∀T2. L ⊢ ⒶVs.T1 ➡ T2 → (ⒶVs.T1 = T2 → False) → L ⊢ ⬇* ⓐV. T2) →
104 𝐒[T1] → L ⊢ ⬇* ⓐV. ⒶVs. T1.
105 #L #V #HV #Vs elim Vs -Vs
106 [ @csn_appl_simple //
107 | #V0 #Vs #_ #T1 #HT1 #_
108 @csn_appl_simple // -HV @HT1