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