]> matita.cs.unibo.it Git - helm.git/commitdiff
first definition of cpm:
authorFerruccio Guidi <ferruccio.guidi@unibo.it>
Fri, 1 Jul 2016 13:59:41 +0000 (13:59 +0000)
committerFerruccio Guidi <ferruccio.guidi@unibo.it>
Fri, 1 Jul 2016 13:59:41 +0000 (13:59 +0000)
the contextual rule for cast is incorrect :(

21 files changed:
matita/matita/contribs/lambdadelta/basic_2/names.txt
matita/matita/contribs/lambdadelta/basic_2/notation/relations/pred_6.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpg.ma
matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpg_drops.ma
matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpm.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpx.ma
matita/matita/contribs/lambdadelta/basic_2/rt_transition/partial.txt
matita/matita/contribs/lambdadelta/basic_2/static/frees_drops.ma
matita/matita/contribs/lambdadelta/ground_2/lib/arith.ma
matita/matita/contribs/lambdadelta/ground_2/notation/relations/isredtype_2.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/ground_2/notation/xoa_notation.ma
matita/matita/contribs/lambdadelta/ground_2/relocation/nstream_istot.ma
matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_after.ma
matita/matita/contribs/lambdadelta/ground_2/relocation/rtmap_sor.ma
matita/matita/contribs/lambdadelta/ground_2/steps/rtc.ma
matita/matita/contribs/lambdadelta/ground_2/steps/rtc_isrt.ma [new file with mode: 0644]
matita/matita/contribs/lambdadelta/ground_2/steps/rtc_plus.ma
matita/matita/contribs/lambdadelta/ground_2/steps/rtc_shift.ma
matita/matita/contribs/lambdadelta/ground_2/web/ground_2_src.tbl
matita/matita/contribs/lambdadelta/ground_2/xoa.conf.xml
matita/matita/contribs/lambdadelta/ground_2/xoa/xoa.ma

index 91449b0ba80c18df08ac6035fcfd7f79e3132027..bf8778e2d8783c0c2e7143bf5ae665cc780a1799 100644 (file)
@@ -79,6 +79,7 @@ c: conversion
 d: decomposed rt-reduction
 e: decomposed rt-conversion
 g: counted rt-transition (generic)
+m: semi-counted rt-transition (mixed)
 q: restricted reduction
 r: reduction
 s: substitution
diff --git a/matita/matita/contribs/lambdadelta/basic_2/notation/relations/pred_6.ma b/matita/matita/contribs/lambdadelta/basic_2/notation/relations/pred_6.ma
new file mode 100644 (file)
index 0000000..3bc75f6
--- /dev/null
@@ -0,0 +1,19 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+(* NOTATION FOR THE FORMAL SYSTEM λδ ****************************************)
+
+notation "hvbox( ⦃ term 46 G, break term 46 L ⦄ ⊢ break term 46 T1 ➡ break [ term 46 n, break term 46 h ] break term 46 T2 )"
+   non associative with precedence 45
+   for @{ 'PRed $n $h $G $L $T1 $T2 }.
index b8742090c50969394388b66b35774e5d821358f2..fd44b81fd8816cbf44f0e1b11cdc01e13cbb703e 100644 (file)
@@ -12,7 +12,6 @@
 (*                                                                        *)
 (**************************************************************************)
 
-include "ground_2/steps/rtc_shift.ma".
 include "ground_2/steps/rtc_plus.ma".
 include "basic_2/notation/relations/predty_6.ma".
 include "basic_2/grammar/lenv.ma".
@@ -29,7 +28,7 @@ inductive cpg (h): rtc → relation4 genv lenv term term ≝
 | cpg_delta: ∀c,G,L,V1,V2,W2. cpg h c G L V1 V2 →
              ⬆*[1] V2 ≡ W2 → cpg h c G (L.ⓓV1) (#0) W2
 | cpg_ell  : ∀c,G,L,V1,V2,W2. cpg h c G L V1 V2 →
-             ⬆*[1] V2 ≡ W2 → cpg h ((↓c)+𝟘𝟙) G (L.ⓛV1) (#0) W2
+             ⬆*[1] V2 ≡ W2 → cpg h (c+𝟘𝟙) G (L.ⓛV1) (#0) W2
 | cpg_lref : ∀c,I,G,L,V,T,U,i. cpg h c G L (#i) T → 
              ⬆*[1] T ≡ U → cpg h c G (L.ⓑ{I}V) (#⫯i) U
 | cpg_bind : ∀cV,cT,p,I,G,L,V1,V2,T1,T2.
@@ -39,16 +38,16 @@ inductive cpg (h): rtc → relation4 genv lenv term term ≝
              cpg h cV G L V1 V2 → cpg h cT G L T1 T2 →
              cpg h ((↓cV)+cT) G L (ⓕ{I}V1.T1) (ⓕ{I}V2.T2)
 | cpg_zeta : ∀c,G,L,V,T1,T,T2. cpg h c G (L.ⓓV) T1 T →
-             ⬆*[1] T2 ≡ T → cpg h ((↓c)+𝟙𝟘) G L (+ⓓV.T1) T2
-| cpg_eps  : ∀c,G,L,V,T1,T2. cpg h c G L T1 T2 → cpg h ((↓c)+𝟙𝟘) G L (ⓝV.T1) T2
-| cpg_ee   : ∀c,G,L,V1,V2,T. cpg h c G L V1 V2 → cpg h ((↓c)+𝟘𝟙) G L (ⓝV1.T) V2
+             ⬆*[1] T2 ≡ T → cpg h (c+𝟙𝟘) G L (+ⓓV.T1) T2
+| cpg_eps  : ∀c,G,L,V,T1,T2. cpg h c G L T1 T2 → cpg h (c+𝟙𝟘) G L (ⓝV.T1) T2
+| cpg_ee   : ∀c,G,L,V1,V2,T. cpg h c G L V1 V2 → cpg h (c+𝟘𝟙) G L (ⓝV1.T) V2
 | cpg_beta : ∀cV,cW,cT,p,G,L,V1,V2,W1,W2,T1,T2.
              cpg h cV G L V1 V2 → cpg h cW G L W1 W2 → cpg h cT G (L.ⓛW1) T1 T2 →
-             cpg h ((↓cV)+(↓cW)+(↓cT)+𝟙𝟘) G L (ⓐV1.ⓛ{p}W1.T1) (ⓓ{p}ⓝW2.V2.T2)
+             cpg h ((↓cV)+(↓cW)+cT+𝟙𝟘) G L (ⓐV1.ⓛ{p}W1.T1) (ⓓ{p}ⓝW2.V2.T2)
 | cpg_theta: ∀cV,cW,cT,p,G,L,V1,V,V2,W1,W2,T1,T2.
              cpg h cV G L V1 V → ⬆*[1] V ≡ V2 → cpg h cW G L W1 W2 →
              cpg h cT G (L.ⓓW1) T1 T2 →
-             cpg h ((↓cV)+(↓cW)+(↓cT)+𝟙𝟘) G L (ⓐV1.ⓓ{p}W1.T1) (ⓓ{p}W2.ⓐV2.T2)
+             cpg h ((↓cV)+(↓cW)+cT+𝟙𝟘) G L (ⓐV1.ⓓ{p}W1.T1) (ⓓ{p}W2.ⓐV2.T2)
 .
 
 interpretation
@@ -75,7 +74,7 @@ fact cpg_inv_atom1_aux: ∀c,h,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈[c, h] T2 → ∀
                          | ∃∃cV,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈[cV, h] V2 & ⬆*[1] V2 ≡ T2 &
                                          L = K.ⓓV1 & J = LRef 0 & c = cV
                          | ∃∃cV,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈[cV, h] V2 & ⬆*[1] V2 ≡ T2 &
-                                         L = K.ⓛV1 & J = LRef 0 & c = (↓cV)+𝟘𝟙
+                                         L = K.ⓛV1 & J = LRef 0 & c = cV+𝟘𝟙
                          | ∃∃I,K,V,T,i. ⦃G, K⦄ ⊢ #i ⬈[c, h] T & ⬆*[1] T ≡ T2 &
                                         L = K.ⓑ{I}V & J = LRef (⫯i).
 #c #h #G #L #T1 #T2 * -c -G -L -T1 -T2
@@ -100,7 +99,7 @@ lemma cpg_inv_atom1: ∀c,h,J,G,L,T2. ⦃G, L⦄ ⊢ ⓪{J} ⬈[c, h] T2 →
                       | ∃∃cV,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈[cV, h] V2 & ⬆*[1] V2 ≡ T2 &
                                       L = K.ⓓV1 & J = LRef 0 & c = cV
                       | ∃∃cV,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈[cV, h] V2 & ⬆*[1] V2 ≡ T2 &
-                                      L = K.ⓛV1 & J = LRef 0 & c = (↓cV)+𝟘𝟙
+                                      L = K.ⓛV1 & J = LRef 0 & c = cV+𝟘𝟙
                       | ∃∃I,K,V,T,i. ⦃G, K⦄ ⊢ #i ⬈[c, h] T & ⬆*[1] T ≡ T2 &
                                      L = K.ⓑ{I}V & J = LRef (⫯i).
 /2 width=3 by cpg_inv_atom1_aux/ qed-.
@@ -120,7 +119,7 @@ lemma cpg_inv_zero1: ∀c,h,G,L,T2. ⦃G, L⦄ ⊢ #0 ⬈[c, h] T2 →
                       | ∃∃cV,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈[cV, h] V2 & ⬆*[1] V2 ≡ T2 &
                                       L = K.ⓓV1 & c = cV
                       | ∃∃cV,K,V1,V2. ⦃G, K⦄ ⊢ V1 ⬈[cV, h] V2 & ⬆*[1] V2 ≡ T2 &
-                                      L = K.ⓛV1 & c = (↓cV)+𝟘𝟙.
+                                      L = K.ⓛV1 & c = cV+𝟘𝟙.
 #c #h #G #L #T2 #H
 elim (cpg_inv_atom1 … H) -H * /3 width=1 by or3_intro0, conj/
 [ #s #H destruct
@@ -155,7 +154,7 @@ fact cpg_inv_bind1_aux: ∀c,h,G,L,U,U2. ⦃G, L⦄ ⊢ U ⬈[c, h] U2 →
                                        U2 = ⓑ{p,J}V2.T2 & c = (↓cV)+cT
                         ) ∨
                         ∃∃cT,T. ⦃G, L.ⓓV1⦄ ⊢ U1 ⬈[cT, h] T & ⬆*[1] U2 ≡ T &
-                                p = true & J = Abbr & c = (↓cT)+𝟙𝟘.
+                                p = true & J = Abbr & c = cT+𝟙𝟘.
 #c #h #G #L #U #U2 * -c -G -L -U -U2
 [ #I #G #L #q #J #W #U1 #H destruct
 | #G #L #s #q #J #W #U1 #H destruct
@@ -177,7 +176,7 @@ lemma cpg_inv_bind1: ∀c,h,p,I,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈[c
                                     U2 = ⓑ{p,I}V2.T2 & c = (↓cV)+cT
                      ) ∨
                      ∃∃cT,T. ⦃G, L.ⓓV1⦄ ⊢ T1 ⬈[cT, h] T & ⬆*[1] U2 ≡ T &
-                             p = true & I = Abbr & c = (↓cT)+𝟙𝟘.
+                             p = true & I = Abbr & c = cT+𝟙𝟘.
 /2 width=3 by cpg_inv_bind1_aux/ qed-.
 
 lemma cpg_inv_abbr1: ∀c,h,p,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{p}V1.T1 ⬈[c, h] U2 → (
@@ -185,7 +184,7 @@ lemma cpg_inv_abbr1: ∀c,h,p,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{p}V1.T1 ⬈[c, h]
                                     U2 = ⓓ{p}V2.T2 & c = (↓cV)+cT
                      ) ∨
                      ∃∃cT,T. ⦃G, L.ⓓV1⦄ ⊢ T1 ⬈[cT, h] T & ⬆*[1] U2 ≡ T &
-                             p = true & c = (↓cT)+𝟙𝟘.
+                             p = true & c = cT+𝟙𝟘.
 #c #h #p #G #L #V1 #T1 #U2 #H elim (cpg_inv_bind1 … H) -H *
 /3 width=8 by ex4_4_intro, ex4_2_intro, or_introl, or_intror/
 qed-.
@@ -203,12 +202,12 @@ fact cpg_inv_flat1_aux: ∀c,h,G,L,U,U2. ⦃G, L⦄ ⊢ U ⬈[c, h] U2 →
                         ∀J,V1,U1. U = ⓕ{J}V1.U1 →
                         ∨∨ ∃∃cV,cT,V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] V2 & ⦃G, L⦄ ⊢ U1 ⬈[cT, h] T2 &
                                           U2 = ⓕ{J}V2.T2 & c = (↓cV)+cT
-                         | ∃∃cT. ⦃G, L⦄ ⊢ U1 ⬈[cT, h] U2 & J = Cast & c = (↓cT)+𝟙𝟘
-                         | ∃∃cV. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] U2 & J = Cast & c = (↓cV)+𝟘𝟙
+                         | ∃∃cT. ⦃G, L⦄ ⊢ U1 ⬈[cT, h] U2 & J = Cast & c = cT+𝟙𝟘
+                         | ∃∃cV. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] U2 & J = Cast & c = cV+𝟘𝟙
                          | ∃∃cV,cW,cT,p,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] V2 & ⦃G, L⦄ ⊢ W1 ⬈[cW, h] W2 & ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈[cT, h] T2 &
-                                                        J = Appl & U1 = ⓛ{p}W1.T1 & U2 = ⓓ{p}ⓝW2.V2.T2 & c = (↓cV)+(↓cW)+(↓cT)+𝟙𝟘
+                                                        J = Appl & U1 = ⓛ{p}W1.T1 & U2 = ⓓ{p}ⓝW2.V2.T2 & c = (↓cV)+(↓cW)+cT+𝟙𝟘
                          | ∃∃cV,cW,cT,p,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] V & ⬆*[1] V ≡ V2 & ⦃G, L⦄ ⊢ W1 ⬈[cW, h] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈[cT, h] T2 &
-                                                          J = Appl & U1 = ⓓ{p}W1.T1 & U2 = ⓓ{p}W2.ⓐV2.T2 & c = (↓cV)+(↓cW)+(↓cT)+𝟙𝟘.
+                                                          J = Appl & U1 = ⓓ{p}W1.T1 & U2 = ⓓ{p}W2.ⓐV2.T2 & c = (↓cV)+(↓cW)+cT+𝟙𝟘.
 #c #h #G #L #U #U2 * -c -G -L -U -U2
 [ #I #G #L #J #W #U1 #H destruct
 | #G #L #s #J #W #U1 #H destruct
@@ -228,21 +227,21 @@ qed-.
 lemma cpg_inv_flat1: ∀c,h,I,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓕ{I}V1.U1 ⬈[c, h] U2 →
                      ∨∨ ∃∃cV,cT,V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] V2 & ⦃G, L⦄ ⊢ U1 ⬈[cT, h] T2 &
                                        U2 = ⓕ{I}V2.T2 & c = (↓cV)+cT
-                      | ∃∃cT. ⦃G, L⦄ ⊢ U1 ⬈[cT, h] U2 & I = Cast & c = (↓cT)+𝟙𝟘
-                      | ∃∃cV. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] U2 & I = Cast & c = (↓cV)+𝟘𝟙
+                      | ∃∃cT. ⦃G, L⦄ ⊢ U1 ⬈[cT, h] U2 & I = Cast & c = cT+𝟙𝟘
+                      | ∃∃cV. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] U2 & I = Cast & c = cV+𝟘𝟙
                       | ∃∃cV,cW,cT,p,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] V2 & ⦃G, L⦄ ⊢ W1 ⬈[cW, h] W2 & ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈[cT, h] T2 &
