]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpm.ma
renaming
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_transition / cpm.ma
index 61badb90a0e9ca3cc8e71c46446f8e3cb5aaf202..3158b8b032752192ee29c58de21f6d4530f41bb9 100644 (file)
@@ -19,16 +19,16 @@ include "basic_2/rt_transition/cpg.ma".
 (* T-BOUND CONTEXT-SENSITIVE PARALLEL RT-TRANSITION FOR TERMS ***************)
 
 (* Basic_2A1: includes: cpr *)
-definition cpm (n) (h): relation4 genv lenv term term ≝
-                        λG,L,T1,T2. ∃∃c. 𝐑𝐓⦃n, c⦄ & ⦃G, L⦄ ⊢ T1 ⬈[eq_t, c, h] T2.
+definition cpm (h) (G) (L) (n): relation2 term term ≝
+                                λT1,T2. ∃∃c. 𝐑𝐓⦃n, c⦄ & ⦃G, L⦄ ⊢ T1 ⬈[eq_t, c, h] T2.
 
 interpretation
-   "semi-counted context-sensitive parallel rt-transition (term)"
-   'PRed n h G L T1 T2 = (cpm n h G L T1 T2).
+   "t-bound context-sensitive parallel rt-transition (term)"
+   'PRed n h G L T1 T2 = (cpm h G L n T1 T2).
 
 interpretation
    "context-sensitive parallel r-transition (term)"
-   'PRed h G L T1 T2 = (cpm O h G L T1 T2).
+   'PRed h G L T1 T2 = (cpm h G L O T1 T2).
 
 (* Basic properties *********************************************************)
 
@@ -42,13 +42,13 @@ lemma cpm_delta: ∀n,h,G,K,V1,V2,W2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 →
 qed.
 
 lemma cpm_ell: ∀n,h,G,K,V1,V2,W2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 →
-               â¬\86*[1] V2 â\89\98 W2 â\86\92 â¦\83G, K.â\93\9bV1â¦\84 â\8a¢ #0 â\9e¡[⫯n, h] W2.
+               â¬\86*[1] V2 â\89\98 W2 â\86\92 â¦\83G, K.â\93\9bV1â¦\84 â\8a¢ #0 â\9e¡[â\86\91n, h] W2.
 #n #h #G #K #V1 #V2 #W2 *
 /3 width=5 by cpg_ell, ex2_intro, isrt_succ/
 qed.
 
 lemma cpm_lref: ∀n,h,I,G,K,T,U,i. ⦃G, K⦄ ⊢ #i ➡[n, h] T →
-                â¬\86*[1] T â\89\98 U â\86\92 â¦\83G, K.â\93\98{I}â¦\84 â\8a¢ #⫯i ➡[n, h] U.
+                â¬\86*[1] T â\89\98 U â\86\92 â¦\83G, K.â\93\98{I}â¦\84 â\8a¢ #â\86\91i ➡[n, h] U.
 #n #h #I #G #K #T #U #i *
 /3 width=5 by cpg_lref, ex2_intro/
 qed.
@@ -88,7 +88,7 @@ lemma cpm_eps: ∀n,h,G,L,V,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 → ⦃G, L⦄
 /3 width=3 by cpg_eps, isrt_plus_O2, ex2_intro/
 qed.
 
-lemma cpm_ee: â\88\80n,h,G,L,V1,V2,T. â¦\83G, Lâ¦\84 â\8a¢ V1 â\9e¡[n, h] V2 â\86\92 â¦\83G, Lâ¦\84 â\8a¢ â\93\9dV1.T â\9e¡[⫯n, h] V2.
+lemma cpm_ee: â\88\80n,h,G,L,V1,V2,T. â¦\83G, Lâ¦\84 â\8a¢ V1 â\9e¡[n, h] V2 â\86\92 â¦\83G, Lâ¦\84 â\8a¢ â\93\9dV1.T â\9e¡[â\86\91n, h] V2.
 #n #h #G #L #V1 #V2 #T *
 /3 width=3 by cpg_ee, isrt_succ, ex2_intro/
 qed.
