]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/relocation/drops.ma
- exclusion binder added in local environments
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / relocation / drops.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/rtmap_coafter.ma".
16 include "basic_2/notation/relations/rdropstar_3.ma".
17 include "basic_2/notation/relations/rdropstar_4.ma".
18 include "basic_2/relocation/lreq.ma".
19 include "basic_2/relocation/lifts_bind.ma".
20
21 (* GENERIC SLICING FOR LOCAL ENVIRONMENTS ***********************************)
22
23 (* Basic_1: includes: drop_skip_bind drop1_skip_bind *)
24 (* Basic_2A1: includes: drop_atom drop_pair drop_drop drop_skip
25                         drop_refl_atom_O2 drop_drop_lt drop_skip_lt
26 *)
27 inductive drops (b:bool): rtmap → relation lenv ≝
28 | drops_atom: ∀f. (b = Ⓣ → 𝐈⦃f⦄) → drops b (f) (⋆) (⋆)
29 | drops_drop: ∀f,I,L1,L2. drops b f L1 L2 → drops b (⫯f) (L1.ⓘ{I}) L2
30 | drops_skip: ∀f,I1,I2,L1,L2.
31               drops b f L1 L2 → ⬆*[f] I2 ≡ I1 →
32               drops b (↑f) (L1.ⓘ{I1}) (L2.ⓘ{I2})
33 .
34
35 interpretation "uniform slicing (local environment)"
36    'RDropStar i L1 L2 = (drops true (uni i) L1 L2).
37
38 interpretation "generic slicing (local environment)"
39    'RDropStar b f L1 L2 = (drops b f L1 L2).
40
41 definition d_liftable1: predicate (relation2 lenv term) ≝
42                         λR. ∀K,T. R K T → ∀b,f,L. ⬇*[b, f] L ≡ K →
43                         ∀U. ⬆*[f] T ≡ U → R L U.
44
45 definition d_deliftable1: predicate (relation2 lenv term) ≝
46                           λR. ∀L,U. R L U → ∀b,f,K. ⬇*[b, f] L ≡ K →
47                           ∀T. ⬆*[f] T ≡ U → R K T.
48
49 definition d_liftable2_sn: ∀C:Type[0]. ∀S:rtmap → relation C.
50                            predicate (lenv → relation C) ≝
51                            λC,S,R. ∀K,T1,T2. R K T1 T2 → ∀b,f,L. ⬇*[b, f] L ≡ K →
52                            ∀U1. S f T1 U1 →
53                            ∃∃U2. S f T2 U2 & R L U1 U2.
54
55 definition d_deliftable2_sn: ∀C:Type[0]. ∀S:rtmap → relation C.
56                              predicate (lenv → relation C) ≝
57                              λC,S,R. ∀L,U1,U2. R L U1 U2 → ∀b,f,K. ⬇*[b, f] L ≡ K →
58                              ∀T1. S f T1 U1 →
59                              ∃∃T2. S f T2 U2 & R K T1 T2.
60
61 definition d_liftable2_bi: ∀C:Type[0]. ∀S:rtmap → relation C.
62                            predicate (lenv → relation C) ≝
63                            λC,S,R. ∀K,T1,T2. R K T1 T2 → ∀b,f,L. ⬇*[b, f] L ≡ K →
64                            ∀U1. S f T1 U1 →
65                            ∀U2. S f T2 U2 → R L U1 U2.
66
67 definition d_deliftable2_bi: ∀C:Type[0]. ∀S:rtmap → relation C.
68                              predicate (lenv → relation C) ≝
69                              λC,S,R. ∀L,U1,U2. R L U1 U2 → ∀b,f,K. ⬇*[b, f] L ≡ K →
70                              ∀T1. S f T1 U1 →
71                              ∀T2. S f T2 U2 → R K T1 T2.
72
73 definition co_dropable_sn: predicate (rtmap → relation lenv) ≝
74                            λR. ∀b,f,L1,K1. ⬇*[b, f] L1 ≡ K1 → 𝐔⦃f⦄ →
75                            ∀f2,L2. R f2 L1 L2 → ∀f1. f ~⊚ f1 ≡ f2 →
76                            ∃∃K2. R f1 K1 K2 & ⬇*[b, f] L2 ≡ K2.
77
78 definition co_dropable_dx: predicate (rtmap → relation lenv) ≝
79                            λR. ∀f2,L1,L2. R f2 L1 L2 →
80                            ∀b,f,K2. ⬇*[b, f] L2 ≡ K2 → 𝐔⦃f⦄ →
81                            ∀f1. f ~⊚ f1 ≡ f2 → 
82                            ∃∃K1. ⬇*[b, f] L1 ≡ K1 & R f1 K1 K2.
83
84 definition co_dedropable_sn: predicate (rtmap → relation lenv) ≝
85                              λR. ∀b,f,L1,K1. ⬇*[b, f] L1 ≡ K1 → ∀f1,K2. R f1 K1 K2 →
86                              ∀f2. f ~⊚ f1 ≡ f2 →
87                              ∃∃L2. R f2 L1 L2 & ⬇*[b, f] L2 ≡ K2 & L1 ≡[f] L2.
88
89 (* Basic properties *********************************************************)
90
91 lemma drops_atom_F: ∀f. ⬇*[Ⓕ, f] ⋆ ≡ ⋆.
92 #f @drops_atom #H destruct
93 qed.
94
95 lemma drops_eq_repl_back: ∀b,L1,L2. eq_repl_back … (λf. ⬇*[b, f] L1 ≡ L2).
96 #b #L1 #L2 #f1 #H elim H -f1 -L1 -L2
97 [ /4 width=3 by drops_atom, isid_eq_repl_back/
98 | #f1 #I #L1 #L2 #_ #IH #f2 #H elim (eq_inv_nx … H) -H
99   /3 width=3 by drops_drop/
100 | #f1 #I1 #I2 #L1 #L2 #_ #HI #IH #f2 #H elim (eq_inv_px … H) -H
101   /3 width=3 by drops_skip, liftsb_eq_repl_back/
102 ]
103 qed-.
104
105 lemma drops_eq_repl_fwd: ∀b,L1,L2. eq_repl_fwd … (λf. ⬇*[b, f] L1 ≡ L2).
106 #b #L1 #L2 @eq_repl_sym /2 width=3 by drops_eq_repl_back/ (**) (* full auto fails *)
107 qed-.
108
109 (* Basic_2A1: includes: drop_FT *)
110 lemma drops_TF: ∀f,L1,L2. ⬇*[Ⓣ, f] L1 ≡ L2 → ⬇*[Ⓕ, f] L1 ≡ L2.
111 #f #L1 #L2 #H elim H -f -L1 -L2
112 /3 width=1 by drops_atom, drops_drop, drops_skip/
113 qed.
114
115 (* Basic_2A1: includes: drop_gen *)
116 lemma drops_gen: ∀b,f,L1,L2. ⬇*[Ⓣ, f] L1 ≡ L2 → ⬇*[b, f] L1 ≡ L2.
117 * /2 width=1 by drops_TF/
118 qed-.
119
120 (* Basic_2A1: includes: drop_T *)
121 lemma drops_F: ∀b,f,L1,L2. ⬇*[b, f] L1 ≡ L2 → ⬇*[Ⓕ, f] L1 ≡ L2.
122 * /2 width=1 by drops_TF/
123 qed-.
124
125 lemma d_liftable2_sn_bi: ∀C,S. (∀f,c. is_mono … (S f c)) →
126                          ∀R. d_liftable2_sn C S R → d_liftable2_bi C S R.
127 #C #S #HS #R #HR #K #T1 #T2 #HT12 #b #f #L #HLK #U1 #HTU1 #U2 #HTU2
128 elim (HR … HT12 … HLK … HTU1) -HR -K -T1 #X #HTX #HUX
129 <(HS … HTX … HTU2) -T2 -U2 -b -f //
130 qed-.
131
132 lemma d_deliftable2_sn_bi: ∀C,S. (∀f. is_inj2 … (S f)) →
133                            ∀R. d_deliftable2_sn C S R → d_deliftable2_bi C S R.
134 #C #S #HS #R #HR #L #U1 #U2 #HU12 #b #f #K #HLK #T1 #HTU1 #T2 #HTU2
135 elim (HR … HU12 … HLK … HTU1) -HR -L -U1 #X #HUX #HTX
136 <(HS … HUX … HTU2) -U2 -T2 -b -f //
137 qed-.
138
139 (* Basic inversion lemmas ***************************************************)
140
141 fact drops_inv_atom1_aux: ∀b,f,X,Y. ⬇*[b, f] X ≡ Y → X = ⋆ →
142                           Y = ⋆ ∧ (b = Ⓣ → 𝐈⦃f⦄).
143 #b #f #X #Y * -f -X -Y
144 [ /3 width=1 by conj/
145 | #f #I #L1 #L2 #_ #H destruct
146 | #f #I1 #I2 #L1 #L2 #_ #_ #H destruct
147 ]
148 qed-.
149
150 (* Basic_1: includes: drop_gen_sort *)
151 (* Basic_2A1: includes: drop_inv_atom1 *)
152 lemma drops_inv_atom1: ∀b,f,Y. ⬇*[b, f] ⋆ ≡ Y → Y = ⋆ ∧ (b = Ⓣ → 𝐈⦃f⦄).
153 /2 width=3 by drops_inv_atom1_aux/ qed-.
154
155 fact drops_inv_drop1_aux: ∀b,f,X,Y. ⬇*[b, f] X ≡ Y → ∀g,I,K. X = K.ⓘ{I} → f = ⫯g →
156                           ⬇*[b, g] K ≡ Y.
157 #b #f #X #Y * -f -X -Y
158 [ #f #Hf #g #J #K #H destruct
159 | #f #I #L1 #L2 #HL #g #J #K #H1 #H2 <(injective_next … H2) -g destruct //
160 | #f #I1 #I2 #L1 #L2 #_ #_ #g #J #K #_ #H2 elim (discr_push_next … H2)
161 ]
162 qed-.
163
164 (* Basic_1: includes: drop_gen_drop *)
165 (* Basic_2A1: includes: drop_inv_drop1_lt drop_inv_drop1 *)
166 lemma drops_inv_drop1: ∀b,f,I,K,Y. ⬇*[b, ⫯f] K.ⓘ{I} ≡ Y → ⬇*[b, f] K ≡ Y.
167 /2 width=6 by drops_inv_drop1_aux/ qed-.
168
169 fact drops_inv_skip1_aux: ∀b,f,X,Y. ⬇*[b, f] X ≡ Y → ∀g,I1,K1. X = K1.ⓘ{I1} → f = ↑g →
170                           ∃∃I2,K2. ⬇*[b, g] K1 ≡ K2 & ⬆*[g] I2 ≡ I1 & Y = K2.ⓘ{I2}.
171 #b #f #X #Y * -f -X -Y
172 [ #f #Hf #g #J1 #K1 #H destruct
173 | #f #I #L1 #L2 #_ #g #J1 #K1 #_ #H2 elim (discr_next_push … H2)
174 | #f #I1 #I2 #L1 #L2 #HL #HI #g #J1 #K1 #H1 #H2 <(injective_push … H2) -g destruct
175   /2 width=5 by ex3_2_intro/
176 ]
177 qed-.
178
179 (* Basic_1: includes: drop_gen_skip_l *)
180 (* Basic_2A1: includes: drop_inv_skip1 *)
181 lemma drops_inv_skip1: ∀b,f,I1,K1,Y. ⬇*[b, ↑f] K1.ⓘ{I1} ≡ Y →
182                        ∃∃I2,K2. ⬇*[b, f] K1 ≡ K2 & ⬆*[f] I2 ≡ I1 & Y = K2.ⓘ{I2}.
183 /2 width=5 by drops_inv_skip1_aux/ qed-.
184
185 fact drops_inv_skip2_aux: ∀b,f,X,Y. ⬇*[b, f] X ≡ Y → ∀g,I2,K2. Y = K2.ⓘ{I2} → f = ↑g →
186                           ∃∃I1,K1. ⬇*[b, g] K1 ≡ K2 & ⬆*[g] I2 ≡ I1 & X = K1.ⓘ{I1}.
187 #b #f #X #Y * -f -X -Y
188 [ #f #Hf #g #J2 #K2 #H destruct
189 | #f #I #L1 #L2 #_ #g #J2 #K2 #_ #H2 elim (discr_next_push … H2)
190 | #f #I1 #I2 #L1 #L2 #HL #HV #g #J2 #K2 #H1 #H2 <(injective_push … H2) -g destruct
191   /2 width=5 by ex3_2_intro/
192 ]
193 qed-.
194
195 (* Basic_1: includes: drop_gen_skip_r *)
196 (* Basic_2A1: includes: drop_inv_skip2 *)
197 lemma drops_inv_skip2: ∀b,f,I2,X,K2. ⬇*[b, ↑f] X ≡ K2.ⓘ{I2} →
198                        ∃∃I1,K1. ⬇*[b, f] K1 ≡ K2 & ⬆*[f] I2 ≡ I1 & X = K1.ⓘ{I1}.
199 /2 width=5 by drops_inv_skip2_aux/ qed-.
200
201 (* Basic forward lemmas *****************************************************)
202
203 fact drops_fwd_drop2_aux: ∀b,f2,X,Y. ⬇*[b, f2] X ≡ Y → ∀I,K. Y = K.ⓘ{I} →
204                           ∃∃f1,f. 𝐈⦃f1⦄ & f2 ⊚ ⫯f1 ≡ f & ⬇*[b, f] X ≡ K.
205 #b #f2 #X #Y #H elim H -f2 -X -Y
206 [ #f2 #Hf2 #J #K #H destruct
207 | #f2 #I #L1 #L2 #_ #IHL #J #K #H elim (IHL … H) -IHL
208   /3 width=7 by after_next, ex3_2_intro, drops_drop/
209 | #f2 #I1 #I2 #L1 #L2 #HL #_ #_ #J #K #H destruct
210   lapply (after_isid_dx 𝐈𝐝 … f2) /3 width=9 by after_push, ex3_2_intro, drops_drop/
211 ]
212 qed-.
213
214 lemma drops_fwd_drop2: ∀b,f2,I,X,K. ⬇*[b, f2] X ≡ K.ⓘ{I} →
215                        ∃∃f1,f. 𝐈⦃f1⦄ & f2 ⊚ ⫯f1 ≡ f & ⬇*[b, f] X ≡ K.
216 /2 width=4 by drops_fwd_drop2_aux/ qed-.
217
218 (* Properties with test for identity ****************************************)
219
220 (* Basic_2A1: includes: drop_refl *)
221 lemma drops_refl: ∀b,L,f. 𝐈⦃f⦄ → ⬇*[b, f] L ≡ L.
222 #b #L elim L -L /2 width=1 by drops_atom/
223 #L #I #IHL #f #Hf elim (isid_inv_gen … Hf) -Hf
224 /3 width=1 by drops_skip, liftsb_refl/
225 qed.
226
227 (* Forward lemmas test for identity *****************************************)
228
229 (* Basic_1: includes: drop_gen_refl *)
230 (* Basic_2A1: includes: drop_inv_O2 *)
231 lemma drops_fwd_isid: ∀b,f,L1,L2. ⬇*[b, f] L1 ≡ L2 → 𝐈⦃f⦄ → L1 = L2.
232 #b #f #L1 #L2 #H elim H -f -L1 -L2 //
233 [ #f #I #L1 #L2 #_ #_ #H elim (isid_inv_next … H) //
234 | /5 width=5 by isid_inv_push, liftsb_fwd_isid, eq_f2, sym_eq/
235 ]
236 qed-.
237
238
239 lemma drops_after_fwd_drop2: ∀b,f2,I,X,K. ⬇*[b, f2] X ≡ K.ⓘ{I} →
240                              ∀f1,f. 𝐈⦃f1⦄ → f2 ⊚ ⫯f1 ≡ f → ⬇*[b, f] X ≡ K.
241 #b #f2 #I #X #K #H #f1 #f #Hf1 #Hf elim (drops_fwd_drop2 … H) -H
242 #g1 #g #Hg1 #Hg #HK lapply (after_mono_eq … Hg … Hf ??) -Hg -Hf
243 /3 width=5 by drops_eq_repl_back, isid_inv_eq_repl, eq_next/
244 qed-.
245
246 (* Forward lemmas with test for finite colength *****************************)
247
248 lemma drops_fwd_isfin: ∀f,L1,L2. ⬇*[Ⓣ, f] L1 ≡ L2 → 𝐅⦃f⦄.
249 #f #L1 #L2 #H elim H -f -L1 -L2
250 /3 width=1 by isfin_next, isfin_push, isfin_isid/
251 qed-.
252
253 (* Properties with test for uniformity **************************************)
254
255 lemma drops_isuni_ex: ∀f. 𝐔⦃f⦄ → ∀L. ∃K. ⬇*[Ⓕ, f] L ≡ K.
256 #f #H elim H -f /4 width=2 by drops_refl, drops_TF, ex_intro/
257 #f #_ #g #H #IH destruct * /2 width=2 by ex_intro/ 
258 #L #I elim (IH L) -IH /3 width=2 by drops_drop, ex_intro/
259 qed-.
260
261 (* Inversion lemmas with test for uniformity ********************************)
262
263 lemma drops_inv_isuni: ∀f,L1,L2. ⬇*[Ⓣ, f] L1 ≡ L2 → 𝐔⦃f⦄ →
264                        (𝐈⦃f⦄ ∧ L1 = L2) ∨
265                        ∃∃g,I,K. ⬇*[Ⓣ, g] K ≡ L2 & 𝐔⦃g⦄ & L1 = K.ⓘ{I} & f = ⫯g.
266 #f #L1 #L2 * -f -L1 -L2
267 [ /4 width=1 by or_introl, conj/
268 | /4 width=7 by isuni_inv_next, ex4_3_intro, or_intror/
269 | /7 width=6 by drops_fwd_isid, liftsb_fwd_isid, isuni_inv_push, isid_push, or_introl, conj, eq_f2, sym_eq/
270 ]
271 qed-.
272
273 (* Basic_2A1: was: drop_inv_O1_pair1 *)
274 lemma drops_inv_bind1_isuni: ∀b,f,I,K,L2. 𝐔⦃f⦄ → ⬇*[b, f] K.ⓘ{I} ≡ L2 →
275                              (𝐈⦃f⦄ ∧ L2 = K.ⓘ{I}) ∨
276                              ∃∃g. 𝐔⦃g⦄ & ⬇*[b, g] K ≡ L2 & f = ⫯g.
277 #b #f #I #K #L2 #Hf #H elim (isuni_split … Hf) -Hf * #g #Hg #H0 destruct
278 [ lapply (drops_inv_skip1 … H) -H * #Z #Y #HY #HZ #H destruct
279   <(drops_fwd_isid … HY Hg) -Y >(liftsb_fwd_isid … HZ Hg) -Z
280   /4 width=3 by isid_push, or_introl, conj/
281 | lapply (drops_inv_drop1 … H) -H /3 width=4 by ex3_intro, or_intror/
282 ]
283 qed-.
284
285 (* Basic_2A1: was: drop_inv_O1_pair2 *)
286 lemma drops_inv_bind2_isuni: ∀b,f,I,K,L1. 𝐔⦃f⦄ → ⬇*[b, f] L1 ≡ K.ⓘ{I} →
287                              (𝐈⦃f⦄ ∧ L1 = K.ⓘ{I}) ∨
288                              ∃∃g,I1,K1. 𝐔⦃g⦄ & ⬇*[b, g] K1 ≡ K.ⓘ{I} & L1 = K1.ⓘ{I1} & f = ⫯g.
289 #b #f #I #K *
290 [ #Hf #H elim (drops_inv_atom1 … H) -H #H destruct
291 | #L1 #I1 #Hf #H elim (drops_inv_bind1_isuni … Hf H) -Hf -H *
292   [ #Hf #H destruct /3 width=1 by or_introl, conj/
293   | /3 width=7 by ex4_3_intro, or_intror/
294   ]
295 ]
296 qed-.
297
298 lemma drops_inv_bind2_isuni_next: ∀b,f,I,K,L1. 𝐔⦃f⦄ → ⬇*[b, ⫯f] L1 ≡ K.ⓘ{I} →
299                                   ∃∃I1,K1. ⬇*[b, f] K1 ≡ K.ⓘ{I} & L1 = K1.ⓘ{I1}.
300 #b #f #I #K #L1 #Hf #H elim (drops_inv_bind2_isuni … H) -H /2 width=3 by isuni_next/ -Hf *
301 [ #H elim (isid_inv_next … H) -H //
302 | /2 width=4 by ex2_2_intro/
303 ]
304 qed-.
305
306 fact drops_inv_TF_aux: ∀f,L1,L2. ⬇*[Ⓕ, f] L1 ≡ L2 → 𝐔⦃f⦄ →
307                        ∀I,K. L2 = K.ⓘ{I} → ⬇*[Ⓣ, f] L1 ≡ K.ⓘ{I}.
308 #f #L1 #L2 #H elim H -f -L1 -L2
309 [ #f #_ #_ #J #K #H destruct
310 | #f #I #L1 #L2 #_ #IH #Hf #J #K #H destruct
311   /4 width=3 by drops_drop, isuni_inv_next/
312 | #f #I1 #I2 #L1 #L2 #HL12 #HI21 #_ #Hf #J #K #H destruct
313   lapply (isuni_inv_push … Hf ??) -Hf [1,2: // ] #Hf
314   <(drops_fwd_isid … HL12) -K // <(liftsb_fwd_isid … HI21) -I1
315   /3 width=3 by drops_refl, isid_push/
316 ]
317 qed-.
318
319 (* Basic_2A1: includes: drop_inv_FT *)
320 lemma drops_inv_TF: ∀f,I,L,K. ⬇*[Ⓕ, f] L ≡ K.ⓘ{I} → 𝐔⦃f⦄ → ⬇*[Ⓣ, f] L ≡ K.ⓘ{I}.
321 /2 width=3 by drops_inv_TF_aux/ qed-.
322
323 (* Basic_2A1: includes: drop_inv_gen *)
324 lemma drops_inv_gen: ∀b,f,I,L,K. ⬇*[b, f] L ≡ K.ⓘ{I} → 𝐔⦃f⦄ → ⬇*[Ⓣ, f] L ≡ K.ⓘ{I}.
325 * /2 width=1 by drops_inv_TF/
326 qed-.
327
328 (* Basic_2A1: includes: drop_inv_T *)
329 lemma drops_inv_F: ∀b,f,I,L,K. ⬇*[Ⓕ, f] L ≡ K.ⓘ{I} → 𝐔⦃f⦄ → ⬇*[b, f] L ≡ K.ⓘ{I}.
330 * /2 width=1 by drops_inv_TF/
331 qed-.
332
333 (* Forward lemmas with test for uniformity **********************************)
334
335 (* Basic_1: was: drop_S *)
336 (* Basic_2A1: was: drop_fwd_drop2 *)
337 lemma drops_isuni_fwd_drop2: ∀b,f,I,X,K. 𝐔⦃f⦄ → ⬇*[b, f] X ≡ K.ⓘ{I} → ⬇*[b, ⫯f] X ≡ K.
338 /3 width=7 by drops_after_fwd_drop2, after_isid_isuni/ qed-.
339
340 (* Inversion lemmas with uniform relocations ********************************)
341
342 lemma drops_inv_atom2: ∀b,L,f. ⬇*[b, f] L ≡ ⋆ →
343                        ∃∃n,f1. ⬇*[b, 𝐔❴n❵] L ≡ ⋆ & 𝐔❴n❵ ⊚ f1 ≡ f.
344 #b #L elim L -L
345 [ /3 width=4 by drops_atom, after_isid_sn, ex2_2_intro/
346 | #L #I #IH #f #H elim (pn_split f) * #g #H0 destruct
347   [ elim (drops_inv_skip1 … H) -H #J #K #_ #_ #H destruct
348   | lapply (drops_inv_drop1 … H) -H #HL
349     elim (IH … HL) -IH -HL /3 width=8 by drops_drop, after_next, ex2_2_intro/
350   ]
351 ]
352 qed-.
353
354 lemma drops_inv_succ: ∀L1,L2,i. ⬇*[⫯i] L1 ≡ L2 →
355                       ∃∃I,K. ⬇*[i] K ≡ L2 & L1 = K.ⓘ{I}.
356 #L1 #L2 #i #H elim (drops_inv_isuni … H) -H // *
357 [ #H elim (isid_inv_next … H) -H //
358 | /2 width=4 by ex2_2_intro/
359 ]
360 qed-.
361
362 (* Properties with uniform relocations **************************************)
363
364 lemma drops_F_uni: ∀L,i. ⬇*[Ⓕ, 𝐔❴i❵] L ≡ ⋆ ∨ ∃∃I,K. ⬇*[i] L ≡ K.ⓘ{I}.
365 #L elim L -L /2 width=1 by or_introl/
366 #L #I #IH * /4 width=3 by drops_refl, ex1_2_intro, or_intror/
367 #i elim (IH i) -IH /3 width=1 by drops_drop, or_introl/
368 * /4 width=3 by drops_drop, ex1_2_intro, or_intror/
369 qed-.
370
371 (* Basic_2A1: includes: drop_split *)
372 lemma drops_split_trans: ∀b,f,L1,L2. ⬇*[b, f] L1 ≡ L2 → ∀f1,f2. f1 ⊚ f2 ≡ f → 𝐔⦃f1⦄ →
373                          ∃∃L. ⬇*[b, f1] L1 ≡ L & ⬇*[b, f2] L ≡ L2.
374 #b #f #L1 #L2 #H elim H -f -L1 -L2
375 [ #f #H0f #f1 #f2 #Hf #Hf1 @(ex2_intro … (⋆)) @drops_atom
376   #H lapply (H0f H) -b
377   #H elim (after_inv_isid3 … Hf H) -f //
378 | #f #I #L1 #L2 #HL12 #IHL12 #f1 #f2 #Hf #Hf1 elim (after_inv_xxn … Hf) -Hf [1,3: * |*: // ]
379   [ #g1 #g2 #Hf #H1 #H2 destruct
380     lapply (isuni_inv_push … Hf1 ??) -Hf1 [1,2: // ] #Hg1
381     elim (IHL12 … Hf) -f
382     /4 width=5 by drops_drop, drops_skip, liftsb_refl, isuni_isid, ex2_intro/
383   | #g1 #Hf #H destruct elim (IHL12 … Hf) -f
384     /3 width=5 by ex2_intro, drops_drop, isuni_inv_next/
385   ]
386 | #f #I1 #I2 #L1 #L2 #_ #HI21 #IHL12 #f1 #f2 #Hf #Hf1 elim (after_inv_xxp … Hf) -Hf [2,3: // ]
387   #g1 #g2 #Hf #H1 #H2 destruct elim (liftsb_split_trans … HI21 … Hf) -HI21
388   elim (IHL12 … Hf) -f /3 width=5 by ex2_intro, drops_skip, isuni_fwd_push/
389 ]
390 qed-.
391
392 lemma drops_split_div: ∀b,f1,L1,L. ⬇*[b, f1] L1 ≡ L → ∀f2,f. f1 ⊚ f2 ≡ f → 𝐔⦃f2⦄ →
393                        ∃∃L2. ⬇*[Ⓕ, f2] L ≡ L2 & ⬇*[Ⓕ, f] L1 ≡ L2.
394 #b #f1 #L1 #L #H elim H -f1 -L1 -L
395 [ #f1 #Hf1 #f2 #f #Hf #Hf2 @(ex2_intro … (⋆)) @drops_atom #H destruct
396 | #f1 #I #L1 #L #HL1 #IH #f2 #f #Hf #Hf2 elim (after_inv_nxx … Hf) -Hf [2,3: // ]
397   #g #Hg #H destruct elim (IH … Hg) -IH -Hg /3 width=5 by drops_drop, ex2_intro/
398 | #f1 #I1 #I #L1 #L #HL1 #HI1 #IH #f2 #f #Hf #Hf2
399   elim (after_inv_pxx … Hf) -Hf [1,3: * |*: // ]
400   #g2 #g #Hg #H2 #H0 destruct
401   [ lapply (isuni_inv_push … Hf2 ??) -Hf2 [1,2: // ] #Hg2 -IH
402     lapply (after_isid_inv_dx … Hg … Hg2) -Hg #Hg
403     /5 width=7 by drops_eq_repl_back, drops_F, drops_refl, drops_skip, liftsb_eq_repl_back, isid_push, ex2_intro/
404   | lapply (isuni_inv_next … Hf2 ??) -Hf2 [1,2: // ] #Hg2 -HL1 -HI1
405     elim (IH … Hg) -f1 /3 width=3 by drops_drop, ex2_intro/
406   ]
407 ]
408 qed-.
409
410 (* Properties with application **********************************************)
411
412 lemma drops_tls_at: ∀f,i1,i2. @⦃i1,f⦄ ≡ i2 →
413                     ∀b,L1,L2. ⬇*[b,⫱*[i2]f] L1 ≡ L2 →
414                     ⬇*[b,↑⫱*[⫯i2]f] L1 ≡ L2.
415 /3 width=3 by drops_eq_repl_fwd, at_inv_tls/ qed-.
416
417 lemma drops_split_trans_bind2: ∀b,f,I,L,K0. ⬇*[b, f] L ≡ K0.ⓘ{I} → ∀i. @⦃O, f⦄ ≡ i →
418                                ∃∃J,K. ⬇*[i]L ≡ K.ⓘ{J} & ⬇*[b, ⫱*[⫯i]f] K ≡ K0 & ⬆*[⫱*[⫯i]f] I ≡ J.
419 #b #f #I #L #K0 #H #i #Hf
420 elim (drops_split_trans … H) -H [ |5: @(after_uni_dx … Hf) |2,3: skip ] /2 width=1 by after_isid_dx/ #Y #HLY #H
421 lapply (drops_tls_at … Hf … H) -H #H
422 elim (drops_inv_skip2 … H) -H #J #K #HK0 #HIJ #H destruct
423 /3 width=5 by drops_inv_gen, ex3_2_intro/
424 qed-.
425
426 (* Properties with context-sensitive equivalence for terms ******************)
427
428 lemma ceq_lift_sn: d_liftable2_sn … liftsb ceq.
429 /2 width=3 by ex2_intro/ qed-.
430
431 lemma ceq_inv_lift_sn: d_deliftable2_sn … liftsb ceq.
432 /2 width=3 by ex2_intro/ qed-.
433
434 (* Note: d_deliftable2_sn cfull does not hold *)
435 lemma cfull_lift_sn: d_liftable2_sn … liftsb cfull.
436 #K #I1 #I2 #_ #b #f #L #_ #J1 #_ -K -I1 -b
437 elim (liftsb_total I2 f) /2 width=3 by ex2_intro/
438 qed-.
439
440 (* Basic_2A1: removed theorems 12:
441               drops_inv_nil drops_inv_cons d1_liftable_liftables
442               drop_refl_atom_O2 drop_inv_pair1
443               drop_inv_Y1 drop_Y1 drop_O_Y drop_fwd_Y2
444               drop_fwd_length_minus2 drop_fwd_length_minus4
445 *)
446 (* Basic_1: removed theorems 53:
447             drop1_gen_pnil drop1_gen_pcons drop1_getl_trans
448             drop_ctail drop_skip_flat
449             cimp_flat_sx cimp_flat_dx cimp_bind cimp_getl_conf
450             drop_clear drop_clear_O drop_clear_S
451             clear_gen_sort clear_gen_bind clear_gen_flat clear_gen_flat_r
452             clear_gen_all clear_clear clear_mono clear_trans clear_ctail clear_cle
453             getl_ctail_clen getl_gen_tail clear_getl_trans getl_clear_trans
454             getl_clear_bind getl_clear_conf getl_dec getl_drop getl_drop_conf_lt
455             getl_drop_conf_ge getl_conf_ge_drop getl_drop_conf_rev
456             drop_getl_trans_lt drop_getl_trans_le drop_getl_trans_ge
457             getl_drop_trans getl_flt getl_gen_all getl_gen_sort getl_gen_O
458             getl_gen_S getl_gen_2 getl_gen_flat getl_gen_bind getl_conf_le
459             getl_trans getl_refl getl_head getl_flat getl_ctail getl_mono
460 *)