X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbasic_2%2Frelocation%2Fldrop.ma;h=b26b7e95b128caf163d94b776c92f82a106fcc7f;hb=928cfe1ebf2fbd31731c8851cdec70802596016d;hp=ee4780d884bf23a22a5911e37fc0d0020e6ee7ad;hpb=cfc43911db215e21036317b26bd1dcf9c3e5d435;p=helm.git diff --git a/matita/matita/contribs/lambdadelta/basic_2/relocation/ldrop.ma b/matita/matita/contribs/lambdadelta/basic_2/relocation/ldrop.ma index ee4780d88..b26b7e95b 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/relocation/ldrop.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/relocation/ldrop.ma @@ -12,8 +12,11 @@ (* *) (**************************************************************************) +include "ground_2/lib/bool.ma". include "ground_2/lib/lstar.ma". +include "basic_2/notation/relations/rdrop_5.ma". include "basic_2/notation/relations/rdrop_4.ma". +include "basic_2/notation/relations/rdrop_3.ma". include "basic_2/grammar/lenv_length.ma". include "basic_2/grammar/cl_restricted_weight.ma". include "basic_2/relocation/lift.ma". @@ -21,283 +24,307 @@ include "basic_2/relocation/lift.ma". (* BASIC SLICING FOR LOCAL ENVIRONMENTS *************************************) (* Basic_1: includes: drop_skip_bind *) -inductive ldrop: relation4 nat nat lenv lenv ≝ -| ldrop_atom : ∀d. ldrop d 0 (⋆) (⋆) -| ldrop_pair : ∀L,I,V. ldrop 0 0 (L. ⓑ{I} V) (L. ⓑ{I} V) -| ldrop_ldrop: ∀L1,L2,I,V,e. ldrop 0 e L1 L2 → ldrop 0 (e + 1) (L1. ⓑ{I} V) L2 -| ldrop_skip : ∀L1,L2,I,V1,V2,d,e. - ldrop d e L1 L2 → ⇧[d,e] V2 ≡ V1 → - ldrop (d + 1) e (L1. ⓑ{I} V1) (L2. ⓑ{I} V2) +inductive ldrop (s:bool): relation4 nat nat lenv lenv ≝ +| ldrop_atom: ∀d,e. (s = Ⓕ → e = 0) → ldrop s d e (⋆) (⋆) +| ldrop_pair: ∀I,L,V. ldrop s 0 0 (L.ⓑ{I}V) (L.ⓑ{I}V) +| ldrop_drop: ∀I,L1,L2,V,e. ldrop s 0 e L1 L2 → ldrop s 0 (e+1) (L1.ⓑ{I}V) L2 +| ldrop_skip: ∀I,L1,L2,V1,V2,d,e. + ldrop s d e L1 L2 → ⇧[d, e] V2 ≡ V1 → + ldrop s (d+1) e (L1.ⓑ{I}V1) (L2.ⓑ{I}V2) . interpretation - "basic slicing (local environment)" - 'RDrop d e L1 L2 = (ldrop d e L1 L2). + "basic slicing (local environment) abstract" + 'RDrop s d e L1 L2 = (ldrop s d e L1 L2). + +interpretation + "basic slicing (local environment) general" + 'RDrop d e L1 L2 = (ldrop true d e L1 L2). + +interpretation + "basic slicing (local environment) lget" + 'RDrop e L1 L2 = (ldrop false O e L1 L2). definition l_liftable: predicate (lenv → relation term) ≝ - λR. ∀K,T1,T2. R K T1 T2 → ∀L,d,e. ⇩[d, e] L ≡ K → + λR. ∀K,T1,T2. R K T1 T2 → ∀L,s,d,e. ⇩[s, d, e] L ≡ K → ∀U1. ⇧[d, e] T1 ≡ U1 → ∀U2. ⇧[d, e] T2 ≡ U2 → R L U1 U2. definition l_deliftable_sn: predicate (lenv → relation term) ≝ - λR. ∀L,U1,U2. R L U1 U2 → ∀K,d,e. ⇩[d, e] L ≡ K → + λR. ∀L,U1,U2. R L U1 U2 → ∀K,s,d,e. ⇩[s, d, e] L ≡ K → ∀T1. ⇧[d, e] T1 ≡ U1 → ∃∃T2. ⇧[d, e] T2 ≡ U2 & R K T1 T2. definition dropable_sn: predicate (relation lenv) ≝ - λR. ∀L1,K1,d,e. ⇩[d, e] L1 ≡ K1 → ∀L2. R L1 L2 → - ∃∃K2. R K1 K2 & ⇩[d, e] L2 ≡ K2. + λR. ∀L1,K1,s,d,e. ⇩[s, d, e] L1 ≡ K1 → ∀L2. R L1 L2 → + ∃∃K2. R K1 K2 & ⇩[s, d, e] L2 ≡ K2. definition dedropable_sn: predicate (relation lenv) ≝ - λR. ∀L1,K1,d,e. ⇩[d, e] L1 ≡ K1 → ∀K2. R K1 K2 → - ∃∃L2. R L1 L2 & ⇩[d, e] L2 ≡ K2. + λR. ∀L1,K1,s,d,e. ⇩[s, d, e] L1 ≡ K1 → ∀K2. R K1 K2 → + ∃∃L2. R L1 L2 & ⇩[s, d, e] L2 ≡ K2. definition dropable_dx: predicate (relation lenv) ≝ - λR. ∀L1,L2. R L1 L2 → ∀K2,e. ⇩[0, e] L2 ≡ K2 → - ∃∃K1. ⇩[0, e] L1 ≡ K1 & R K1 K2. + λR. ∀L1,L2. R L1 L2 → ∀K2,s,e. ⇩[s, 0, e] L2 ≡ K2 → + ∃∃K1. ⇩[s, 0, e] L1 ≡ K1 & R K1 K2. (* Basic inversion lemmas ***************************************************) -fact ldrop_inv_atom1_aux: ∀d,e,L1,L2. ⇩[d, e] L1 ≡ L2 → L1 = ⋆ → - L2 = ⋆ ∧ e = 0. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ /2 width=1 by conj/ -| #L #I #V #H destruct -| #L1 #L2 #I #V #e #_ #H destruct -| #L1 #L2 #I #V1 #V2 #d #e #_ #_ #H destruct +fact ldrop_inv_atom1_aux: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → L1 = ⋆ → + L2 = ⋆ ∧ (s = Ⓕ → e = 0). +#L1 #L2 #s #d #e * -L1 -L2 -d -e +[ /3 width=1 by conj/ +| #I #L #V #H destruct +| #I #L1 #L2 #V #e #_ #H destruct +| #I #L1 #L2 #V1 #V2 #d #e #_ #_ #H destruct ] qed-. (* Basic_1: was: drop_gen_sort *) -lemma ldrop_inv_atom1: ∀d,e,L2. ⇩[d, e] ⋆ ≡ L2 → L2 = ⋆ ∧ e = 0. +lemma ldrop_inv_atom1: ∀L2,s,d,e. ⇩[s, d, e] ⋆ ≡ L2 → L2 = ⋆ ∧ (s = Ⓕ → e = 0). /2 width=4 by ldrop_inv_atom1_aux/ qed-. -fact ldrop_inv_O1_pair1_aux: ∀d,e,L1,L2. ⇩[d, e] L1 ≡ L2 → d = 0 → - ∀K,I,V. L1 = K. ⓑ{I} V → - (e = 0 ∧ L2 = K. ⓑ{I} V) ∨ - (0 < e ∧ ⇩[d, e - 1] K ≡ L2). -#d #e #L1 #L2 * -d -e -L1 -L2 -[ #d #_ #K #I #V #H destruct -| #L #I #V #_ #K #J #W #HX destruct /3 width=1 by or_introl, conj/ -| #L1 #L2 #I #V #e #HL12 #_ #K #J #W #H destruct /3 width=1 by or_intror, conj/ -| #L1 #L2 #I #V1 #V2 #d #e #_ #_ >commutative_plus normalize #H destruct +fact ldrop_inv_O1_pair1_aux: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → d = 0 → + ∀K,I,V. L1 = K.ⓑ{I}V → + (e = 0 ∧ L2 = K.ⓑ{I}V) ∨ + (0 < e ∧ ⇩[s, d, e-1] K ≡ L2). +#L1 #L2 #s #d #e * -L1 -L2 -d -e +[ #d #e #_ #_ #K #J #W #H destruct +| #I #L #V #_ #K #J #W #HX destruct /3 width=1 by or_introl, conj/ +| #I #L1 #L2 #V #e #HL12 #_ #K #J #W #H destruct /3 width=1 by or_intror, conj/ +| #I #L1 #L2 #V1 #V2 #d #e #_ #_ >commutative_plus normalize #H destruct ] qed-. -lemma ldrop_inv_O1_pair1: ∀e,K,I,V,L2. ⇩[0, e] K. ⓑ{I} V ≡ L2 → - (e = 0 ∧ L2 = K. ⓑ{I} V) ∨ - (0 < e ∧ ⇩[0, e - 1] K ≡ L2). +lemma ldrop_inv_O1_pair1: ∀I,K,L2,V,s,e. ⇩[s, 0, e] K. ⓑ{I} V ≡ L2 → + (e = 0 ∧ L2 = K.ⓑ{I}V) ∨ + (0 < e ∧ ⇩[s, 0, e-1] K ≡ L2). /2 width=3 by ldrop_inv_O1_pair1_aux/ qed-. -lemma ldrop_inv_pair1: ∀K,I,V,L2. ⇩[0, 0] K. ⓑ{I} V ≡ L2 → L2 = K. ⓑ{I} V. -#K #I #V #L2 #H +lemma ldrop_inv_pair1: ∀I,K,L2,V,s. ⇩[s, 0, 0] K.ⓑ{I}V ≡ L2 → L2 = K.ⓑ{I}V. +#I #K #L2 #V #s #H elim (ldrop_inv_O1_pair1 … H) -H * // #H destruct elim (lt_refl_false … H) qed-. (* Basic_1: was: drop_gen_drop *) -lemma ldrop_inv_ldrop1_lt: ∀e,K,I,V,L2. - ⇩[0, e] K. ⓑ{I} V ≡ L2 → 0 < e → ⇩[0, e - 1] K ≡ L2. -#e #K #I #V #L2 #H #He +lemma ldrop_inv_drop1_lt: ∀I,K,L2,V,s,e. + ⇩[s, 0, e] K.ⓑ{I}V ≡ L2 → 0 < e → ⇩[s, 0, e-1] K ≡ L2. +#I #K #L2 #V #s #e #H #He elim (ldrop_inv_O1_pair1 … H) -H * // #H destruct elim (lt_refl_false … He) qed-. -lemma ldrop_inv_ldrop1: ∀e,K,I,V,L2. - ⇩[0, e+1] K. ⓑ{I} V ≡ L2 → ⇩[0, e] K ≡ L2. -#e #K #I #V #L2 #H lapply (ldrop_inv_ldrop1_lt … H ?) -H // +lemma ldrop_inv_drop1: ∀I,K,L2,V,s,e. + ⇩[s, 0, e+1] K.ⓑ{I}V ≡ L2 → ⇩[s, 0, e] K ≡ L2. +#I #K #L2 #V #s #e #H lapply (ldrop_inv_drop1_lt … H ?) -H // qed-. -fact ldrop_inv_skip1_aux: ∀d,e,L1,L2. ⇩[d, e] L1 ≡ L2 → 0 < d → - ∀I,K1,V1. L1 = K1. ⓑ{I} V1 → - ∃∃K2,V2. ⇩[d - 1, e] K1 ≡ K2 & - ⇧[d - 1, e] V2 ≡ V1 & - L2 = K2. ⓑ{I} V2. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ #d #_ #I #K #V #H destruct -| #L #I #V #H elim (lt_refl_false … H) -| #L1 #L2 #I #V #e #_ #H elim (lt_refl_false … H) -| #X #L2 #Y #Z #V2 #d #e #HL12 #HV12 #_ #I #L1 #V1 #H destruct /2 width=5 by ex3_2_intro/ +fact ldrop_inv_skip1_aux: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → 0 < d → + ∀I,K1,V1. L1 = K1.ⓑ{I}V1 → + ∃∃K2,V2. ⇩[s, d-1, e] K1 ≡ K2 & + ⇧[d-1, e] V2 ≡ V1 & + L2 = K2.ⓑ{I}V2. +#L1 #L2 #s #d #e * -L1 -L2 -d -e +[ #d #e #_ #_ #J #K1 #W1 #H destruct +| #I #L #V #H elim (lt_refl_false … H) +| #I #L1 #L2 #V #e #_ #H elim (lt_refl_false … H) +| #I #L1 #L2 #V1 #V2 #d #e #HL12 #HV21 #_ #J #K1 #W1 #H destruct /2 width=5 by ex3_2_intro/ ] qed-. (* Basic_1: was: drop_gen_skip_l *) -lemma ldrop_inv_skip1: ∀d,e,I,K1,V1,L2. ⇩[d, e] K1. ⓑ{I} V1 ≡ L2 → 0 < d → - ∃∃K2,V2. ⇩[d - 1, e] K1 ≡ K2 & - ⇧[d - 1, e] V2 ≡ V1 & - L2 = K2. ⓑ{I} V2. +lemma ldrop_inv_skip1: ∀I,K1,V1,L2,s,d,e. ⇩[s, d, e] K1.ⓑ{I}V1 ≡ L2 → 0 < d → + ∃∃K2,V2. ⇩[s, d-1, e] K1 ≡ K2 & + ⇧[d-1, e] V2 ≡ V1 & + L2 = K2.ⓑ{I}V2. /2 width=3 by ldrop_inv_skip1_aux/ qed-. -lemma ldrop_inv_O1_pair2: ∀I,K,V,e,L1. ⇩[0, e] L1 ≡ K. ⓑ{I} V → - (e = 0 ∧ L1 = K. ⓑ{I} V) ∨ - ∃∃I1,K1,V1. ⇩[0, e - 1] K1 ≡ K. ⓑ{I} V & L1 = K1.ⓑ{I1}V1 & 0 < e. -#I #K #V #e * +lemma ldrop_inv_O1_pair2: ∀I,K,V,s,e,L1. ⇩[s, 0, e] L1 ≡ K.ⓑ{I}V → + (e = 0 ∧ L1 = K.ⓑ{I}V) ∨ + ∃∃I1,K1,V1. ⇩[s, 0, e-1] K1 ≡ K.ⓑ{I}V & L1 = K1.ⓑ{I1}V1 & 0 < e. +#I #K #V #s #e * [ #H elim (ldrop_inv_atom1 … H) -H #H destruct | #L1 #I1 #V1 #H elim (ldrop_inv_O1_pair1 … H) -H * [ #H1 #H2 destruct /3 width=1 by or_introl, conj/ - | /3 width=5/ + | /3 width=5 by ex3_3_intro, or_intror/ ] ] qed-. -fact ldrop_inv_skip2_aux: ∀d,e,L1,L2. ⇩[d, e] L1 ≡ L2 → 0 < d → - ∀I,K2,V2. L2 = K2. ⓑ{I} V2 → - ∃∃K1,V1. ⇩[d - 1, e] K1 ≡ K2 & - ⇧[d - 1, e] V2 ≡ V1 & - L1 = K1. ⓑ{I} V1. -#d #e #L1 #L2 * -d -e -L1 -L2 -[ #d #_ #I #K #V #H destruct -| #L #I #V #H elim (lt_refl_false … H) -| #L1 #L2 #I #V #e #_ #H elim (lt_refl_false … H) -| #L1 #X #Y #V1 #Z #d #e #HL12 #HV12 #_ #I #L2 #V2 #H destruct /2 width=5 by ex3_2_intro/ +fact ldrop_inv_skip2_aux: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → 0 < d → + ∀I,K2,V2. L2 = K2.ⓑ{I}V2 → + ∃∃K1,V1. ⇩[s, d-1, e] K1 ≡ K2 & + ⇧[d-1, e] V2 ≡ V1 & + L1 = K1.ⓑ{I}V1. +#L1 #L2 #s #d #e * -L1 -L2 -d -e +[ #d #e #_ #_ #J #K2 #W2 #H destruct +| #I #L #V #H elim (lt_refl_false … H) +| #I #L1 #L2 #V #e #_ #H elim (lt_refl_false … H) +| #I #L1 #L2 #V1 #V2 #d #e #HL12 #HV21 #_ #J #K2 #W2 #H destruct /2 width=5 by ex3_2_intro/ ] qed-. (* Basic_1: was: drop_gen_skip_r *) -lemma ldrop_inv_skip2: ∀d,e,I,L1,K2,V2. ⇩[d, e] L1 ≡ K2. ⓑ{I} V2 → 0 < d → - ∃∃K1,V1. ⇩[d - 1, e] K1 ≡ K2 & ⇧[d - 1, e] V2 ≡ V1 & - L1 = K1. ⓑ{I} V1. +lemma ldrop_inv_skip2: ∀I,L1,K2,V2,s,d,e. ⇩[s, d, e] L1 ≡ K2.ⓑ{I}V2 → 0 < d → + ∃∃K1,V1. ⇩[s, d-1, e] K1 ≡ K2 & ⇧[d-1, e] V2 ≡ V1 & + L1 = K1.ⓑ{I}V1. /2 width=3 by ldrop_inv_skip2_aux/ qed-. (* Basic properties *********************************************************) +lemma ldrop_refl_atom_O2: ∀s,d. ⇩[s, d, O] ⋆ ≡ ⋆. +/2 width=1 by ldrop_atom/ qed. + (* Basic_1: was by definition: drop_refl *) -lemma ldrop_refl: ∀L,d. ⇩[d, 0] L ≡ L. +lemma ldrop_refl: ∀L,d,s. ⇩[s, d, 0] L ≡ L. #L elim L -L // -#L #I #V #IHL #d @(nat_ind_plus … d) -d /2 width=1 by ldrop_pair, ldrop_skip/ +#L #I #V #IHL #d #s @(nat_ind_plus … d) -d /2 width=1 by ldrop_pair, ldrop_skip/ qed. -lemma ldrop_ldrop_lt: ∀L1,L2,I,V,e. - ⇩[0, e - 1] L1 ≡ L2 → 0 < e → ⇩[0, e] L1. ⓑ{I} V ≡ L2. -#L1 #L2 #I #V #e #HL12 #He >(plus_minus_m_m e 1) /2 width=1 by ldrop_ldrop/ +lemma ldrop_drop_lt: ∀I,L1,L2,V,s,e. + ⇩[s, 0, e-1] L1 ≡ L2 → 0 < e → ⇩[s, 0, e] L1.ⓑ{I}V ≡ L2. +#I #L1 #L2 #V #s #e #HL12 #He >(plus_minus_m_m e 1) /2 width=1 by ldrop_drop/ qed. -lemma ldrop_skip_lt: ∀L1,L2,I,V1,V2,d,e. - ⇩[d - 1, e] L1 ≡ L2 → ⇧[d - 1, e] V2 ≡ V1 → 0 < d → - ⇩[d, e] L1. ⓑ{I} V1 ≡ L2. ⓑ{I} V2. -#L1 #L2 #I #V1 #V2 #d #e #HL12 #HV21 #Hd >(plus_minus_m_m d 1) /2 width=1 by ldrop_skip/ +lemma ldrop_skip_lt: ∀I,L1,L2,V1,V2,s,d,e. + ⇩[s, d-1, e] L1 ≡ L2 → ⇧[d-1, e] V2 ≡ V1 → 0 < d → + ⇩[s, d, e] L1. ⓑ{I} V1 ≡ L2.ⓑ{I}V2. +#I #L1 #L2 #V1 #V2 #s #d #e #HL12 #HV21 #Hd >(plus_minus_m_m d 1) /2 width=1 by ldrop_skip/ qed. -lemma ldrop_O1_le: ∀e,L. e ≤ |L| → ∃K. ⇩[0, e] L ≡ K. -#e @(nat_ind_plus … e) -e /2 width=2/ +lemma ldrop_O1_le: ∀e,L. e ≤ |L| → ∃K. ⇩[e] L ≡ K. +#e @(nat_ind_plus … e) -e /2 width=2 by ex_intro/ #e #IHe * [ #H lapply (le_n_O_to_eq … H) -H >commutative_plus normalize #H destruct | #L #I #V normalize #H - elim (IHe L) -IHe /2 width=1/ -H /3 width=2 by ldrop_ldrop, ex_intro/ + elim (IHe L) -IHe /3 width=2 by ldrop_drop, monotonic_pred, ex_intro/ ] -qed. +qed-. -lemma ldrop_O1_lt: ∀L,e. e < |L| → ∃∃I,K,V. ⇩[0, e] L ≡ K.ⓑ{I}V. +lemma ldrop_O1_lt: ∀L,e. e < |L| → ∃∃I,K,V. ⇩[e] L ≡ K.ⓑ{I}V. #L elim L -L [ #e #H elim (lt_zero_false … H) | #L #I #V #IHL #e @(nat_ind_plus … e) -e /2 width=4 by ldrop_pair, ex1_3_intro/ #e #_ normalize #H - elim (IHL e) -IHL /3 width=4 by ldrop_ldrop, lt_plus_to_minus_r, lt_plus_to_lt_l, ex1_3_intro/ + elim (IHL e) -IHL /3 width=4 by ldrop_drop, lt_plus_to_minus_r, lt_plus_to_lt_l, ex1_3_intro/ ] +qed-. + +lemma ldrop_FT: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → ⇩[Ⓣ, d, e] L1 ≡ L2. +#L1 #L2 #d #e #H elim H -L1 -L2 -d -e +/3 width=1 by ldrop_atom, ldrop_drop, ldrop_skip/ qed. +lemma ldrop_gen: ∀L1,L2,s,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → ⇩[s, d, e] L1 ≡ L2. +#L1 #L2 * /2 width=1 by ldrop_FT/ +qed-. + +lemma ldrop_T: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → ⇩[Ⓣ, d, e] L1 ≡ L2. +#L1 #L2 * /2 width=1 by ldrop_FT/ +qed-. + lemma l_liftable_LTC: ∀R. l_liftable R → l_liftable (LTC … R). #R #HR #K #T1 #T2 #H elim H -T2 -[ /3 width=9/ -| #T #T2 #_ #HT2 #IHT1 #L #d #e #HLK #U1 #HTU1 #U2 #HTU2 - elim (lift_total T d e) /4 width=11 by step/ +[ /3 width=10 by inj/ +| #T #T2 #_ #HT2 #IHT1 #L #s #d #e #HLK #U1 #HTU1 #U2 #HTU2 + elim (lift_total T d e) /4 width=12 by step/ ] -qed. +qed-. lemma l_deliftable_sn_LTC: ∀R. l_deliftable_sn R → l_deliftable_sn (LTC … R). #R #HR #L #U1 #U2 #H elim H -U2 -[ #U2 #HU12 #K #d #e #HLK #T1 #HTU1 +[ #U2 #HU12 #K #s #d #e #HLK #T1 #HTU1 elim (HR … HU12 … HLK … HTU1) -HR -L -U1 /3 width=3 by inj, ex2_intro/ -| #U #U2 #_ #HU2 #IHU1 #K #d #e #HLK #T1 #HTU1 +| #U #U2 #_ #HU2 #IHU1 #K #s #d #e #HLK #T1 #HTU1 elim (IHU1 … HLK … HTU1) -IHU1 -U1 #T #HTU #HT1 elim (HR … HU2 … HLK … HTU) -HR -L -U /3 width=5 by step, ex2_intro/ ] -qed. +qed-. lemma dropable_sn_TC: ∀R. dropable_sn R → dropable_sn (TC … R). -#R #HR #L1 #K1 #d #e #HLK1 #L2 #H elim H -L2 -[ #L2 #HL12 - elim (HR … HLK1 … HL12) -HR -L1 /3 width=3 by inj, ex2_intro/ -| #L #L2 #_ #HL2 * #K #HK1 #HLK - elim (HR … HLK … HL2) -HR -L /3 width=3 by step, ex2_intro/ +#R #HR #L1 #K1 #s #d #e #HLK1 #L2 #H elim H -L2 +[ #L2 #HL12 elim (HR … HLK1 … HL12) -HR -L1 + /3 width=3 by inj, ex2_intro/ +| #L #L2 #_ #HL2 * #K #HK1 #HLK elim (HR … HLK … HL2) -HR -L + /3 width=3 by step, ex2_intro/ ] -qed. +qed-. lemma dedropable_sn_TC: ∀R. dedropable_sn R → dedropable_sn (TC … R). -#R #HR #L1 #K1 #d #e #HLK1 #K2 #H elim H -K2 -[ #K2 #HK12 - elim (HR … HLK1 … HK12) -HR -K1 /3 width=3 by inj, ex2_intro/ -| #K #K2 #_ #HK2 * #L #HL1 #HLK - elim (HR … HLK … HK2) -HR -K /3 width=3 by step, ex2_intro/ +#R #HR #L1 #K1 #s #d #e #HLK1 #K2 #H elim H -K2 +[ #K2 #HK12 elim (HR … HLK1 … HK12) -HR -K1 + /3 width=3 by inj, ex2_intro/ +| #K #K2 #_ #HK2 * #L #HL1 #HLK elim (HR … HLK … HK2) -HR -K + /3 width=3 by step, ex2_intro/ ] -qed. +qed-. lemma dropable_dx_TC: ∀R. dropable_dx R → dropable_dx (TC … R). #R #HR #L1 #L2 #H elim H -L2 -[ #L2 #HL12 #K2 #e #HLK2 - elim (HR … HL12 … HLK2) -HR -L2 /3 width=3 by inj, ex2_intro/ -| #L #L2 #_ #HL2 #IHL1 #K2 #e #HLK2 - elim (HR … HL2 … HLK2) -HR -L2 #K #HLK #HK2 - elim (IHL1 … HLK) -L /3 width=5 by step, ex2_intro/ +[ #L2 #HL12 #K2 #s #e #HLK2 elim (HR … HL12 … HLK2) -HR -L2 + /3 width=3 by inj, ex2_intro/ +| #L #L2 #_ #HL2 #IHL1 #K2 #s #e #HLK2 elim (HR … HL2 … HLK2) -HR -L2 + #K #HLK #HK2 elim (IHL1 … HLK) -L + /3 width=5 by step, ex2_intro/ ] -qed. +qed-. lemma l_deliftable_sn_llstar: ∀R. l_deliftable_sn R → ∀l. l_deliftable_sn (llstar … R l). #R #HR #l #L #U1 #U2 #H @(lstar_ind_r … l U2 H) -l -U2 [ /2 width=3 by lstar_O, ex2_intro/ -| #l #U #U2 #_ #HU2 #IHU1 #K #d #e #HLK #T1 #HTU1 +| #l #U #U2 #_ #HU2 #IHU1 #K #s #d #e #HLK #T1 #HTU1 elim (IHU1 … HLK … HTU1) -IHU1 -U1 #T #HTU #HT1 elim (HR … HU2 … HLK … HTU) -HR -L -U /3 width=5 by lstar_dx, ex2_intro/ ] -qed. +qed-. (* Basic forvard lemmas *****************************************************) (* Basic_1: was: drop_S *) -lemma ldrop_fwd_ldrop2: ∀L1,I2,K2,V2,e. ⇩[O, e] L1 ≡ K2. ⓑ{I2} V2 → - ⇩[O, e + 1] L1 ≡ K2. +lemma ldrop_fwd_drop2: ∀L1,I2,K2,V2,s,e. ⇩[s, O, e] L1 ≡ K2. ⓑ{I2} V2 → + ⇩[s, O, e + 1] L1 ≡ K2. #L1 elim L1 -L1 -[ #I2 #K2 #V2 #e #H lapply (ldrop_inv_atom1 … H) -H * #H destruct -| #K1 #I1 #V1 #IHL1 #I2 #K2 #V2 #e #H +[ #I2 #K2 #V2 #s #e #H lapply (ldrop_inv_atom1 … H) -H * #H destruct +| #K1 #I1 #V1 #IHL1 #I2 #K2 #V2 #s #e #H elim (ldrop_inv_O1_pair1 … H) -H * #He #H - [ -IHL1 destruct /2 width=1/ - | @ldrop_ldrop >(plus_minus_m_m e 1) /2 width=3 by / + [ -IHL1 destruct /2 width=1 by ldrop_drop/ + | @ldrop_drop >(plus_minus_m_m e 1) /2 width=3 by/ ] ] qed-. -lemma ldrop_fwd_length: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → |L1| = |L2| + e. -#L1 #L2 #d #e #H elim H -L1 -L2 -d -e // normalize /2 width=1 by / +lemma ldrop_fwd_length: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → |L1| = |L2| + e. +#L1 #L2 #d #e #H elim H -L1 -L2 -d -e // normalize /2 width=1 by/ qed-. -lemma ldrop_fwd_length_minus2: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → |L2| = |L1| - e. +lemma ldrop_fwd_length_minus2: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → |L2| = |L1| - e. #L1 #L2 #d #e #H lapply (ldrop_fwd_length … H) -H /2 width=1 by plus_minus, le_n/ qed-. -lemma ldrop_fwd_length_minus4: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → e = |L1| - |L2|. +lemma ldrop_fwd_length_minus4: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → e = |L1| - |L2|. #L1 #L2 #d #e #H lapply (ldrop_fwd_length … H) -H // qed-. -lemma ldrop_fwd_length_le2: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → e ≤ |L1|. +lemma ldrop_fwd_length_le2: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → e ≤ |L1|. #L1 #L2 #d #e #H lapply (ldrop_fwd_length … H) -H // qed-. -lemma ldrop_fwd_length_le4: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → |L2| ≤ |L1|. +lemma ldrop_fwd_length_le4: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → |L2| ≤ |L1|. #L1 #L2 #d #e #H lapply (ldrop_fwd_length … H) -H // qed-. lemma ldrop_fwd_length_lt2: ∀L1,I2,K2,V2,d,e. - ⇩[d, e] L1 ≡ K2. ⓑ{I2} V2 → e < |L1|. + ⇩[Ⓕ, d, e] L1 ≡ K2. ⓑ{I2} V2 → e < |L1|. #L1 #I2 #K2 #V2 #d #e #H lapply (ldrop_fwd_length … H) normalize in ⊢ (%→?); -I2 -V2 // qed-. -lemma ldrop_fwd_length_lt4: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → 0 < e → |L2| < |L1|. +lemma ldrop_fwd_length_lt4: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → 0 < e → |L2| < |L1|. #L1 #L2 #d #e #H lapply (ldrop_fwd_length … H) -H /2 width=1 by lt_minus_to_plus_r/ qed-. -lemma ldrop_fwd_length_eq1: ∀L1,L2,K1,K2,d,e. ⇩[d, e] L1 ≡ K1 → ⇩[d, e] L2 ≡ K2 → +lemma ldrop_fwd_length_eq1: ∀L1,L2,K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → |L1| = |L2| → |K1| = |K2|. #L1 #L2 #K1 #K2 #d #e #HLK1 #HLK2 #HL12 lapply (ldrop_fwd_length … HLK1) -HLK1 @@ -305,60 +332,85 @@ lapply (ldrop_fwd_length … HLK2) -HLK2 /2 width=2 by injective_plus_r/ qed-. -lemma ldrop_fwd_length_eq2: ∀L1,L2,K1,K2,d,e. ⇩[d, e] L1 ≡ K1 → ⇩[d, e] L2 ≡ K2 → +lemma ldrop_fwd_length_eq2: ∀L1,L2,K1,K2,d,e. ⇩[Ⓕ, d, e] L1 ≡ K1 → ⇩[Ⓕ, d, e] L2 ≡ K2 → |K1| = |K2| → |L1| = |L2|. #L1 #L2 #K1 #K2 #d #e #HLK1 #HLK2 #HL12 lapply (ldrop_fwd_length … HLK1) -HLK1 lapply (ldrop_fwd_length … HLK2) -HLK2 // qed-. -lemma ldrop_fwd_lw: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → ♯{L2} ≤ ♯{L1}. -#L1 #L2 #d #e #H elim H -L1 -L2 -d -e // normalize +lemma ldrop_fwd_lw: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → ♯{L2} ≤ ♯{L1}. +#L1 #L2 #s #d #e #H elim H -L1 -L2 -d -e // normalize [ /2 width=3 by transitive_le/ -| #L1 #L2 #I #V1 #V2 #d #e #_ #HV21 #IHL12 +| #I #L1 #L2 #V1 #V2 #d #e #_ #HV21 #IHL12 >(lift_fwd_tw … HV21) -HV21 /2 width=1 by monotonic_le_plus_l/ ] qed-. -lemma ldrop_fwd_lw_lt: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → 0 < e → ♯{L2} < ♯{L1}. -#L1 #L2 #d #e #H elim H -L1 -L2 -d -e // -[ #L #I #V #H elim (lt_refl_false … H) -| #L1 #L2 #I #V #e #HL12 #_ #_ +lemma ldrop_fwd_lw_lt: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → 0 < e → ♯{L2} < ♯{L1}. +#L1 #L2 #d #e #H elim H -L1 -L2 -d -e +[ #d #e #H >H -H // +| #I #L #V #H elim (lt_refl_false … H) +| #I #L1 #L2 #V #e #HL12 #_ #_ lapply (ldrop_fwd_lw … HL12) -HL12 #HL12 @(le_to_lt_to_lt … HL12) -HL12 // -| #L1 #L2 #I #V1 #V2 #d #e #_ #HV21 #IHL12 #H normalize in ⊢ (?%%); -I +| #I #L1 #L2 #V1 #V2 #d #e #_ #HV21 #IHL12 #H normalize in ⊢ (?%%); -I >(lift_fwd_tw … HV21) -V2 /3 by lt_minus_to_plus/ ] qed-. -lemma ldrop_fwd_rfw: ∀I,L,K,V,i. ⇩[O, i] L ≡ K.ⓑ{I}V → ♯{K, V} < ♯{L, #i}. +lemma ldrop_fwd_rfw: ∀I,L,K,V,i. ⇩[i] L ≡ K.ⓑ{I}V → ♯{K, V} < ♯{L, #i}. #I #L #K #V #i #HLK lapply (ldrop_fwd_lw … HLK) -HLK normalize in ⊢ (%→?%%); /2 width=1 by le_S_S/ qed-. (* Advanced inversion lemmas ************************************************) -fact ldrop_inv_O2_aux: ∀d,e,L1,L2. ⇩[d, e] L1 ≡ L2 → e = 0 → L1 = L2. -#d #e #L1 #L2 #H elim H -d -e -L1 -L2 +fact ldrop_inv_O2_aux: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → e = 0 → L1 = L2. +#L1 #L2 #s #d #e #H elim H -L1 -L2 -d -e [ // | // -| #L1 #L2 #I #V #e #_ #_ >commutative_plus normalize #H destruct -| #L1 #L2 #I #V1 #V2 #d #e #_ #HV21 #IHL12 #H +| #I #L1 #L2 #V #e #_ #_ >commutative_plus normalize #H destruct +| #I #L1 #L2 #V1 #V2 #d #e #_ #HV21 #IHL12 #H >(IHL12 H) -L1 >(lift_inv_O2_aux … HV21 … H) -V2 -d -e // ] qed-. (* Basic_1: was: drop_gen_refl *) -lemma ldrop_inv_O2: ∀L1,L2,d. ⇩[d, 0] L1 ≡ L2 → L1 = L2. -/2 width=4 by ldrop_inv_O2_aux/ qed-. +lemma ldrop_inv_O2: ∀L1,L2,s,d. ⇩[s, d, 0] L1 ≡ L2 → L1 = L2. +/2 width=5 by ldrop_inv_O2_aux/ qed-. -lemma ldrop_inv_length_eq: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → |L1| = |L2| → e = 0. +lemma ldrop_inv_length_eq: ∀L1,L2,d,e. ⇩[Ⓕ, d, e] L1 ≡ L2 → |L1| = |L2| → e = 0. #L1 #L2 #d #e #H #HL12 lapply (ldrop_fwd_length_minus4 … H) // qed-. -lemma ldrop_inv_refl: ∀L,d,e. ⇩[d, e] L ≡ L → e = 0. +lemma ldrop_inv_refl: ∀L,d,e. ⇩[Ⓕ, d, e] L ≡ L → e = 0. /2 width=5 by ldrop_inv_length_eq/ qed-. +fact ldrop_inv_FT_aux: ∀L1,L2,s,d,e. ⇩[s, d, e] L1 ≡ L2 → + ∀I,K,V. L2 = K.ⓑ{I}V → s = Ⓣ → d = 0 → + ⇩[Ⓕ, d, e] L1 ≡ K.ⓑ{I}V. +#L1 #L2 #s #d #e #H elim H -L1 -L2 -d -e +[ #d #e #_ #J #K #W #H destruct +| #I #L #V #J #K #W #H destruct // +| #I #L1 #L2 #V #e #_ #IHL12 #J #K #W #H1 #H2 destruct + /3 width=1 by ldrop_drop/ +| #I #L1 #L2 #V1 #V2 #d #e #_ #_ #_ #J #K #W #_ #_ +