]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpm_drops.ma
update in ground_2, static_2, basic_2, apps_2, alpha_1
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_transition / cpm_drops.ma
index fbcd7958d4776e6ec180603c5e5601a0981d7e9b..8dcb983e1cc10dcb6b3798aee8f1051e006f0fc5 100644 (file)
@@ -17,33 +17,61 @@ include "basic_2/rt_transition/cpm.ma".
 
 (* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION FOR TERMS ***************)
 
+(* Properties with generic slicing for local environments *******************)
+
+(* Basic_1: includes: pr0_lift pr2_lift *)
+(* Basic_2A1: includes: cpr_lift *)
+lemma cpm_lifts_sn: ∀n,h,G. d_liftable2_sn … lifts (λL. cpm h G L n).
+#n #h #G #K #T1 #T2 * #c #Hc #HT12 #b #f #L #HLK #U1 #HTU1
+elim (cpg_lifts_sn … HT12 … HLK … HTU1) -K -T1
+/3 width=5 by ex2_intro/
+qed-.
+
+lemma cpm_lifts_bi: ∀n,h,G. d_liftable2_bi … lifts (λL. cpm h G L n).
+#n #h #G #K #T1 #T2 * /3 width=11 by cpg_lifts_bi, ex2_intro/
+qed-.
+
+(* Inversion lemmas with generic slicing for local environments *************)
+
+(* Basic_1: includes: pr0_gen_lift pr2_gen_lift *)
+(* Basic_2A1: includes: cpr_inv_lift1 *)
+lemma cpm_inv_lifts_sn: ∀n,h,G. d_deliftable2_sn … lifts (λL. cpm h G L n).
+#n #h #G #L #U1 #U2 * #c #Hc #HU12 #b #f #K #HLK #T1 #HTU1
+elim (cpg_inv_lifts_sn … HU12 … HLK … HTU1) -L -U1
+/3 width=5 by ex2_intro/
+qed-.
+
+lemma cpm_inv_lifts_bi: ∀n,h,G. d_deliftable2_bi … lifts (λL. cpm h G L n).
+#n #h #G #L #U1 #U2 * /3 width=11 by cpg_inv_lifts_bi, ex2_intro/
+qed-.
+
 (* Advanced properties ******************************************************)
 
 (* Basic_1: includes: pr2_delta1 *)
 (* Basic_2A1: includes: cpr_delta *)
 lemma cpm_delta_drops: ∀n,h,G,L,K,V,V2,W2,i.
-                       â¬\87*[i] L â\89¡ K.â\93\93V â\86\92 â¦\83G, Kâ¦\84 â\8a¢ V â\9e¡[n, h] V2 →
-                       â¬\86*[⫯i] V2 â\89¡ W2 â\86\92 â¦\83G, Lâ¦\84 â\8a¢ #i â\9e¡[n, h] W2.
+                       â\87©*[i] L â\89\98 K.â\93\93V â\86\92 â\9dªG,Kâ\9d« â\8a¢ V â\9e¡[n,h] V2 →
+                       â\87§*[â\86\91i] V2 â\89\98 W2 â\86\92 â\9dªG,Lâ\9d« â\8a¢ #i â\9e¡[n,h] W2.
 #n #h #G #L #K #V #V2 #W2 #i #HLK *
 /3 width=8 by cpg_delta_drops, ex2_intro/
 qed.
 
 lemma cpm_ell_drops: ∀n,h,G,L,K,V,V2,W2,i.
