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/syntax/theq_tdeq.ma".
16 include "basic_2/rt_computation/cpxs_lsubr.ma".
17 include "basic_2/rt_computation/cpxs_cnx.ma".
18 include "basic_2/rt_computation/lfpxs_cpxs.ma".
20 (* UNCOUNTED CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS ************)
22 (* Forward lemmas with head equivalence for terms ***************************)
24 lemma cpxs_fwd_sort: ∀h,o,G,L,U,s. ⦃G, L⦄ ⊢ ⋆s ⬈*[h] U →
25 ⋆s ⩳[h, o] U ∨ ⦃G, L⦄ ⊢ ⋆(next h s) ⬈*[h] U.
26 #h #o #G #L #U #s #H elim (cpxs_inv_sort1 … H) -H *
27 [ #H destruct /2 width=1 by or_introl/
29 @or_intror >iter_S <(iter_n_Sm … (next h)) // (**)
33 (* Note: probably this is an inversion lemma *)
34 (* Basic_2A1: was: cpxs_fwd_delta *)
35 lemma cpxs_fwd_delta_drops: ∀h,o,I,G,L,K,V1,i. ⬇*[i] L ≡ K.ⓑ{I}V1 →
37 ∀U. ⦃G, L⦄ ⊢ #i ⬈*[h] U →
38 #i ⩳[h, o] U ∨ ⦃G, L⦄ ⊢ V2 ⬈*[h] U.
39 #h #o #I #G #L #K #V1 #i #HLK #V2 #HV12 #U #H
40 elim (cpxs_inv_lref1_drops … H) -H /2 width=1 by or_introl/
41 * #I0 #K0 #V0 #U0 #HLK0 #HVU0 #HU0
42 lapply (drops_mono … HLK0 … HLK) -HLK0 #H destruct
43 elim (cpxs_lifts … HVU0 (Ⓣ) … L … HV12) -HVU0 -HV12 /2 width=3 by drops_isuni_fwd_drop2/ #X #H
44 <(lifts_mono … HU0 … H) -U0 -X /2 width=1 by or_intror/
47 (* Basic_1: was just: pr3_iso_beta *)
48 lemma cpxs_fwd_beta: ∀h,o,p,G,L,V,W,T,U. ⦃G, L⦄ ⊢ ⓐV.ⓛ{p}W.T ⬈*[h] U →
49 ⓐV.ⓛ{p}W.T ⩳[h, o] U ∨ ⦃G, L⦄ ⊢ ⓓ{p}ⓝW.V.T ⬈*[h] U.
50 #h #o #p #G #L #V #W #T #U #H elim (cpxs_inv_appl1 … H) -H *
51 [ #V0 #T0 #_ #_ #H destruct /2 width=1 by theq_pair, or_introl/
53 elim (cpxs_inv_abst1 … HT0) -HT0 #W1 #T1 #HW1 #HT1 #H destruct
54 lapply (lsubr_cpxs_trans … HT1 (L.ⓓⓝW.V) ?) -HT1
55 /5 width=3 by cpxs_trans, cpxs_bind, cpxs_pair_sn, lsubr_beta, or_intror/
56 | #b #V1 #V2 #V0 #T1 #_ #_ #HT1 #_
57 elim (cpxs_inv_abst1 … HT1) -HT1 #W2 #T2 #_ #_ #H destruct
61 lemma cpxs_fwd_theta: ∀h,o,p,G,L,V1,V,T,U. ⦃G, L⦄ ⊢ ⓐV1.ⓓ{p}V.T ⬈*[h] U →
62 ∀V2. ⬆*[1] V1 ≡ V2 → ⓐV1.ⓓ{p}V.T ⩳[h, o] U ∨
63 ⦃G, L⦄ ⊢ ⓓ{p}V.ⓐV2.T ⬈*[h] U.
64 #h #o #p #G #L #V1 #V #T #U #H #V2 #HV12
65 elim (cpxs_inv_appl1 … H) -H *
66 [ -HV12 #V0 #T0 #_ #_ #H destruct /2 width=1 by theq_pair, or_introl/
68 elim (cpxs_inv_abbr1 … HT0) -HT0 *
69 [ #V3 #T3 #_ #_ #H destruct
70 | #X #HT2 #H #H0 destruct
71 elim (lifts_inv_bind1 … H) -H #W2 #T2 #HW2 #HT02 #H destruct
72 @or_intror @(cpxs_trans … HU) -U (**) (* explicit constructor *)
73 @(cpxs_trans … (+ⓓV.ⓐV2.ⓛ{q}W2.T2)) [ /3 width=1 by cpxs_flat_dx, cpxs_bind_dx/ ] -T
74 @(cpxs_strap2 … (ⓐV1.ⓛ{q}W.T0)) [2: /2 width=1 by cpxs_beta_dx/ ]
75 /4 width=7 by cpx_zeta, lifts_bind, lifts_flat/
77 | #q #V3 #V4 #V0 #T0 #HV13 #HV34 #HT0 #HU
78 @or_intror @(cpxs_trans … HU) -U (**) (* explicit constructor *)
79 elim (cpxs_inv_abbr1 … HT0) -HT0 *
80 [ #V5 #T5 #HV5 #HT5 #H destruct
81 elim (cpxs_lifts … HV13 (Ⓣ) … (L.ⓓV) … HV12) -V1 /3 width=1 by drops_refl, drops_drop/ #X #H
82 <(lifts_mono … HV34 … H) -V3 -X /3 width=1 by cpxs_flat, cpxs_bind/
83 | #X #HT1 #H #H0 destruct
84 elim (lifts_inv_bind1 … H) -H #V5 #T5 #HV05 #HT05 #H destruct
85 elim (cpxs_lifts … HV13 (Ⓣ) … (L.ⓓV0) … HV12) -HV13 /3 width=1 by drops_refl, drops_drop/ #X #H
86 <(lifts_mono … HV34 … H) -V3 -X #HV24
87 @(cpxs_trans … (+ⓓV.ⓐV2.ⓓ{q}V5.T5)) [ /3 width=1 by cpxs_flat_dx, cpxs_bind_dx/ ] -T
88 @(cpxs_strap2 … (ⓐV1.ⓓ{q}V0.T0)) [ /4 width=7 by cpx_zeta, lifts_bind, lifts_flat/ ] -V -V5 -T5
89 @(cpxs_strap2 … (ⓓ{q}V0.ⓐV2.T0)) /3 width=3 by cpxs_pair_sn, cpxs_bind_dx, cpx_theta/
94 lemma cpxs_fwd_cast: ∀h,o,G,L,W,T,U. ⦃G, L⦄ ⊢ ⓝW.T ⬈*[h] U →
95 ∨∨ ⓝW. T ⩳[h, o] U | ⦃G, L⦄ ⊢ T ⬈*[h] U | ⦃G, L⦄ ⊢ W ⬈*[h] U.
96 #h #o #G #L #W #T #U #H
97 elim (cpxs_inv_cast1 … H) -H /2 width=1 by or3_intro1, or3_intro2/ *
98 #W0 #T0 #_ #_ #H destruct /2 width=1 by theq_pair, or3_intro0/
101 lemma cpxs_fwd_cnx: ∀h,o,G,L,T. ⦃G, L⦄ ⊢ ⬈[h, o] 𝐍⦃T⦄ →
102 ∀U. ⦃G, L⦄ ⊢ T ⬈*[h] U → T ⩳[h, o] U.
103 /3 width=4 by cpxs_inv_cnx1, tdeq_theq/ qed-.