@@ -110,11 +110,12 @@ lemma cpm_theta: ∀n,h,p,G,L,V1,V,V2,W1,W2,T1,T2.
 /6 width=9 by cpg_theta, isrt_plus_O2, isrt_max, isr_shift, ex2_intro/
 qed.
 
-(* Basic properties on r-transition *****************************************)
+(* Basic properties with r-transition ***************************************)
 
+(* Note: this is needed by cpms_ind_sn and cpms_ind_dx *)
 (* Basic_1: includes by definition: pr0_refl *)
 (* Basic_2A1: includes: cpr_atom *)
-lemma cpr_refl: ∀h,G,L. reflexive … (cpm 0 h G L).
+lemma cpr_refl: ∀h,G,L. reflexive … (cpm h G L 0).
 /3 width=3 by cpg_refl, ex2_intro/ qed.
 
 (* Basic inversion lemmas ***************************************************)
@@ -125,9 +126,9 @@ lemma cpm_inv_atom1: ∀n,h,J,G,L,T2. ⦃G, L⦄ ⊢ ⓪{J} ➡[n, h] T2 →
                       | ∃∃K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 & ⬆*[1] V2 ≘ T2 &
                                    L = K.ⓓV1 & J = LRef 0
                       | ∃∃k,K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[k, h] V2 & ⬆*[1] V2 ≘ T2 &
-                                     L = K.â\93\9bV1 & J = LRef 0 & n = â«¯k
+                                     L = K.â\93\9bV1 & J = LRef 0 & n = â\86\91k
                       | ∃∃I,K,T,i. ⦃G, K⦄ ⊢ #i ➡[n, h] T & ⬆*[1] T ≘ T2 &