-                     â¬\87*[i] L â\89¡ K.â\93\9bV â\86\92 â¦\83G, Kâ¦\84 â\8a¢ V â\9e¡[n, h] V2 →
-                     â¬\86*[⫯i] V2 â\89¡ W2 â\86\92 â¦\83G, Lâ¦\84 â\8a¢ #i â\9e¡[⫯n, h] W2.
+                     â\87©*[i] L â\89\98 K.â\93\9bV â\86\92 â\9dªG,Kâ\9d« â\8a¢ V â\9e¡[n,h] V2 →
+                     â\87§*[â\86\91i] V2 â\89\98 W2 â\86\92 â\9dªG,Lâ\9d« â\8a¢ #i â\9e¡[â\86\91n,h] W2.
 #n #h #G #L #K #V #V2 #W2 #i #HLK *
 /3 width=8 by cpg_ell_drops, isrt_succ, ex2_intro/
 qed.
 
 (* Advanced inversion lemmas ************************************************)
 
-lemma cpm_inv_atom1_drops: â\88\80n,h,I,G,L,T2. â¦\83G, Lâ¦\84 â\8a¢ â\93ª{I} â\9e¡[n, h] T2 →
-                           ∨∨ T2 = ⓪{I} ∧ n = 0
-                            | ∃∃s. T2 = ⋆(next h s) & I = Sort s & n = 1
-                            | â\88\83â\88\83K,V,V2,i. â¬\87*[i] L â\89¡ K.â\93\93V & â¦\83G, Kâ¦\84 â\8a¢ V â\9e¡[n, h] V2 &
-                                          â¬\86*[⫯i] V2 â\89¡ T2 & I = LRef i
-                            | ∃∃k,K,V,V2,i. ⬇*[i] L ≡ K.ⓛV & ⦃G, K⦄ ⊢ V ➡[k, h] V2 &
-                                            â¬\86*[⫯i] V2 â\89¡ T2 & I = LRef i & n = â«¯k.
+lemma cpm_inv_atom1_drops: â\88\80n,h,I,G,L,T2. â\9dªG,Lâ\9d« â\8a¢ â\93ª[I] â\9e¡[n,h] T2 →
+                           ∨∨ T2 = ⓪[I] ∧ n = 0
+                            | ∃∃s. T2 = ⋆(⫯[h]s) & I = Sort s & n = 1
+                            | â\88\83â\88\83K,V,V2,i. â\87©*[i] L â\89\98 K.â\93\93V & â\9dªG,Kâ\9d« â\8a¢ V â\9e¡[n,h] V2 &
+                                          â\87§*[â\86\91i] V2 â\89\98 T2 & I = LRef i
+                            | ∃∃m,K,V,V2,i. ⇩*[i] L ≘ K.ⓛV & ❪G,K❫ ⊢ V ➡[m,h] V2 &
+                                            â\87§*[â\86\91i] V2 â\89\98 T2 & I = LRef i & n = â\86\91m.
 #n #h #I #G #L #T2 * #c #Hc #H elim (cpg_inv_atom1_drops … H) -H *
 [ #H1 #H2 destruct lapply (isrt_inv_00 … Hc) -Hc
   /3 width=1 by or4_intro0, conj/
@@ -57,12 +85,12 @@ lemma cpm_inv_atom1_drops: ∀n,h,I,G,L,T2. ⦃G, L⦄ ⊢ ⓪{I} ➡[n, h] T2 
 ]
 qed-.
 
-lemma cpm_inv_lref1_drops: â\88\80n,h,G,L,T2,i. â¦\83G, Lâ¦\84 â\8a¢ #i â\9e¡[n, h] T2 →
+lemma cpm_inv_lref1_drops: â\88\80n,h,G,L,T2,i. â\9dªG,Lâ\9d« â\8a¢ #i â\9e¡[n,h] T2 →
                            ∨∨ T2 = #i ∧ n = 0
