1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "ground_2/ynat/ynat_max.ma".
16 include "basic_2/substitution/drop_drop.ma".
17 include "basic_2/reduction/cpr.ma".
19 (* CONTEXT-SENSITIVE PARALLEL REDUCTION FOR TERMS ***************************)
21 (* Relocation properties ****************************************************)
23 (* Basic_1: includes: pr0_lift pr2_lift *)
24 lemma cpr_lift: ∀G. d_liftable (cpr G).
25 #G #K #T1 #T2 #H elim H -G -K -T1 -T2
26 [ #I #G #K #L #b #l #k #_ #U1 #H1 #U2 #H2
27 >(lift_mono … H1 … H2) -H1 -H2 //
28 | #G #K #KV #V #V2 #W2 #i #HKV #HV2 #HVW2 #IHV2 #L #b #l #k #HLK #U1 #H #U2 #HWU2
29 elim (lift_inv_lref1 … H) * #Hil #H destruct
30 [ elim (lift_trans_ge … HVW2 … HWU2) -W2 /2 width=1 by ylt_fwd_le_succ1/ #W2 #HVW2 #HWU2
31 elim (drop_trans_le … HLK … HKV) -K /2 width=2 by ylt_fwd_le/ #X #HLK #H
32 elim (drop_inv_skip2 … H) -H /2 width=1 by ylt_to_minus/ -Hil
33 #K #Y #HKV #HVY #H destruct /3 width=9 by cpr_delta/
34 | lapply (lift_trans_be … HVW2 … HWU2 ? ?) -W2 /2 width=1 by yle_succ_dx/ >plus_plus_comm_23 #HVU2
35 lapply (drop_trans_ge_comm … HLK … HKV ?) -K // -Hil /3 width=6 by cpr_delta, drop_inv_gen/
37 | #a #I #G #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #b #l #k #HLK #U1 #H1 #U2 #H2
38 elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct
39 elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /4 width=6 by cpr_bind, drop_skip/
40 | #I #G #K #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #b #l #k #HLK #U1 #H1 #U2 #H2
41 elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct
42 elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=6 by cpr_flat/
43 | #G #K #V #T1 #T #T2 #_ #HT2 #IHT1 #L #b #l #k #HLK #U1 #H #U2 #HTU2
44 elim (lift_inv_bind1 … H) -H #VV1 #TT1 #HVV1 #HTT1 #H destruct
45 elim (lift_conf_O1 … HTU2 … HT2) -T2 /4 width=6 by cpr_zeta, drop_skip/
46 | #G #K #V #T1 #T2 #_ #IHT12 #L #b #l #k #HLK #U1 #H #U2 #HTU2
47 elim (lift_inv_flat1 … H) -H #VV1 #TT1 #HVV1 #HTT1 #H destruct /3 width=6 by cpr_eps/
48 | #a #G #K #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #L #b #l #k #HLK #X1 #HX1 #X2 #HX2
49 elim (lift_inv_flat1 … HX1) -HX1 #V0 #X #HV10 #HX #HX1 destruct
50 elim (lift_inv_bind1 … HX) -HX #W0 #T0 #HW0 #HT10 #HX destruct
51 elim (lift_inv_bind1 … HX2) -HX2 #X #T3 #HX #HT23 #HX2 destruct
52 elim (lift_inv_flat1 … HX) -HX #W3 #V3 #HW23 #HV23 #HX destruct /4 width=6 by cpr_beta, drop_skip/
53 | #a #G #K #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #L #b #l #k #HLK #X1 #HX1 #X2 #HX2
54 elim (lift_inv_flat1 … HX1) -HX1 #V0 #X #HV10 #HX #HX1 destruct
55 elim (lift_inv_bind1 … HX) -HX #W0 #T0 #HW0 #HT10 #HX destruct
56 elim (lift_inv_bind1 … HX2) -HX2 #W3 #X #HW23 #HX #HX2 destruct
57 elim (lift_inv_flat1 … HX) -HX #V3 #T3 #HV3 #HT23 #HX destruct
58 elim (lift_trans_ge … HV2 … HV3) -V2 /4 width=6 by cpr_theta, drop_skip/
62 (* Basic_1: includes: pr0_gen_lift pr2_gen_lift *)
63 lemma cpr_inv_lift1: ∀G. d_deliftable_sn (cpr G).
64 #G #L #U1 #U2 #H elim H -G -L -U1 -U2
65 [ * #i #G #L #K #b #l #k #_ #T1 #H
66 [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=3 by ex2_intro/
67 | elim (lift_inv_lref2 … H) -H * #Hil #H destruct /3 width=3 by lift_lref_ge_minus, lift_lref_lt, ex2_intro/
68 | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=3 by ex2_intro/
70 | #G #L #LV #V #V2 #W2 #i #HLV #HV2 #HVW2 #IHV2 #K #b #l #k #HLK #T1 #H
71 elim (lift_inv_lref2 … H) -H * #Hil #H destruct
72 [ elim (drop_conf_lt … HLK … HLV) -L // #L #U #HKL #HLV #HUV
73 elim (IHV2 … HLV … HUV) -V #U2 #HUV2 #HU2
74 elim (lift_trans_le … HUV2 … HVW2) -V2 // <yminus_succ2 <yplus_inj >yplus_SO2 >ymax_pre_sn /3 width=8 by cpr_delta, ylt_fwd_le_succ1, ex2_intro/
75 | elim (yle_inv_plus_inj2 … Hil) #Hlim #Hmi
76 lapply (yle_inv_inj … Hmi) -Hmi #Hmi
77 lapply (drop_conf_ge … HLK … HLV ?) -L // #HKLV
78 elim (lift_split … HVW2 l (i - k + 1)) -HVW2 [2,3,4: /2 width=1 by yle_succ_dx, le_S_S/ ] -Hil -Hlim
79 #V1 #HV1 >plus_minus // <minus_minus /2 width=1 by le_S/ <minus_n_n <plus_n_O
80 /3 width=8 by cpr_delta, ex2_intro/
82 | #a #I #G #L #V1 #V2 #U1 #U2 #_ #_ #IHV12 #IHU12 #K #b #l #k #HLK #X #H
83 elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
84 elim (IHV12 … HLK … HWV1) -IHV12 #W2 #HW12 #HWV2
85 elim (IHU12 … HTU1) -IHU12 -HTU1 /3 width=6 by cpr_bind, drop_skip, lift_bind, ex2_intro/
86 | #I #G #L #V1 #V2 #U1 #U2 #_ #_ #IHV12 #IHU12 #K #b #l #k #HLK #X #H
87 elim (lift_inv_flat2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
88 elim (IHV12 … HLK … HWV1) -V1
89 elim (IHU12 … HLK … HTU1) -U1 -HLK /3 width=6 by cpr_flat, lift_flat, ex2_intro/
90 | #G #L #V #U1 #U #U2 #_ #HU2 #IHU1 #K #b #l #k #HLK #X #H
91 elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
92 elim (IHU1 (K.ⓓW1) b … HTU1) /2 width=1 by drop_skip/ -L -U1 #T #HTU #HT1
93 elim (lift_div_le … HU2 … HTU) -U /3 width=6 by cpr_zeta, ex2_intro/
94 | #G #L #V #U1 #U2 #_ #IHU12 #K #b #l #k #HLK #X #H
95 elim (lift_inv_flat2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
96 elim (IHU12 … HLK … HTU1) -L -U1 /3 width=3 by cpr_eps, ex2_intro/
97 | #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #IHV12 #IHW12 #IHT12 #K #b #l #k #HLK #X #HX
98 elim (lift_inv_flat2 … HX) -HX #V0 #Y #HV01 #HY #HX destruct
99 elim (lift_inv_bind2 … HY) -HY #W0 #T0 #HW01 #HT01 #HY destruct
100 elim (IHV12 … HLK … HV01) -V1
101 elim (IHT12 (K.ⓛW0) b … HT01) -T1 /2 width=1 by drop_skip/
102 elim (IHW12 … HLK … HW01) -W1 /4 width=7 by cpr_beta, lift_flat, lift_bind, ex2_intro/
103 | #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #HV2 #_ #_ #IHV1 #IHW12 #IHT12 #K #b #l #k #HLK #X #HX
104 elim (lift_inv_flat2 … HX) -HX #V0 #Y #HV01 #HY #HX destruct
105 elim (lift_inv_bind2 … HY) -HY #W0 #T0 #HW01 #HT01 #HY destruct
106 elim (IHV1 … HLK … HV01) -V1 #V3 #HV3 #HV03
107 elim (IHT12 (K.ⓓW0) b … HT01) -T1 /2 width=1 by drop_skip/ #T3 #HT32 #HT03
108 elim (IHW12 … HLK … HW01) -W1
109 elim (lift_trans_le … HV3 … HV2) -V
110 /4 width=9 by cpr_theta, lift_flat, lift_bind, ex2_intro/