(* 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.
+ λG,L,T1,T2. ∃∃c. 𝐑𝐓⦃n, c⦄ & ⦃G, L⦄ ⊢ T1 ⬈[eq_t, c, h] T2.
interpretation
"semi-counted context-sensitive parallel rt-transition (term)"
/3 width=5 by cpg_lref, ex2_intro/
qed.
+(* Basic_2A1: includes: cpr_bind *)
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/
+#n #h #p #I #G #L #V1 #V2 #T1 #T2 * #cV #HcV #HV12 *
+/5 width=5 by cpg_bind, isrt_max_O1, isr_shift, ex2_intro/
qed.
-lemma cpm_flat: ∀n,h,I,G,L,V1,V2,T1,T2.
+lemma cpm_appl: ∀n,h,G,L,V1,V2,T1,T2.
⦃G, L⦄ ⊢ V1 ➡[h] V2 → ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 →
- â¦\83G, Lâ¦\84 â\8a¢ â\93\95{I}V1.T1 â\9e¡[n, h] â\93\95{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/
+ â¦\83G, Lâ¦\84 â\8a¢ â\93\90V1.T1 â\9e¡[n, h] â\93\90V2.T2.
+#n #h #G #L #V1 #V2 #T1 #T2 * #cV #HcV #HV12 *
+/5 width=5 by isrt_max_O1, isr_shift, cpg_appl, ex2_intro/
qed.
+lemma cpm_cast: ∀n,h,G,L,U1,U2,T1,T2.
+ ⦃G, L⦄ ⊢ U1 ➡[n, h] U2 → ⦃G, L⦄ ⊢ T1 ➡[n, h] T2 →
+ ⦃G, L⦄ ⊢ ⓝU1.T1 ➡[n, h] ⓝU2.T2.
+#n #h #G #L #U1 #U2 #T1 #T2 * #cU #HcU #HU12 *
+/4 width=6 by cpg_cast, isrt_max_idem1, isrt_mono, ex2_intro/
+qed.
+
+(* Basic_2A1: includes: cpr_zeta *)
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.
+(* Basic_2A1: includes: cpr_eps *)
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/
/3 width=3 by cpg_ee, isrt_succ, ex2_intro/
qed.
+(* Basic_2A1: includes: cpr_beta *)
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/
+/6 width=7 by cpg_beta, isrt_plus_O2, isrt_max, isr_shift, ex2_intro/
qed.
+(* Basic_2A1: includes: cpr_theta *)
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/
+/6 width=9 by cpg_theta, isrt_plus_O2, isrt_max, isr_shift, ex2_intro/
qed.
(* Basic properties on r-transition *****************************************)
+(* Basic_1: includes by definition: pr0_refl *)
(* 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.
+/3 width=3 by cpg_refl, ex2_intro/ qed.
(* Basic inversion lemmas ***************************************************)
#H1 #H2 destruct /3 width=1 by isrt_inv_00, conj/
qed-.
+(* Basic_2A1: includes: cpr_inv_bind1 *)
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
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_max … 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
]
qed-.
+(* Basic_1: includes: pr0_gen_abbr pr2_gen_abbr *)
+(* Basic_2A1: includes: cpr_inv_abbr1 *)
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_max … 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
]
qed-.
+(* Basic_1: includes: pr0_gen_abst pr2_gen_abst *)
+(* Basic_2A1: includes: cpr_inv_abst1 *)
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_max … 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-.
-
+(* Basic_1: includes: pr0_gen_appl pr2_gen_appl *)
+(* Basic_2A1: includes: cpr_inv_appl1 *)
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
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_max … 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_max … Hc) -Hc #n0 #nT #Hc #HcT #H destruct
+ elim (isrt_inv_max … 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_max … Hc) -Hc #n0 #nT #Hc #HcT #H destruct
+ elim (isrt_inv_max … 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 &
+ ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ➡[n, 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
+[ #cV #cT #V2 #T2 #HV12 #HT12 #HcVT #H1 #H2 destruct
+ elim (isrt_inv_max … Hc) -Hc #nV #nT #HcV #HcT #H destruct
+ lapply (isrt_eq_t_trans … HcV HcVT) -HcVT #H
+ lapply (isrt_inj … H HcT) -H #H destruct <idempotent_max
/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/
(* Basic forward lemmas *****************************************************)
+(* Basic_2A1: includes: cpr_fwd_bind1_minus *)
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.