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/relocation/nstream_after.ma".
16 include "static_2/notation/relations/rliftstar_3.ma".
17 include "static_2/notation/relations/rlift_3.ma".
18 include "static_2/syntax/term.ma".
20 (* GENERIC RELOCATION FOR TERMS *********************************************)
23 lift_sort lift_lref_lt lift_lref_ge lift_bind lift_flat
26 inductive lifts: pr_map → 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)
38 interpretation "generic relocation (term)"
39 'RLiftStar f T1 T2 = (lifts f T1 T2).
41 interpretation "uniform relocation (term)"
42 'RLift i T1 T2 = (lifts (pr_uni i) T1 T2).
44 definition liftable2_sn: predicate (relation term) ≝
45 λR. ∀T1,T2. R T1 T2 → ∀f,U1. ⇧*[f] T1 ≘ U1 →
46 ∃∃U2. ⇧*[f] T2 ≘ U2 & R U1 U2.
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.
52 definition liftable2_bi: predicate (relation term) ≝
53 λR. ∀T1,T2. R T1 T2 → ∀f,U1. ⇧*[f] T1 ≘ U1 →
54 ∀U2. ⇧*[f] T2 ≘ U2 → R U1 U2.
56 definition deliftable2_bi: predicate (relation term) ≝
57 λR. ∀U1,U2. R U1 U2 → ∀f,T1. ⇧*[f] T1 ≘ U1 →
58 ∀T2. ⇧*[f] T2 ≘ U2 → R T1 T2.
60 definition liftable2_dx: predicate (relation term) ≝
61 λR. ∀T1,T2. R T1 T2 → ∀f,U2. ⇧*[f] T2 ≘ U2 →
62 ∃∃U1. ⇧*[f] T1 ≘ U1 & R U1 U2.
64 definition deliftable2_dx: predicate (relation term) ≝
65 λR. ∀U1,U2. R U1 U2 → ∀f,T2. ⇧*[f] T2 ≘ U2 →
66 ∃∃T1. ⇧*[f] T1 ≘ U1 & R T1 T2.
68 (* Basic inversion lemmas ***************************************************)
70 fact lifts_inv_sort1_aux: ∀f,X,Y. ⇧*[f] X ≘ Y → ∀s. X = ⋆s → Y = ⋆s.
71 #f #X #Y * -f -X -Y //
72 [ #f #i1 #i2 #_ #x #H destruct
73 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
74 | #f #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
78 (* Basic_1: was: lift1_sort *)
79 (* Basic_2A1: includes: lift_inv_sort1 *)
80 lemma lifts_inv_sort1: ∀f,Y,s. ⇧*[f] ⋆s ≘ Y → Y = ⋆s.
81 /2 width=4 by lifts_inv_sort1_aux/ qed-.
83 fact lifts_inv_lref1_aux: ∀f,X,Y. ⇧*[f] X ≘ Y → ∀i1. X = #i1 →
84 ∃∃i2. @❪i1,f❫ ≘ i2 & Y = #i2.
86 [ #f #s #x #H destruct
87 | #f #i1 #i2 #Hi12 #x #H destruct /2 width=3 by ex2_intro/
88 | #f #l #x #H destruct
89 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
90 | #f #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
94 (* Basic_1: was: lift1_lref *)
95 (* Basic_2A1: includes: lift_inv_lref1 lift_inv_lref1_lt lift_inv_lref1_ge *)
96 lemma lifts_inv_lref1: ∀f,Y,i1. ⇧*[f] #i1 ≘ Y →
97 ∃∃i2. @❪i1,f❫ ≘ i2 & Y = #i2.
98 /2 width=3 by lifts_inv_lref1_aux/ qed-.
100 fact lifts_inv_gref1_aux: ∀f,X,Y. ⇧*[f] X ≘ Y → ∀l. X = §l → Y = §l.
101 #f #X #Y * -f -X -Y //
102 [ #f #i1 #i2 #_ #x #H destruct
103 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
104 | #f #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
108 (* Basic_2A1: includes: lift_inv_gref1 *)
109 lemma lifts_inv_gref1: ∀f,Y,l. ⇧*[f] §l ≘ Y → Y = §l.
110 /2 width=4 by lifts_inv_gref1_aux/ qed-.
112 fact lifts_inv_bind1_aux: ∀f,X,Y. ⇧*[f] X ≘ Y →
113 ∀p,I,V1,T1. X = ⓑ[p,I]V1.T1 →
114 ∃∃V2,T2. ⇧*[f] V1 ≘ V2 & ⇧*[⫯f] T1 ≘ T2 &
117 [ #f #s #q #J #W1 #U1 #H destruct
118 | #f #i1 #i2 #_ #q #J #W1 #U1 #H destruct
119 | #f #l #b #J #W1 #U1 #H destruct
120 | #f #p #I #V1 #V2 #T1 #T2 #HV12 #HT12 #q #J #W1 #U1 #H destruct /2 width=5 by ex3_2_intro/
121 | #f #I #V1 #V2 #T1 #T2 #_ #_ #q #J #W1 #U1 #H destruct
125 (* Basic_1: was: lift1_bind *)
126 (* Basic_2A1: includes: lift_inv_bind1 *)
127 lemma lifts_inv_bind1: ∀f,p,I,V1,T1,Y. ⇧*[f] ⓑ[p,I]V1.T1 ≘ Y →
128 ∃∃V2,T2. ⇧*[f] V1 ≘ V2 & ⇧*[⫯f] T1 ≘ T2 &
130 /2 width=3 by lifts_inv_bind1_aux/ qed-.
132 fact lifts_inv_flat1_aux: ∀f,X,Y. ⇧*[f] X ≘ Y →
133 ∀I,V1,T1. X = ⓕ[I]V1.T1 →
134 ∃∃V2,T2. ⇧*[f] V1 ≘ V2 & ⇧*[f] T1 ≘ T2 &
137 [ #f #s #J #W1 #U1 #H destruct
138 | #f #i1 #i2 #_ #J #W1 #U1 #H destruct
139 | #f #l #J #W1 #U1 #H destruct
140 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #J #W1 #U1 #H destruct
141 | #f #I #V1 #V2 #T1 #T2 #HV12 #HT12 #J #W1 #U1 #H destruct /2 width=5 by ex3_2_intro/
145 (* Basic_1: was: lift1_flat *)
146 (* Basic_2A1: includes: lift_inv_flat1 *)
147 lemma lifts_inv_flat1: ∀f,I,V1,T1,Y. ⇧*[f] ⓕ[I]V1.T1 ≘ Y →
148 ∃∃V2,T2. ⇧*[f] V1 ≘ V2 & ⇧*[f] T1 ≘ T2 &
150 /2 width=3 by lifts_inv_flat1_aux/ qed-.
152 fact lifts_inv_sort2_aux: ∀f,X,Y. ⇧*[f] X ≘ Y → ∀s. Y = ⋆s → X = ⋆s.
153 #f #X #Y * -f -X -Y //
154 [ #f #i1 #i2 #_ #x #H destruct
155 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
156 | #f #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
160 (* Basic_1: includes: lift_gen_sort *)
161 (* Basic_2A1: includes: lift_inv_sort2 *)
162 lemma lifts_inv_sort2: ∀f,X,s. ⇧*[f] X ≘ ⋆s → X = ⋆s.
163 /2 width=4 by lifts_inv_sort2_aux/ qed-.
165 fact lifts_inv_lref2_aux: ∀f,X,Y. ⇧*[f] X ≘ Y → ∀i2. Y = #i2 →
166 ∃∃i1. @❪i1,f❫ ≘ i2 & X = #i1.
168 [ #f #s #x #H destruct
169 | #f #i1 #i2 #Hi12 #x #H destruct /2 width=3 by ex2_intro/
170 | #f #l #x #H destruct
171 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
172 | #f #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
176 (* Basic_1: includes: lift_gen_lref lift_gen_lref_lt lift_gen_lref_false lift_gen_lref_ge *)
177 (* Basic_2A1: includes: lift_inv_lref2 lift_inv_lref2_lt lift_inv_lref2_be lift_inv_lref2_ge lift_inv_lref2_plus *)
178 lemma lifts_inv_lref2: ∀f,X,i2. ⇧*[f] X ≘ #i2 →
179 ∃∃i1. @❪i1,f❫ ≘ i2 & X = #i1.
180 /2 width=3 by lifts_inv_lref2_aux/ qed-.
182 fact lifts_inv_gref2_aux: ∀f,X,Y. ⇧*[f] X ≘ Y → ∀l. Y = §l → X = §l.
183 #f #X #Y * -f -X -Y //
184 [ #f #i1 #i2 #_ #x #H destruct
185 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
186 | #f #I #V1 #V2 #T1 #T2 #_ #_ #x #H destruct
190 (* Basic_2A1: includes: lift_inv_gref1 *)
191 lemma lifts_inv_gref2: ∀f,X,l. ⇧*[f] X ≘ §l → X = §l.
192 /2 width=4 by lifts_inv_gref2_aux/ qed-.
194 fact lifts_inv_bind2_aux: ∀f,X,Y. ⇧*[f] X ≘ Y →
195 ∀p,I,V2,T2. Y = ⓑ[p,I]V2.T2 →
196 ∃∃V1,T1. ⇧*[f] V1 ≘ V2 & ⇧*[⫯f] T1 ≘ T2 &
199 [ #f #s #q #J #W2 #U2 #H destruct
200 | #f #i1 #i2 #_ #q #J #W2 #U2 #H destruct
201 | #f #l #q #J #W2 #U2 #H destruct
202 | #f #p #I #V1 #V2 #T1 #T2 #HV12 #HT12 #q #J #W2 #U2 #H destruct /2 width=5 by ex3_2_intro/
203 | #f #I #V1 #V2 #T1 #T2 #_ #_ #q #J #W2 #U2 #H destruct
207 (* Basic_1: includes: lift_gen_bind *)
208 (* Basic_2A1: includes: lift_inv_bind2 *)
209 lemma lifts_inv_bind2: ∀f,p,I,V2,T2,X. ⇧*[f] X ≘ ⓑ[p,I]V2.T2 →
210 ∃∃V1,T1. ⇧*[f] V1 ≘ V2 & ⇧*[⫯f] T1 ≘ T2 &
212 /2 width=3 by lifts_inv_bind2_aux/ qed-.
214 fact lifts_inv_flat2_aux: ∀f,X,Y. ⇧*[f] X ≘ Y →
215 ∀I,V2,T2. Y = ⓕ[I]V2.T2 →
216 ∃∃V1,T1. ⇧*[f] V1 ≘ V2 & ⇧*[f] T1 ≘ T2 &
219 [ #f #s #J #W2 #U2 #H destruct
220 | #f #i1 #i2 #_ #J #W2 #U2 #H destruct
221 | #f #l #J #W2 #U2 #H destruct
222 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #J #W2 #U2 #H destruct
223 | #f #I #V1 #V2 #T1 #T2 #HV12 #HT12 #J #W2 #U2 #H destruct /2 width=5 by ex3_2_intro/
227 (* Basic_1: includes: lift_gen_flat *)
228 (* Basic_2A1: includes: lift_inv_flat2 *)
229 lemma lifts_inv_flat2: ∀f,I,V2,T2,X. ⇧*[f] X ≘ ⓕ[I]V2.T2 →
230 ∃∃V1,T1. ⇧*[f] V1 ≘ V2 & ⇧*[f] T1 ≘ T2 &
232 /2 width=3 by lifts_inv_flat2_aux/ qed-.
234 (* Advanced inversion lemmas ************************************************)
236 lemma lifts_inv_atom1: ∀f,I,Y. ⇧*[f] ⓪[I] ≘ Y →
237 ∨∨ ∃∃s. I = Sort s & Y = ⋆s
238 | ∃∃i,j. @❪i,f❫ ≘ j & I = LRef i & Y = #j
239 | ∃∃l. I = GRef l & Y = §l.
241 [ lapply (lifts_inv_sort1 … H)
242 | elim (lifts_inv_lref1 … H)
243 | lapply (lifts_inv_gref1 … H)
244 ] -H /3 width=5 by or3_intro0, or3_intro1, or3_intro2, ex3_2_intro, ex2_intro/
247 lemma lifts_inv_atom2: ∀f,I,X. ⇧*[f] X ≘ ⓪[I] →
248 ∨∨ ∃∃s. X = ⋆s & I = Sort s
249 | ∃∃i,j. @❪i,f❫ ≘ j & X = #i & I = LRef j
250 | ∃∃l. X = §l & I = GRef l.
252 [ lapply (lifts_inv_sort2 … H)
253 | elim (lifts_inv_lref2 … H)
254 | lapply (lifts_inv_gref2 … H)
255 ] -H /3 width=5 by or3_intro0, or3_intro1, or3_intro2, ex3_2_intro, ex2_intro/
258 (* Basic_2A1: includes: lift_inv_pair_xy_x *)
259 lemma lifts_inv_pair_xy_x: ∀f,I,V,T. ⇧*[f] ②[I]V.T ≘ V → ⊥.
262 [ lapply (lifts_inv_sort2 … H) -H #H destruct
263 | elim (lifts_inv_lref2 … H) -H
265 | lapply (lifts_inv_gref2 … H) -H #H destruct
267 | * [ #p ] #I #V2 #T2 #IHV2 #_ #U #H
268 [ elim (lifts_inv_bind2 … H) -H #V1 #T1 #HV12 #_ #H destruct /2 width=3 by/
269 | elim (lifts_inv_flat2 … H) -H #V1 #T1 #HV12 #_ #H destruct /2 width=3 by/
274 (* Basic_1: includes: thead_x_lift_y_y *)
275 (* Basic_2A1: includes: lift_inv_pair_xy_y *)
276 lemma lifts_inv_pair_xy_y: ∀I,T,V,f. ⇧*[f] ②[I]V.T ≘ T → ⊥.
279 [ lapply (lifts_inv_sort2 … H) -H #H destruct
280 | elim (lifts_inv_lref2 … H) -H
282 | lapply (lifts_inv_gref2 … H) -H #H destruct
284 | * [ #p ] #I #V2 #T2 #_ #IHT2 #W #f #H
285 [ elim (lifts_inv_bind2 … H) -H #V1 #T1 #_ #HT12 #H destruct /2 width=4 by/
286 | elim (lifts_inv_flat2 … H) -H #V1 #T1 #_ #HT12 #H destruct /2 width=4 by/
291 lemma lifts_inv_push_zero_sn (f):
292 ∀X. ⇧*[⫯f]#0 ≘ X → #0 = X.
294 elim (lifts_inv_lref1 … H) -H #i #Hi #H destruct
295 lapply (pr_pat_inv_unit_push … Hi ???) -Hi //
298 lemma lifts_inv_push_succ_sn (f) (i1):
299 ∀X. ⇧*[⫯f]#(↑i1) ≘ X →
300 ∃∃i2. ⇧*[f]#i1 ≘ #i2 & #(↑i2) = X.
302 elim (lifts_inv_lref1 … H) -H #j #Hij #H destruct
303 elim (pr_pat_inv_succ_push … Hij) -Hij [|*: // ] #i2 #Hi12 #H destruct
304 /3 width=3 by lifts_lref, ex2_intro/
307 (* Inversion lemmas with uniform relocations ********************************)
309 lemma lifts_inv_lref1_uni: ∀l,Y,i. ⇧[l] #i ≘ Y → Y = #(l+i).
310 #l #Y #i1 #H elim (lifts_inv_lref1 … H) -H /4 width=4 by fr2_nat_mono, eq_f/
313 lemma lifts_inv_lref2_uni: ∀l,X,i2. ⇧[l] X ≘ #i2 →
314 ∃∃i1. X = #i1 & i2 = l + i1.
315 #l #X #i2 #H elim (lifts_inv_lref2 … H) -H
316 /3 width=3 by pr_pat_inv_uni, ex2_intro/
319 lemma lifts_inv_lref2_uni_ge: ∀l,X,i. ⇧[l] X ≘ #(l + i) → X = #i.
320 #l #X #i2 #H elim (lifts_inv_lref2_uni … H) -H
321 #i1 #H1 #H2 destruct /4 width=2 by eq_inv_nplus_bi_sn, eq_f, sym_eq/
324 lemma lifts_inv_lref2_uni_lt: ∀l,X,i. ⇧[l] X ≘ #i → i < l → ⊥.
325 #l #X #i2 #H elim (lifts_inv_lref2_uni … H) -H
326 #i1 #_ #H1 #H2 destruct /2 width=4 by nlt_ge_false/
329 (* Basic forward lemmas *****************************************************)
331 (* Basic_2A1: includes: lift_inv_O2 *)
332 lemma lifts_fwd_isid: ∀f,T1,T2. ⇧*[f] T1 ≘ T2 → 𝐈❪f❫ → T1 = T2.
333 #f #T1 #T2 #H elim H -f -T1 -T2
334 /4 width=3 by pr_isi_pat_des, pr_isi_push, eq_f2, eq_f/
337 (* Basic_2A1: includes: lift_fwd_pair1 *)
338 lemma lifts_fwd_pair1: ∀f,I,V1,T1,Y. ⇧*[f] ②[I]V1.T1 ≘ Y →
339 ∃∃V2,T2. ⇧*[f] V1 ≘ V2 & Y = ②[I]V2.T2.
340 #f * [ #p ] #I #V1 #T1 #Y #H
341 [ elim (lifts_inv_bind1 … H) -H /2 width=4 by ex2_2_intro/
342 | elim (lifts_inv_flat1 … H) -H /2 width=4 by ex2_2_intro/
346 (* Basic_2A1: includes: lift_fwd_pair2 *)
347 lemma lifts_fwd_pair2: ∀f,I,V2,T2,X. ⇧*[f] X ≘ ②[I]V2.T2 →
348 ∃∃V1,T1. ⇧*[f] V1 ≘ V2 & X = ②[I]V1.T1.
349 #f * [ #p ] #I #V2 #T2 #X #H
350 [ elim (lifts_inv_bind2 … H) -H /2 width=4 by ex2_2_intro/
351 | elim (lifts_inv_flat2 … H) -H /2 width=4 by ex2_2_intro/
355 (* Basic properties *********************************************************)
357 lemma liftable2_sn_dx (R): symmetric … R → liftable2_sn R → liftable2_dx R.
358 #R #H2R #H1R #T1 #T2 #HT12 #f #U2 #HTU2
359 elim (H1R … T1 … HTU2) -H1R /3 width=3 by ex2_intro/
362 lemma deliftable2_sn_dx (R): symmetric … R → deliftable2_sn R → deliftable2_dx R.
363 #R #H2R #H1R #U1 #U2 #HU12 #f #T2 #HTU2
364 elim (H1R … U1 … HTU2) -H1R /3 width=3 by ex2_intro/
367 lemma lifts_eq_repl_back: ∀T1,T2. pr_eq_repl_back … (λf. ⇧*[f] T1 ≘ T2).
368 #T1 #T2 #f1 #H elim H -T1 -T2 -f1
369 /4 width=5 by lifts_flat, lifts_bind, lifts_lref, pr_pat_eq_repl_back, pr_eq_push/
372 lemma lifts_eq_repl_fwd: ∀T1,T2. pr_eq_repl_fwd … (λf. ⇧*[f] T1 ≘ T2).
373 #T1 #T2 @pr_eq_repl_sym /2 width=3 by lifts_eq_repl_back/ (**) (* full auto fails *)
376 (* Basic_1: includes: lift_r *)
377 (* Basic_2A1: includes: lift_refl *)
378 lemma lifts_refl: ∀T,f. 𝐈❪f❫ → ⇧*[f] T ≘ T.
380 /4 width=3 by lifts_flat, lifts_bind, lifts_lref, pr_isi_inv_pat, pr_isi_push/
383 (* Basic_2A1: includes: lift_total *)
384 lemma lifts_total: ∀T1,f. ∃T2. ⇧*[f] T1 ≘ T2.
386 /3 width=2 by lifts_lref, lifts_sort, lifts_gref, ex_intro/
387 [ #p ] #I #V1 #T1 #IHV1 #IHT1 #f
388 elim (IHV1 f) -IHV1 #V2 #HV12
389 [ elim (IHT1 (⫯f)) -IHT1 /3 width=2 by lifts_bind, ex_intro/
390 | elim (IHT1 f) -IHT1 /3 width=2 by lifts_flat, ex_intro/
394 lemma lifts_push_zero (f): ⇧*[⫯f]#0 ≘ #0.
395 /2 width=1 by lifts_lref/ qed.
397 lemma lifts_push_lref (f) (i1) (i2): ⇧*[f]#i1 ≘ #i2 → ⇧*[⫯f]#(↑i1) ≘ #(↑i2).
399 elim (lifts_inv_lref1 … H) -H #j #Hij #H destruct
400 /3 width=7 by lifts_lref, pr_pat_push/
403 lemma lifts_lref_uni: ∀l,i. ⇧[l] #i ≘ #(l+i).
404 #l elim l -l /2 width=1 by lifts_lref/
407 (* Basic_1: includes: lift_free (right to left) *)
408 (* Basic_2A1: includes: lift_split *)
409 lemma lifts_split_trans: ∀f,T1,T2. ⇧*[f] T1 ≘ T2 →
410 ∀f1,f2. f2 ⊚ f1 ≘ f →
411 ∃∃T. ⇧*[f1] T1 ≘ T & ⇧*[f2] T ≘ T2.
412 #f #T1 #T2 #H elim H -f -T1 -T2
413 [ /3 width=3 by lifts_sort, ex2_intro/
414 | #f #i1 #i2 #Hi #f1 #f2 #Ht elim (pr_after_pat_des … Hi … Ht) -Hi -Ht
415 /3 width=3 by lifts_lref, ex2_intro/
416 | /3 width=3 by lifts_gref, ex2_intro/
417 | #f #p #I #V1 #V2 #T1 #T2 #_ #_ #IHV #IHT #f1 #f2 #Ht
418 elim (IHV … Ht) elim (IHT (⫯f1) (⫯f2)) -IHV -IHT
419 /3 width=5 by lifts_bind, after_O2, ex2_intro/
420 | #f #I #V1 #V2 #T1 #T2 #_ #_ #IHV #IHT #f1 #f2 #Ht
421 elim (IHV … Ht) elim (IHT … Ht) -IHV -IHT -Ht
422 /3 width=5 by lifts_flat, ex2_intro/
426 (* Note: apparently, this was missing in Basic_2A1 *)
427 lemma lifts_split_div: ∀f1,T1,T2. ⇧*[f1] T1 ≘ T2 →
429 ∃∃T. ⇧*[f2] T2 ≘ T & ⇧*[f] T1 ≘ T.
430 #f1 #T1 #T2 #H elim H -f1 -T1 -T2
431 [ /3 width=3 by lifts_sort, ex2_intro/
432 | #f1 #i1 #i2 #Hi #f2 #f #Ht elim (pr_after_des_ist_pat … Hi … Ht) -Hi -Ht
433 /3 width=3 by lifts_lref, ex2_intro/
434 | /3 width=3 by lifts_gref, ex2_intro/
435 | #f1 #p #I #V1 #V2 #T1 #T2 #_ #_ #IHV #IHT #f2 #f #Ht
436 elim (IHV … Ht) elim (IHT (⫯f2) (⫯f)) -IHV -IHT
437 /3 width=5 by lifts_bind, after_O2, ex2_intro/
438 | #f1 #I #V1 #V2 #T1 #T2 #_ #_ #IHV #IHT #f2 #f #Ht
439 elim (IHV … Ht) elim (IHT … Ht) -IHV -IHT -Ht
440 /3 width=5 by lifts_flat, ex2_intro/
444 (* Basic_1: includes: dnf_dec2 dnf_dec *)
445 (* Basic_2A1: includes: is_lift_dec *)
446 lemma is_lifts_dec: ∀T2,f. Decidable (∃T1. ⇧*[f] T1 ≘ T2).
448 [ * [1,3: /3 width=2 by lifts_sort, lifts_gref, ex_intro, or_introl/ ]
449 #i2 #f elim (is_pr_pat_dec f i2) //
450 [ * /4 width=3 by lifts_lref, ex_intro, or_introl/
452 #X #HX elim (lifts_inv_lref2 … HX) -HX
453 /3 width=2 by ex_intro/
455 | * [ #p ] #I #V2 #T2 #IHV2 #IHT2 #f
456 [ elim (IHV2 f) -IHV2
457 [ * #V1 #HV12 elim (IHT2 (⫯f)) -IHT2
458 [ * #T1 #HT12 @or_introl /3 width=2 by lifts_bind, ex_intro/
459 | -V1 #HT2 @or_intror * #X #H
460 elim (lifts_inv_bind2 … H) -H /3 width=2 by ex_intro/
462 | -IHT2 #HV2 @or_intror * #X #H
463 elim (lifts_inv_bind2 … H) -H /3 width=2 by ex_intro/
465 | elim (IHV2 f) -IHV2
466 [ * #V1 #HV12 elim (IHT2 f) -IHT2
467 [ * #T1 #HT12 /4 width=2 by lifts_flat, ex_intro, or_introl/
468 | -V1 #HT2 @or_intror * #X #H
469 elim (lifts_inv_flat2 … H) -H /3 width=2 by ex_intro/
471 | -IHT2 #HV2 @or_intror * #X #H
472 elim (lifts_inv_flat2 … H) -H /3 width=2 by ex_intro/
478 (* Properties with uniform relocation ***************************************)
480 lemma lifts_uni: ∀n1,n2,T,U. ⇧*[𝐔❨n1❩∘𝐔❨n2❩] T ≘ U → ⇧[n1+n2] T ≘ U.
481 /3 width=4 by lifts_eq_repl_back, after_inv_total/ qed.
483 (* Basic_2A1: removed theorems 14:
484 lifts_inv_nil lifts_inv_cons
485 lift_inv_Y1 lift_inv_Y2 lift_inv_lref_Y1 lift_inv_lref_Y2 lift_lref_Y lift_Y1
486 lift_lref_lt_eq lift_lref_ge_eq lift_lref_plus lift_lref_pred
487 lift_lref_ge_minus lift_lref_ge_minus_eq
489 (* Basic_1: removed theorems 8:
491 lift_head lift_gen_head
492 lift_weight_map lift_weight lift_weight_add lift_weight_add_O