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