]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/basic_2/static/aaa_drops.ma
- advances on drops
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / static / aaa_drops.ma
index 9fc9a9ebd27c1447b716384f4e6ea3dd6a2a557e..5ef58ee9f1bbeb91c7a88d72ff30055813af0624 100644 (file)
 (*                                                                        *)
 (**************************************************************************)
 
-include "basic_2/relocation/drops.ma".
+include "basic_2/relocation/drops_drops.ma".
+include "basic_2/s_computation/fqup_weight.ma".
+include "basic_2/s_computation/fqup_drops.ma".
 include "basic_2/static/aaa.ma".
 
 (* ATONIC ARITY ASSIGNMENT ON TERMS *****************************************)
 
-(* Properties with generic slicing for local environments *******************)
+(* Advanced properties ******************************************************)
 
 (* Basic_2A1: was: aaa_lref *)
 lemma aaa_lref_gen: ∀I,G,K,V,B,i,L. ⬇*[i] L ≡ K.ⓑ{I}V → ⦃G, K⦄ ⊢ V ⁝ B → ⦃G, L⦄ ⊢ #i ⁝ B.
@@ -29,46 +31,7 @@ lemma aaa_lref_gen: ∀I,G,K,V,B,i,L. ⬇*[i] L ≡ K.ⓑ{I}V → ⦃G, K⦄ ⊢
 ]
 qed.
 
