]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/unfold/cpss_lift.ma
update in basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / unfold / cpss_lift.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/substitution/ldrop_ldrop.ma".
16 include "basic_2/unfold/cpss.ma".
17
18 (* CONTEXT-SENSITIVE PARALLEL UNFOLD FOR TERMS ******************************)
19
20 (* Relocation properties ****************************************************)
21
22 lemma cpss_lift: l_liftable cpss.
23 #K #T1 #T2 #H elim H -K -T1 -T2
24 [ #K #I #L #d #e #_ #U1 #H1 #U2 #H2
25   >(lift_mono … H1 … H2) -H1 -H2 //
26 | #K #KV #V #V2 #W2 #i #HKV #HV2 #HVW2 #IHV2 #L #d #e #HLK #U1 #H #U2 #HWU2
27   elim (lift_inv_lref1 … H) * #Hid #H destruct
28   [ elim (lift_trans_ge … HVW2 … HWU2 ?) -W2 // <minus_plus #W2 #HVW2 #HWU2
29     elim (ldrop_trans_le … HLK … HKV ?) -K /2 width=2/ #X #HLK #H
30     elim (ldrop_inv_skip2 … H ?) -H /2 width=1/ -Hid #K #Y #HKV #HVY #H destruct /3 width=8/
31   | lapply (lift_trans_be … HVW2 … HWU2 ? ?) -W2 // /2 width=1/ >plus_plus_comm_23 #HVU2
32     lapply (ldrop_trans_ge_comm … HLK … HKV ?) -K // -Hid /3 width=6/
33   ]
34 | #K #a #I #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #d #e #HLK #U1 #H1 #U2 #H2
35   elim (lift_inv_bind1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct
36   elim (lift_inv_bind1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /4 width=5/
37 | #K #I #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #L #d #e #HLK #U1 #H1 #U2 #H2
38   elim (lift_inv_flat1 … H1) -H1 #VV1 #TT1 #HVV1 #HTT1 #H1 destruct
39   elim (lift_inv_flat1 … H2) -H2 #VV2 #TT2 #HVV2 #HTT2 #H2 destruct /3 width=6/
40 ]
41 qed.
42
43 lemma cpss_inv_lift1: l_deliftable_sn cpss.
44 #L #U1 #U2 #H elim H -L -U1 -U2
45 [ #L * #i #K #d #e #_ #T1 #H
46   [ lapply (lift_inv_sort2 … H) -H #H destruct /2 width=3/
47   | elim (lift_inv_lref2 … H) -H * #Hid #H destruct /3 width=3/
48   | lapply (lift_inv_gref2 … H) -H #H destruct /2 width=3/
49   ]
50 | #L #LV #V #V2 #W2 #i #HLV #HV2 #HVW2 #IHV2 #K #d #e #HLK #T1 #H
51   elim (lift_inv_lref2 … H) -H * #Hid #H destruct
52   [ elim (ldrop_conf_lt … HLK … HLV ?) -L // #L #U #HKL #HLV #HUV
53     elim (IHV2 … HLV … HUV) -V #U2 #HUV2 #HU2
54     elim (lift_trans_le … HUV2 … HVW2 ?) -V2 // >minus_plus <plus_minus_m_m // -Hid /3 width=8/
55   | elim (le_inv_plus_l … Hid) #Hdie #Hei
56     lapply (ldrop_conf_ge … HLK … HLV ?) -L // #HKLV
57     elim (lift_split … HVW2 d (i - e + 1) ? ? ?) -HVW2 [4: // |3: /2 width=1/ |2: /3 width=1/ ] -Hid -Hdie
58     #V1 #HV1 >plus_minus // <minus_minus // /2 width=1/ <minus_n_n <plus_n_O /3 width=8/
59   ]
60 | #L #a #I #V1 #V2 #U1 #U2 #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H
61   elim (lift_inv_bind2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
62   elim (IHV12 … HLK … HWV1) -IHV12 #W2 #HW12 #HWV2
63   elim (IHU12 … HTU1) -IHU12 -HTU1 /3 width=5/
64 | #L #I #V1 #V2 #U1 #U2 #_ #_ #IHV12 #IHU12 #K #d #e #HLK #X #H
65   elim (lift_inv_flat2 … H) -H #W1 #T1 #HWV1 #HTU1 #H destruct
66   elim (IHV12 … HLK … HWV1) -V1
67   elim (IHU12 … HLK … HTU1) -U1 -HLK /3 width=5/
68 ]
69 qed-.