-                                                     I = Appl & U1 = ⓛ{p}W1.T1 & U2 = ⓓ{p}ⓝW2.V2.T2 & c = (↓cV)+(↓cW)+(↓cT)+𝟙𝟘
+                                                     I = Appl & U1 = ⓛ{p}W1.T1 & U2 = ⓓ{p}ⓝW2.V2.T2 & c = (↓cV)+(↓cW)+cT+𝟙𝟘
                       | ∃∃cV,cW,cT,p,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] V & ⬆*[1] V ≡ V2 & ⦃G, L⦄ ⊢ W1 ⬈[cW, h] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈[cT, h] T2 &
-                                                       I = Appl & U1 = ⓓ{p}W1.T1 & U2 = ⓓ{p}W2.ⓐV2.T2 & c = (↓cV)+(↓cW)+(↓cT)+𝟙𝟘.
+                                                       I = Appl & U1 = ⓓ{p}W1.T1 & U2 = ⓓ{p}W2.ⓐV2.T2 & c = (↓cV)+(↓cW)+cT+𝟙𝟘.
 /2 width=3 by cpg_inv_flat1_aux/ qed-.
 
 lemma cpg_inv_appl1: ∀c,h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓐV1.U1 ⬈[c, h] U2 →
                      ∨∨ ∃∃cV,cT,V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] V2 & ⦃G, L⦄ ⊢ U1 ⬈[cT, h] T2 &
                                        U2 = ⓐV2.T2 & c = (↓cV)+cT
                       | ∃∃cV,cW,cT,p,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] V2 & ⦃G, L⦄ ⊢ W1 ⬈[cW, h] W2 & ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈[cT, h] T2 &
-                                                     U1 = ⓛ{p}W1.T1 & U2 = ⓓ{p}ⓝW2.V2.T2 & c = (↓cV)+(↓cW)+(↓cT)+𝟙𝟘
+                                                     U1 = ⓛ{p}W1.T1 & U2 = ⓓ{p}ⓝW2.V2.T2 & c = (↓cV)+(↓cW)+cT+𝟙𝟘
                       | ∃∃cV,cW,cT,p,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] V & ⬆*[1] V ≡ V2 & ⦃G, L⦄ ⊢ W1 ⬈[cW, h] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈[cT, h] T2 &