-                            | â\88\83â\88\83K,V,V2. â¬\87*[i] L â\89¡ K. â\93\93V & â¦\83G, Kâ¦\84 â\8a¢ V â\9e¡[n, h] V2 &
-                                        â¬\86*[⫯i] V2 â\89¡ T2
-                            | ∃∃k,K,V,V2. ⬇*[i] L ≡ K. ⓛV & ⦃G, K⦄ ⊢ V ➡[k, h] V2 &
-                                          â¬\86*[⫯i] V2 â\89¡ T2 & n = â«¯k.
+                            | â\88\83â\88\83K,V,V2. â\87©*[i] L â\89\98 K.â\93\93V & â\9dªG,Kâ\9d« â\8a¢ V â\9e¡[n,h] V2 &
+                                        â\87§*[â\86\91i] V2 â\89\98 T2
+                            | ∃∃m,K,V,V2. ⇩*[i] L ≘ K. ⓛV & ❪G,K❫ ⊢ V ➡[m,h] V2 &
+                                          â\87§*[â\86\91i] V2 â\89\98 T2 & n = â\86\91m.
 #n #h #G #L #T2 #i * #c #Hc #H elim (cpg_inv_lref1_drops … H) -H *
 [ #H1 #H2 destruct lapply (isrt_inv_00 … Hc) -Hc
   /3 width=1 by or3_intro0, conj/
@@ -74,22 +102,69 @@ lemma cpm_inv_lref1_drops: ∀n,h,G,L,T2,i. ⦃G, L⦄ ⊢ #i ➡[n, h] T2 →
 ]
 qed-.
 
-(* Properties with generic slicing for local environments *******************)
+(* Advanced forward lemmas **************************************************)
 
