]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/reducibility/tpr_tpss.ma
f3ea69327c9b11705834babc0c287a7c21612a8d
[helm.git] / matita / matita / contribs / lambda_delta / basic_2 / reducibility / tpr_tpss.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/unfold/ltpss_dx_ltpss_dx.ma".
16 include "basic_2/reducibility/ltpr_ldrop.ma".
17
18 (* CONTEXT-FREE PARALLEL REDUCTION ON TERMS *********************************)
19
20 (* Unfold properties ********************************************************)
21
22 (* Basic_1: was: pr0_subst1 *)
23 lemma tpr_tps_ltpr: ∀T1,T2. T1 ➡ T2 →
24                     ∀L1,d,e,U1. L1 ⊢ T1 ▶ [d, e] U1 →
25                     ∀L2. L1 ➡ L2 →
26                     ∃∃U2. U1 ➡ U2 & L2 ⊢ T2 ▶* [d, e] U2.
27 #T1 #T2 #H elim H -T1 -T2
28 [ #I #L1 #d #e #X #H
29   elim (tps_inv_atom1 … H) -H
30   [ #H destruct /2 width=3/
31   | * #K1 #V1 #i #Hdi #Hide #HLK1 #HVU1 #H #L2 #HL12 destruct
32     elim (ltpr_ldrop_conf … HLK1 … HL12) -L1 #X #H #HLK2
33     elim (ltpr_inv_pair1 … H) -H #K2 #V2 #_ #HV12 #H destruct
34     elim (lift_total V2 0 (i+1)) #U2 #HVU2
35     lapply (tpr_lift … HV12 … HVU1 … HVU2) -V1 #HU12
36     @ex2_1_intro [2: @HU12 | skip | /3 width=4/ ] (**) (* /4 width=6/ is too slow *)
37   ]
38 | #I #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #d #e #X #H #L2 #HL12
39   elim (tps_inv_flat1 … H) -H #W1 #U1 #HVW1 #HTU1 #H destruct
40   elim (IHV12 … HVW1 … HL12) -V1
41   elim (IHT12 … HTU1 … HL12) -T1 -HL12 /3 width=5/
42 | #a #V1 #V2 #W #T1 #T2 #_ #_ #IHV12 #IHT12 #L1 #d #e #X #H #L2 #HL12
43   elim (tps_inv_flat1 … H) -H #VV1 #Y #HVV1 #HY #HX destruct
44   elim (tps_inv_bind1 … HY) -HY #WW #TT1 #_ #HTT1 #H destruct
45   elim (IHV12 … HVV1 … HL12) -V1 #VV2 #HVV12 #HVV2
46   elim (IHT12 … HTT1 (L2. ⓛWW) ?) -T1 /2 width=1/ -HL12 #TT2 #HTT12 #HTT2
47   lapply (tpss_lsubs_trans … HTT2 (L2. ⓓVV2) ?) -HTT2 /3 width=5/
48 | #a #I #V1 #V2 #T1 #T #T2 #HV12 #_ #HT2 #IHV12 #IHT1 #L1 #d #e #X #H #L2 #HL12
49   elim (tps_inv_bind1 … H) -H #W1 #U1 #HVW1 #HTU1 #H destruct
50   elim (IHV12 … HVW1 … HL12) -V1 #W2 #HW12 #HVW2
51   elim (IHT1 … HTU1 (L2. ⓑ{I} W2) ?) -T1 /2 width=1/ -HL12 #U #HU1 #HTU
52   elim (tpss_strip_neq … HTU … HT2 ?) -T /2 width=1/ #U2 #HU2 #HTU2
53   lapply (tps_lsubs_trans … HU2 (L2. ⓑ{I} V2) ?) -HU2 /2 width=1/ #HU2
54   elim (ltpss_dx_tps_conf … HU2 (L2. ⓑ{I} W2) (d + 1) e ?) -HU2 /2 width=1/ #U3 #HU3 #HU23
55   lapply (tps_lsubs_trans … HU3 (⋆. ⓑ{I} W2) ?) -HU3 /2 width=1/ #HU3
56   lapply (tpss_lsubs_trans … HU23 (L2. ⓑ{I} W2) ?) -HU23 /2 width=1/ #HU23
57   lapply (tpss_trans_eq … HTU2 … HU23) -U2 /3 width=5/
58 | #a #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV12 #IHW12 #IHT12 #L1 #d #e #X #H #L2 #HL12
59   elim (tps_inv_flat1 … H) -H #VV1 #Y #HVV1 #HY #HX destruct
60   elim (tps_inv_bind1 … HY) -HY #WW1 #TT1 #HWW1 #HTT1 #H destruct
61   elim (IHV12 … HVV1 … HL12) -V1 #VV2 #HVV12 #HVV2
62   elim (IHW12 … HWW1 … HL12) -W1 #WW2 #HWW12 #HWW2
63   elim (IHT12 … HTT1 (L2. ⓓWW2) ?) -T1 /2 width=1/ -HL12 #TT2 #HTT12 #HTT2
64   elim (lift_total VV2 0 1) #VV #H2VV
65   lapply (tpss_lift_ge … HVV2 (L2. ⓓWW2) … HV2 … H2VV) -V2 /2 width=1/ #HVV
66   @ex2_1_intro [2: @tpr_theta |1: skip |3: @tpss_bind [2: @tpss_flat ] ] /width=11/ (**) (* /4 width=11/ is too slow *)
67 | #V #T1 #T #T2 #_ #HT2 #IHT1 #L1 #d #e #X #H #L2 #HL12
68   elim (tps_inv_bind1 … H) -H #W #U1 #_ #HTU1 #H destruct -V
69   elim (IHT1 … HTU1 (L2.ⓓW) ?) -T1 /2 width=1/ -HL12 #U #HU1 #HTU
70   elim (tpss_inv_lift1_ge … HTU L2 … HT2 ?) -T <minus_plus_m_m /3 width=3/
71 | #V1 #T1 #T2 #_ #IHT12 #L1 #d #e #X #H #L2 #HL12
72   elim (tps_inv_flat1 … H) -H #VV1 #TT1 #HVV1 #HTT1 #H destruct
73   elim (IHT12 … HTT1 … HL12) -T1 -HL12 /3 width=3/
74 ]
75 qed.
76
77 lemma tpr_tps_bind: ∀I,V1,V2,T1,T2,U1. V1 ➡ V2 → T1 ➡ T2 →
78                     ⋆. ⓑ{I} V1 ⊢ T1 ▶ [0, 1] U1 →
79                     ∃∃U2. U1 ➡ U2 & ⋆. ⓑ{I} V2 ⊢ T2 ▶ [0, 1] U2.
80 #I #V1 #V2 #T1 #T2 #U1 #HV12 #HT12 #HTU1
81 elim (tpr_tps_ltpr … HT12 … HTU1 (⋆. ⓑ{I} V2) ?) -T1 /2 width=1/ -V1 #U2 #HU12 #HTU2
82 lapply (tpss_inv_SO2 … HTU2) -HTU2 /2 width=3/
83 qed.
84
85 lemma tpr_tpss_ltpr: ∀L1,L2. L1 ➡ L2 → ∀T1,T2. T1 ➡ T2 →
86                      ∀d,e,U1. L1 ⊢ T1 ▶* [d, e] U1 →
87                      ∃∃U2. U1 ➡ U2 & L2 ⊢ T2 ▶* [d, e] U2.
88 #L1 #L2 #HL12 #T1 #T2 #HT12 #d #e #U1 #HTU1 @(tpss_ind … HTU1) -U1
89 [ /2 width=3/
90 | -HT12 #U #U1 #_ #HU1 * #T #HUT #HT2
91   elim (tpr_tps_ltpr … HUT … HU1 … HL12) -U -HL12 #U2 #HU12 #HTU2
92   lapply (tpss_trans_eq … HT2 … HTU2) -T /2 width=3/
93 ]
94 qed.
95
96 lemma tpr_tpss_conf: ∀T1,T2. T1 ➡ T2 →
97                      ∀L,U1,d,e. L ⊢ T1 ▶* [d, e] U1 →
98                      ∃∃U2. U1 ➡ U2 & L ⊢ T2 ▶* [d, e] U2.
99 /2 width=5/ qed.