]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/basic_2/relocation/lsuby.ma
- main proposition on lsx finally proved!
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / relocation / lsuby.ma
index 34212a6c7f857ab57d6efcedc29a1d380b318c81..6c90b202b9a44388297b107b64f8a35f255eb691 100644 (file)
@@ -14,7 +14,7 @@
 
 include "ground_2/ynat/ynat_plus.ma".
 include "basic_2/notation/relations/extlrsubeq_4.ma".
-include "basic_2/grammar/lenv_length.ma".
+include "basic_2/relocation/ldrop.ma".
 
 (* LOCAL ENVIRONMENT REFINEMENT FOR EXTENDED SUBSTITUTION *******************)
 
@@ -57,7 +57,7 @@ lemma lsuby_refl: ∀L,d,e. L ⊑×[d, e] L.
 #He destruct /2 width=1 by lsuby_zero, lsuby_pair/
 qed.
 
-lemma lsuby_O1: ∀L2,L1,d. |L2| ≤ |L1| → L1 ⊑×[d, yinj 0] L2.
+lemma lsuby_O2: ∀L2,L1,d. |L2| ≤ |L1| → L1 ⊑×[d, yinj 0] L2.
 #L2 elim L2 -L2 // #L2 #I2 #V2 #IHL2 * normalize
 [ #d #H lapply (le_n_O_to_eq … H) -H <plus_n_Sm #H destruct
 | #L1 #I1 #V1 #d #H lapply (le_plus_to_le_r … H) -H #HL12
@@ -69,7 +69,7 @@ qed.
 lemma lsuby_sym: ∀d,e,L1,L2. L1 ⊑×[d, e] L2 → |L1| = |L2| → L2 ⊑×[d, e] L1.
 #d #e #L1 #L2 #H elim H -d -e -L1 -L2
 [ #L1 #d #e #H >(length_inv_zero_dx … H) -L1 //
-| /2 width=1 by lsuby_O1/
+| /2 width=1 by lsuby_O2/
 | #I1 #I2 #L1 #L2 #V #e #_ #IHL12 #H lapply (injective_plus_l … H)
   /3 width=1 by lsuby_pair/
 | #I1 #I2 #L1 #L2 #V1 #V2 #d #e #_ #IHL12 #H lapply (injective_plus_l … H)
@@ -206,3 +206,32 @@ lemma lsuby_inv_succ2: ∀I2,K2,L1,V2,d,e. L1 ⊑×[d, e] K2.ⓑ{I2}V2 → 0 < d
 lemma lsuby_fwd_length: ∀L1,L2,d,e. L1 ⊑×[d, e] L2 → |L2| ≤ |L1|.
 #L1 #L2 #d #e #H elim H -L1 -L2 -d -e normalize /2 width=1 by le_S_S/
 qed-.
+
+(* Properties on basic slicing **********************************************)
+
+lemma lsuby_ldrop_trans_be: ∀L1,L2,d,e. L1 ⊑×[d, e] L2 →
+                            ∀I2,K2,W,s,i. ⇩[s, 0, i] L2 ≡ K2.ⓑ{I2}W →
+                            d ≤ i → i < d + e →
+                            ∃∃I1,K1. K1 ⊑×[0, ⫰(d+e-i)] K2 & ⇩[s, 0, i] L1 ≡ K1.ⓑ{I1}W.
+#L1 #L2 #d #e #H elim H -L1 -L2 -d -e
+[ #L1 #d #e #J2 #K2 #W #s #i #H
+  elim (ldrop_inv_atom1 … H) -H #H destruct
+| #I1 #I2 #L1 #L2 #V1 #V2 #_ #_ #J2 #K2 #W #s #i #_ #_ #H
+  elim (ylt_yle_false … H) //
+| #I1 #I2 #L1 #L2 #V #e #HL12 #IHL12 #J2 #K2 #W #s #i #H #_ >yplus_O1
+  elim (ldrop_inv_O1_pair1 … H) -H * #Hi #HLK1 [ -IHL12 | -HL12 ]
+  [ #_ destruct -I2 >ypred_succ
+    /2 width=4 by ldrop_pair, ex2_2_intro/
+  | lapply (ylt_inv_O1 i ?) /2 width=1 by ylt_inj/
+    #H <H -H #H lapply (ylt_inv_succ … H) -H
+    #Hie elim (IHL12 … HLK1) -IHL12 -HLK1 // -Hie
+    >yminus_succ <yminus_inj /3 width=4 by ldrop_drop_lt, ex2_2_intro/
+  ]
+| #I1 #I2 #L1 #L2 #V1 #V2 #d #e #_ #IHL12 #J2 #K2 #W #s #i #HLK2 #Hdi
+  elim (yle_inv_succ1 … Hdi) -Hdi
+  #Hdi #Hi <Hi >yplus_succ1 #H lapply (ylt_inv_succ … H) -H
+  #Hide lapply (ldrop_inv_drop1_lt … HLK2 ?) -HLK2 /2 width=1 by ylt_O/
+  #HLK1 elim (IHL12 … HLK1) -IHL12 -HLK1 <yminus_inj >yminus_SO2
+  /4 width=4 by ylt_O, ldrop_drop_lt, ex2_2_intro/
+]
+qed-.