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_2/lib/bool.ma".
16 include "ground_2/lib/lstar.ma".
17 include "basic_2/notation/relations/rdrop_5.ma".
18 include "basic_2/notation/relations/rdrop_4.ma".
19 include "basic_2/notation/relations/rdrop_3.ma".
20 include "basic_2/grammar/cl_restricted_weight.ma".
21 include "basic_2/relocation/lift.ma".
22 include "basic_2/relocation/lsuby.ma".
24 (* BASIC SLICING FOR LOCAL ENVIRONMENTS *************************************)
26 (* Basic_1: includes: drop_skip_bind *)
27 inductive ldrop (s:bool): relation4 nat nat lenv lenv ≝
28 | ldrop_atom: ∀d,e. (s = Ⓕ → e = 0) → ldrop s d e (⋆) (⋆)
29 | ldrop_pair: ∀I,L,V. ldrop s 0 0 (L.ⓑ{I}V) (L.ⓑ{I}V)
30 | ldrop_drop: ∀I,L1,L2,V,e. ldrop s 0 e L1 L2 → ldrop s 0 (e+1) (L1.ⓑ{I}V) L2
31 | ldrop_skip: ∀I,L1,L2,V1,V2,d,e.
32 ldrop s d e L1 L2 → ⇧[d, e] V2 ≡ V1 →
33 ldrop s (d+1) e (L1.ⓑ{I}V1) (L2.ⓑ{I}V2)
37 "basic slicing (local environment) abstract"
38 'RDrop s d e L1 L2 = (ldrop s d e L1 L2).
41 "basic slicing (local environment) general"
42 'RDrop d e L1 L2 = (ldrop true d e L1 L2).
45 "basic slicing (local environment) lget"
46 'RDrop e L1 L2 = (ldrop false O e L1 L2).
48 definition l_liftable: predicate (lenv → relation term) ≝
49 λR. ∀K,T1,T2. R K T1 T2 → ∀L,s,d,e. ⇩[s, d, e] L ≡ K →
50 ∀U1. ⇧[d, e] T1 ≡ U1 → ∀U2. ⇧[d, e] T2 ≡ U2 → R L U1 U2.
52 definition l_deliftable_sn: predicate (lenv → relation term) ≝
53 λR. ∀L,U1,U2. R L U1 U2 → ∀K,s,d,e. ⇩[s, d, e] L ≡ K →
54 ∀T1. ⇧[d, e] T1 ≡ U1 →
55 ∃∃T2. ⇧[d, e] T2 ≡ U2 & R K T1 T2.
57 definition dropable_sn: predicate (relation lenv) ≝
58 λR. ∀L1,K1,s,d,e. ⇩[s, d, e] L1 ≡ K1 → ∀L2. R L1 L2 →
59 ∃∃K2. R K1 K2 & ⇩[s, d, e] L2 ≡ K2.
61 definition dedropable_sn: predicate (relation lenv) ≝
62 λR. ∀L1,K1,s,d,e. ⇩[s, d, e] L1 ≡ K1 → ∀K2. R K1 K2 →
63 ∃∃L2. R L1 L2 & ⇩[s, d, e] L2 ≡ K2 & L2 ⊑×[d, e] L1.
65 definition dropable_dx: predicate (relation lenv) ≝
66 λR. ∀L1,L2. R L1 L2 → ∀K2,s,e. ⇩[s, 0, e] L2 ≡ K2 →
67 ∃∃K1. ⇩[s, 0, e] L1 ≡ K1 & R K1 K2.
69 (* Basic inversion lemmas ***************************************************)
71 fact ldrop_inv_atom1_aux: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → L1 = ⋆ →
72 L2 = ⋆ ∧ (s = Ⓕ → e = 0).
73 #L1 #L2 #s #d #e * -L1 -L2 -d -e
75 | #I #L #V #H destruct
76 | #I #L1 #L2 #V #e #_ #H destruct
77 | #I #L1 #L2 #V1 #V2 #d #e #_ #_ #H destruct
81 (* Basic_1: was: drop_gen_sort *)
82 lemma ldrop_inv_atom1: ∀L2,s,d,e. ⇩[s, d, e] ⋆ ≡ L2 → L2 = ⋆ ∧ (s = Ⓕ → e = 0).
83 /2 width=4 by ldrop_inv_atom1_aux/ qed-.
85 fact ldrop_inv_O1_pair1_aux: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → d = 0 →
86 ∀K,I,V. L1 = K.ⓑ{I}V →
87 (e = 0 ∧ L2 = K.ⓑ{I}V) ∨
88 (0 < e ∧ ⇩[s, d, e-1] K ≡ L2).
89 #L1 #L2 #s #d #e * -L1 -L2 -d -e
90 [ #d #e #_ #_ #K #J #W #H destruct
91 | #I #L #V #_ #K #J #W #HX destruct /3 width=1 by or_introl, conj/
92 | #I #L1 #L2 #V #e #HL12 #_ #K #J #W #H destruct /3 width=1 by or_intror, conj/
93 | #I #L1 #L2 #V1 #V2 #d #e #_ #_ >commutative_plus normalize #H destruct
97 lemma ldrop_inv_O1_pair1: ∀I,K,L2,V,s,e. ⇩[s, 0, e] K. ⓑ{I} V ≡ L2 →
98 (e = 0 ∧ L2 = K.ⓑ{I}V) ∨
99 (0 < e ∧ ⇩[s, 0, e-1] K ≡ L2).
100 /2 width=3 by ldrop_inv_O1_pair1_aux/ qed-.
102 lemma ldrop_inv_pair1: ∀I,K,L2,V,s. ⇩[s, 0, 0] K.ⓑ{I}V ≡ L2 → L2 = K.ⓑ{I}V.
104 elim (ldrop_inv_O1_pair1 … H) -H * // #H destruct
105 elim (lt_refl_false … H)
108 (* Basic_1: was: drop_gen_drop *)
109 lemma ldrop_inv_drop1_lt: ∀I,K,L2,V,s,e.
110 ⇩[s, 0, e] K.ⓑ{I}V ≡ L2 → 0 < e → ⇩[s, 0, e-1] K ≡ L2.
111 #I #K #L2 #V #s #e #H #He
112 elim (ldrop_inv_O1_pair1 … H) -H * // #H destruct
113 elim (lt_refl_false … He)
116 lemma ldrop_inv_drop1: ∀I,K,L2,V,s,e.
117 ⇩[s, 0, e+1] K.ⓑ{I}V ≡ L2 → ⇩[s, 0, e] K ≡ L2.
118 #I #K #L2 #V #s #e #H lapply (ldrop_inv_drop1_lt … H ?) -H //
121 fact ldrop_inv_skip1_aux: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → 0 < d →
122 ∀I,K1,V1. L1 = K1.ⓑ{I}V1 →
123 ∃∃K2,V2. ⇩[s, d-1, e] K1 ≡ K2 &
126 #L1 #L2 #s #d #e * -L1 -L2 -d -e
127 [ #d #e #_ #_ #J #K1 #W1 #H destruct
128 | #I #L #V #H elim (lt_refl_false … H)
129 | #I #L1 #L2 #V #e #_ #H elim (lt_refl_false … H)
130 | #I #L1 #L2 #V1 #V2 #d #e #HL12 #HV21 #_ #J #K1 #W1 #H destruct /2 width=5 by ex3_2_intro/
134 (* Basic_1: was: drop_gen_skip_l *)
135 lemma ldrop_inv_skip1: ∀I,K1,V1,L2,s,d,e. ⇩[s, d, e] K1.ⓑ{I}V1 ≡ L2 → 0 < d →
136 ∃∃K2,V2. ⇩[s, d-1, e] K1 ≡ K2 &
139 /2 width=3 by ldrop_inv_skip1_aux/ qed-.
141 lemma ldrop_inv_O1_pair2: ∀I,K,V,s,e,L1. ⇩[s, 0, e] L1 ≡ K.ⓑ{I}V →
142 (e = 0 ∧ L1 = K.ⓑ{I}V) ∨
143 ∃∃I1,K1,V1. ⇩[s, 0, e-1] K1 ≡ K.ⓑ{I}V & L1 = K1.ⓑ{I1}V1 & 0 < e.
145 [ #H elim (ldrop_inv_atom1 … H) -H #H destruct
147 elim (ldrop_inv_O1_pair1 … H) -H *
148 [ #H1 #H2 destruct /3 width=1 by or_introl, conj/
149 | /3 width=5 by ex3_3_intro, or_intror/
154 fact ldrop_inv_skip2_aux: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → 0 < d →
155 ∀I,K2,V2. L2 = K2.ⓑ{I}V2 →
156 ∃∃K1,V1. ⇩[s, d-1, e] K1 ≡ K2 &
159 #L1 #L2 #s #d #e * -L1 -L2 -d -e
160 [ #d #e #_ #_ #J #K2 #W2 #H destruct
161 | #I #L #V #H elim (lt_refl_false … H)
162 | #I #L1 #L2 #V #e #_ #H elim (lt_refl_false … H)
163 | #I #L1 #L2 #V1 #V2 #d #e #HL12 #HV21 #_ #J #K2 #W2 #H destruct /2 width=5 by ex3_2_intro/
167 (* Basic_1: was: drop_gen_skip_r *)
168 lemma ldrop_inv_skip2: ∀I,L1,K2,V2,s,d,e. ⇩[s, d, e] L1 ≡ K2.ⓑ{I}V2 → 0 < d →
169 ∃∃K1,V1. ⇩[s, d-1, e] K1 ≡ K2 & ⇧[d-1, e] V2 ≡ V1 &
171 /2 width=3 by ldrop_inv_skip2_aux/ qed-.
173 (* Basic properties *********************************************************)
175 lemma ldrop_refl_atom_O2: ∀s,d. ⇩[s, d, O] ⋆ ≡ ⋆.
176 /2 width=1 by ldrop_atom/ qed.
178 (* Basic_1: was by definition: drop_refl *)
179 lemma ldrop_refl: ∀L,d,s. ⇩[s, d, 0] L ≡ L.
181 #L #I #V #IHL #d #s @(nat_ind_plus … d) -d /2 width=1 by ldrop_pair, ldrop_skip/
184 lemma ldrop_drop_lt: ∀I,L1,L2,V,s,e.
185 ⇩[s, 0, e-1] L1 ≡ L2 → 0 < e → ⇩[s, 0, e] L1.ⓑ{I}V ≡ L2.
186 #I #L1 #L2 #V #s #e #HL12 #He >(plus_minus_m_m e 1) /2 width=1 by ldrop_drop/
189 lemma ldrop_skip_lt: ∀I,L1,L2,V1,V2,s,d,e.
190 ⇩[s, d-1, e] L1 ≡ L2 → ⇧[d-1, e] V2 ≡ V1 → 0 < d →
191 ⇩[s, d, e] L1. ⓑ{I} V1 ≡ L2.ⓑ{I}V2.
192 #I #L1 #L2 #V1 #V2 #s #d #e #HL12 #HV21 #Hd >(plus_minus_m_m d 1) /2 width=1 by ldrop_skip/
195 lemma ldrop_O1_le: ∀e,L. e ≤ |L| → ∃K. ⇩[e] L ≡ K.
196 #e @(nat_ind_plus … e) -e /2 width=2 by ex_intro/
198 [ #H lapply (le_n_O_to_eq … H) -H >commutative_plus normalize #H destruct
199 | #L #I #V normalize #H
200 elim (IHe L) -IHe /3 width=2 by ldrop_drop, monotonic_pred, ex_intro/
204 lemma ldrop_O1_lt: ∀L,e. e < |L| → ∃∃I,K,V. ⇩[e] L ≡ K.ⓑ{I}V.
206 [ #e #H elim (lt_zero_false … H)
207 | #L #I #V #IHL #e @(nat_ind_plus … e) -e /2 width=4 by ldrop_pair, ex1_3_intro/
209 elim (IHL e) -IHL /3 width=4 by ldrop_drop, lt_plus_to_minus_r, lt_plus_to_lt_l, ex1_3_intro/
213 lemma ldrop_FT: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → ⇩[Ⓣ, d, e] L1 ≡ L2.
214 #L1 #L2 #d #e #H elim H -L1 -L2 -d -e
215 /3 width=1 by ldrop_atom, ldrop_drop, ldrop_skip/
218 lemma ldrop_gen: ∀L1,L2,s,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → ⇩[s, d, e] L1 ≡ L2.
219 #L1 #L2 * /2 width=1 by ldrop_FT/
222 lemma ldrop_T: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → ⇩[Ⓣ, d, e] L1 ≡ L2.
223 #L1 #L2 * /2 width=1 by ldrop_FT/
226 lemma l_liftable_LTC: ∀R. l_liftable R → l_liftable (LTC … R).
227 #R #HR #K #T1 #T2 #H elim H -T2
228 [ /3 width=10 by inj/
229 | #T #T2 #_ #HT2 #IHT1 #L #s #d #e #HLK #U1 #HTU1 #U2 #HTU2
230 elim (lift_total T d e) /4 width=12 by step/
234 lemma l_deliftable_sn_LTC: ∀R. l_deliftable_sn R → l_deliftable_sn (LTC … R).
235 #R #HR #L #U1 #U2 #H elim H -U2
236 [ #U2 #HU12 #K #s #d #e #HLK #T1 #HTU1
237 elim (HR … HU12 … HLK … HTU1) -HR -L -U1 /3 width=3 by inj, ex2_intro/
238 | #U #U2 #_ #HU2 #IHU1 #K #s #d #e #HLK #T1 #HTU1
239 elim (IHU1 … HLK … HTU1) -IHU1 -U1 #T #HTU #HT1
240 elim (HR … HU2 … HLK … HTU) -HR -L -U /3 width=5 by step, ex2_intro/
244 lemma dropable_sn_TC: ∀R. dropable_sn R → dropable_sn (TC … R).
245 #R #HR #L1 #K1 #s #d #e #HLK1 #L2 #H elim H -L2
246 [ #L2 #HL12 elim (HR … HLK1 … HL12) -HR -L1
247 /3 width=3 by inj, ex2_intro/
248 | #L #L2 #_ #HL2 * #K #HK1 #HLK elim (HR … HLK … HL2) -HR -L
249 /3 width=3 by step, ex2_intro/
253 lemma dropable_dx_TC: ∀R. dropable_dx R → dropable_dx (TC … R).
254 #R #HR #L1 #L2 #H elim H -L2
255 [ #L2 #HL12 #K2 #s #e #HLK2 elim (HR … HL12 … HLK2) -HR -L2
256 /3 width=3 by inj, ex2_intro/
257 | #L #L2 #_ #HL2 #IHL1 #K2 #s #e #HLK2 elim (HR … HL2 … HLK2) -HR -L2
258 #K #HLK #HK2 elim (IHL1 … HLK) -L
259 /3 width=5 by step, ex2_intro/
263 lemma l_deliftable_sn_llstar: ∀R. l_deliftable_sn R →
264 ∀l. l_deliftable_sn (llstar … R l).
265 #R #HR #l #L #U1 #U2 #H @(lstar_ind_r … l U2 H) -l -U2
266 [ /2 width=3 by lstar_O, ex2_intro/
267 | #l #U #U2 #_ #HU2 #IHU1 #K #s #d #e #HLK #T1 #HTU1
268 elim (IHU1 … HLK … HTU1) -IHU1 -U1 #T #HTU #HT1
269 elim (HR … HU2 … HLK … HTU) -HR -L -U /3 width=5 by lstar_dx, ex2_intro/
273 lemma lsuby_ldrop_trans_be: ∀L1,L2,d,e. L1 ⊑×[d, e] L2 →
274 ∀I2,K2,W,s,i. ⇩[s, 0, i] L2 ≡ K2.ⓑ{I2}W →
276 ∃∃I1,K1. K1 ⊑×[0, ⫰(d+e-i)] K2 & ⇩[s, 0, i] L1 ≡ K1.ⓑ{I1}W.
277 #L1 #L2 #d #e #H elim H -L1 -L2 -d -e
278 [ #L1 #d #e #J2 #K2 #W #s #i #H
279 elim (ldrop_inv_atom1 … H) -H #H destruct
280 | #I1 #I2 #L1 #L2 #V1 #V2 #_ #_ #J2 #K2 #W #s #i #_ #_ #H
281 elim (ylt_yle_false … H) //
282 | #I1 #I2 #L1 #L2 #V #e #HL12 #IHL12 #J2 #K2 #W #s #i #H #_ >yplus_O1
283 elim (ldrop_inv_O1_pair1 … H) -H * #Hi #HLK1 [ -IHL12 | -HL12 ]
284 [ #_ destruct -I2 >ypred_succ
285 /2 width=4 by ldrop_pair, ex2_2_intro/
286 | lapply (ylt_inv_O1 i ?) /2 width=1 by ylt_inj/
287 #H <H -H #H lapply (ylt_inv_succ … H) -H
288 #Hie elim (IHL12 … HLK1) -IHL12 -HLK1 // -Hie
289 >yminus_succ <yminus_inj /3 width=4 by ldrop_drop_lt, ex2_2_intro/
291 | #I1 #I2 #L1 #L2 #V1 #V2 #d #e #_ #IHL12 #J2 #K2 #W #s #i #HLK2 #Hdi
292 elim (yle_inv_succ1 … Hdi) -Hdi
293 #Hdi #Hi <Hi >yplus_succ1 #H lapply (ylt_inv_succ … H) -H
294 #Hide lapply (ldrop_inv_drop1_lt … HLK2 ?) -HLK2 /2 width=1 by ylt_O/
295 #HLK1 elim (IHL12 … HLK1) -IHL12 -HLK1 <yminus_inj >yminus_SO2
296 /4 width=4 by ylt_O, ldrop_drop_lt, ex2_2_intro/
300 (* Basic forvard lemmas *****************************************************)
302 (* Basic_1: was: drop_S *)
303 lemma ldrop_fwd_drop2: ∀L1,I2,K2,V2,s,e. ⇩[s, O, e] L1 ≡ K2. ⓑ{I2} V2 →
304 ⇩[s, O, e + 1] L1 ≡ K2.
306 [ #I2 #K2 #V2 #s #e #H lapply (ldrop_inv_atom1 … H) -H * #H destruct
307 | #K1 #I1 #V1 #IHL1 #I2 #K2 #V2 #s #e #H
308 elim (ldrop_inv_O1_pair1 … H) -H * #He #H
309 [ -IHL1 destruct /2 width=1 by ldrop_drop/
310 | @ldrop_drop >(plus_minus_m_m e 1) /2 width=3 by/
315 lemma ldrop_fwd_length: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → |L1| = |L2| + e.
316 #L1 #L2 #d #e #H elim H -L1 -L2 -d -e // normalize /2 width=1 by/
319 lemma ldrop_fwd_length_minus2: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → |L2| = |L1| - e.
320 #L1 #L2 #d #e #H lapply (ldrop_fwd_length … H) -H /2 width=1 by plus_minus, le_n/
323 lemma ldrop_fwd_length_minus4: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → e = |L1| - |L2|.
324 #L1 #L2 #d #e #H lapply (ldrop_fwd_length … H) -H //
327 lemma ldrop_fwd_length_le2: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → e ≤ |L1|.
328 #L1 #L2 #d #e #H lapply (ldrop_fwd_length … H) -H //
331 lemma ldrop_fwd_length_le4: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → |L2| ≤ |L1|.
332 #L1 #L2 #d #e #H lapply (ldrop_fwd_length … H) -H //
335 lemma ldrop_fwd_length_lt2: ∀L1,I2,K2,V2,d,e.
336 ⇩[Ⓕ, d, e] L1 ≡ K2. ⓑ{I2} V2 → e < |L1|.
337 #L1 #I2 #K2 #V2 #d #e #H
338 lapply (ldrop_fwd_length … H) normalize in ⊢ (%→?); -I2 -V2 //
341 lemma ldrop_fwd_length_lt4: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → 0 < e → |L2| < |L1|.
342 #L1 #L2 #d #e #H lapply (ldrop_fwd_length … H) -H /2 width=1 by lt_minus_to_plus_r/
345 lemma ldrop_fwd_length_eq1: ∀L1,L2,K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 →
346 |L1| = |L2| → |K1| = |K2|.
347 #L1 #L2 #K1 #K2 #d #e #HLK1 #HLK2 #HL12
348 lapply (ldrop_fwd_length … HLK1) -HLK1
349 lapply (ldrop_fwd_length … HLK2) -HLK2
350 /2 width=2 by injective_plus_r/
353 lemma ldrop_fwd_length_eq2: ∀L1,L2,K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 →
354 |K1| = |K2| → |L1| = |L2|.
355 #L1 #L2 #K1 #K2 #d #e #HLK1 #HLK2 #HL12
356 lapply (ldrop_fwd_length … HLK1) -HLK1
357 lapply (ldrop_fwd_length … HLK2) -HLK2 //
360 lemma ldrop_fwd_lw: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → ♯{L2} ≤ ♯{L1}.
361 #L1 #L2 #s #d #e #H elim H -L1 -L2 -d -e // normalize
362 [ /2 width=3 by transitive_le/
363 | #I #L1 #L2 #V1 #V2 #d #e #_ #HV21 #IHL12
364 >(lift_fwd_tw … HV21) -HV21 /2 width=1 by monotonic_le_plus_l/
368 lemma ldrop_fwd_lw_lt: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → 0 < e → ♯{L2} < ♯{L1}.
369 #L1 #L2 #d #e #H elim H -L1 -L2 -d -e
371 | #I #L #V #H elim (lt_refl_false … H)
372 | #I #L1 #L2 #V #e #HL12 #_ #_
373 lapply (ldrop_fwd_lw … HL12) -HL12 #HL12
374 @(le_to_lt_to_lt … HL12) -HL12 //
375 | #I #L1 #L2 #V1 #V2 #d #e #_ #HV21 #IHL12 #H normalize in ⊢ (?%%); -I
376 >(lift_fwd_tw … HV21) -V2 /3 by lt_minus_to_plus/
380 lemma ldrop_fwd_rfw: ∀I,L,K,V,i. ⇩[i] L ≡ K.ⓑ{I}V → ♯{K, V} < ♯{L, #i}.
381 #I #L #K #V #i #HLK lapply (ldrop_fwd_lw … HLK) -HLK
382 normalize in ⊢ (%→?%%); /2 width=1 by le_S_S/
385 (* Advanced inversion lemmas ************************************************)
387 fact ldrop_inv_O2_aux: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → e = 0 → L1 = L2.
388 #L1 #L2 #s #d #e #H elim H -L1 -L2 -d -e
391 | #I #L1 #L2 #V #e #_ #_ >commutative_plus normalize #H destruct
392 | #I #L1 #L2 #V1 #V2 #d #e #_ #HV21 #IHL12 #H
393 >(IHL12 H) -L1 >(lift_inv_O2_aux … HV21 … H) -V2 -d -e //
397 (* Basic_1: was: drop_gen_refl *)
398 lemma ldrop_inv_O2: ∀L1,L2,s,d. ⇩[s, d, 0] L1 ≡ L2 → L1 = L2.
399 /2 width=5 by ldrop_inv_O2_aux/ qed-.
401 lemma ldrop_inv_length_eq: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → |L1| = |L2| → e = 0.
402 #L1 #L2 #d #e #H #HL12 lapply (ldrop_fwd_length_minus4 … H) //
405 lemma ldrop_inv_refl: ∀L,d,e. ⇩[Ⓕ, d, e] L ≡ L → e = 0.
406 /2 width=5 by ldrop_inv_length_eq/ qed-.
408 fact ldrop_inv_FT_aux: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 →
409 ∀I,K,V. L2 = K.ⓑ{I}V → s = Ⓣ → d = 0 →
410 ⇩[Ⓕ, d, e] L1 ≡ K.ⓑ{I}V.
411 #L1 #L2 #s #d #e #H elim H -L1 -L2 -d -e
412 [ #d #e #_ #J #K #W #H destruct
413 | #I #L #V #J #K #W #H destruct //
414 | #I #L1 #L2 #V #e #_ #IHL12 #J #K #W #H1 #H2 destruct
415 /3 width=1 by ldrop_drop/
416 | #I #L1 #L2 #V1 #V2 #d #e #_ #_ #_ #J #K #W #_ #_
417 <plus_n_Sm #H destruct
421 lemma ldrop_inv_FT: ∀I,L,K,V,e. ⇩[Ⓣ, 0, e] L ≡ K.ⓑ{I}V → ⇩[e] L ≡ K.ⓑ{I}V.
422 /2 width=5 by ldrop_inv_FT_aux/ qed.
424 lemma ldrop_inv_gen: ∀I,L,K,V,s,e. ⇩[s, 0, e] L ≡ K.ⓑ{I}V → ⇩[e] L ≡ K.ⓑ{I}V.
425 #I #L #K #V * /2 width=1 by ldrop_inv_FT/
428 lemma ldrop_inv_T: ∀I,L,K,V,s,e. ⇩[Ⓣ, 0, e] L ≡ K.ⓑ{I}V → ⇩[s, 0, e] L ≡ K.ⓑ{I}V.
429 #I #L #K #V * /2 width=1 by ldrop_inv_FT/
432 (* Basic_1: removed theorems 50:
433 drop_ctail drop_skip_flat
434 cimp_flat_sx cimp_flat_dx cimp_bind cimp_getl_conf
435 drop_clear drop_clear_O drop_clear_S
436 clear_gen_sort clear_gen_bind clear_gen_flat clear_gen_flat_r
437 clear_gen_all clear_clear clear_mono clear_trans clear_ctail clear_cle
438 getl_ctail_clen getl_gen_tail clear_getl_trans getl_clear_trans
439 getl_clear_bind getl_clear_conf getl_dec getl_drop getl_drop_conf_lt
440 getl_drop_conf_ge getl_conf_ge_drop getl_drop_conf_rev
441 drop_getl_trans_lt drop_getl_trans_le drop_getl_trans_ge
442 getl_drop_trans getl_flt getl_gen_all getl_gen_sort getl_gen_O
443 getl_gen_S getl_gen_2 getl_gen_flat getl_gen_bind getl_conf_le
444 getl_trans getl_refl getl_head getl_flat getl_ctail getl_mono