-                                   L = K.â\93\98{I} & J = LRef (⫯i).
+                                   L = K.â\93\98{I} & J = LRef (â\86\91i).
 #n #h #J #G #L #T2 * #c #Hc #H elim (cpg_inv_atom1 … H) -H *
 [ #H1 #H2 destruct /4 width=1 by isrt_inv_00, or5_intro0, conj/
 | #s #H1 #H2 #H3 destruct /4 width=3 by isrt_inv_01, or5_intro1, ex3_intro/
@@ -154,7 +155,7 @@ lemma cpm_inv_zero1: ∀n,h,G,L,T2. ⦃G, L⦄ ⊢ #0 ➡[n, h] T2 →
                       | ∃∃K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 & ⬆*[1] V2 ≘ T2 &
                                    L = K.ⓓV1
                       | ∃∃k,K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[k, h] V2 & ⬆*[1] V2 ≘ T2 &
-                                     L = K.â\93\9bV1 & n = â«¯k.
+                                     L = K.â\93\9bV1 & n = â\86\91k.
 #n #h #G #L #T2 * #c #Hc #H elim (cpg_inv_zero1 … H) -H *
 [ #H1 #H2 destruct /4 width=1 by isrt_inv_00, or3_intro0, conj/
 | #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 destruct
@@ -165,8 +166,8 @@ lemma cpm_inv_zero1: ∀n,h,G,L,T2. ⦃G, L⦄ ⊢ #0 ➡[n, h] T2 →
 ]
 qed-.
 
-lemma cpm_inv_lref1: â\88\80n,h,G,L,T2,i. â¦\83G, Lâ¦\84 â\8a¢ #⫯i ➡[n, h] T2 →
-                     â\88¨â\88¨ T2 = #(⫯i) ∧ n = 0
+lemma cpm_inv_lref1: â\88\80n,h,G,L,T2,i. â¦\83G, Lâ¦\84 â\8a¢ #â\86\91i ➡[n, h] T2 →
+                     â\88¨â\88¨ T2 = #(â\86\91i) ∧ n = 0
                       | ∃∃I,K,T. ⦃G, K⦄ ⊢ #i ➡[n, h] T & ⬆*[1] T ≘ T2 & L = K.ⓘ{I}.
 #n #h #G #L #T2 #i * #c #Hc #H elim (cpg_inv_lref1 … H) -H *
 [ #H1 #H2 destruct /4 width=1 by isrt_inv_00, or_introl, conj/
@@ -261,7 +262,7 @@ lemma cpm_inv_cast1: ∀n,h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝV1.U1 ➡[n, h] U2 
                      ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[n, h] V2 & ⦃G, L⦄ ⊢ U1 ➡[n, h] T2 &
                                  U2 = ⓝV2.T2
                       | ⦃G, L⦄ ⊢ U1 ➡[n, h] U2
-                      | â\88\83â\88\83k. â¦\83G, Lâ¦\84 â\8a¢ V1 â\9e¡[k, h] U2 & n = â«¯k.
+                      | â\88\83â\88\83k. â¦\83G, Lâ¦\84 â\8a¢ V1 â\9e¡[k, h] U2 & n = â\86\91k.
 #n #h #G #L #V1 #U1 #U2 * #c #Hc #H elim (cpg_inv_cast1 … H) -H *
 [ #cV #cT #V2 #T2 #HV12 #HT12 #HcVT #H1 #H2 destruct
   elim (isrt_inv_max … Hc) -Hc #nV #nT #HcV #HcT #H destruct
@@ -285,3 +286,75 @@ lemma cpm_fwd_bind1_minus: ∀n,h,I,G,L,V1,T1,T. ⦃G, L⦄ ⊢ -ⓑ{I}V1.T1 ➡
 #n #h #I #G #L #V1 #T1 #T * #c #Hc #H #p elim (cpg_fwd_bind1_minus … H p) -H
 /3 width=4 by ex2_2_intro, ex2_intro/
 qed-.
+
+(* Basic eliminators ********************************************************)
+
+lemma cpm_ind (h): ∀Q:relation5 nat genv lenv term term.
+                   (∀I,G,L. Q 0 G L (⓪{I}) (⓪{I})) →
+                   (∀G,L,s. Q 1 G L (⋆s) (⋆(next h s))) →
+                   (∀n,G,K,V1,V2,W2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 → Q n G K V1 V2 →
+                     ⬆*[1] V2 ≘ W2 → Q n G (K.ⓓV1) (#0) W2
+                   ) → (∀n,G,K,V1,V2,W2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 → Q n G K V1 V2 →
+                     ⬆*[1] V2 ≘ W2 → Q (↑n) G (K.ⓛV1) (#0) W2
+                   ) → (∀n,I,G,K,T,U,i. ⦃G, K⦄ ⊢ #i ➡[n, h] T → Q n G K (#i) T →
+                     ⬆*[1] T ≘ U → Q n G (K.ⓘ{I}) (#↑i) (U)
+                   ) → (∀n,p,I,G,L,V1,V2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ➡[n, h] T2 →
+                     Q 0 G L V1 V2 → Q n G (L.ⓑ{I}V1) T1 T2 → Q n G L (ⓑ{p,I}V1.T1) (ⓑ{p,I}V2.T2)
+                   ) → (∀n,G,L,V1,V2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 →
+                     Q 0 G L V1 V2 → Q n G L T1 T2 → Q n G L (ⓐV1.T1) (ⓐV2.T2)
+                   ) → (∀n,G,L,V1,V2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[n, h] V2 → ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 →
+                     Q n G L V1 V2 → Q n G L T1 T2 → Q n G L (ⓝV1.T1) (ⓝV2.T2)
+                   ) → (∀n,G,L,V,T1,T,T2. ⦃G, L.ⓓV⦄ ⊢ T1 ➡[n, h] T → Q n G (L.ⓓV) T1 T →
+                     ⬆*[1] T2 ≘ T → Q n G L (+ⓓV.T1) T2
+                   ) → (∀n,G,L,V,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 →
+                     Q n G L T1 T2 → Q n G L (ⓝV.T1) T2
+                   ) → (∀n,G,L,V1,V2,T. ⦃G, L⦄ ⊢ V1 ➡[n, h] V2 →
+                     Q n G L V1 V2 → Q (↑n) G L (ⓝV1.T) V2
+                   ) → (∀n,p,G,L,V1,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L⦄ ⊢ W1 ➡[h] W2 → ⦃G, L.ⓛW1⦄ ⊢ T1 ➡[n, h] T2 →
+                     Q 0 G L V1 V2 → Q 0 G L W1 W2 → Q n G (L.ⓛW1) T1 T2 →
+                     Q n G L (ⓐV1.ⓛ{p}W1.T1) (ⓓ{p}ⓝW2.V2.T2)
+                   ) → (∀n,p,G,L,V1,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V → ⦃G, L⦄ ⊢ W1 ➡[h] W2 → ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[n, h] T2 →
+                     Q 0 G L V1 V → Q 0 G L W1 W2 → Q n G (L.ⓓW1) T1 T2 →
+                     ⬆*[1] V ≘ V2 → Q n G L (ⓐV1.ⓓ{p}W1.T1) (ⓓ{p}W2.ⓐV2.T2)
+                   ) →
+                   ∀n,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 → Q n G L T1 T2.
+#h #Q #IH1 #IH2 #IH3 #IH4 #IH5 #IH6 #IH7 #IH8 #IH9 #IH10 #IH11 #IH12 #IH13 #n #G #L #T1 #T2
+* #c #HC #H generalize in match HC; -HC generalize in match n; -n
+elim H -c -G -L -T1 -T2
+[ #I #G #L #n #H <(isrt_inv_00 … H) -H //
+| #G #L #s #n #H <(isrt_inv_01 … H) -H //
+| /3 width=4 by ex2_intro/
+| #c #G #L #V1 #V2 #W2 #HV12 #HVW2 #IH #x #H
+  elim (isrt_inv_plus_SO_dx … H) -H // #n #Hc #H destruct
+  /3 width=4 by ex2_intro/
+| /3 width=4 by ex2_intro/
+| #cV #cT #p #I #G #L #V1 #V2 #T1 #T2 #HV12 #HT12 #IHV #IHT #n #H
+  elim (isrt_inv_max_shift_sn … H) -H #HcV #HcT
+  /3 width=3 by ex2_intro/
+| #cV #cT #G #L #V1 #V2 #T1 #T2 #HV12 #HT12 #IHV #IHT #n #H
+  elim (isrt_inv_max_shift_sn … H) -H #HcV #HcT
+  /3 width=3 by ex2_intro/
+| #cU #cT #G #L #U1 #U2 #T1 #T2 #HUT #HU12 #HT12 #IHU #IHT #n #H
+  elim (isrt_inv_max_eq_t … H) -H // #HcV #HcT
+  /3 width=3 by ex2_intro/
+| #c #G #L #V #T1 #T2 #T #HT12 #HT2 #IH #n #H
+  lapply (isrt_inv_plus_O_dx … H ?) -H // #Hc
+  /3 width=4 by ex2_intro/
+| #c #G #L #U #T1 #T2 #HT12 #IH #n #H
+  lapply (isrt_inv_plus_O_dx … H ?) -H // #Hc
+  /3 width=3 by ex2_intro/
+| #c #G #L #U1 #U2 #T #HU12 #IH #x #H
+  elim (isrt_inv_plus_SO_dx … H) -H // #n #Hc #H destruct
+  /3 width=3 by ex2_intro/
+| #cV #cW #cT #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 #HW12 #HT12 #IHV #IHW #IHT #n #H
+  lapply (isrt_inv_plus_O_dx … H ?) -H // >max_shift #H
+  elim (isrt_inv_max_shift_sn … H) -H #H #HcT
+  elim (isrt_O_inv_max … H) -H #HcV #HcW
+  /3 width=3 by ex2_intro/
+| #cV #cW #cT #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HW12 #HT12 #IHV #IHW #IHT #n #H
+  lapply (isrt_inv_plus_O_dx … H ?) -H // >max_shift #H
+  elim (isrt_inv_max_shift_sn … H) -H #H #HcT
+  elim (isrt_O_inv_max … H) -H #HcV #HcW
+  /3 width=4 by ex2_intro/
+]
+qed-.