]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/relocation/lifts.ma
1d6225393ab9c483dee902e2184ac9fddd898fd5
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / relocation / lifts.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 "ground_2/relocation/nstream_after.ma".
16 include "static_2/notation/relations/rliftstar_3.ma".
17 include "static_2/syntax/term.ma".
18
19 (* GENERIC RELOCATION FOR TERMS *********************************************)
20
21 (* Basic_1: includes:
22             lift_sort lift_lref_lt lift_lref_ge lift_bind lift_flat
23             lifts_nil lifts_cons
24 *)
25 inductive lifts: rtmap → relation term ≝
26 | lifts_sort: ∀f,s. lifts f (⋆s) (⋆s)
27 | lifts_lref: ∀f,i1,i2. @⦃i1, f⦄ ≘ i2 → lifts f (#i1) (#i2)
28 | lifts_gref: ∀f,l. lifts f (§l) (§l)
29 | lifts_bind: ∀f,p,I,V1,V2,T1,T2.
30               lifts f V1 V2 → lifts (⫯f) T1 T2 →
31               lifts f (ⓑ{p,I}V1.T1) (ⓑ{p,I}V2.T2)
32 | lifts_flat: ∀f,I,V1,V2,T1,T2.
33               lifts f V1 V2 → lifts f T1 T2 →
34               lifts f (ⓕ{I}V1.T1) (ⓕ{I}V2.T2)
35 .
36
37 interpretation "uniform relocation (term)"
38    'RLiftStar i T1 T2 = (lifts (uni i) T1 T2).
39
40 interpretation "generic relocation (term)"
41    'RLiftStar f T1 T2 = (lifts f T1 T2).
42
43 definition liftable2_sn: predicate (relation term) ≝
44                          λR. ∀T1,T2. R T1 T2 → ∀f,U1. ⬆*[f] T1 ≘ U1 → 
45                          ∃∃U2. ⬆*[f] T2 ≘ U2 & R U1 U2.
46
47 definition deliftable2_sn: predicate (relation term) ≝
48                            λR. ∀U1,U2. R U1 U2 → ∀f,T1. ⬆*[f] T1 ≘ U1 →
49                            ∃∃T2. ⬆*[f] T2 ≘ U2 & R T1 T2.
50
51 definition liftable2_bi: predicate (relation term) ≝
52                          λR. ∀T1,T2. R T1 T2 → ∀f,U1. ⬆*[f] T1 ≘ U1 → 
53                          ∀U2. ⬆*[f] T2 ≘ U2 → R U1 U2.
54
55 definition deliftable2_bi: predicate (relation term) ≝
56                            λR. ∀U1,U2. R U1 U2 → ∀f,T1. ⬆*[f] T1 ≘ U1 →
57                            ∀T2. ⬆*[f] T2 ≘ U2 → R T1 T2.
58
59 (* Basic inversion lemmas ***************************************************)
60
61 fact lifts_inv_sort1_aux: ∀f,X,Y. ⬆*[f] X ≘ Y → ∀s. X = ⋆s → Y = ⋆s.
62 #f #X #Y * -f -X -Y //
63 [ #f #i1 #i2 #_ #x #H destruct
64 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
65 | #f #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
66 ]
67 qed-.
68
69 (* Basic_1: was: lift1_sort *)
70 (* Basic_2A1: includes: lift_inv_sort1 *)
71 lemma lifts_inv_sort1: ∀f,Y,s. ⬆*[f] ⋆s ≘ Y → Y = ⋆s.
72 /2 width=4 by lifts_inv_sort1_aux/ qed-.
73
74 fact lifts_inv_lref1_aux: ∀f,X,Y. ⬆*[f] X ≘ Y → ∀i1. X = #i1 →
75                           ∃∃i2. @⦃i1, f⦄ ≘ i2 & Y = #i2.
76 #f #X #Y * -f -X -Y
77 [ #f #s #x #H destruct
78 | #f #i1 #i2 #Hi12 #x #H destruct /2 width=3 by ex2_intro/
79 | #f #l #x #H destruct
80 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
81 | #f #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
82 ]
83 qed-.
84
85 (* Basic_1: was: lift1_lref *)
86 (* Basic_2A1: includes: lift_inv_lref1 lift_inv_lref1_lt lift_inv_lref1_ge *)
87 lemma lifts_inv_lref1: ∀f,Y,i1. ⬆*[f] #i1 ≘ Y →
88                        ∃∃i2. @⦃i1, f⦄ ≘ i2 & Y = #i2.
89 /2 width=3 by lifts_inv_lref1_aux/ qed-.
90
91 fact lifts_inv_gref1_aux: ∀f,X,Y. ⬆*[f] X ≘ Y → ∀l. X = §l → Y = §l.
92 #f #X #Y * -f -X -Y //
93 [ #f #i1 #i2 #_ #x #H destruct
94 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
95 | #f #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
96 ]
97 qed-.
98
99 (* Basic_2A1: includes: lift_inv_gref1 *)
100 lemma lifts_inv_gref1: ∀f,Y,l. ⬆*[f] §l ≘ Y → Y = §l.
101 /2 width=4 by lifts_inv_gref1_aux/ qed-.
102
103 fact lifts_inv_bind1_aux: ∀f,X,Y. ⬆*[f] X ≘ Y →
104                           ∀p,I,V1,T1. X = ⓑ{p,I}V1.T1 →
105                           ∃∃V2,T2. ⬆*[f] V1 ≘ V2 & ⬆*[⫯f] T1 ≘ T2 &
106                                    Y = ⓑ{p,I}V2.T2.
107 #f #X #Y * -f -X -Y
108 [ #f #s #q #J #W1 #U1 #H destruct
109 | #f #i1 #i2 #_ #q #J #W1 #U1 #H destruct
110 | #f #l #b #J #W1 #U1 #H destruct
111 | #f #p #I #V1 #V2 #T1 #T2 #HV12 #HT12 #q #J #W1 #U1 #H destruct /2 width=5 by ex3_2_intro/
112 | #f #I #V1 #V2 #T1 #T2 #_ #_ #q #J #W1 #U1 #H destruct
113 ]
114 qed-.
115
116 (* Basic_1: was: lift1_bind *)
117 (* Basic_2A1: includes: lift_inv_bind1 *)
118 lemma lifts_inv_bind1: ∀f,p,I,V1,T1,Y. ⬆*[f] ⓑ{p,I}V1.T1 ≘ Y →
119                        ∃∃V2,T2. ⬆*[f] V1 ≘ V2 & ⬆*[⫯f] T1 ≘ T2 &
120                                 Y = ⓑ{p,I}V2.T2.
121 /2 width=3 by lifts_inv_bind1_aux/ qed-.
122
123 fact lifts_inv_flat1_aux: ∀f:rtmap. ∀X,Y. ⬆*[f] X ≘ Y →
124                           ∀I,V1,T1. X = ⓕ{I}V1.T1 →
125                           ∃∃V2,T2. ⬆*[f] V1 ≘ V2 & ⬆*[f] T1 ≘ T2 &
126                                    Y = ⓕ{I}V2.T2.
127 #f #X #Y * -f -X -Y
128 [ #f #s #J #W1 #U1 #H destruct
129 | #f #i1 #i2 #_ #J #W1 #U1 #H destruct
130 | #f #l #J #W1 #U1 #H destruct
131 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #J #W1 #U1 #H destruct
132 | #f #I #V1 #V2 #T1 #T2 #HV12 #HT12 #J #W1 #U1 #H destruct /2 width=5 by ex3_2_intro/
133 ]
134 qed-.
135
136 (* Basic_1: was: lift1_flat *)
137 (* Basic_2A1: includes: lift_inv_flat1 *)
138 lemma lifts_inv_flat1: ∀f:rtmap. ∀I,V1,T1,Y. ⬆*[f] ⓕ{I}V1.T1 ≘ Y →
139                        ∃∃V2,T2. ⬆*[f] V1 ≘ V2 & ⬆*[f] T1 ≘ T2 &
140                                 Y = ⓕ{I}V2.T2.
141 /2 width=3 by lifts_inv_flat1_aux/ qed-.
142
143 fact lifts_inv_sort2_aux: ∀f,X,Y. ⬆*[f] X ≘ Y → ∀s. Y = ⋆s → X = ⋆s.
144 #f #X #Y * -f -X -Y //
145 [ #f #i1 #i2 #_ #x #H destruct
146 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
147 | #f #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
148 ]
149 qed-.
150
151 (* Basic_1: includes: lift_gen_sort *)
152 (* Basic_2A1: includes: lift_inv_sort2 *)
153 lemma lifts_inv_sort2: ∀f,X,s. ⬆*[f] X ≘ ⋆s → X = ⋆s.
154 /2 width=4 by lifts_inv_sort2_aux/ qed-.
155
156 fact lifts_inv_lref2_aux: ∀f,X,Y. ⬆*[f] X ≘ Y → ∀i2. Y = #i2 →
157                           ∃∃i1. @⦃i1, f⦄ ≘ i2 & X = #i1.
158 #f #X #Y * -f -X -Y
159 [ #f #s #x #H destruct
160 | #f #i1 #i2 #Hi12 #x #H destruct /2 width=3 by ex2_intro/
161 | #f #l #x #H destruct
162 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
163 | #f #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
164 ]
165 qed-.
166
167 (* Basic_1: includes: lift_gen_lref lift_gen_lref_lt lift_gen_lref_false lift_gen_lref_ge *)
168 (* Basic_2A1: includes: lift_inv_lref2 lift_inv_lref2_lt lift_inv_lref2_be lift_inv_lref2_ge lift_inv_lref2_plus *)
169 lemma lifts_inv_lref2: ∀f,X,i2. ⬆*[f] X ≘ #i2 →
170                        ∃∃i1. @⦃i1, f⦄ ≘ i2 & X = #i1.
171 /2 width=3 by lifts_inv_lref2_aux/ qed-.
172
173 fact lifts_inv_gref2_aux: ∀f,X,Y. ⬆*[f] X ≘ Y → ∀l. Y = §l → X = §l.
174 #f #X #Y * -f -X -Y //
175 [ #f #i1 #i2 #_ #x #H destruct
176 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
177 | #f #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
178 ]
179 qed-.
180
181 (* Basic_2A1: includes: lift_inv_gref1 *)
182 lemma lifts_inv_gref2: ∀f,X,l. ⬆*[f] X ≘ §l → X = §l.
183 /2 width=4 by lifts_inv_gref2_aux/ qed-.
184
185 fact lifts_inv_bind2_aux: ∀f,X,Y. ⬆*[f] X ≘ Y →
186                           ∀p,I,V2,T2. Y = ⓑ{p,I}V2.T2 →
187                           ∃∃V1,T1. ⬆*[f] V1 ≘ V2 & ⬆*[⫯f] T1 ≘ T2 &
188                                    X = ⓑ{p,I}V1.T1.
189 #f #X #Y * -f -X -Y
190 [ #f #s #q #J #W2 #U2 #H destruct
191 | #f #i1 #i2 #_ #q #J #W2 #U2 #H destruct
192 | #f #l #q #J #W2 #U2 #H destruct
193 | #f #p #I #V1 #V2 #T1 #T2 #HV12 #HT12 #q #J #W2 #U2 #H destruct /2 width=5 by ex3_2_intro/
194 | #f #I #V1 #V2 #T1 #T2 #_ #_ #q #J #W2 #U2 #H destruct
195 ]
196 qed-.
197
198 (* Basic_1: includes: lift_gen_bind *)
199 (* Basic_2A1: includes: lift_inv_bind2 *)
200 lemma lifts_inv_bind2: ∀f,p,I,V2,T2,X. ⬆*[f] X ≘ ⓑ{p,I}V2.T2 →
201                        ∃∃V1,T1. ⬆*[f] V1 ≘ V2 & ⬆*[⫯f] T1 ≘ T2 &
202                                 X = ⓑ{p,I}V1.T1.
203 /2 width=3 by lifts_inv_bind2_aux/ qed-.
204
205 fact lifts_inv_flat2_aux: ∀f:rtmap. ∀X,Y. ⬆*[f] X ≘ Y →
206                           ∀I,V2,T2. Y = ⓕ{I}V2.T2 →
207                           ∃∃V1,T1. ⬆*[f] V1 ≘ V2 & ⬆*[f] T1 ≘ T2 &
208                                    X = ⓕ{I}V1.T1.
209 #f #X #Y * -f -X -Y
210 [ #f #s #J #W2 #U2 #H destruct
211 | #f #i1 #i2 #_ #J #W2 #U2 #H destruct
212 | #f #l #J #W2 #U2 #H destruct
213 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #J #W2 #U2 #H destruct
214 | #f #I #V1 #V2 #T1 #T2 #HV12 #HT12 #J #W2 #U2 #H destruct /2 width=5 by ex3_2_intro/
215 ]
216 qed-.
217
218 (* Basic_1: includes: lift_gen_flat *)
219 (* Basic_2A1: includes: lift_inv_flat2 *)
220 lemma lifts_inv_flat2: ∀f:rtmap. ∀I,V2,T2,X. ⬆*[f] X ≘ ⓕ{I}V2.T2 →
221                        ∃∃V1,T1. ⬆*[f] V1 ≘ V2 & ⬆*[f] T1 ≘ T2 &
222                                 X = ⓕ{I}V1.T1.
223 /2 width=3 by lifts_inv_flat2_aux/ qed-.
224
225 (* Advanced inversion lemmas ************************************************)
226
227 lemma lifts_inv_atom1: ∀f,I,Y. ⬆*[f] ⓪{I} ≘ Y →
228                        ∨∨ ∃∃s. I = Sort s & Y = ⋆s
229                         | ∃∃i,j. @⦃i, f⦄ ≘ j & I = LRef i & Y = #j
230                         | ∃∃l. I = GRef l & Y = §l.
231 #f * #n #Y #H
232 [ lapply (lifts_inv_sort1 … H)
233 | elim (lifts_inv_lref1 … H)
234 | lapply (lifts_inv_gref1 … H)
235 ] -H /3 width=5 by or3_intro0, or3_intro1, or3_intro2, ex3_2_intro, ex2_intro/
236 qed-.
237
238 lemma lifts_inv_atom2: ∀f,I,X. ⬆*[f] X ≘ ⓪{I} →
239                        ∨∨ ∃∃s. X = ⋆s & I = Sort s
240                         | ∃∃i,j. @⦃i, f⦄ ≘ j & X = #i & I = LRef j
241                         | ∃∃l. X = §l & I = GRef l.
242 #f * #n #X #H
243 [ lapply (lifts_inv_sort2 … H)
244 | elim (lifts_inv_lref2 … H)
245 | lapply (lifts_inv_gref2 … H)
246 ] -H /3 width=5 by or3_intro0, or3_intro1, or3_intro2, ex3_2_intro, ex2_intro/
247 qed-.
248
249 (* Basic_2A1: includes: lift_inv_pair_xy_x *)
250 lemma lifts_inv_pair_xy_x: ∀f,I,V,T. ⬆*[f] ②{I}V.T ≘ V → ⊥.
251 #f #J #V elim V -V
252 [ * #i #U #H
253   [ lapply (lifts_inv_sort2 … H) -H #H destruct
254   | elim (lifts_inv_lref2 … H) -H
255     #x #_ #H destruct
256   | lapply (lifts_inv_gref2 … H) -H #H destruct
257   ]
258 | * [ #p ] #I #V2 #T2 #IHV2 #_ #U #H
259   [ elim (lifts_inv_bind2 … H) -H #V1 #T1 #HV12 #_ #H destruct /2 width=3 by/
260   | elim (lifts_inv_flat2 … H) -H #V1 #T1 #HV12 #_ #H destruct /2 width=3 by/
261   ]
262 ]
263 qed-.
264
265 (* Basic_1: includes: thead_x_lift_y_y *)
266 (* Basic_2A1: includes: lift_inv_pair_xy_y *)
267 lemma lifts_inv_pair_xy_y: ∀I,T,V,f. ⬆*[f] ②{I}V.T ≘ T → ⊥.
268 #J #T elim T -T
269 [ * #i #W #f #H
270   [ lapply (lifts_inv_sort2 … H) -H #H destruct
271   | elim (lifts_inv_lref2 … H) -H
272     #x #_ #H destruct
273   | lapply (lifts_inv_gref2 … H) -H #H destruct
274   ]
275 | * [ #p ] #I #V2 #T2 #_ #IHT2 #W #f #H
276   [ elim (lifts_inv_bind2 … H) -H #V1 #T1 #_ #HT12 #H destruct /2 width=4 by/
277   | elim (lifts_inv_flat2 … H) -H #V1 #T1 #_ #HT12 #H destruct /2 width=4 by/
278   ]
279 ]
280 qed-.
281
282 (* Inversion lemmas with uniform relocations ********************************)
283
284 lemma lifts_inv_lref1_uni: ∀l,Y,i. ⬆*[l] #i ≘ Y → Y = #(l+i).
285 #l #Y #i1 #H elim (lifts_inv_lref1 … H) -H /4 width=4 by at_mono, eq_f/
286 qed-.
287
288 lemma lifts_inv_lref2_uni: ∀l,X,i2. ⬆*[l] X ≘ #i2 →
289                            ∃∃i1. X = #i1 & i2 = l + i1.
290 #l #X #i2 #H elim (lifts_inv_lref2 … H) -H
291 /3 width=3 by at_inv_uni, ex2_intro/
292 qed-.
293
294 lemma lifts_inv_lref2_uni_ge: ∀l,X,i. ⬆*[l] X ≘ #(l + i) → X = #i.
295 #l #X #i2 #H elim (lifts_inv_lref2_uni … H) -H
296 #i1 #H1 #H2 destruct /4 width=2 by injective_plus_r, eq_f, sym_eq/
297 qed-.
298
299 lemma lifts_inv_lref2_uni_lt: ∀l,X,i. ⬆*[l] X ≘ #i → i < l → ⊥.
300 #l #X #i2 #H elim (lifts_inv_lref2_uni … H) -H
301 #i1 #_ #H1 #H2 destruct /2 width=4 by lt_le_false/
302 qed-.
303
304 (* Basic forward lemmas *****************************************************)
305
306 (* Basic_2A1: includes: lift_inv_O2 *)
307 lemma lifts_fwd_isid: ∀f,T1,T2. ⬆*[f] T1 ≘ T2 → 𝐈⦃f⦄ → T1 = T2.
308 #f #T1 #T2 #H elim H -f -T1 -T2
309 /4 width=3 by isid_inv_at_mono, isid_push, eq_f2, eq_f/
310 qed-.
311
312 (* Basic_2A1: includes: lift_fwd_pair1 *)
313 lemma lifts_fwd_pair1: ∀f:rtmap. ∀I,V1,T1,Y. ⬆*[f] ②{I}V1.T1 ≘ Y →
314                        ∃∃V2,T2. ⬆*[f] V1 ≘ V2 & Y = ②{I}V2.T2.
315 #f * [ #p ] #I #V1 #T1 #Y #H
316 [ elim (lifts_inv_bind1 … H) -H /2 width=4 by ex2_2_intro/
317 | elim (lifts_inv_flat1 … H) -H /2 width=4 by ex2_2_intro/
318 ]
319 qed-.
320
321 (* Basic_2A1: includes: lift_fwd_pair2 *)
322 lemma lifts_fwd_pair2: ∀f:rtmap. ∀I,V2,T2,X. ⬆*[f] X ≘ ②{I}V2.T2 →
323                        ∃∃V1,T1. ⬆*[f] V1 ≘ V2 & X = ②{I}V1.T1.
324 #f * [ #p ] #I #V2 #T2 #X #H
325 [ elim (lifts_inv_bind2 … H) -H /2 width=4 by ex2_2_intro/
326 | elim (lifts_inv_flat2 … H) -H /2 width=4 by ex2_2_intro/
327 ]
328 qed-.
329
330 (* Basic properties *********************************************************)
331
332 lemma lifts_eq_repl_back: ∀T1,T2. eq_repl_back … (λf. ⬆*[f] T1 ≘ T2).
333 #T1 #T2 #f1 #H elim H -T1 -T2 -f1
334 /4 width=5 by lifts_flat, lifts_bind, lifts_lref, at_eq_repl_back, eq_push/
335 qed-.
336
337 lemma lifts_eq_repl_fwd: ∀T1,T2. eq_repl_fwd … (λf. ⬆*[f] T1 ≘ T2).
338 #T1 #T2 @eq_repl_sym /2 width=3 by lifts_eq_repl_back/ (**) (* full auto fails *)
339 qed-.
340
341 (* Basic_1: includes: lift_r *)
342 (* Basic_2A1: includes: lift_refl *)
343 lemma lifts_refl: ∀T,f. 𝐈⦃f⦄ → ⬆*[f] T ≘ T.
344 #T elim T -T *
345 /4 width=3 by lifts_flat, lifts_bind, lifts_lref, isid_inv_at, isid_push/
346 qed.
347
348 (* Basic_2A1: includes: lift_total *)
349 lemma lifts_total: ∀T1,f. ∃T2. ⬆*[f] T1 ≘ T2.
350 #T1 elim T1 -T1 *
351 /3 width=2 by lifts_lref, lifts_sort, lifts_gref, ex_intro/
352 [ #p ] #I #V1 #T1 #IHV1 #IHT1 #f
353 elim (IHV1 f) -IHV1 #V2 #HV12
354 [ elim (IHT1 (⫯f)) -IHT1 /3 width=2 by lifts_bind, ex_intro/
355 | elim (IHT1 f) -IHT1 /3 width=2 by lifts_flat, ex_intro/
356 ]
357 qed-.
358
359 lemma lifts_push_zero (f): ⬆*[⫯f]#O ≘ #0.
360 /2 width=1 by lifts_lref/ qed.
361
362 lemma lifts_push_lref (f) (i1) (i2): ⬆*[f]#i1 ≘ #i2 → ⬆*[⫯f]#(↑i1) ≘ #(↑i2).
363 #f1 #i1 #i2 #H
364 elim (lifts_inv_lref1 … H) -H #j #Hij #H destruct
365 /3 width=7 by lifts_lref, at_push/
366 qed.
367
368 lemma lifts_lref_uni: ∀l,i. ⬆*[l] #i ≘ #(l+i).
369 #l elim l -l /2 width=1 by lifts_lref/
370 qed.
371
372 (* Basic_1: includes: lift_free (right to left) *)
373 (* Basic_2A1: includes: lift_split *)
374 lemma lifts_split_trans: ∀f,T1,T2. ⬆*[f] T1 ≘ T2 →
375                          ∀f1,f2. f2 ⊚ f1 ≘ f →
376                          ∃∃T. ⬆*[f1] T1 ≘ T & ⬆*[f2] T ≘ T2.
377 #f #T1 #T2 #H elim H -f -T1 -T2
378 [ /3 width=3 by lifts_sort, ex2_intro/
379 | #f #i1 #i2 #Hi #f1 #f2 #Ht elim (after_at_fwd … Hi … Ht) -Hi -Ht
380   /3 width=3 by lifts_lref, ex2_intro/
381 | /3 width=3 by lifts_gref, ex2_intro/
382 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #IHV #IHT #f1 #f2 #Ht
383   elim (IHV … Ht) elim (IHT (⫯f1) (⫯f2)) -IHV -IHT
384   /3 width=5 by lifts_bind, after_O2, ex2_intro/
385 | #f #I #V1 #V2 #T1 #T2 #_ #_ #IHV #IHT #f1 #f2 #Ht
386   elim (IHV … Ht) elim (IHT … Ht) -IHV -IHT -Ht
387   /3 width=5 by lifts_flat, ex2_intro/
388 ]
389 qed-.
390
391 (* Note: apparently, this was missing in Basic_2A1 *)
392 lemma lifts_split_div: ∀f1,T1,T2. ⬆*[f1] T1 ≘ T2 →
393                        ∀f2,f. f2 ⊚ f1 ≘ f →
394                        ∃∃T. ⬆*[f2] T2 ≘ T & ⬆*[f] T1 ≘ T.
395 #f1 #T1 #T2 #H elim H -f1 -T1 -T2
396 [ /3 width=3 by lifts_sort, ex2_intro/
397 | #f1 #i1 #i2 #Hi #f2 #f #Ht elim (after_at1_fwd … Hi … Ht) -Hi -Ht
398   /3 width=3 by lifts_lref, ex2_intro/
399 | /3 width=3 by lifts_gref, ex2_intro/
400 | #f1 #p #I #V1 #V2 #T1 #T2 #_ #_ #IHV #IHT #f2 #f #Ht
401   elim (IHV … Ht) elim (IHT (⫯f2) (⫯f)) -IHV -IHT
402   /3 width=5 by lifts_bind, after_O2, ex2_intro/
403 | #f1 #I #V1 #V2 #T1 #T2 #_ #_ #IHV #IHT #f2 #f #Ht
404   elim (IHV … Ht) elim (IHT … Ht) -IHV -IHT -Ht
405   /3 width=5 by lifts_flat, ex2_intro/
406 ]
407 qed-.
408
409 (* Basic_1: includes: dnf_dec2 dnf_dec *)
410 (* Basic_2A1: includes: is_lift_dec *)
411 lemma is_lifts_dec: ∀T2,f. Decidable (∃T1. ⬆*[f] T1 ≘ T2).
412 #T1 elim T1 -T1
413 [ * [1,3: /3 width=2 by lifts_sort, lifts_gref, ex_intro, or_introl/ ]
414   #i2 #f elim (is_at_dec f i2) //
415   [ * /4 width=3 by lifts_lref, ex_intro, or_introl/
416   | #H @or_intror *
417     #X #HX elim (lifts_inv_lref2 … HX) -HX
418     /3 width=2 by ex_intro/
419   ]
420 | * [ #p ] #I #V2 #T2 #IHV2 #IHT2 #f
421   [ elim (IHV2 f) -IHV2
422     [ * #V1 #HV12 elim (IHT2 (⫯f)) -IHT2
423       [ * #T1 #HT12 @or_introl /3 width=2 by lifts_bind, ex_intro/
424       | -V1 #HT2 @or_intror * #X #H
425         elim (lifts_inv_bind2 … H) -H /3 width=2 by ex_intro/
426       ]
427     | -IHT2 #HV2 @or_intror * #X #H
428       elim (lifts_inv_bind2 … H) -H /3 width=2 by ex_intro/
429     ]
430   | elim (IHV2 f) -IHV2
431     [ * #V1 #HV12 elim (IHT2 f) -IHT2
432       [ * #T1 #HT12 /4 width=2 by lifts_flat, ex_intro, or_introl/
433       | -V1 #HT2 @or_intror * #X #H
434         elim (lifts_inv_flat2 … H) -H /3 width=2 by ex_intro/
435       ]
436     | -IHT2 #HV2 @or_intror * #X #H
437       elim (lifts_inv_flat2 … H) -H /3 width=2 by ex_intro/
438     ]
439   ]
440 ]
441 qed-.
442
443 (* Properties with uniform relocation ***************************************)
444
445 lemma lifts_uni: ∀n1,n2,T,U. ⬆*[𝐔❴n1❵∘𝐔❴n2❵] T ≘ U → ⬆*[n1+n2] T ≘ U.
446 /3 width=4 by lifts_eq_repl_back, after_inv_total/ qed.
447
448 (* Basic_2A1: removed theorems 14:
449               lifts_inv_nil lifts_inv_cons
450               lift_inv_Y1 lift_inv_Y2 lift_inv_lref_Y1 lift_inv_lref_Y2 lift_lref_Y lift_Y1
451               lift_lref_lt_eq lift_lref_ge_eq lift_lref_plus lift_lref_pred
452               lift_lref_ge_minus lift_lref_ge_minus_eq
453 *)
454 (* Basic_1: removed theorems 8:
455             lift_lref_gt            
456             lift_head lift_gen_head 
457             lift_weight_map lift_weight lift_weight_add lift_weight_add_O
458             lift_tlt_dx
459 *)