-                                                       U1 = ⓓ{p}W1.T1 & U2 = ⓓ{p}W2.ⓐV2.T2 & c = (↓cV)+(↓cW)+(↓cT)+𝟙𝟘.
+                                                       U1 = ⓓ{p}W1.T1 & U2 = ⓓ{p}W2.ⓐV2.T2 & c = (↓cV)+(↓cW)+cT+𝟙𝟘.
 #c #h #G #L #V1 #U1 #U2 #H elim (cpg_inv_flat1 … H) -H *
 [ /3 width=8 by or3_intro0, ex4_4_intro/
 |2,3: #c #_ #H destruct
@@ -254,8 +253,8 @@ qed-.
 lemma cpg_inv_cast1: ∀c,h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝV1.U1 ⬈[c, h] U2 →
                      ∨∨ ∃∃cV,cT,V2,T2. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] V2 & ⦃G, L⦄ ⊢ U1 ⬈[cT, h] T2 &
                                        U2 = ⓝV2.T2 & c = (↓cV)+cT
-                      | ∃∃cT. ⦃G, L⦄ ⊢ U1 ⬈[cT, h] U2 & c = (↓cT)+𝟙𝟘
-                      | ∃∃cV. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] U2 & c = (↓cV)+𝟘𝟙.
+                      | ∃∃cT. ⦃G, L⦄ ⊢ U1 ⬈[cT, h] U2 & c = cT+𝟙𝟘
+                      | ∃∃cV. ⦃G, L⦄ ⊢ V1 ⬈[cV, h] U2 & c = cV+𝟘𝟙.
 #c #h #G #L #V1 #U1 #U2 #H elim (cpg_inv_flat1 … H) -H *
 [ /3 width=8 by or3_intro0, ex4_4_intro/
 |2,3: /3 width=3 by or3_intro1, or3_intro2, ex2_intro/
index 7c9c79b70fc52d27fc96171c9e248659085b2660..b22fc0938546fb58baf22e32da10e229f9bf71b2 100644 (file)
@@ -32,7 +32,7 @@ lemma cpg_delta_drops: ∀c,h,G,K,V,V2,i,L,T2. ⬇*[i] L ≡ K.ⓓV → ⦃G, K
 qed.
 
 lemma cpg_ell_drops: ∀c,h,G,K,V,V2,i,L,T2. ⬇*[i] L ≡ K.ⓛV → ⦃G, K⦄ ⊢ V ⬈[c, h] V2 →
-                     ⬆*[⫯i] V2 ≡ T2 →  ⦃G, L⦄ ⊢ #i ⬈[(↓c)+𝟘𝟙, h] T2.
+                     ⬆*[⫯i] V2 ≡ T2 →  ⦃G, L⦄ ⊢ #i ⬈[c+𝟘𝟙, h] T2.
 #c #h #G #K #V #V2 #i elim i -i
 [ #L #T2 #HLK lapply (drops_fwd_isid … HLK ?) // #H destruct /3 width=3 by cpg_ell/
 | #i #IH #L0 #T0 #H0 #HV2 #HVT2
@@ -48,7 +48,7 @@ lemma cpg_inv_lref1_drops: ∀c,h,G,i,L,T2. ⦃G, L⦄ ⊢ #i ⬈[c, h] T2 →
                             | ∃∃cV,K,V,V2. ⬇*[i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V ⬈[cV, h] V2 &
                                            ⬆*[⫯i] V2 ≡ T2 & c = cV
                             | ∃∃cV,K,V,V2. ⬇*[i] L ≡ K.ⓛV & ⦃G, K⦄ ⊢ V ⬈[cV, h] V2 &
-                                           ⬆*[⫯i] V2 ≡ T2 & c = (↓cV) + 𝟘𝟙.
+                                           ⬆*[⫯i] V2 ≡ T2 & c = cV + 𝟘𝟙.
 #c #h #G #i elim i -i
 [ #L #T2 #H elim (cpg_inv_zero1 … H) -H * /3 width=1 by or3_intro0, conj/
   /4 width=8 by drops_refl, ex4_4_intro, or3_intro2, or3_intro1/
@@ -67,7 +67,7 @@ lemma cpg_inv_atom1_drops: ∀c,h,I,G,L,T2. ⦃G, L⦄ ⊢ ⓪{I} ⬈[c, h] T2 
                             | ∃∃cV,i,K,V,V2. ⬇*[i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V ⬈[cV, h] V2 &
                                              ⬆*[⫯i] V2 ≡ T2 & I = LRef i & c = cV
                             | ∃∃cV,i,K,V,V2. ⬇*[i] L ≡ K.ⓛV & ⦃G, K⦄ ⊢ V ⬈[cV, h] V2 &
-                                             ⬆*[⫯i] V2 ≡ T2 & I = LRef i & c = (↓cV) + 𝟘𝟙.
+                                             ⬆*[⫯i] V2 ≡ T2 & I = LRef i & c = cV + 𝟘𝟙.
 #c #h * #n #G #L #T2 #H
 [ elim (cpg_inv_sort1 … H) -H *
   /3 width=3 by or4_intro0, or4_intro1, ex3_intro, conj/
diff --git a/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpm.ma b/matita/matita/contribs/lambdadelta/basic_2/rt_transition/cpm.ma
new file mode 100644 (file)
index 0000000..3201a5b
--- /dev/null
@@ -0,0 +1,313 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+include "basic_2/notation/relations/pred_6.ma".
+include "basic_2/notation/relations/pred_5.ma".
+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 ⬈[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).
+
+interpretation
+   "context-sensitive parallel r-transition (term)"
+   'PRed h G L T1 T2 = (cpm O h G L T1 T2).
+
+(* Basic properties *********************************************************)
+
+lemma cpm_ess: ∀h,G,L,s. ⦃G, L⦄ ⊢ ⋆s ➡[1, h] ⋆(next h s).
+/2 width=3 by cpg_ess, ex2_intro/ qed.
+
+lemma cpm_delta: ∀n,h,G,K,V1,V2,W2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 →
+                 ⬆*[1] V2 ≡ W2 → ⦃G, K.ⓓV1⦄ ⊢ #0 ➡[n, h] W2.
+#n #h #G #K #V1 #V2 #W2 *
+/3 width=5 by cpg_delta, ex2_intro/
+qed.
+
+lemma cpm_ell: ∀n,h,G,K,V1,V2,W2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 →
+               ⬆*[1] V2 ≡ W2 → ⦃G, K.ⓛV1⦄ ⊢ #0 ➡[⫯n, 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,V,T,U,i. ⦃G, K⦄ ⊢ #i ➡[n, h] T →
+                ⬆*[1] T ≡ U → ⦃G, K.ⓑ{I}V⦄ ⊢ #⫯i ➡[n, h] U.
+#n #h #I #G #K #V #T #U #i *
+/3 width=5 by cpg_lref, ex2_intro/
+qed.
+
+lemma cpm_bind: ∀n,h,p,I,G,L,V1,V2,T1,T2.
+                ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ➡[n, h] T2 →
+                ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ➡[n, h] ⓑ{p,I}V2.T2.
+#n #h #p #I #G #L #V1 #V2 #T1 #T2 * #riV #rhV #HV12 *
+/5 width=5 by cpg_bind, isrt_plus_O1, isr_shift, ex2_intro/
+qed.
+
+lemma cpm_flat: ∀n,h,I,G,L,V1,V2,T1,T2.
+                ⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 →
+                ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ➡[n, h] ⓕ{I}V2.T2.
+#n #h #I #G #L #V1 #V2 #T1 #T2 * #riV #rhV #HV12 *
+/5 width=5 by isrt_plus_O1, isr_shift, cpg_flat, ex2_intro/
+qed.
+
+lemma cpm_zeta: ∀n,h,G,L,V,T1,T,T2. ⦃G, L.ⓓV⦄ ⊢ T1 ➡[n, h] T →
+                ⬆*[1] T2 ≡ T → ⦃G, L⦄ ⊢ +ⓓV.T1 ➡[n, h] T2.
+#n #h #G #L #V #T1 #T #T2 *
+/3 width=5 by cpg_zeta, isrt_plus_O2, ex2_intro/
+qed.
+
+lemma cpm_eps: ∀n,h,G,L,V,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 → ⦃G, L⦄ ⊢ ⓝV.T1 ➡[n, h] T2.
+#n #h #G #L #V #T1 #T2 *
+/3 width=3 by cpg_eps, isrt_plus_O2, ex2_intro/
+qed.
+
+lemma cpm_ee: ∀n,h,G,L,V1,V2,T. ⦃G, L⦄ ⊢ V1 ➡[n, h] V2 → ⦃G, L⦄ ⊢ ⓝV1.T ➡[⫯n, h] V2.
+#n #h #G #L #V1 #V2 #T *
+/3 width=3 by cpg_ee, isrt_succ, ex2_intro/
+qed.
+
+lemma cpm_beta: ∀n,h,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 →
+                ⦃G, L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ➡[n, h] ⓓ{p}ⓝW2.V2.T2.
+#n #h #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 * #riV #rhV #HV12 * #riW #rhW #HW12 *
+/6 width=7 by cpg_beta, isrt_plus_O2, isrt_plus, isr_shift, ex2_intro/
+qed.
+
+lemma cpm_theta: ∀n,h,p,G,L,V1,V,V2,W1,W2,T1,T2.
+                 ⦃G, L⦄ ⊢ V1 ➡[h] V → ⬆*[1] V ≡ V2 → ⦃G, L⦄ ⊢ W1 ➡[h] W2 →
+                 ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[n, h] T2 →
+                 ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ➡[n, h] ⓓ{p}W2.ⓐV2.T2.
+#n #h #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 * #riV #rhV #HV1 #HV2 * #riW #rhW #HW12 *
+/6 width=9 by cpg_theta, isrt_plus_O2, isrt_plus, isr_shift, ex2_intro/
+qed.
+
+(* Basic properties on r-transition *****************************************)
+
+(* Basic_2A1: includes: cpr_atom *)
+lemma cpr_refl: ∀h,G,L. reflexive … (cpm 0 h G L).
+/2 width=3 by ex2_intro/ qed.
+
+lemma cpr_pair_sn: ∀h,I,G,L,V1,V2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 →
+                   ∀T. ⦃G, L⦄ ⊢ ②{I}V1.T ➡[h] ②{I}V2.T.
+#h #I #G #L #V1 #V2 *
+/3 width=3 by cpg_pair_sn, isr_shift, ex2_intro/
+qed.
+
+(* Basic inversion lemmas ***************************************************)
+
+lemma cpm_inv_atom1: ∀n,h,J,G,L,T2. ⦃G, L⦄ ⊢ ⓪{J} ➡[n, h] T2 →
+                     ∨∨ T2 = ⓪{J} ∧ n = 0
+                      | ∃∃s. T2 = ⋆(next h s) & J = Sort s & n = 1
+                      | ∃∃K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 & ⬆*[1] V2 ≡ T2 &
+                                   L = K.ⓓV1 & J = LRef 0
+                      | ∃∃m,K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[m, h] V2 & ⬆*[1] V2 ≡ T2 &
+                                     L = K.ⓛV1 & J = LRef 0 & n = ⫯m
+                      | ∃∃I,K,V,T,i. ⦃G, K⦄ ⊢ #i ➡[n, h] T & ⬆*[1] T ≡ T2 &
+                                     L = K.ⓑ{I}V & J = LRef (⫯i).
+#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/
+| #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 #H3 destruct
+  /4 width=6 by or5_intro2, ex4_3_intro, ex2_intro/
+| #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 #H3 destruct
+  elim (isrt_inv_plus_SO_dx … Hc) -Hc // #m #Hc #H destruct
+  /4 width=9 by or5_intro3, ex5_4_intro, ex2_intro/
+| #I #K #V1 #V2 #i #HV2 #HVT2 #H1 #H2 destruct
+  /4 width=9 by or5_intro4, ex4_5_intro, ex2_intro/
+]
+qed-.
+
+lemma cpm_inv_sort1: ∀n,h,G,L,T2,s. ⦃G, L⦄ ⊢ ⋆s ➡[n,h] T2 →
+                     (T2 = ⋆s ∧ n = 0) ∨
+                     (T2 = ⋆(next h s) ∧ n = 1).
+#n #h #G #L #T2 #s * #c #Hc #H elim (cpg_inv_sort1 … H) -H *
+#H1 #H2 destruct
+/4 width=1 by isrt_inv_01, isrt_inv_00, or_introl, or_intror, conj/
+qed-.
+
+lemma cpm_inv_zero1: ∀n,h,G,L,T2. ⦃G, L⦄ ⊢ #0 ➡[n, h] T2 →
+                     ∨∨ (T2 = #0 ∧ n = 0)
+                      | ∃∃K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[n, h] V2 & ⬆*[1] V2 ≡ T2 &
+                                   L = K.ⓓV1
+                      | ∃∃m,K,V1,V2. ⦃G, K⦄ ⊢ V1 ➡[m, h] V2 & ⬆*[1] V2 ≡ T2 &
+                                     L = K.ⓛV1 & n = ⫯m.
+#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
+  /4 width=8 by or3_intro1, ex3_3_intro, ex2_intro/
+| #cV #K #V1 #V2 #HV12 #HVT2 #H1 #H2 destruct
+  elim (isrt_inv_plus_SO_dx … Hc) -Hc // #m #Hc #H destruct
+  /4 width=8 by or3_intro2, ex4_4_intro, ex2_intro/
+]
+qed-.
+
+lemma cpm_inv_lref1: ∀n,h,G,L,T2,i. ⦃G, L⦄ ⊢ #⫯i ➡[n, h] T2 →
+                     (T2 = #(⫯i) ∧ n = 0) ∨
+                     ∃∃I,K,V,T. ⦃G, K⦄ ⊢ #i ➡[n, h] T & ⬆*[1] T ≡ T2 & L = K.ⓑ{I}V.
+#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/
+| #I #K #V1 #V2 #HV2 #HVT2 #H1 destruct
+ /4 width=7 by ex3_4_intro, ex2_intro, or_intror/
+]
+qed-.
+
+lemma cpm_inv_gref1: ∀n,h,G,L,T2,l. ⦃G, L⦄ ⊢ §l ➡[n, h] T2 → T2 = §l ∧ n = 0.
+#n #h #G #L #T2 #l * #c #Hc #H elim (cpg_inv_gref1 … H) -H
+#H1 #H2 destruct /3 width=1 by isrt_inv_00, conj/ 
+qed-.
+
+lemma cpm_inv_bind1: ∀n,h,p,I,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ➡[n, h] U2 → (
+                     ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ➡[n, h] T2 &
+                              U2 = ⓑ{p,I}V2.T2
+                     ) ∨
+                     ∃∃T. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡[n, h] T & ⬆*[1] U2 ≡ T &
+                          p = true & I = Abbr.
+#n #h #p #I #G #L #V1 #T1 #U2 * #c #Hc #H elim (cpg_inv_bind1 … H) -H *
+[ #cV #cT #V2 #T2 #HV12 #HT12 #H1 #H2 destruct
+  elim (isrt_inv_plus … Hc) -Hc #nV #nT #HcV #HcT #H destruct
+  elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
+  /4 width=5 by ex3_2_intro, ex2_intro, or_introl/
+| #cT #T2 #HT12 #HUT2 #H1 #H2 #H3 destruct
+  /5 width=3 by isrt_inv_plus_O_dx, ex4_intro, ex2_intro, or_intror/
+]
+qed-.
+
+lemma cpm_inv_abbr1: ∀n,h,p,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓓ{p}V1.T1 ➡[n, h] U2 → (
+                     ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L.ⓓV1⦄ ⊢ T1 ➡[n, h] T2 &
+                              U2 = ⓓ{p}V2.T2
+                     ) ∨
+                     ∃∃T. ⦃G, L.ⓓV1⦄ ⊢ T1 ➡[n, h] T & ⬆*[1] U2 ≡ T & p = true.
+#n #h #p #G #L #V1 #T1 #U2 * #c #Hc #H elim (cpg_inv_abbr1 … H) -H *
+[ #cV #cT #V2 #T2 #HV12 #HT12 #H1 #H2 destruct
+  elim (isrt_inv_plus … Hc) -Hc #nV #nT #HcV #HcT #H destruct
+  elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
+  /4 width=5 by ex3_2_intro, ex2_intro, or_introl/
+| #cT #T2 #HT12 #HUT2 #H1 #H2 destruct
+  /5 width=3 by isrt_inv_plus_O_dx, ex3_intro, ex2_intro, or_intror/
+]
+qed-.
+
+lemma cpm_inv_abst1: ∀n,h,p,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓛ{p}V1.T1 ➡[n, h] U2 →
+                     ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L.ⓛV1⦄ ⊢ T1 ➡[n, h] T2 &
+                              U2 = ⓛ{p}V2.T2.
+#n #h #p #G #L #V1 #T1 #U2 * #c #Hc #H elim (cpg_inv_abst1 … H) -H
+#cV #cT #V2 #T2 #HV12 #HT12 #H1 #H2 destruct
+elim (isrt_inv_plus … Hc) -Hc #nV #nT #HcV #HcT #H destruct
+elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
+/3 width=5 by ex3_2_intro, ex2_intro/
+qed-.
+
+lemma cpm_inv_flat1: ∀n,h,I,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓕ{I}V1.U1 ➡[n, h] U2 →
+                     ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ U1 ➡[n, h] T2 &
+                                 U2 = ⓕ{I}V2.T2
+                      | (⦃G, L⦄ ⊢ U1 ➡[n, h] U2 ∧ I = Cast)
+                      | ∃∃m. ⦃G, L⦄ ⊢ V1 ➡[m, h] U2 & I = Cast & n = ⫯m
+                      | ∃∃p,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ W1 ➡[h] W2 &
+                                            ⦃G, L.ⓛW1⦄ ⊢ T1 ➡[n, h] T2 &
+                                            U1 = ⓛ{p}W1.T1 &
+                                            U2 = ⓓ{p}ⓝW2.V2.T2 & I = Appl
+                      | ∃∃p,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V & ⬆*[1] V ≡ V2 &
+                                              ⦃G, L⦄ ⊢ W1 ➡[h] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[n, h] T2 &
+                                              U1 = ⓓ{p}W1.T1 &
+                                              U2 = ⓓ{p}W2.ⓐV2.T2 & I = Appl.
+#n #h #I #G #L #V1 #U1 #U2 * #c #Hc #H elim (cpg_inv_flat1 … H) -H *
+[ #cV #cT #V2 #T2 #HV12 #HT12 #H1 #H2 destruct
+  elim (isrt_inv_plus … Hc) -Hc #nV #nT #HcV #HcT #H destruct
+  elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
+  /4 width=5 by or5_intro0, ex3_2_intro, ex2_intro/
+| #cU #U12 #H1 #H2 destruct
+  /5 width=3 by isrt_inv_plus_O_dx, or5_intro1, conj, ex2_intro/
+| #cU #H12 #H1 #H2 destruct
+  elim (isrt_inv_plus_SO_dx … Hc) -Hc // #m #Hc #H destruct
+  /4 width=3 by or5_intro2, ex3_intro, ex2_intro/
+| #cV #cW #cT #p #V2 #W1 #W2 #T1 #T2 #HV12 #HW12 #HT12 #H1 #H2 #H3 #H4 destruct
+  lapply (isrt_inv_plus_O_dx … Hc ?) -Hc // #Hc
+  elim (isrt_inv_plus … Hc) -Hc #n0 #nT #Hc #HcT #H destruct
+  elim (isrt_inv_plus … Hc) -Hc #nV #nW #HcV #HcW #H destruct
+  elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
+  elim (isrt_inv_shift … HcW) -HcW #HcW #H destruct
+  /4 width=11 by or5_intro3, ex6_6_intro, ex2_intro/
+| #cV #cW #cT #p #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HW12 #HT12 #H1 #H2 #H3 #H4 destruct
+  lapply (isrt_inv_plus_O_dx … Hc ?) -Hc // #Hc
+  elim (isrt_inv_plus … Hc) -Hc #n0 #nT #Hc #HcT #H destruct
+  elim (isrt_inv_plus … Hc) -Hc #nV #nW #HcV #HcW #H destruct
+  elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
+  elim (isrt_inv_shift … HcW) -HcW #HcW #H destruct
+  /4 width=13 by or5_intro4, ex7_7_intro, ex2_intro/
+]
+qed-.
+
+lemma cpm_inv_appl1: ∀n,h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓐ V1.U1 ➡[n, h] U2 →
+                     ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ U1 ➡[n, h] T2 &
+                                 U2 = ⓐV2.T2
+                      | ∃∃p,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ W1 ➡[h] W2 &
+                                            ⦃G, L.ⓛW1⦄ ⊢ T1 ➡[n, h] T2 &
+                                            U1 = ⓛ{p}W1.T1 & U2 = ⓓ{p}ⓝW2.V2.T2
+                      | ∃∃p,V,V2,W1,W2,T1,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V & ⬆*[1] V ≡ V2 &
+                                              ⦃G, L⦄ ⊢ W1 ➡[h] W2 & ⦃G, L.ⓓW1⦄ ⊢ T1 ➡[n, h] T2 &
+                                              U1 = ⓓ{p}W1.T1 & U2 = ⓓ{p}W2.ⓐV2.T2.
+#n #h #G #L #V1 #U1 #U2 * #c #Hc #H elim (cpg_inv_appl1 … H) -H *
+[ #cV #cT #V2 #T2 #HV12 #HT12 #H1 #H2 destruct
+  elim (isrt_inv_plus … Hc) -Hc #nV #nT #HcV #HcT #H destruct
+  elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
+  /4 width=5 by or3_intro0, ex3_2_intro, ex2_intro/
+| #cV #cW #cT #p #V2 #W1 #W2 #T1 #T2 #HV12 #HW12 #HT12 #H1 #H2 #H3 destruct
+  lapply (isrt_inv_plus_O_dx … Hc ?) -Hc // #Hc
+  elim (isrt_inv_plus … Hc) -Hc #n0 #nT #Hc #HcT #H destruct
+  elim (isrt_inv_plus … Hc) -Hc #nV #nW #HcV #HcW #H destruct
+  elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
+  elim (isrt_inv_shift … HcW) -HcW #HcW #H destruct
+  /4 width=11 by or3_intro1, ex5_6_intro, ex2_intro/
+| #cV #cW #cT #p #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HW12 #HT12 #H1 #H2 #H3 destruct
+  lapply (isrt_inv_plus_O_dx … Hc ?) -Hc // #Hc
+  elim (isrt_inv_plus … Hc) -Hc #n0 #nT #Hc #HcT #H destruct
+  elim (isrt_inv_plus … Hc) -Hc #nV #nW #HcV #HcW #H destruct
+  elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
+  elim (isrt_inv_shift … HcW) -HcW #HcW #H destruct
+  /4 width=13 by or3_intro2, ex6_7_intro, ex2_intro/
+]
+qed-.
+
+lemma cpm_inv_cast1: ∀n,h,G,L,V1,U1,U2. ⦃G, L⦄ ⊢ ⓝV1.U1 ➡[n, h] U2 →
+                     ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[h] V2 & ⦃G, L⦄ ⊢ U1 ➡[n,h] T2 &
+                                 U2 = ⓝV2.T2
+                      | ⦃G, L⦄ ⊢ U1 ➡[n, h] U2
+                      | ∃∃m. ⦃G, L⦄ ⊢ V1 ➡[m, h] U2 & n = ⫯m.
+#n #h #G #L #V1 #U1 #U2 * #c #Hc #H elim (cpg_inv_cast1 … H) -H *
+[ #cV #cT #V2 #T2 #HV12 #HT12 #H1 #H2 destruct
+  elim (isrt_inv_plus … Hc) -Hc #nV #nT #HcV #HcT #H destruct
+  elim (isrt_inv_shift … HcV) -HcV #HcV #H destruct
+  /4 width=5 by or3_intro0, ex3_2_intro, ex2_intro/
+| #cU #U12 #H destruct
+  /4 width=3 by isrt_inv_plus_O_dx, or3_intro1, ex2_intro/
+| #cU #H12 #H destruct
+  elim (isrt_inv_plus_SO_dx … Hc) -Hc // #m #Hc #H destruct
+  /4 width=3 by or3_intro2, ex2_intro/
+]
+qed-.
+
+(* Basic forward lemmas *****************************************************)
+
+lemma cpm_fwd_bind1_minus: ∀n,h,I,G,L,V1,T1,T. ⦃G, L⦄ ⊢ -ⓑ{I}V1.T1 ➡[n, h] T → ∀p.
+                           ∃∃V2,T2. ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ➡[n, h] ⓑ{p,I}V2.T2 &
+                                    T = -ⓑ{I}V2.T2.
+#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-.
index 966e4a17eb25c3d3e8da3c12766de613bbed8d2e..9900e8bf1cd088fcafad53a2a3633475df8fdc3d 100644 (file)
@@ -26,9 +26,6 @@ interpretation
 
 (* Basic properties *********************************************************)
 
-lemma cpx_atom: ∀h,I,G,L. ⦃G, L⦄ ⊢ ⓪{I} ⬈[h] ⓪{I}.
-/2 width=2 by cpg_atom, ex_intro/ qed.
-
 (* Basic_2A1: was: cpx_st *)
 lemma cpx_ess: ∀h,G,L,s. ⦃G, L⦄ ⊢ ⋆s ⬈[h] ⋆(next h s).
 /2 width=2 by cpg_ess, ex_intro/ qed.
@@ -91,6 +88,7 @@ lemma cpx_theta: ∀h,p,G,L,V1,V,V2,W1,W2,T1,T2.
 /3 width=4 by cpg_theta, ex_intro/
 qed.
 
+(* Basic_2A1: includes: cpx_atom *)
 lemma cpx_refl: ∀h,G,L. reflexive … (cpx h G L).
 /2 width=2 by ex_intro/ qed.
 
index 4e25194d84fb50c42784b282e1fe9526ccddb71d..8658ca5cf8da3d95be956d7bfb45becfad23f0ae 100644 (file)
@@ -1,3 +1,4 @@
 cpg.ma cpg_simple.ma cpg_drops.ma cpg_lsubr.ma
 cpx.ma cpx_simple.ma cpx_drops.ma cpx_lsubr.ma
 lfpx.ma lfpx_length.ma lfpx_drops.ma lfpx_fqup.ma 
+cpm.ma
index 441d3c51f5670ff8298c9f8f35738024078f3102..c5762eacbbe202d8c246ec8f26d0bb63782efc5f 100644 (file)
@@ -49,7 +49,8 @@ lemma frees_lref_pushs: ∀f,K,j. K ⊢ 𝐅*⦃#j⦄ ≡ f →
                         ∀i,L. ⬇*[i] L ≡ K → L ⊢ 𝐅*⦃#(i+j)⦄ ≡ ↑*[i] f.
 #f #K #j #Hf #i elim i -i
 [ #L #H lapply (drops_fwd_isid … H ?) -H //
-| #i #IH #L #H elim (drops_inv_succ … H) -H /3 width=1 by frees_lref/
+| #i #IH #L #H elim (drops_inv_succ … H) -H
+  #I #Y #V #HYK #H destruct /3 width=1 by frees_lref/
 ]
 qed.
 
index 8ce8b954c1bd353ce1d1e6f7ddf8e2411a863337..9fedf60c0c180fd43f5e2ce90139254ba59dbfca 100644 (file)
@@ -51,6 +51,9 @@ qed.
 
 (* Equations ****************************************************************)
 
+lemma plus_SO: ∀n. n + 1 = ⫯n.
+// qed.
+
 lemma minus_plus_m_m_commutative: ∀n,m:nat. n = m + n - m.
 // qed-.
 
@@ -155,6 +158,9 @@ qed.
 
 (* Inversion & forward lemmas ***********************************************)
 
+lemma plus_inv_O3: ∀x,y. x + y = 0 → x = 0 ∧ y = 0.
+/2 width=1 by plus_le_0/ qed-.
+
 lemma discr_plus_xy_y: ∀x,y. x + y = y → x = 0.
 // qed-.
 
diff --git a/matita/matita/contribs/lambdadelta/ground_2/notation/relations/isredtype_2.ma b/matita/matita/contribs/lambdadelta/ground_2/notation/relations/isredtype_2.ma
new file mode 100644 (file)
index 0000000..72275c5
--- /dev/null
@@ -0,0 +1,19 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+(* GENERAL NOTATION USED BY THE FORMAL SYSTEM λδ ****************************)
+
+notation "hvbox( 𝐑𝐓 ⦃ term 46 n, break term 46 c ⦄ )"
+   non associative with precedence 45
+   for @{ 'IsRedType $n $c }.
index cb25fdb894471666ea4222e1c2e194be76b92e50..cc4329acf89436b514c9251ea5f75075bc635db0 100644 (file)
@@ -254,6 +254,16 @@ notation < "hvbox(∃∃ ident x0 , ident x1 , ident x2 , ident x3 , ident x4 ,
  non associative with precedence 20
  for @{ 'Ex (λ${ident x0}:$T0.λ${ident x1}:$T1.λ${ident x2}:$T2.λ${ident x3}:$T3.λ${ident x4}:$T4.λ${ident x5}:$T5.λ${ident x6}:$T6.$P0) (λ${ident x0}:$T0.λ${ident x1}:$T1.λ${ident x2}:$T2.λ${ident x3}:$T3.λ${ident x4}:$T4.λ${ident x5}:$T5.λ${ident x6}:$T6.$P1) (λ${ident x0}:$T0.λ${ident x1}:$T1.λ${ident x2}:$T2.λ${ident x3}:$T3.λ${ident x4}:$T4.λ${ident x5}:$T5.λ${ident x6}:$T6.$P2) (λ${ident x0}:$T0.λ${ident x1}:$T1.λ${ident x2}:$T2.λ${ident x3}:$T3.λ${ident x4}:$T4.λ${ident x5}:$T5.λ${ident x6}:$T6.$P3) (λ${ident x0}:$T0.λ${ident x1}:$T1.λ${ident x2}:$T2.λ${ident x3}:$T3.λ${ident x4}:$T4.λ${ident x5}:$T5.λ${ident x6}:$T6.$P4) (λ${ident x0}:$T0.λ${ident x1}:$T1.λ${ident x2}:$T2.λ${ident x3}:$T3.λ${ident x4}:$T4.λ${ident x5}:$T5.λ${ident x6}:$T6.$P5) }.
 
+(* multiple existental quantifier (6, 8) *)
+
+notation > "hvbox(∃∃ ident x0 , ident x1 , ident x2 , ident x3 , ident x4 , ident x5 , ident x6 , ident x7 break . term 19 P0 break & term 19 P1 break & term 19 P2 break & term 19 P3 break & term 19 P4 break & term 19 P5)"
+ non associative with precedence 20
+ for @{ 'Ex (λ${ident x0}.λ${ident x1}.λ${ident x2}.λ${ident x3}.λ${ident x4}.λ${ident x5}.λ${ident x6}.λ${ident x7}.$P0) (λ${ident x0}.λ${ident x1}.λ${ident x2}.λ${ident x3}.λ${ident x4}.λ${ident x5}.λ${ident x6}.λ${ident x7}.$P1) (λ${ident x0}.λ${ident x1}.λ${ident x2}.λ${ident x3}.λ${ident x4}.λ${ident x5}.λ${ident x6}.λ${ident x7}.$P2) (λ${ident x0}.λ${ident x1}.λ${ident x2}.λ${ident x3}.λ${ident x4}.λ${ident x5}.λ${ident x6}.λ${ident x7}.$P3) (λ${ident x0}.λ${ident x1}.λ${ident x2}.λ${ident x3}.λ${ident x4}.λ${ident x5}.λ${ident x6}.λ${ident x7}.$P4) (λ${ident x0}.λ${ident x1}.λ${ident x2}.λ${ident x3}.λ${ident x4}.λ${ident x5}.λ${ident x6}.λ${ident x7}.$P5) }.
+
+notation < "hvbox(∃∃ ident x0 , ident x1 , ident x2 , ident x3 , ident x4 , ident x5 , ident x6 , ident x7 break . term 19 P0 break & term 19 P1 break & term 19 P2 break & term 19 P3 break & term 19 P4 break & term 19 P5)"
+ non associative with precedence 20
+ for @{ 'Ex (λ${ident x0}:$T0.λ${ident x1}:$T1.λ${ident x2}:$T2.λ${ident x3}:$T3.λ${ident x4}:$T4.λ${ident x5}:$T5.λ${ident x6}:$T6.λ${ident x7}:$T7.$P0) (λ${ident x0}:$T0.λ${ident x1}:$T1.λ${ident x2}:$T2.λ${ident x3}:$T3.λ${ident x4}:$T4.λ${ident x5}:$T5.λ${ident x6}:$T6.λ${ident x7}:$T7.$P1) (λ${ident x0}:$T0.λ${ident x1}:$T1.λ${ident x2}:$T2.λ${ident x3}:$T3.λ${ident x4}:$T4.λ${ident x5}:$T5.λ${ident x6}:$T6.λ${ident x7}:$T7.$P2) (λ${ident x0}:$T0.λ${ident x1}:$T1.λ${ident x2}:$T2.λ${ident x3}:$T3.λ${ident x4}:$T4.λ${ident x5}:$T5.λ${ident x6}:$T6.λ${ident x7}:$T7.$P3) (λ${ident x0}:$T0.λ${ident x1}:$T1.λ${ident x2}:$T2.λ${ident x3}:$T3.λ${ident x4}:$T4.λ${ident x5}:$T5.λ${ident x6}:$T6.λ${ident x7}:$T7.$P4) (λ${ident x0}:$T0.λ${ident x1}:$T1.λ${ident x2}:$T2.λ${ident x3}:$T3.λ${ident x4}:$T4.λ${ident x5}:$T5.λ${ident x6}:$T6.λ${ident x7}:$T7.$P5) }.
+
 (* multiple existental quantifier (6, 9) *)
 
 notation > "hvbox(∃∃ ident x0 , ident x1 , ident x2 , ident x3 , ident x4 , ident x5 , ident x6 , ident x7 , ident x8 break . term 19 P0 break & term 19 P1 break & term 19 P2 break & term 19 P3 break & term 19 P4 break & term 19 P5)"
index 0bf3c4da85ea1e208e366908b8e5fa9c8224ab68..39211d7f2c74ece3b91c7f155788ca883719e581 100644 (file)
@@ -48,7 +48,8 @@ lemma at_istot: ∀f. 𝐓⦃f⦄.
 /2 width=2 by ex_intro/ qed.
 
 lemma at_plus2: ∀f,i1,i,n,m. @⦃i1, n@f⦄ ≡ i → @⦃i1, (m+n)@f⦄ ≡ m+i.
-#f #i1 #i #n #m #H elim m -m /2 width=5 by at_next/
+#f #i1 #i #n #m #H elim m -m //
+#m <plus_S1 /2 width=5 by at_next/ (**) (* full auto fails *)
 qed.
 
 (* Specific inversion lemmas on at ******************************************)
index 4ca5caf746694bedf22ee49ee1ee1cf5444a8a0b..a28f7b384a76697ad88453e5b109db45731a4b2e 100644 (file)
@@ -1,3 +1,4 @@
+
 (**************************************************************************)
 (*       ___                                                              *)
 (*      ||M||                                                             *)
@@ -336,8 +337,8 @@ qed.
 (* Properties on uni ********************************************************)
 
 lemma after_uni: ∀n1,n2. 𝐔❴n1❵ ⊚ 𝐔❴n2❵ ≡ 𝐔❴n1+n2❵.
-@nat_elim2
-/4 width=5 by after_uni_next2, after_isid_sn, after_isid_dx, after_next/
+@nat_elim2 [3: #n #m <plus_n_Sm ] (**) (* full auto fails *)
+/4 width=5 by after_uni_next2, after_isid_dx, after_isid_sn, after_next/
 qed.
 
 (* Forward lemmas on at *****************************************************)
index 3ae50a862b7d75dd71a5babf8ff4a5f5c8fc120c..02bac68a04d5594e3daec27c9fbf52407d9239ab 100644 (file)
@@ -316,11 +316,11 @@ lemma sor_fcla_ex: ∀f1,n1. 𝐂⦃f1⦄ ≡ n1 → ∀f2,n2. 𝐂⦃f2⦄ ≡
                    ∃∃f,n. f1 ⋓ f2 ≡ f & 𝐂⦃f⦄ ≡ n & (n1 ∨ n2) ≤ n & n ≤ n1 + n2.
 #f1 #n1 #Hf1 elim Hf1 -f1 -n1 /3 width=6 by sor_isid_sn, ex4_2_intro/
 #f1 #n1 #Hf1 #IH #f2 #n2 * -f2 -n2 /3 width=6 by fcla_push, fcla_next, ex4_2_intro, sor_isid_dx/
-#f2 #n2 #Hf2 elim (IH … Hf2) -IH -Hf2 -Hf1
-[ /3 width=7 by fcla_push, sor_pp, ex4_2_intro/
-| /3 width=7 by fcla_next, sor_pn, max_S2_le_S, le_S_S, ex4_2_intro/
-| /3 width=7 by fcla_next, sor_np, max_S1_le_S, le_S_S, ex4_2_intro/
+#f2 #n2 #Hf2 elim (IH … Hf2) -IH -Hf2 -Hf1 [2,4: #f #n <plus_n_Sm ] (**) (* full auto fails *)
+[ /3 width=7 by fcla_next, sor_pn, max_S2_le_S, le_S_S, ex4_2_intro/
 | /4 width=7 by fcla_next, sor_nn, le_S, le_S_S, ex4_2_intro/
+| /3 width=7 by fcla_push, sor_pp, ex4_2_intro/
+| /3 width=7 by fcla_next, sor_np, max_S1_le_S, le_S_S, ex4_2_intro/
 ]
 qed-.
 
index 494650d04d9dff70e6bff2054b0aa538d2613ef5..62228d229e21af156c36c43980e8956f51a4fd48 100644 (file)
@@ -22,13 +22,13 @@ include "ground_2/lib/arith.ma".
 
 record rtc: Type[0] ≝ {
    ri: nat; (* Note: inner r-steps *)
-   rh: nat; (* Note: head  r-steps *)
+   rs: nat; (* Note: spine r-steps *)
    ti: nat; (* Note: inner t-steps *)
-   th: nat  (* Note: head  t-steps *)
+   ts: nat  (* Note: spine t-steps *)
 }.
 
 interpretation "constructor (rtc)"
-   'Tuple ri rh ti th = (mk_rtc ri rh ti th).
+   'Tuple ri rs ti ts = (mk_rtc ri rs ti ts).
 
 interpretation "one structural step (rtc)"
    'ZeroZero = (mk_rtc O O O O).
diff --git a/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_isrt.ma b/matita/matita/contribs/lambdadelta/ground_2/steps/rtc_isrt.ma
new file mode 100644 (file)
index 0000000..ced8357
--- /dev/null
@@ -0,0 +1,55 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+include "ground_2/notation/relations/isredtype_2.ma".
+include "ground_2/steps/rtc.ma".
+
+(* RT-TRANSITION COUNTER ****************************************************)
+
+definition isrt: relation2 nat rtc ≝ λts,c.
+                 ∃∃ri,rs. 〈ri, rs, 0, ts〉 = c.
+
+interpretation "test for costrained rt-transition counter (rtc)"
+   'IsRedType ts c = (isrt ts c).
+
+(* Basic properties *********************************************************)
+
+lemma isr_00: 𝐑𝐓⦃0, 𝟘𝟘⦄.
+/2 width=3 by ex1_2_intro/ qed.
+
+lemma isr_10: 𝐑𝐓⦃0, 𝟙𝟘⦄.
+/2 width=3 by ex1_2_intro/ qed.
+
+lemma isrt_01: 𝐑𝐓⦃1, 𝟘𝟙⦄.
+/2 width=3 by ex1_2_intro/ qed.
+
+(* Basic inversion properties ***********************************************)
+
+lemma isrt_inv_00: ∀n. 𝐑𝐓⦃n, 𝟘𝟘⦄ → 0 = n.
+#n * #ri #rs #H destruct //
+qed-.
+
+lemma isrt_inv_10: ∀n. 𝐑𝐓⦃n, 𝟙𝟘⦄ → 0 = n.
+#n * #ri #rs #H destruct //
+qed-.
+
+lemma isrt_inv_01: ∀n. 𝐑𝐓⦃n, 𝟘𝟙⦄ → 1 = n.
+#n * #ri #rs #H destruct //
+qed-.
+
+(* Main inversion properties ************************************************)
+
+theorem isrt_mono: ∀n1,n2,c. 𝐑𝐓⦃n1, c⦄ → 𝐑𝐓⦃n2, c⦄ → n1 = n2.
+#n1 #n2 #c * #ri1 #rs1 #H1 * #ri2 #rs2 #H2 destruct //
+qed-.
index 41f0e8a273e59ffc1875150bcb2311110cb1649c..900e6b4836e6f0ce739d3d2927ec1b35e1aa1882 100644 (file)
 (*                                                                        *)
 (**************************************************************************)
 
-include "ground_2/steps/rtc.ma".
+include "ground_2/steps/rtc_shift.ma".
 
 (* RT-TRANSITION COUNTER ****************************************************)
 
-definition plus (r1:rtc) (r2:rtc): rtc ≝ match r1 with [
-   mk_rtc ri1 rh1 ti1 th1 ⇒ match r2 with [
-      mk_rtc ri2 rh2 ti2 th2 ⇒ 〈ri1+ri2, rh1+rh2, ti1+ti2, th1+th2〉
+definition plus (c1:rtc) (c2:rtc): rtc ≝ match c1 with [
+   mk_rtc ri1 rs1 ti1 ts1 ⇒ match c2 with [
+      mk_rtc ri2 rs2 ti2 ts2 ⇒ 〈ri1+ri2, rs1+rs2, ti1+ti2, ts1+ts2〉
    ]
 ].
 
 interpretation "plus (rtc)"
-   'plus r1 r2 = (plus r1 r2).
+   'plus c1 c2 = (plus c1 c2).
 
 (* Basic properties *********************************************************)
 
-lemma plus_OO_r: ∀r. r = 𝟘𝟘 + r.
-* normalize //
+lemma plus_rew: ∀ri1,ri2,rs1,rs2,ti1,ti2,ts1,ts2. 
+                〈ri1+ri2, rs1+rs2, ti1+ti2, ts1+ts2〉 =
+                plus (〈ri1,rs1,ti1,ts1〉) (〈ri2,rs2,ti2,ts2〉).
+// qed. (**) (* disambiguation of plus fails *)
+
+lemma plus_O_dx: ∀c. c = c + 𝟘𝟘.
+* #ri #rs #ti #ts <plus_rew //
+qed.
+
+(* Basic inversion properties ***********************************************)
+
+lemma plus_inv_dx: ∀ri,rs,ti,ts,c1,c2. 〈ri,rs,ti,ts〉 = c1 + c2 →
+                   ∃∃ri1,rs1,ti1,ts1,ri2,rs2,ti2,ts2.
+                   ri1+ri2 = ri & rs1+rs2 = rs & ti1+ti2 = ti & ts1+ts2 = ts &
+                   〈ri1,rs1,ti1,ts1〉 = c1 & 〈ri2,rs2,ti2,ts2〉 = c2.
+#ri #rs #ti #ts * #ri1 #rs1 #ti1 #ts1 * #ri2 #rs2 #ti2 #ts2
+<plus_rew #H destruct /2 width=14 by ex6_8_intro/
+qed-.
+
+(* Main Properties **********************************************************)
+
+theorem plus_assoc: associative … plus.
+* #ri1 #rs1 #ti1 #ts1 * #ri2 #rs2 #ti2 #ts2 * #ri3 #rs3 #ti3 #ts3
+<plus_rew //
+qed.
+
+(* Properties with test for constrained rt-transition counter ***************)
+
+lemma isrt_plus: ∀n1,n2,c1,c2. 𝐑𝐓⦃n1, c1⦄ → 𝐑𝐓⦃n2, c2⦄ → 𝐑𝐓⦃n1+n2, c1+c2⦄.
+#n1 #n2 #c1 #c2 * #ri1 #rs1 #H1 * #ri2 #rs2 #H2 destruct
+/2 width=3 by ex1_2_intro/
 qed.
 
-lemma plus_r_OO: ∀r. r = r + 𝟘𝟘.
-* normalize //
+lemma isrt_plus_O1: ∀n,c1,c2. 𝐑𝐓⦃0, c1⦄ → 𝐑𝐓⦃n, c2⦄ → 𝐑𝐓⦃n, c1+c2⦄.
+/2 width=1 by isrt_plus/ qed.
+
+lemma isrt_plus_O2: ∀n,c1,c2. 𝐑𝐓⦃n, c1⦄ → 𝐑𝐓⦃0, c2⦄ → 𝐑𝐓⦃n, c1+c2⦄.
+#n #c1 #c2 #H1 #H2 >(plus_n_O n) /2 width=1 by isrt_plus/
+qed.
+
+lemma isrt_succ: ∀n,c. 𝐑𝐓⦃n, c⦄ → 𝐑𝐓⦃⫯n, c+𝟘𝟙⦄.
+/2 width=1 by isrt_plus/ qed.
+
+(* Inversion properties with test for constrained rt-transition counter *****)
+
+lemma isrt_inv_plus: ∀n,c1,c2. 𝐑𝐓⦃n, c1 + c2⦄ →
+                     ∃∃n1,n2. 𝐑𝐓⦃n1, c1⦄ & 𝐑𝐓⦃n2, c2⦄ & n1 + n2 = n.
+#n #c1 #c2 * #ri #rs #H
+elim (plus_inv_dx … H) -H #ri1 #rs1 #ti1 #ts1 #ri2 #rs2 #ti2 #ts2 #_ #_ #H1 #H2 #H3 #H4
+elim (plus_inv_O3 … H1) -H1 /3 width=5 by ex3_2_intro, ex1_2_intro/
+qed-.
+
+lemma isrt_inv_plus_O_dx: ∀n,c1,c2. 𝐑𝐓⦃n, c1 + c2⦄ → 𝐑𝐓⦃0, c2⦄ → 𝐑𝐓⦃n, c1⦄.
+#n #c1 #c2 #H #H2
+elim (isrt_inv_plus … H) -H #n1 #n2 #Hn1 #Hn2 #H destruct
+lapply (isrt_mono … Hn2 H2) -c2 #H destruct //
+qed-.
+
+lemma isrt_inv_plus_SO_dx: ∀n,c1,c2. 𝐑𝐓⦃n, c1 + c2⦄ → 𝐑𝐓⦃1, c2⦄ →
+                           ∃∃m. 𝐑𝐓⦃m, c1⦄ & n = ⫯m.
+#n #c1 #c2 #H #H2
+elim (isrt_inv_plus … H) -H #n1 #n2 #Hn1 #Hn2 #H destruct
+lapply (isrt_mono … Hn2 H2) -c2 #H destruct
+/2 width=3 by ex2_intro/
+qed-.
+
+(* Properties with shift ****************************************************)
+
+lemma plus_shift: ∀c1,c2. (↓c1) + (↓c2) = ↓(c1+c2).
+* #ri1 #rs1 #ti1 #ts1 * #ri2 #rs2 #ti2 #ts2
+<shift_rew <shift_rew <shift_rew <plus_rew //
 qed.
index a2746366cc458cf0f925767862f12d510a507fa1..f7c56a3e1f50438a7734b09959d12295237626b7 100644 (file)
 (**************************************************************************)
 
 include "ground_2/notation/functions/drop_1.ma".
-include "ground_2/steps/rtc.ma".
+include "ground_2/steps/rtc_isrt.ma".
 
 (* RT-TRANSITION COUNTER ****************************************************)
 
-definition shift (r:rtc): rtc ≝ match r with
-[ mk_rtc ri rh ti th ⇒ 〈ri+rh, 0, ti+th, 0〉 ].
+definition shift (c:rtc): rtc ≝ match c with
+[ mk_rtc ri rs ti ts ⇒ 〈ri+rs, 0, ti+ts, 0〉 ].
 
 interpretation "shift (rtc)"
-   'Drop r = (shift r).
+   'Drop c = (shift c).
 
 (* Basic properties *********************************************************)
 
-lemma shift_refl: ∀ri,ti. 〈ri, 0, ti, 0〉 = ↓〈ri, 0, ti, 0〉.
+lemma shift_rew: ∀ri,rs,ti,ts. 〈ri+rs, 0, ti+ts, 0〉 = ↓〈ri, rs, ti, ts〉.
 normalize //
 qed.
+
+lemma shift_O: 𝟘𝟘 = ↓𝟘𝟘.
+// qed.
+
+(* Basic inversion properties ***********************************************)
+
+lemma shift_inv_dx: ∀ri,rs,ti,ts,c. 〈ri, rs, ti, ts〉 = ↓c →
+                    ∃∃ri0,rs0,ti0,ts0. ri0+rs0 = ri & 0 = rs & ti0+ts0 = ti & 0 = ts &
+                                       〈ri0, rs0, ti0, ts0〉 = c.
+#ri #rs #ti #ts * #ri0 #rs0 #ti0 #ts0 <shift_rew #H destruct
+/2 width=7 by ex5_4_intro/
+qed-.
+
+(* Properties with test for costrained rt-transition counter ****************)
+
+lemma isr_shift: ∀c. 𝐑𝐓⦃0, c⦄ → 𝐑𝐓⦃0, ↓c⦄.
+#c * #ri #rs #H destruct /2 width=3 by ex1_2_intro/
+qed.
+
+(* Inversion properties with test for costrained rt-counter *****************)
+
+lemma isrt_inv_shift: ∀n,c. 𝐑𝐓⦃n, ↓c⦄ → 𝐑𝐓⦃0, c⦄ ∧ 0 = n.
+#n #c * #ri #rs #H
+elim (shift_inv_dx … H) -H #rt0 #rs0 #ti0 #ts0 #_ #_ #H1 #H2 #H3
+elim (plus_inv_O3 … H1) -H1 /3 width=3 by ex1_2_intro, conj/
+qed-.
+
+lemma isr_inv_shift: ∀c. 𝐑𝐓⦃0, ↓c⦄ → 𝐑𝐓⦃0, c⦄.
+#c #H elim (isrt_inv_shift … H) -H //
+qed-.
index 92cec8dc578ce947ab6d53bf746ec459a913daf8..7e76ce4e15954706d9f46de90775625f544ec4ba 100644 (file)
@@ -12,7 +12,7 @@ table {
    class "water"
    [ { "generic rt-transition counter" * } {
         [ { "" * } {
-             [ "rtc ( 〈?,?,?,?〉 ) ( 𝟘𝟘 ) ( 𝟙𝟘 ) ( 𝟘𝟙 )" "rtc_shift ( ↓? )" "rtc_plus ( ? + ? )" * ]
+             [ "rtc ( 〈?,?,?,?〉 ) ( 𝟘𝟘 ) ( 𝟙𝟘 ) ( 𝟘𝟙 )" "rtc_isrc ( 𝐑𝐓⦃?, ?⦄ )" "rtc_shift ( ↓? )" "rtc_plus ( ? + ? )" * ]
           }
         ]
      }
index 960017fac6c8b8fffe563bb47afc65a5aca40a0d..1a5ddeed3c48afbc1e4083e3c2f85af37185b67e 100644 (file)
@@ -29,6 +29,7 @@
     <key name="ex">6 5</key>
     <key name="ex">6 6</key>
     <key name="ex">6 7</key>
+    <key name="ex">6 8</key>
     <key name="ex">6 9</key>
     <key name="ex">7 3</key>
     <key name="ex">7 4</key>    
index 7099edae0d550cb0c625fbdecd7cfed90f275e33..af3c36d266b1efa406d02f7f48e3ddad9d9f8448 100644 (file)
@@ -210,6 +210,14 @@ inductive ex6_7 (A0,A1,A2,A3,A4,A5,A6:Type[0]) (P0,P1,P2,P3,P4,P5:A0→A1→A2
 
 interpretation "multiple existental quantifier (6, 7)" 'Ex P0 P1 P2 P3 P4 P5 = (ex6_7 ? ? ? ? ? ? ? P0 P1 P2 P3 P4 P5).
 
+(* multiple existental quantifier (6, 8) *)
+
+inductive ex6_8 (A0,A1,A2,A3,A4,A5,A6,A7:Type[0]) (P0,P1,P2,P3,P4,P5:A0→A1→A2→A3→A4→A5→A6→A7→Prop) : Prop ≝
+   | ex6_8_intro: ∀x0,x1,x2,x3,x4,x5,x6,x7. P0 x0 x1 x2 x3 x4 x5 x6 x7 → P1 x0 x1 x2 x3 x4 x5 x6 x7 → P2 x0 x1 x2 x3 x4 x5 x6 x7 → P3 x0 x1 x2 x3 x4 x5 x6 x7 → P4 x0 x1 x2 x3 x4 x5 x6 x7 → P5 x0 x1 x2 x3 x4 x5 x6 x7 → ex6_8 ? ? ? ? ? ? ? ? ? ? ? ? ? ?
+.
+
+interpretation "multiple existental quantifier (6, 8)" 'Ex P0 P1 P2 P3 P4 P5 = (ex6_8 ? ? ? ? ? ? ? ? P0 P1 P2 P3 P4 P5).
+
 (* multiple existental quantifier (6, 9) *)
 
 inductive ex6_9 (A0,A1,A2,A3,A4,A5,A6,A7,A8:Type[0]) (P0,P1,P2,P3,P4,P5:A0→A1→A2→A3→A4→A5→A6→A7→A8→Prop) : Prop ≝