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 (* Basic_1: was: sn3_abbr *)
47 lemma csn_lref_abbr: ∀L,K,V,i. ⇩[0, i] L ≡ K. ⓓV → K ⊢ ⬇* V → L ⊢ ⬇* #i.
50 elim (cpr_inv_lref1 … H) -H
51 [ #H destruct elim (Hi ?) //
52 | -Hi * #K0 #V0 #V1 #HLK0 #HV01 #HV1 #_
53 lapply (ldrop_mono … HLK0 … HLK) -HLK #H destruct
54 lapply (ldrop_fwd_ldrop2 … HLK0) -HLK0 #HLK
55 @(csn_lift … HLK HV1) -HLK -HV1
56 @(csn_cpr_trans … HV) -HV
57 @(cpr_intro … HV01) -HV01 //
61 lemma csn_abst: ∀L,W. L ⊢ ⬇* W → ∀I,V,T. L. ⓑ{I} V ⊢ ⬇* T → L ⊢ ⬇* ⓛW. T.
62 #L #W #HW elim HW -W #W #_ #IHW #I #V #T #HT @(csn_ind … HT) -T #T #HT #IHT
64 elim (cpr_inv_abst1 … H1 I V) -H1
65 #W0 #T0 #HLW0 #HLT0 #H destruct
66 elim (eq_false_inv_tpair_sn … H2) -H2
68 | -HLW0 * #H destruct /3 width=1/
72 lemma csn_appl_simple: ∀L,V. L ⊢ ⬇* V → ∀T1.
73 (∀T2. L ⊢ T1 ➡ T2 → (T1 = T2 → False) → L ⊢ ⬇* ⓐV. T2) →
74 𝐒[T1] → L ⊢ ⬇* ⓐV. T1.
75 #L #V #H @(csn_ind … H) -V #V #_ #IHV #T1 #IHT1 #HT1
77 elim (cpr_inv_appl1_simple … H1 ?) // -H1
78 #V0 #T0 #HLV0 #HLT10 #H destruct
79 elim (eq_false_inv_tpair_dx … H2) -H2
81 @(csn_cpr_trans … (ⓐV.T0)) /2 width=1/ -HLV0
82 @IHT1 -IHT1 // /2 width=1/
83 | -HLT10 * #H #HV0 destruct
84 @IHV -IHV // -HT1 /2 width=1/ -HV0
86 @(csn_cpr_trans … (ⓐV.T2)) /2 width=1/ -HLV0
87 @IHT1 -IHT1 // -HLT02 /2 width=1/
91 (* Advanced inversion lemmas ************************************************)
93 (* Basic_1: was: sn3_gen_def *)
94 lemma csn_inv_lref_abbr: ∀L,K,V,i. ⇩[0, i] L ≡ K. ⓓV → L ⊢ ⬇* #i → K ⊢ ⬇* V.
96 elim (lift_total V 0 (i+1)) #V0 #HV0
97 lapply (ldrop_fwd_ldrop2 … HLK) #H0LK
98 @(csn_inv_lift … H0LK … HV0) -H0LK
99 @(csn_cpr_trans … Hi) -Hi /2 width=6/
102 (* Main properties **********************************************************)
104 theorem csn_acp: acp cpr (eq …) (csn …).