]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/computation/csn_lift.ma
4fd784d75217aa0f4d7748797afc31094e6b231c
[helm.git] / matita / matita / contribs / lambda_delta / basic_2 / computation / csn_lift.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "basic_2/reducibility/cnf_lift.ma".
16 include "basic_2/computation/acp.ma".
17 include "basic_2/computation/csn.ma".
18
19 (* CONTEXT-SENSITIVE STRONGLY NORMALIZING TERMS *****************************)
20
21 (* Relocation properties ****************************************************)
22
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_lift1 … HL21 … HT12 … HLT2) -HLT2 #T0 #HT0 #HLT10
29 @(IHT1 … HLT10) // -L1 -L2 #H destruct
30 >(lift_mono … HT0 … HT12) in HT2; -T1 /2 width=1/
31 qed.
32
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; -T1 /2 width=1/
42 qed.
43
44 (* Advanced properties ******************************************************)
45
46 (* Basic_1: was: sn3_abbr *)
47 lemma csn_lref_abbr: ∀L,K,V,i. ⇩[0, i] L ≡ K. ⓓV → K ⊢ ⬊* V → L ⊢ ⬊* #i.
48 #L #K #V #i #HLK #HV
49 @csn_intro #X #H #Hi
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 //
58 ]
59 qed.
60
61 lemma csn_abst: ∀a,L,W. L ⊢ ⬊* W → ∀I,V,T. L. ⓑ{I} V ⊢ ⬊* T → L ⊢ ⬊* ⓛ{a}W. T.
62 #a #L #W #HW elim HW -W #W #_ #IHW #I #V #T #HT @(csn_ind … HT) -T #T #HT #IHT
63 @csn_intro #X #H1 #H2
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
67 [ /3 width=5/
68 | -HLW0 * #H destruct /3 width=1/
69 ]
70 qed.
71
72 lemma csn_appl_simple: ∀L,V. L ⊢ ⬊* V → ∀T1.
73                        (∀T2. L ⊢ T1 ➡ T2 → (T1 = T2 → ⊥) → L ⊢ ⬊* ⓐV. T2) →
74                        𝐒⦃T1⦄ → L ⊢ ⬊* ⓐV. T1.
75 #L #V #H @(csn_ind … H) -V #V #_ #IHV #T1 #IHT1 #HT1
76 @csn_intro #X #H1 #H2
77 elim (cpr_inv_appl1_simple … H1 ?) // -H1
78 #V0 #T0 #HLV0 #HLT10 #H destruct
79 elim (eq_false_inv_tpair_dx … H2) -H2
80 [ -IHV -HT1 #HT10
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
85   #T2 #HLT02 #HT02
86   @(csn_cpr_trans … (ⓐV.T2)) /2 width=1/ -HLV0
87   @IHT1 -IHT1 // -HLT02 /2 width=1/
88 ]
89 qed.
90
91 (* Advanced inversion lemmas ************************************************)
92
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.
95 #L #K #V #i #HLK #Hi
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/
100 qed-.
101
102 (* Main properties **********************************************************)
103
104 theorem csn_acp: acp cpr (eq …) (csn …).
105 @mk_acp
106 [ /2 width=1/
107 | /2 width=3/
108 | /2 width=5/
109 | @cnf_lift
110 ]
111 qed.