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