1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/rt_transition/cpx_lsubr.ma".
16 include "basic_2/rt_computation/cpxs.ma".
18 (* UNBOUND CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS **************)
20 (* Main properties **********************************************************)
22 theorem cpxs_trans: ∀h,G,L. Transitive … (cpxs h G L).
23 normalize /2 width=3 by trans_TC/ qed-.
25 theorem cpxs_bind: ∀h,p,I,G,L,V1,V2,T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ⬈*[h] T2 →
26 ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 →
27 ⦃G, L⦄ ⊢ ⓑ{p,I}V1.T1 ⬈*[h] ⓑ{p,I}V2.T2.
28 #h #p #I #G #L #V1 #V2 #T1 #T2 #HT12 #H @(cpxs_ind … H) -V2
29 /3 width=5 by cpxs_trans, cpxs_bind_dx/
32 theorem cpxs_flat: ∀h,I,G,L,V1,V2,T1,T2. ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 →
33 ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 →
34 ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ⬈*[h] ⓕ{I}V2.T2.
35 #h #I #G #L #V1 #V2 #T1 #T2 #HT12 #H @(cpxs_ind … H) -V2
36 /3 width=5 by cpxs_trans, cpxs_flat_dx/
39 theorem cpxs_beta_rc: ∀h,p,G,L,V1,V2,W1,W2,T1,T2.
40 ⦃G, L⦄ ⊢ V1 ⬈[h] V2 → ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G, L⦄ ⊢ W1 ⬈*[h] W2 →
41 ⦃G, L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ⬈*[h] ⓓ{p}ⓝW2.V2.T2.
42 #h #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HV12 #HT12 #H @(cpxs_ind … H) -W2
43 /4 width=5 by cpxs_trans, cpxs_beta_dx, cpxs_bind_dx, cpx_pair_sn/
46 theorem cpxs_beta: ∀h,p,G,L,V1,V2,W1,W2,T1,T2.
47 ⦃G, L.ⓛW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G, L⦄ ⊢ W1 ⬈*[h] W2 → ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 →
48 ⦃G, L⦄ ⊢ ⓐV1.ⓛ{p}W1.T1 ⬈*[h] ⓓ{p}ⓝW2.V2.T2.
49 #h #p #G #L #V1 #V2 #W1 #W2 #T1 #T2 #HT12 #HW12 #H @(cpxs_ind … H) -V2
50 /4 width=5 by cpxs_trans, cpxs_beta_rc, cpxs_bind_dx, cpx_flat/
53 theorem cpxs_theta_rc: ∀h,p,G,L,V1,V,V2,W1,W2,T1,T2.
54 ⦃G, L⦄ ⊢ V1 ⬈[h] V → ⬆*[1] V ≘ V2 →
55 ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G, L⦄ ⊢ W1 ⬈*[h] W2 →
56 ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ⬈*[h] ⓓ{p}W2.ⓐV2.T2.
57 #h #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV1 #HV2 #HT12 #H @(cpxs_ind … H) -W2
58 /3 width=5 by cpxs_trans, cpxs_theta_dx, cpxs_bind_dx/
61 theorem cpxs_theta: ∀h,p,G,L,V1,V,V2,W1,W2,T1,T2.
62 ⬆*[1] V ≘ V2 → ⦃G, L⦄ ⊢ W1 ⬈*[h] W2 →
63 ⦃G, L.ⓓW1⦄ ⊢ T1 ⬈*[h] T2 → ⦃G, L⦄ ⊢ V1 ⬈*[h] V →
64 ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}W1.T1 ⬈*[h] ⓓ{p}W2.ⓐV2.T2.
65 #h #p #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #HV2 #HW12 #HT12 #H @(TC_ind_dx … V1 H) -V1
66 /3 width=5 by cpxs_trans, cpxs_theta_rc, cpxs_flat_dx/
69 (* Advanced inversion lemmas ************************************************)
71 lemma cpxs_inv_appl1: ∀h,G,L,V1,T1,U2. ⦃G, L⦄ ⊢ ⓐV1.T1 ⬈*[h] U2 →
72 ∨∨ ∃∃V2,T2. ⦃G, L⦄ ⊢ V1 ⬈*[h] V2 & ⦃G, L⦄ ⊢ T1 ⬈*[h] T2 &
74 | ∃∃p,W,T. ⦃G, L⦄ ⊢ T1 ⬈*[h] ⓛ{p}W.T & ⦃G, L⦄ ⊢ ⓓ{p}ⓝW.V1.T ⬈*[h] U2
75 | ∃∃p,V0,V2,V,T. ⦃G, L⦄ ⊢ V1 ⬈*[h] V0 & ⬆*[1] V0 ≘ V2 &
76 ⦃G, L⦄ ⊢ T1 ⬈*[h] ⓓ{p}V.T & ⦃G, L⦄ ⊢ ⓓ{p}V.ⓐV2.T ⬈*[h] U2.
77 #h #G #L #V1 #T1 #U2 #H @(cpxs_ind … H) -U2 [ /3 width=5 by or3_intro0, ex3_2_intro/ ]
79 [ #V0 #T0 #HV10 #HT10 #H destruct
80 elim (cpx_inv_appl1 … HU2) -HU2 *
81 [ #V2 #T2 #HV02 #HT02 #H destruct /4 width=5 by cpxs_strap1, or3_intro0, ex3_2_intro/
82 | #p #V2 #W #W2 #T #T2 #HV02 #HW2 #HT2 #H1 #H2 destruct
83 lapply (cpxs_strap1 … HV10 … HV02) -V0 #HV12
84 lapply (lsubr_cpx_trans … HT2 (L.ⓓⓝW.V1) ?) -HT2
85 /5 width=5 by cpxs_bind, cpxs_flat_dx, cpx_cpxs, lsubr_beta, ex2_3_intro, or3_intro1/
86 | #p #V #V2 #W0 #W2 #T #T2 #HV0 #HV2 #HW02 #HT2 #H1 #H2 destruct
87 /5 width=10 by cpxs_flat_sn, cpxs_bind_dx, cpxs_strap1, ex4_5_intro, or3_intro2/
89 | /4 width=9 by cpxs_strap1, or3_intro1, ex2_3_intro/
90 | /4 width=11 by cpxs_strap1, or3_intro2, ex4_5_intro/