]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/etc/fpr/fprs_cprs.etc
components: arity, csuba
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / etc / fpr / fprs_cprs.etc
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/fpr_cpr.ma".
16 include "basic_2/computation/cprs_lfprs.ma".
17 include "basic_2/computation/lfprs_ltprs.ma".
18 include "basic_2/computation/lfprs_fprs.ma".
19
20 (* CONTEXT-FREE PARALLEL COMPUTATION ON CLOSURES ****************************)
21
22 (* Advanced properties ******************************************************)
23
24 lemma fprs_flat_dx_tpr: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → ∀V1,V2. V1 ➡ V2 →
25                         ∀I. ⦃L1, ⓕ{I}V1.T1⦄ ➡* ⦃L2, ⓕ{I}V2.T2⦄.
26 #L1 #L2 #T1 #T2 #HT12 @(fprs_ind … HT12) -L2 -T2 /3 width=1/
27 #L #L2 #T #T2 #_ #HT2 #IHT2 #V1 #V2 #HV12 #I
28 lapply (IHT2 … HV12 I) -IHT2 -HV12 /3 width=6/
29 qed.
30
31 lemma fprs_bind2_minus: ∀I,L1,L2,V1,T1,U2. ⦃L1, -ⓑ{I}V1.T1⦄ ➡* ⦃L2, U2⦄ →
32                         ∃∃V2,T2. ⦃L1.ⓑ{I}V1, T1⦄ ➡* ⦃L2.ⓑ{I}V2, T2⦄ &
33                                  U2 = -ⓑ{I}V2.T2.
34 #I #L1 #L2 #V1 #T1 #U2 #H @(fprs_ind … H) -L2 -U2 /2 width=4/
35 #L #L2 #U #U2 #_ #HU2 * #V #T #HT1 #H destruct
36 elim (fpr_bind2_minus … HU2) -HU2 /3 width=4/
37 qed-.
38
39 lemma fprs_lift: ∀K1,K2,T1,T2. ⦃K1, T1⦄ ➡* ⦃K2, T2⦄ →
40                  ∀d,e,L1. ⇩[d, e] L1 ≡ K1 →
41                  ∀U1,U2. ⇧[d, e] T1 ≡ U1 → ⇧[d, e] T2 ≡ U2 →
42                  ∃∃L2. ⦃L1, U1⦄ ➡* ⦃L2, U2⦄ & ⇩[d, e] L2 ≡ K2.
43 #K1 #K2 #T1 #T2 #HT12 @(fprs_ind … HT12) -K2 -T2
44 [ #d #e #L1 #HLK1 #U1 #U2 #HTU1 #HTU2
45   >(lift_mono … HTU2 … HTU1) -U2 /2 width=3/
46 | #K #K2 #T #T2 #_ #HT2 #IHT1 #d #e #L1 #HLK1 #U1 #U2 #HTU1 #HTU2
47   elim (lift_total T d e) #U #HTU
48   elim (IHT1 … HLK1 … HTU1 HTU) -K1 -T1 #L #HU1 #HKL
49   elim (fpr_lift … HT2 … HKL … HTU HTU2) -K -T -T2 /3 width=4/
50 ]
51 qed-.
52
53 (* Advanced inversion lemmas ************************************************)
54
55 lemma fprs_inv_pair1: ∀I,K1,L2,V1,T1,T2. ⦃K1.ⓑ{I}V1, T1⦄ ➡* ⦃L2, T2⦄ →
56                       ∃∃K2,V2. ⦃K1, V1⦄  ➡* ⦃K2, V2⦄ &
57                                ⦃K1, -ⓑ{I}V1.T1⦄ ➡* ⦃K2, -ⓑ{I}V2.T2⦄  &
58                                L2 = K2.ⓑ{I}V2.
59 #I #K1 #L2 #V1 #T1 #T2 #H @(fprs_ind … H) -L2 -T2 /2 width=5/
60 #L #L2 #T #T2 #_ #HT2 * #K #V #HV1 #HT1 #H destruct
61 elim (fpr_inv_pair1 … HT2) -HT2 #K2 #V2 #HV2 #HT2 #H destruct /3 width=5/
62 qed-.
63
64 lemma fprs_inv_pair3: ∀I,L1,K2,V2,T1,T2. ⦃L1, T1⦄ ➡* ⦃K2.ⓑ{I}V2, T2⦄ →
65                       ∃∃K1,V1. ⦃K1, V1⦄  ➡* ⦃K2, V2⦄ &
66                                ⦃K1, -ⓑ{I}V1.T1⦄ ➡* ⦃K2, -ⓑ{I}V2.T2⦄  &
67                                L1 = K1.ⓑ{I}V1.
68 #I2 #L1 #K2 #V2 #T1 #T2 #H @(fprs_ind_dx … H) -L1 -T1 /2 width=5/
69 #L1 #L #T1 #T #HT1 #_ * #K #V #HV2 #HT2 #H destruct
70 elim (fpr_inv_pair3 … HT1) -HT1 #K1 #V1 #HV1 #HT1 #H destruct /3 width=5/
71 qed-.
72
73 (* Advanced forward lemmas **************************************************)
74
75 lemma fprs_fwd_bind2_minus: ∀I,L1,L,V1,T1,T. ⦃L1, -ⓑ{I}V1.T1⦄ ➡* ⦃L, T⦄ → ∀b.
76                             ∃∃V2,T2. ⦃L1, ⓑ{b,I}V1.T1⦄ ➡* ⦃L, ⓑ{b,I}V2.T2⦄ &
77                                      T = -ⓑ{I}V2.T2.
78 #I #L1 #L #V1 #T1 #T #H1 #b @(fprs_ind … H1) -L -T /2 width=4/
79 #L0 #L #T0 #T #_ #H0 * #W1 #U1 #HTU1 #H destruct
80 elim (fpr_fwd_bind2_minus … H0 b) -H0 /3 width=4/
81 qed-.
82
83 lemma fprs_fwd_pair1_full: ∀I,K1,L2,V1,T1,T2. ⦃K1.ⓑ{I}V1, T1⦄ ➡* ⦃L2, T2⦄ →
84                            ∀b. ∃∃K2,V2. ⦃K1, V1⦄  ➡* ⦃K2, V2⦄ &
85                                         ⦃K1, ⓑ{b,I}V1.T1⦄ ➡* ⦃K2, ⓑ{b,I}V2.T2⦄ &
86                                         L2 = K2.ⓑ{I}V2.
87 #I #K1 #L2 #V1 #T1 #T2 #H #b
88 elim (fprs_inv_pair1 … H) -H #K2 #V2 #HV12 #HT12 #H destruct
89 elim (fprs_fwd_bind2_minus … HT12 b) -HT12 #W1 #U1 #HTU1 #H destruct /2 width=5/
90 qed-.
91
92 lemma fprs_fwd_abst2: ∀a,L1,L2,V1,T1,U2. ⦃L1, ⓛ{a}V1.T1⦄ ➡* ⦃L2, U2⦄ → ∀b,I,W.
93                       ∃∃V2,T2. ⦃L1, ⓑ{b,I}W.T1⦄ ➡* ⦃L2, ⓑ{b,I}W.T2⦄ &
94                                U2 = ⓛ{a}V2.T2.
95 #a #L1 #L2 #V1 #T1 #U2 #H #b #I #W @(fprs_ind … H) -L2 -U2 /2 width=4/
96 #L #L2 #U #U2 #_ #H2 * #V #T #HT1 #H destruct
97 elim (fpr_fwd_abst2 … H2 b I W) -H2 /3 width=4/
98 qed-.
99
100 (* Properties on context-sensitive parallel computation for terms ***********)
101
102 lemma cprs_fprs: ∀L,T1,T2. L ⊢ T1 ➡* T2 → ⦃L, T1⦄ ➡* ⦃L, T2⦄.
103 #L #T1 #T2 #H @(cprs_ind … H) -T2 // /3 width=4/
104 qed.
105
106 (* Forward lemmas on context-sensitive parallel computation for terms *******)
107
108 lemma fprs_fwd_cprs: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡* ⦃L2, T2⦄ → L1 ⊢ T1 ➡* T2.
109 #L1 #L2 #T1 #T2 #H @(fprs_ind … H) -L2 -T2 //
110 #L #L2 #T #T2 #H1 #H2 #IH1
111 elim (fpr_inv_all … H2) -H2 #L0 #HL0 #HT2 #_ -L2
112 lapply (lfprs_cpr_trans L1 … HT2) -HT2 /3 width=3/
113 qed-.
114 (*
115 (* Advanced properties ******************************************************)
116
117 lamma fpr_bind_sn: ∀L1,L2,V1,V2. ⦃L1, V1⦄ ➡ ⦃L2, V2⦄ → ∀T1,T2. T1 ➡ T2 →
118                    ∀a,I. ⦃L1, ⓑ{a,I}V1.T1⦄ ➡ ⦃L2, ⓑ{a,I}V2.T2⦄.
119 #L1 #L2 #V1 #V2 #H #T1 #T2 #HT12 #a #I
120 elim (fpr_inv_all … H) /3 width=4/
121 qed.
122
123 (* Advanced forward lemmas **************************************************)
124
125 lamma fpr_fwd_shift_bind_minus: ∀I1,I2,L1,L2,V1,V2,T1,T2.
126                                 ⦃L1, -ⓑ{I1}V1.T1⦄ ➡ ⦃L2, -ⓑ{I2}V2.T2⦄ →
127                                 ⦃L1, V1⦄ ➡ ⦃L2, V2⦄ ∧ I1 = I2.
128 * #I2 #L1 #L2 #V1 #V2 #T1 #T2 #H
129 elim (fpr_inv_all … H) -H #L #HL1 #H #HL2
130 [ elim (cpr_inv_abbr1 … H) -H *
131   [ #V #V0 #T #HV1 #HV0 #_ #H destruct /4 width=4/
132   | #T #_ #_ #H destruct
133   ]
134 | elim (cpr_inv_abst1 … H Abst V2) -H
135   #V #T #HV1 #_ #H destruct /3 width=4/
136 ]
137 qed-.
138 *)