-(* Basic_1: includes: pr0_lift pr2_lift *)
-(* Basic_2A1: includes: cpr_lift *)
-lemma cpm_lifts: ∀n,h,G. d_liftable2 (cpm n h G).
-#n #h #G #K #T1 #T2 * #c #Hc #HT12 #b #f #L #HLK #U1 #HTU1
-elim (cpg_lifts … HT12 … HLK … HTU1) -K -T1
-/3 width=5 by ex2_intro/
+fact cpm_fwd_plus_aux (n) (h): ∀G,L,T1,T2. ❪G,L❫ ⊢ T1 ➡[n,h] T2 →
+                               ∀n1,n2. n1+n2 = n →
+                               ∃∃T. ❪G,L❫ ⊢ T1 ➡[n1,h] T & ❪G,L❫ ⊢ T ➡[n2,h] T2.
+#n #h #G #L #T1 #T2 #H @(cpm_ind … H) -G -L -T1 -T2 -n
+[ #I #G #L #n1 #n2 #H
+  elim (plus_inv_O3 … H) -H #H1 #H2 destruct
+  /2 width=3 by ex2_intro/
+| #G #L #s #x1 #n2 #H
+  elim (plus_inv_S3_sn … H) -H *
+  [ #H1 #H2 destruct /2 width=3 by ex2_intro/
+  | #n1 #H1 #H elim (plus_inv_O3 … H) -H #H2 #H3 destruct
+    /2 width=3 by ex2_intro/
+  ]
+| #n #G #K #V1 #V2 #W2 #_ #IH #HVW2 #n1 #n2 #H destruct
+  elim IH [|*: // ] -IH #V #HV1 #HV2
+  elim (lifts_total V 𝐔❨↑O❩) #W #HVW
+  /5 width=11 by cpm_lifts_bi, cpm_delta, drops_refl, drops_drop, ex2_intro/
+| #n #G #K #V1 #V2 #W2 #HV12 #IH #HVW2 #x1 #n2 #H
+  elim (plus_inv_S3_sn … H) -H *
+  [ #H1 #H2 destruct -IH /3 width=3 by cpm_ell, ex2_intro/
+  | #n1 #H1 #H2 destruct -HV12
+    elim (IH n1) [|*: // ] -IH #V #HV1 #HV2
+    elim (lifts_total V 𝐔❨↑O❩) #W #HVW
+    /5 width=11 by cpm_lifts_bi, cpm_ell, drops_refl, drops_drop, ex2_intro/
+  ]
+| #n #I #G #K #T2 #U2 #i #_ #IH #HTU2 #n1 #n2 #H destruct
+  elim IH [|*: // ] -IH #T #HT1 #HT2
+  elim (lifts_total T 𝐔❨↑O❩) #U #HTU
+  /5 width=11 by cpm_lifts_bi, cpm_lref, drops_refl, drops_drop, ex2_intro/
+| #n #p #I #G #L #V1 #V2 #T1 #T2 #HV12 #_ #_ #IHT #n1 #n2 #H destruct
+  elim IHT [|*: // ] -IHT #T #HT1 #HT2
+  /3 width=5 by cpm_bind, ex2_intro/
+| #n #G #L #V1 #V2 #T1 #T2 #HV12 #_ #_ #IHT #n1 #n2 #H destruct
+  elim IHT [|*: // ] -IHT #T #HT1 #HT2
+  /3 width=5 by cpm_appl, ex2_intro/
+| #n #G #L #U1 #U2 #T1 #T2 #_ #_ #IHU #IHT #n1 #n2 #H destruct
+  elim IHU [|*: // ] -IHU #U #HU1 #HU2
+  elim IHT [|*: // ] -IHT #T #HT1 #HT2
+  /3 width=5 by cpm_cast, ex2_intro/
+| #n #G #K #V #U1 #T1 #T2 #HTU1 #_ #IH #n1 #n2 #H destruct
+  elim IH [|*: // ] -IH #T #HT1 #HT2
+  /3 width=3 by cpm_zeta, ex2_intro/
+| #n #G #L #U #T1 #T2 #_ #IH #n1 #n2 #H destruct
+  elim IH [|*: // ] -IH #T #HT1 #HT2
+  /3 width=3 by cpm_eps, ex2_intro/
+| #n #G #L #U1 #U2 #T #HU12 #IH #x1 #n2 #H
+  elim (plus_inv_S3_sn … H) -H *
+  [ #H1 #H2 destruct -IH /3 width=4 by cpm_ee, cpm_cast, ex2_intro/
+  | #n1 #H1 #H2 destruct -HU12
+    elim (IH n1) [|*: // ] -IH #U #HU1 #HU2
+    /3 width=3 by cpm_ee, ex2_intro/
+  ]
+| #n #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 #HW12 #_ #_ #_ #IH #n1 #n2 #H destruct
+  elim IH [|*: // ] -IH #T #HT1 #HT2
+  /4 width=7 by cpm_beta, cpm_appl, cpm_bind, ex2_intro/
+| #n #p #G #L #V1 #V2 #U2 #W1 #W2 #T1 #T2 #HV12 #HW12 #_ #_ #_ #IH #HVU2 #n1 #n2 #H destruct
+  elim IH [|*: // ] -IH #T #HT1 #HT2
+  /4 width=7 by cpm_theta, cpm_appl, cpm_bind, ex2_intro/
+]
 qed-.
 
-(* Inversion lemmas with generic slicing for local environments *************)
-
-(* Basic_1: includes: pr0_gen_lift pr2_gen_lift *)
-(* Basic_2A1: includes: cpr_inv_lift1 *)
-lemma cpm_inv_lifts1: ∀n,h,G. d_deliftable2_sn (cpm n h G).
-#n #h #G #L #U1 #U2 * #c #Hc #HU12 #b #f #K #HLK #T1 #HTU1
-elim (cpg_inv_lifts1 … HU12 … HLK … HTU1) -L -U1
-/3 width=5 by ex2_intro/
-qed-.
+lemma cpm_fwd_plus (h) (G) (L): ∀n1,n2,T1,T2. ❪G,L❫ ⊢ T1 ➡[n1+n2,h] T2 →
+                                ∃∃T. ❪G,L❫ ⊢ T1 ➡[n1,h] T & ❪G,L❫ ⊢ T ➡[n2,h] T2.
+/2 width=3 by cpm_fwd_plus_aux/ qed-.