]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_computation/cpxs.ma
advances on cpxs and cnx (cnxa removed) ,,,
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / cpxs.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/notation/relations/predtystar_5.ma".
16 include "basic_2/rt_transition/cpx.ma".
17
18 (* UNCOUNTED CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS ************)
19
20 definition cpxs: sh → relation4 genv lenv term term ≝
21                  λh,G. LTC … (cpx h G).
22
23 interpretation "uncounted context-sensitive parallel rt-computation (term)"
24    'PRedTyStar h G L T1 T2 = (cpxs h G L T1 T2).
25
26 (* Basic eliminators ********************************************************)
27
28 lemma cpxs_ind: ∀h,G,L,T1. ∀R:predicate term. R T1 →
29                 (∀T,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T → ⦃G, L⦄ ⊢ T ⬈[h] T2 → R T → R T2) →
30                 ∀T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → R T2.
31 #h #L #G #T1 #R #HT1 #IHT1 #T2 #HT12
32 @(TC_star_ind … HT1 IHT1 … HT12) //
33 qed-.
34
35 lemma cpxs_ind_dx: ∀h,G,L,T2. ∀R:predicate term. R T2 →
36                    (∀T1,T. ⦃G, L⦄ ⊢ T1 ⬈[h] T → ⦃G, L⦄ ⊢ T ⬈*[h] T2 → R T → R T1) →
37                    ∀T1. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 → R T1.
38 #h #G #L #T2 #R #HT2 #IHT2 #T1 #HT12
39 @(TC_star_ind_dx … HT2 IHT2 … HT12) //
40 qed-.
41
42 (* Basic properties *********************************************************)
43
44 lemma cpxs_refl: ∀h,G,L,T. ⦃G, L⦄ ⊢ T ⬈*[h] T.
45 /2 width=1 by inj/ qed.
46
47 lemma cpx_cpxs: ∀h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 → ⦃G, L⦄ ⊢ T1 ⬈*[h] T2.
48 /2 width=1 by inj/ qed.
49
50 lemma cpxs_strap1: ∀h,G,L,T1,T. ⦃G, L⦄ ⊢ T1 ⬈*[h] T →
51                    ∀T2. ⦃G, L⦄ ⊢ T ⬈[h] T2 → ⦃G, L⦄ ⊢ T1 ⬈*[h] T2.
52 normalize /2 width=3 by step/ qed-.
53
54 lemma cpxs_strap2: ∀h,G,L,T1,T. ⦃G, L⦄ ⊢ T1 ⬈[h] T →
55                    ∀T2. ⦃G, L⦄ ⊢ T ⬈*[h] T2 → ⦃G, L⦄ ⊢ T1 ⬈*[h] T2.
56 normalize /2 width=3 by TC_strap/ qed-.
57
58 (* Basic_2A1: was just: cpxs_sort *)
59 lemma cpxs_sort: ∀h,G,L,s,n. ⦃G, L⦄ ⊢ ⋆s ⬈*[h] ⋆((next h)^n s).
60 #h #G #L #s #n elim n -n /2 width=1 by cpx_cpxs/
61 #n >iter_S /2 width=3 by cpxs_strap1/
62 qed.
63
64 lemma cpxs_bind_dx: ∀h,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 →
65                     ∀I,T1,T2. ⦃G, L. ⓑ{I}V1⦄ ⊢ T1 ⬈*[h] T2 →
66                     ∀p. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈*[h] ⓑ{p,I}V2.T2.
67 #h #G #L #V1 #V2 #HV12 #I #T1 #T2 #HT12 #a @(cpxs_ind_dx … HT12) -T1
68 /3 width=3 by cpxs_strap2, cpx_cpxs, cpx_pair_sn, cpx_bind/
69 qed.
70
71 lemma cpxs_flat_dx: ∀h,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈[h] V2 →
72                     ∀T1,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 →
73                     ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬈*[h] ⓕ{I}V2.T2.
74 #h #G #L #V1 #V2 #HV12 #T1 #T2 #HT12 @(cpxs_ind … HT12) -T2
75 /3 width=5 by cpxs_strap1, cpx_cpxs, cpx_pair_sn, cpx_flat/
76 qed.
77
78 lemma cpxs_flat_sn: ∀h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈[h] T2 →
79                     ∀V1,V2. ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 →
80                     ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬈*[h] ⓕ{I}V2.T2.
81 #h #G #L #T1 #T2 #HT12 #V1 #V2 #H @(cpxs_ind … H) -V2
82 /3 width=5 by cpxs_strap1, cpx_cpxs, cpx_pair_sn, cpx_flat/
83 qed.
84
85 lemma cpxs_pair_sn: ∀h,I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 →
86                     ∀T. ⦃G, L⦄ ⊢ ②{I}V1.T ⬈*[h] ②{I}V2.T.
87 #h #I #G #L #V1 #V2 #H @(cpxs_ind … H) -V2
88 /3 width=3 by cpxs_strap1, cpx_pair_sn/
89 qed.
90
91 lemma cpxs_zeta: ∀h,G,L,V,T1,T,T2. ⬆*[1] T2 ≡ T →
92                  ⦃G, L.ⓓV⦄ ⊢ T1 ⬈*[h] T → ⦃G, L⦄ ⊢ +ⓓV.T1 ⬈*[h] T2.
93 #h #G #L #V #T1 #T #T2 #HT2 #H @(cpxs_ind_dx … H) -T1
94 /3 width=3 by cpxs_strap2, cpx_cpxs, cpx_bind, cpx_zeta/
95 qed.
96
97 lemma cpxs_eps: ∀h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 →
98                 ∀V. ⦃G, L⦄ ⊢ ⓝV.T1 ⬈*[h] T2.
99 #h #G #L #T1 #T2 #H @(cpxs_ind … H) -T2
100 /3 width=3 by cpxs_strap1, cpx_cpxs, cpx_eps/
101 qed.
102
103 (* Basic_2A1: was: cpxs_ct *)
104 lemma cpxs_ee: ∀h,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 →
105                ∀T. ⦃G, L⦄ ⊢ ⓝV1.T ⬈*[h] V2.
106 #h #G #L #V1 #V2 #H @(cpxs_ind … H) -V2
107 /3 width=3 by cpxs_strap1, cpx_cpxs, cpx_ee/
108 qed.
109
110 lemma cpxs_beta_dx: ∀h,p,G,L,V1,V2,W1,W2,T1,T2.
111                     ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G, L⦄ ⊢ W1 ⬈[h] W2 →
112                     ⦃G, L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ⬈*[h] ⓓ{p}ⓝW2.V2.T2.
113 #h #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 * -T2
114 /4 width=7 by cpx_cpxs, cpxs_strap1, cpxs_bind_dx, cpxs_flat_dx, cpx_beta/
115 qed.
116
117 lemma cpxs_theta_dx: ∀h,p,G,L,V1,V,V2,W1,W2,T1,T2.
118                      ⦃G, L⦄ ⊢ V1 ⬈[h] V → ⬆*[1] V ≡ V2 → ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈*[h] T2 →
119                      ⦃G, L⦄ ⊢ W1 ⬈[h] W2 → ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ⬈*[h] ⓓ{p}W2.ⓐV2.T2.
120 #h #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 * -T2 
121 /4 width=9 by cpx_cpxs, cpxs_strap1, cpxs_bind_dx, cpxs_flat_dx, cpx_theta/
122 qed.
123
124 (* Basic inversion lemmas ***************************************************)
125
126 (* Basic_2A1: wa just: cpxs_inv_sort1 *)
127 lemma cpxs_inv_sort1: ∀h,G,L,X2,s. ⦃G, L⦄ ⊢ ⋆s ⬈*[h] X2 →
128                       ∃n. X2 = ⋆((next h)^n s).
129 #h #G #L #X2 #s #H @(cpxs_ind … H) -X2 /2 width=2 by ex_intro/
130 #X #X2 #_ #HX2 * #n #H destruct
131 elim (cpx_inv_sort1 … HX2) -HX2 #H destruct /2 width=2 by ex_intro/
132 @(ex_intro … (⫯n)) >iter_S //
133 qed-.
134
135 lemma cpxs_inv_cast1: ∀h,G,L,W1,T1,U2. ⦃G, L⦄ ⊢ ⓝW1.T1 ⬈*[h] U2 →
136                       ∨∨ ∃∃W2,T2. ⦃G, L⦄ ⊢ W1 ⬈*[h] W2 & ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 & U2 = ⓝW2.T2
137                        | ⦃G, L⦄ ⊢ T1 ⬈*[h] U2
138                        | ⦃G, L⦄ ⊢ W1 ⬈*[h] U2.
139 #h #G #L #W1 #T1 #U2 #H @(cpxs_ind … H) -U2 /3 width=5 by or3_intro0, ex3_2_intro/
140 #U2 #U #_ #HU2 * /3 width=3 by cpxs_strap1, or3_intro1, or3_intro2/ *
141 #W #T #HW1 #HT1 #H destruct
142 elim (cpx_inv_cast1 … HU2) -HU2 /3 width=3 by cpxs_strap1, or3_intro1, or3_intro2/ *
143 #W2 #T2 #HW2 #HT2 #H destruct
144 lapply (cpxs_strap1 … HW1 … HW2) -W
145 lapply (cpxs_strap1 … HT1 … HT2) -T /3 width=5 by or3_intro0, ex3_2_intro/
146 qed-.
147
148 (* Basic_2A1: removed theorems 1: cpxs_neq_inv_step_sn *)