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