]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/computation/lpxs_cpxs.ma
update in lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / computation / lpxs_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_2A/computation/cpxs_cpxs.ma".
16 include "basic_2A/computation/lpxs.ma".
17
18 (* SN EXTENDED PARALLEL COMPUTATION ON LOCAL ENVIRONMENTS *******************)
19
20 (* Advanced properties ******************************************************)
21
22 lemma lpxs_pair: ∀h,g,I,G,L1,L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 →
23                  ∀V1,V2. ⦃G, L1⦄ ⊢ V1 ➡*[h, g] V2 →
24                  ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡*[h, g] L2.ⓑ{I}V2.
25 /2 width=1 by TC_lpx_sn_pair/ qed.
26
27 (* Advanced inversion lemmas ************************************************)
28
29 lemma lpxs_inv_pair1: ∀h,g,I,G,K1,L2,V1. ⦃G, K1.ⓑ{I}V1⦄ ⊢ ➡*[h, g] L2 →
30                       ∃∃K2,V2. ⦃G, K1⦄ ⊢ ➡*[h, g] K2 & ⦃G, K1⦄ ⊢ V1 ➡*[h, g] V2 & L2 = K2.ⓑ{I}V2.
31 /3 width=3 by TC_lpx_sn_inv_pair1, lpx_cpxs_trans/ qed-.
32
33 lemma lpxs_inv_pair2: ∀h,g,I,G,L1,K2,V2. ⦃G, L1⦄ ⊢ ➡*[h, g] K2.ⓑ{I}V2 →
34                       ∃∃K1,V1. ⦃G, K1⦄ ⊢ ➡*[h, g] K2 & ⦃G, K1⦄ ⊢ V1 ➡*[h, g] V2 & L1 = K1.ⓑ{I}V1.
35 /3 width=3 by TC_lpx_sn_inv_pair2, lpx_cpxs_trans/ qed-.
36
37 (* Advanced eliminators *****************************************************)
38
39 lemma lpxs_ind_alt: ∀h,g,G. ∀R:relation lenv.
40                     R (⋆) (⋆) → (
41                        ∀I,K1,K2,V1,V2.
42                        ⦃G, K1⦄ ⊢ ➡*[h, g] K2 → ⦃G, K1⦄ ⊢ V1 ➡*[h, g] V2 →
43                        R K1 K2 → R (K1.ⓑ{I}V1) (K2.ⓑ{I}V2)
44                     ) →
45                     ∀L1,L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 → R L1 L2.
46 /3 width=4 by TC_lpx_sn_ind, lpx_cpxs_trans/ qed-.
47
48 (* Properties on context-sensitive extended parallel computation for terms **)
49
50 lemma lpxs_cpx_trans: ∀h,g,G. s_r_transitive … (cpx h g G) (λ_.lpxs h g G).
51 /3 width=5 by s_r_trans_LTC2, lpx_cpxs_trans/ qed-.
52
53 (* Note: alternative proof: /3 width=5 by s_r_trans_TC1, lpxs_cpx_trans/ *)
54 lemma lpxs_cpxs_trans: ∀h,g,G. s_rs_transitive … (cpx h g G) (λ_.lpxs h g G).
55 #h #g #G @s_r_to_s_rs_trans @s_r_trans_LTC2
56 @s_rs_trans_TC1 /2 width=3 by lpx_cpxs_trans/ (**) (* full auto too slow *)
57 qed-.
58
59 lemma cpxs_bind2: ∀h,g,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 →
60                   ∀I,T1,T2. ⦃G, L.ⓑ{I}V2⦄ ⊢ T1 ➡*[h, g] T2 →
61                   ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ➡*[h, g] ⓑ{a,I}V2.T2.
62 /4 width=5 by lpxs_cpxs_trans, lpxs_pair, cpxs_bind/ qed.
63
64 (* Inversion lemmas on context-sensitive ext parallel computation for terms *)
65
66 lemma cpxs_inv_abst1: ∀h,g,a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{a}V1.T1 ➡*[h, g] U2 →
67                       ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 & ⦃G, L.ⓛV1⦄ ⊢ T1 ➡*[h, g] T2 &
68                                U2 = ⓛ{a}V2.T2.
69 #h #g #a #G #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 /2 width=5 by ex3_2_intro/
70 #U0 #U2 #_ #HU02 * #V0 #T0 #HV10 #HT10 #H destruct
71 elim (cpx_inv_abst1 … HU02) -HU02 #V2 #T2 #HV02 #HT02 #H destruct
72 lapply (lpxs_cpx_trans … HT02 (L.ⓛV1) ?)
73 /3 width=5 by lpxs_pair, cpxs_trans, cpxs_strap1, ex3_2_intro/
74 qed-.
75
76 lemma cpxs_inv_abbr1: ∀h,g,a,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{a}V1.T1 ➡*[h, g] U2 → (
77                       ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡*[h, g] V2 & ⦃G, L.ⓓV1⦄ ⊢ T1 ➡*[h, g] T2 &
78                                U2 = ⓓ{a}V2.T2
79                       ) ∨
80                       ∃∃T2. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡*[h, g] T2 & ⬆[0, 1] U2 ≡ T2 & a = true.
81 #h #g #a #G #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 /3 width=5 by ex3_2_intro, or_introl/
82 #U0 #U2 #_ #HU02 * *
83 [ #V0 #T0 #HV10 #HT10 #H destruct
84   elim (cpx_inv_abbr1 … HU02) -HU02 *
85   [ #V2 #T2 #HV02 #HT02 #H destruct
86     lapply (lpxs_cpx_trans … HT02 (L.ⓓV1) ?)
87     /4 width=5 by lpxs_pair, cpxs_trans, cpxs_strap1, ex3_2_intro, or_introl/
88   | #T2 #HT02 #HUT2
89     lapply (lpxs_cpx_trans … HT02 (L.ⓓV1) ?) -HT02
90     /4 width=3 by lpxs_pair, cpxs_trans, ex3_intro, or_intror/
91   ]
92 | #U1 #HTU1 #HU01
93   elim (lift_total U2 0 1) #U #HU2
94   /6 width=12 by cpxs_strap1, cpx_lift, drop_drop, ex3_intro, or_intror/
95 ]
96 qed-.
97
98 (* More advanced properties *************************************************)
99
100 lemma lpxs_pair2: ∀h,g,I,G,L1,L2. ⦃G, L1⦄ ⊢ ➡*[h, g] L2 →
101                   ∀V1,V2. ⦃G, L2⦄ ⊢ V1 ➡*[h, g] V2 → ⦃G, L1.ⓑ{I}V1⦄ ⊢ ➡*[h, g] L2.ⓑ{I}V2.
102 /3 width=3 by lpxs_pair, lpxs_cpxs_trans/ qed.
103
104 (* Properties on supclosure *************************************************)
105
106 lemma lpx_fqup_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ →
107                       ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g] L1 →
108                       ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊐+ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g] L2.
109 #h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2
110 [ #G2 #L2 #T2 #H12 #K1 #HKL1 elim (lpx_fqu_trans … H12 … HKL1) -L1
111   /3 width=5 by cpx_cpxs, fqu_fqup, ex3_2_intro/
112 | #G #G2 #L #L2 #T #T2 #_ #H2 #IH1 #K1 #HLK1 elim (IH1 … HLK1) -L1
113   #L0 #T0 #HT10 #HT0 #HL0 elim (lpx_fqu_trans … H2 … HL0) -L
114   #L #T3 #HT3 #HT32 #HL2 elim (fqup_cpx_trans … HT0 … HT3) -T
115   /3 width=7 by cpxs_strap1, fqup_strap1, ex3_2_intro/
116 ]
117 qed-.
118
119 lemma lpx_fqus_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ →
120                       ∀K1. ⦃G1, K1⦄ ⊢ ➡[h, g] L1 →
121                       ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊐* ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡[h, g] L2.
122 #h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqus_ind … H) -G2 -L2 -T2 [ /2 width=5 by ex3_2_intro/ ]
123 #G #G2 #L #L2 #T #T2 #_ #H2 #IH1 #K1 #HLK1 elim (IH1 … HLK1) -L1
124 #L0 #T0 #HT10 #HT0 #HL0 elim (lpx_fquq_trans … H2 … HL0) -L
125 #L #T3 #HT3 #HT32 #HL2 elim (fqus_cpx_trans … HT0 … HT3) -T
126 /3 width=7 by cpxs_strap1, fqus_strap1, ex3_2_intro/
127 qed-.
128
129 lemma lpxs_fquq_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ →
130                        ∀K1. ⦃G1, K1⦄ ⊢ ➡*[h, g] L1 →
131                        ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊐⸮ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡*[h, g] L2.
132 #h #g #G1 #G2 #L1 #L2 #T1 #T2 #HT12 #K1 #H @(lpxs_ind_dx … H) -K1
133 [ /2 width=5 by ex3_2_intro/
134 | #K1 #K #HK1 #_ * #L #T #HT1 #HT2 #HL2 -HT12
135   lapply (lpx_cpxs_trans … HT1 … HK1) -HT1
136   elim (lpx_fquq_trans … HT2 … HK1) -K
137   /3 width=7 by lpxs_strap2, cpxs_strap1, ex3_2_intro/
138 ]
139 qed-.
140
141 lemma lpxs_fqup_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ →
142                        ∀K1. ⦃G1, K1⦄ ⊢ ➡*[h, g] L1 →
143                        ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊐+ ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡*[h, g] L2.
144 #h #g #G1 #G2 #L1 #L2 #T1 #T2 #HT12 #K1 #H @(lpxs_ind_dx … H) -K1
145 [ /2 width=5 by ex3_2_intro/
146 | #K1 #K #HK1 #_ * #L #T #HT1 #HT2 #HL2 -HT12
147   lapply (lpx_cpxs_trans … HT1 … HK1) -HT1
148   elim (lpx_fqup_trans … HT2 … HK1) -K
149   /3 width=7 by lpxs_strap2, cpxs_trans, ex3_2_intro/
150 ]
151 qed-.
152
153 lemma lpxs_fqus_trans: ∀h,g,G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ →
154                        ∀K1. ⦃G1, K1⦄ ⊢ ➡*[h, g] L1 →
155                        ∃∃K2,T. ⦃G1, K1⦄ ⊢ T1 ➡*[h, g] T & ⦃G1, K1, T⦄ ⊐* ⦃G2, K2, T2⦄ & ⦃G2, K2⦄ ⊢ ➡*[h, g] L2.
156 #h #g #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqus_ind … H) -G2 -L2 -T2 /2 width=5 by ex3_2_intro/
157 #G #G2 #L #L2 #T #T2 #_ #H2 #IH1 #K1 #HLK1 elim (IH1 … HLK1) -L1
158 #L0 #T0 #HT10 #HT0 #HL0 elim (lpxs_fquq_trans … H2 … HL0) -L
159 #L #T3 #HT3 #HT32 #HL2 elim (fqus_cpxs_trans … HT3 … HT0) -T
160 /3 width=7 by cpxs_trans, fqus_strap1, ex3_2_intro/
161 qed-.