-(* Basic_2A1: includes: aaa_lift *)
-lemma aaa_lifts: ∀G,L1,T1,A. ⦃G, L1⦄ ⊢ T1 ⁝ A → ∀L2,c,f. ⬇*[c, f] L2 ≡ L1 →
-                 ∀T2. ⬆*[f] T1 ≡ T2 → ⦃G, L2⦄ ⊢ T2 ⁝ A.
-#G #L1 #T1 #A #H elim H -G -L1 -T1 -A
-[ #G #L1 #s #L2 #c #f #_ #T2 #H
-  >(lifts_inv_sort1 … H) -H //
-| #I #G #L1 #V1 #B #_ #IHB #L2 #c #f #HL21 #T2 #H
-  elim (lifts_inv_lref1 … H) -H #i2 #Hi #H destruct
-  @aaa_lref_gen [5: @IHB ]
-| #I #G #L1 #V1 #B #i1 #_ #IHB #L2 #c #f #HL21 #T2 #H
-  elim (lifts_inv_lref1 … H) -H #i2 #Hi #H destruct
-  lapply (at_inv_nxx … H)
-  
-  
-  
-  
-| #I #G #L1 #K1 #V1 #B #i #HLK1 #_ #IHB #L2 #c #l #k #HL21 #T2 #H
-  elim (lift_inv_lref1 … H) -H * #Hil #H destruct
-  [ elim (drop_trans_le … HL21 … HLK1) -L1 /2 width=2 by ylt_fwd_le/ #X #HLK2 #H
-    elim (drop_inv_skip2 … H) -H /2 width=1 by ylt_to_minus/ -Hil #K2 #V2 #HK21 #HV12 #H destruct
-    /3 width=9 by aaa_lref/
-  | lapply (drop_trans_ge … HL21 … HLK1 ?) -L1
-    /3 width=9 by aaa_lref, drop_inv_gen/
-  ]
-| #a #G #L1 #V1 #T1 #B #A #_ #_ #IHB #IHA #L2 #c #l #k #HL21 #X #H
-  elim (lift_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct
-  /4 width=5 by aaa_abbr, drop_skip/
-| #a #G #L1 #V1 #T1 #B #A #_ #_ #IHB #IHA #L2 #c #l #k #HL21 #X #H
-  elim (lift_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct
-  /4 width=5 by aaa_abst, drop_skip/
-| #G #L1 #V1 #T1 #B #A #_ #_ #IHB #IHA #L2 #c #l #k #HL21 #X #H
-  elim (lift_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct
-  /3 width=5 by aaa_appl/
-| #G #L1 #V1 #T1 #A #_ #_ #IH1 #IH2 #L2 #c #l #k #HL21 #X #H
-  elim (lift_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct
-  /3 width=5 by aaa_cast/
-]
-qed.
-
-(* Inversion lemmas with generic slicing for local environments *************)
+(* Advanced inversion lemmas ************************************************)
 
 (* Basic_2A1: was: aaa_inv_lref *)
 lemma aaa_inv_lref_gen: ∀G,A,i,L. ⦃G, L⦄ ⊢ #i ⁝ A →
@@ -80,27 +43,78 @@ lemma aaa_inv_lref_gen: ∀G,A,i,L. ⦃G, L⦄ ⊢ #i ⁝ A →
 ]
 qed-.
 
-lemma aaa_inv_lift: ∀G,L2,T2,A. ⦃G, L2⦄ ⊢ T2 ⁝ A → ∀L1,c,l,k. ⬇[c, l, k] L2 ≡ L1 →
-                    ∀T1. ⬆[l, k] T1 ≡ T2 → ⦃G, L1⦄ ⊢ T1 ⁝ A.
-#G #L2 #T2 #A #H elim H -G -L2 -T2 -A
-[ #G #L2 #s #L1 #c #l #k #_ #T1 #H
-  >(lift_inv_sort2 … H) -H //
-| #I #G #L2 #K2 #V2 #B #i #HLK2 #_ #IHB #L1 #c #l #k #HL21 #T1 #H
-  elim (lift_inv_lref2 … H) -H * #Hil #H destruct
-  [ elim (drop_conf_lt … HL21 … HLK2) -L2 /3 width=9 by aaa_lref/
-  | lapply (drop_conf_ge … HL21 … HLK2 ?) -L2 /3 width=9 by aaa_lref/
+(* Properties with generic slicing for local environments *******************)
+
+(* Basic_2A1: includes: aaa_lift *)
+lemma aaa_lifts: ∀G,L1,T1,A. ⦃G, L1⦄ ⊢ T1 ⁝ A → ∀L2,c,f. ⬇*[c, f] L2 ≡ L1 →
+                 ∀T2. ⬆*[f] T1 ≡ T2 → ⦃G, L2⦄ ⊢ T2 ⁝ A.
+@fqup_wf_ind_eq #G0 #L0 #T0 #IH #G #L1 * *
+[ #s #HG #HL #HT #A #H #L2 #c #f #HL21 #X #HX -IH -c
+  lapply (aaa_inv_sort … H) -H #H destruct
+  >(lifts_inv_sort1 … HX) -HX //
+| #i1 #HG #HL #HT #A #H #L2 #c #f #HL21 #X #HX
+  elim (aaa_inv_lref_gen … H) -H #J #K1 #V1 #HLK1 #HA
+  elim (lifts_inv_lref1 … HX) -HX #i2 #Hf #H destruct
+  lapply (drops_trans … HL21 … HLK1 ??) -HL21 [1,2: // ] #H
+  elim (drops_split_trans … H) -H [ |*: /2 width=6 by after_uni_dx/ ] #Y #HLK2 #HY
+  lapply (drops_inv_tls_at … Hf … HY) -HY #HY -Hf
+  elim (drops_inv_skip2 … HY) -HY #K2 #V2 #HK21 #HV12 #H destruct
+  /4 width=12 by aaa_lref_gen, fqup_lref, drops_inv_gen/
+| #l #HG #HL #HT #A #H #L2 #c #f #HL21 #X #HX -IH -c -f
+  elim (aaa_inv_gref … H)
+| #p * #V1 #T1 #HG #HL #HT #A #H #L2 #c #f #HL21 #X #HX
+  [ elim (aaa_inv_abbr … H) -H #B #HB #HA
+    elim (lifts_inv_bind1 …  HX) -HX #V2 #T2 #HV12 #HT12 #H destruct
+    /4 width=9 by aaa_abbr, drops_skip/
+  | elim (aaa_inv_abst … H) -H #B #A0 #HB #HA #H0
+    elim (lifts_inv_bind1 …  HX) -HX #V2 #T2 #HV12 #HT12 #H destruct
+    /4 width=8 by aaa_abst, drops_skip/
+  ]
+| * #V1 #T1 #HG #HL #HT #A #H #L2 #c #f #HL21 #X #HX
+  [ elim (aaa_inv_appl … H) -H #B #HB #HA
+    elim (lifts_inv_flat1 …  HX) -HX #V2 #T2 #HV12 #HT12 #H destruct
+    /3 width=10 by aaa_appl/
+  | elim (aaa_inv_cast … H) -H #H1A #H2A
+    elim (lifts_inv_flat1 …  HX) -HX #V2 #T2 #HV12 #HT12 #H destruct
+    /3 width=8 by aaa_cast/
+  ]
+]
+qed-.
+
+(* Inversion lemmas with generic slicing for local environments *************)
+
+(* Basic_2A1: includes: aaa_inv_lift *)
+lemma aaa_inv_lifts: ∀G,L2,T2,A. ⦃G, L2⦄ ⊢ T2 ⁝ A → ∀L1,c,f. ⬇*[c, f] L2 ≡ L1 →
+                     ∀T1. ⬆*[f] T1 ≡ T2 → ⦃G, L1⦄ ⊢ T1 ⁝ A.
+@fqup_wf_ind_eq #G0 #L0 #T0 #IH #G #L2 * *
+[ #s #HG #HL #HT #A #H #L1 #c #f #HL21 #X #HX -IH -c
+  lapply (aaa_inv_sort … H) -H #H destruct
+  >(lifts_inv_sort2 … HX) -HX //
+| #i2 #HG #HL #HT #A #H #L1 #c #f #HL21 #X #HX
+  elim (aaa_inv_lref_gen … H) -H #J #K2 #V2 #HLK2 #HA
+  elim (lifts_inv_lref2 … HX) -HX #i1 #Hf #H destruct
+  lapply (drops_split_div … HL21 (𝐔❴i1❵) ???) -HL21 [4: * |*: // ] #Y #HLK1 #HY
+  lapply (drops_conf … HLK2 … HY ??) -HY [1,2: /2 width=6 by after_uni_dx/ ] #HY
+  lapply (drops_inv_tls_at … Hf … HY) -HY #HY -Hf
+  elim (drops_inv_skip1 … HY) -HY #K1 #V1 #HK21 #HV12 #H destruct
+  /4 width=12 by aaa_lref_gen, fqup_lref, drops_inv_F/
+| #l #HG #HL #HT #A #H #L1 #c #f #HL21 #X #HX -IH -c -f
+  elim (aaa_inv_gref … H)
+| #p * #V2 #T2 #HG #HL #HT #A #H #L1 #c #f #HL21 #X #HX
+  [ elim (aaa_inv_abbr … H) -H #B #HB #HA
+    elim (lifts_inv_bind2 …  HX) -HX #V1 #T1 #HV12 #HT12 #H destruct
+    /4 width=9 by aaa_abbr, drops_skip/
+  | elim (aaa_inv_abst … H) -H #B #A0 #HB #HA #H0
+    elim (lifts_inv_bind2 …  HX) -HX #V1 #T1 #HV12 #HT12 #H destruct
+    /4 width=8 by aaa_abst, drops_skip/
+  ]
+| * #V2 #T2 #HG #HL #HT #A #H #L1 #c #f #HL21 #X #HX
+  [ elim (aaa_inv_appl … H) -H #B #HB #HA
+    elim (lifts_inv_flat2 …  HX) -HX #V1 #T1 #HV12 #HT12 #H destruct
+    /3 width=10 by aaa_appl/
+  | elim (aaa_inv_cast … H) -H #H1A #H2A
+    elim (lifts_inv_flat2 …  HX) -HX #V1 #T1 #HV12 #HT12 #H destruct
+    /3 width=8 by aaa_cast/
   ]
-| #a #G #L2 #V2 #T2 #B #A #_ #_ #IHB #IHA #L1 #c #l #k #HL21 #X #H
-  elim (lift_inv_bind2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
-  /4 width=5 by aaa_abbr, drop_skip/
-| #a #G #L2 #V2 #T2 #B #A #_ #_ #IHB #IHA #L1 #c #l #k #HL21 #X #H
-  elim (lift_inv_bind2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
-  /4 width=5 by aaa_abst, drop_skip/
-| #G #L2 #V2 #T2 #B #A #_ #_ #IHB #IHA #L1 #c #l #k #HL21 #X #H
-  elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
-  /3 width=5 by aaa_appl/
-| #G #L2 #V2 #T2 #A #_ #_ #IH1 #IH2 #L1 #c #l #k #HL21 #X #H
-  elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
-  /3 width=5 by aaa_cast/
 ]
 qed-.