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 "Basic_2/substitution/lift.ma".
17 (* RELOCATION ***************************************************************)
19 (* Main properies ***********************************************************)
21 (* Basic_1: was: lift_inj *)
22 theorem lift_inj: ∀d,e,T1,U. ↑[d,e] T1 ≡ U → ∀T2. ↑[d,e] T2 ≡ U → T1 = T2.
23 #d #e #T1 #U #H elim H -d -e -T1 -U
25 lapply (lift_inv_sort2 … HX) -HX //
26 | #i #d #e #Hid #X #HX
27 lapply (lift_inv_lref2_lt … HX ?) -HX //
28 | #i #d #e #Hdi #X #HX
29 lapply (lift_inv_lref2_ge … HX ?) -HX // /2 width=1/
31 lapply (lift_inv_gref2 … HX) -HX //
32 | #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #X #HX
33 elim (lift_inv_bind2 … HX) -HX #V #T #HV1 #HT1 #HX destruct /3 width=1/
34 | #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #X #HX
35 elim (lift_inv_flat2 … HX) -HX #V #T #HV1 #HT1 #HX destruct /3 width=1/
39 (* Basic_1: was: lift_gen_lift *)
40 theorem lift_div_le: ∀d1,e1,T1,T. ↑[d1, e1] T1 ≡ T →
41 ∀d2,e2,T2. ↑[d2 + e1, e2] T2 ≡ T →
43 ∃∃T0. ↑[d1, e1] T0 ≡ T2 & ↑[d2, e2] T0 ≡ T1.
44 #d1 #e1 #T1 #T #H elim H -d1 -e1 -T1 -T
45 [ #k #d1 #e1 #d2 #e2 #T2 #Hk #Hd12
46 lapply (lift_inv_sort2 … Hk) -Hk #Hk destruct /3 width=3/
47 | #i #d1 #e1 #Hid1 #d2 #e2 #T2 #Hi #Hd12
48 lapply (lt_to_le_to_lt … Hid1 Hd12) -Hd12 #Hid2
49 lapply (lift_inv_lref2_lt … Hi ?) -Hi /2 width=3/ /3 width=3/
50 | #i #d1 #e1 #Hid1 #d2 #e2 #T2 #Hi #Hd12
51 elim (lift_inv_lref2 … Hi) -Hi * #Hid2 #H destruct
52 [ -Hd12 lapply (lt_plus_to_lt_l … Hid2) -Hid2 #Hid2 /3 width=3/
53 | -Hid1 >plus_plus_comm_23 in Hid2; #H lapply (le_inv_plus_plus_r … H) -H #H
54 elim (le_inv_plus_l … H) -H #Hide2 #He2i
55 lapply (transitive_le … Hd12 Hide2) -Hd12 #Hd12
56 >le_plus_minus_comm // >(plus_minus_m_m i e2) in ⊢ (? ? ? %); // -He2i
59 | #p #d1 #e1 #d2 #e2 #T2 #Hk #Hd12
60 lapply (lift_inv_gref2 … Hk) -Hk #Hk destruct /3 width=3/
61 | #I #W1 #W #U1 #U #d1 #e1 #_ #_ #IHW #IHU #d2 #e2 #T2 #H #Hd12
62 lapply (lift_inv_bind2 … H) -H * #W2 #U2 #HW2 #HU2 #H destruct
63 elim (IHW … HW2 ?) // -IHW -HW2 #W0 #HW2 #HW1
64 >plus_plus_comm_23 in HU2; #HU2 elim (IHU … HU2 ?) /2 width=1/ /3 width=5/
65 | #I #W1 #W #U1 #U #d1 #e1 #_ #_ #IHW #IHU #d2 #e2 #T2 #H #Hd12
66 lapply (lift_inv_flat2 … H) -H * #W2 #U2 #HW2 #HU2 #H destruct
67 elim (IHW … HW2 ?) // -IHW -HW2 #W0 #HW2 #HW1
68 elim (IHU … HU2 ?) // /3 width=5/
72 theorem lift_mono: ∀d,e,T,U1. ↑[d,e] T ≡ U1 → ∀U2. ↑[d,e] T ≡ U2 → U1 = U2.
73 #d #e #T #U1 #H elim H -d -e -T -U1
75 lapply (lift_inv_sort1 … HX) -HX //
76 | #i #d #e #Hid #X #HX
77 lapply (lift_inv_lref1_lt … HX ?) -HX //
78 | #i #d #e #Hdi #X #HX
79 lapply (lift_inv_lref1_ge … HX ?) -HX //
81 lapply (lift_inv_gref1 … HX) -HX //
82 | #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #X #HX
83 elim (lift_inv_bind1 … HX) -HX #V #T #HV1 #HT1 #HX destruct /3 width=1/
84 | #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #X #HX
85 elim (lift_inv_flat1 … HX) -HX #V #T #HV1 #HT1 #HX destruct /3 width=1/
89 (* Basic_1: was: lift_free (left to right) *)
90 theorem lift_trans_be: ∀d1,e1,T1,T. ↑[d1, e1] T1 ≡ T →
91 ∀d2,e2,T2. ↑[d2, e2] T ≡ T2 →
92 d1 ≤ d2 → d2 ≤ d1 + e1 → ↑[d1, e1 + e2] T1 ≡ T2.
93 #d1 #e1 #T1 #T #H elim H -d1 -e1 -T1 -T
94 [ #k #d1 #e1 #d2 #e2 #T2 #HT2 #_ #_
95 >(lift_inv_sort1 … HT2) -HT2 //
96 | #i #d1 #e1 #Hid1 #d2 #e2 #T2 #HT2 #Hd12 #_
97 lapply (lt_to_le_to_lt … Hid1 Hd12) -Hd12 #Hid2
98 lapply (lift_inv_lref1_lt … HT2 Hid2) /2 width=1/
99 | #i #d1 #e1 #Hid1 #d2 #e2 #T2 #HT2 #_ #Hd21
100 lapply (lift_inv_lref1_ge … HT2 ?) -HT2
101 [ @(transitive_le … Hd21 ?) -Hd21 /2 width=1/
104 | #p #d1 #e1 #d2 #e2 #T2 #HT2 #_ #_
105 >(lift_inv_gref1 … HT2) -HT2 //
106 | #I #V1 #V2 #T1 #T2 #d1 #e1 #_ #_ #IHV12 #IHT12 #d2 #e2 #X #HX #Hd12 #Hd21
107 elim (lift_inv_bind1 … HX) -HX #V0 #T0 #HV20 #HT20 #HX destruct
108 lapply (IHV12 … HV20 ? ?) // -IHV12 -HV20 #HV10
109 lapply (IHT12 … HT20 ? ?) /2 width=1/
110 | #I #V1 #V2 #T1 #T2 #d1 #e1 #_ #_ #IHV12 #IHT12 #d2 #e2 #X #HX #Hd12 #Hd21
111 elim (lift_inv_flat1 … HX) -HX #V0 #T0 #HV20 #HT20 #HX destruct
112 lapply (IHV12 … HV20 ? ?) // -IHV12 -HV20 #HV10
113 lapply (IHT12 … HT20 ? ?) // /2 width=1/
117 (* Basic_1: was: lift_d (right to left) *)
118 theorem lift_trans_le: ∀d1,e1,T1,T. ↑[d1, e1] T1 ≡ T →
119 ∀d2,e2,T2. ↑[d2, e2] T ≡ T2 → d2 ≤ d1 →
120 ∃∃T0. ↑[d2, e2] T1 ≡ T0 & ↑[d1 + e2, e1] T0 ≡ T2.
121 #d1 #e1 #T1 #T #H elim H -d1 -e1 -T1 -T
122 [ #k #d1 #e1 #d2 #e2 #X #HX #_
123 >(lift_inv_sort1 … HX) -HX /2 width=3/
124 | #i #d1 #e1 #Hid1 #d2 #e2 #X #HX #_
125 lapply (lt_to_le_to_lt … (d1+e2) Hid1 ?) // #Hie2
126 elim (lift_inv_lref1 … HX) -HX * #Hid2 #HX destruct /3 width=3/ /4 width=3/
127 | #i #d1 #e1 #Hid1 #d2 #e2 #X #HX #Hd21
128 lapply (transitive_le … Hd21 Hid1) -Hd21 #Hid2
129 lapply (lift_inv_lref1_ge … HX ?) -HX /2 width=1/ #HX destruct
130 >plus_plus_comm_23 /4 width=3/
131 | #p #d1 #e1 #d2 #e2 #X #HX #_
132 >(lift_inv_gref1 … HX) -HX /2 width=3/
133 | #I #V1 #V2 #T1 #T2 #d1 #e1 #_ #_ #IHV12 #IHT12 #d2 #e2 #X #HX #Hd21
134 elim (lift_inv_bind1 … HX) -HX #V0 #T0 #HV20 #HT20 #HX destruct
135 elim (IHV12 … HV20 ?) -IHV12 -HV20 //
136 elim (IHT12 … HT20 ?) -IHT12 -HT20 /2 width=1/ /3 width=5/
137 | #I #V1 #V2 #T1 #T2 #d1 #e1 #_ #_ #IHV12 #IHT12 #d2 #e2 #X #HX #Hd21
138 elim (lift_inv_flat1 … HX) -HX #V0 #T0 #HV20 #HT20 #HX destruct
139 elim (IHV12 … HV20 ?) -IHV12 -HV20 //
140 elim (IHT12 … HT20 ?) -IHT12 -HT20 // /3 width=5/
144 (* Basic_1: was: lift_d (left to right) *)
145 theorem lift_trans_ge: ∀d1,e1,T1,T. ↑[d1, e1] T1 ≡ T →
146 ∀d2,e2,T2. ↑[d2, e2] T ≡ T2 → d1 + e1 ≤ d2 →
147 ∃∃T0. ↑[d2 - e1, e2] T1 ≡ T0 & ↑[d1, e1] T0 ≡ T2.
148 #d1 #e1 #T1 #T #H elim H -d1 -e1 -T1 -T
149 [ #k #d1 #e1 #d2 #e2 #X #HX #_
150 >(lift_inv_sort1 … HX) -HX /2 width=3/
151 | #i #d1 #e1 #Hid1 #d2 #e2 #X #HX #Hded
152 lapply (lt_to_le_to_lt … (d1+e1) Hid1 ?) // #Hid1e
153 lapply (lt_to_le_to_lt … (d2-e1) Hid1 ?) /2 width=1/ #Hid2e
154 lapply (lt_to_le_to_lt … Hid1e Hded) -Hid1e -Hded #Hid2
155 lapply (lift_inv_lref1_lt … HX ?) -HX // #HX destruct /3 width=3/
156 | #i #d1 #e1 #Hid1 #d2 #e2 #X #HX #_
157 elim (lift_inv_lref1 … HX) -HX * #Hied #HX destruct /4 width=3/
158 | #p #d1 #e1 #d2 #e2 #X #HX #_
159 >(lift_inv_gref1 … HX) -HX /2 width=3/
160 | #I #V1 #V2 #T1 #T2 #d1 #e1 #_ #_ #IHV12 #IHT12 #d2 #e2 #X #HX #Hded
161 elim (lift_inv_bind1 … HX) -HX #V0 #T0 #HV20 #HT20 #HX destruct
162 elim (IHV12 … HV20 ?) -IHV12 -HV20 //
163 elim (IHT12 … HT20 ?) -IHT12 -HT20 /2 width=1/ #T
164 <plus_minus /2 width=2/ /3 width=5/
165 | #I #V1 #V2 #T1 #T2 #d1 #e1 #_ #_ #IHV12 #IHT12 #d2 #e2 #X #HX #Hded
166 elim (lift_inv_flat1 … HX) -HX #V0 #T0 #HV20 #HT20 #HX destruct
167 elim (IHV12 … HV20 ?) -IHV12 -HV20 //
168 elim (IHT12 … HT20 ?) -IHT12 -HT20 // /3 width=5/