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 "static_2/syntax/teqo_teqg.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/lpxs_cpxs.ma".
20 (* EXTENDED CONTEXT-SENSITIVE PARALLEL RT-COMPUTATION FOR TERMS *************)
22 (* Forward lemmas with sort-irrelevant outer equivalence for terms **********)
24 lemma cpxs_fwd_sort (G) (L):
25 ∀X2,s1. ❨G,L❩ ⊢ ⋆s1 ⬈* X2 → ⋆s1 ~ X2.
27 elim (cpxs_inv_sort1 … H) -H #s2 #H destruct //
30 (* Note: probably this is an inversion lemma *)
31 (* Basic_2A1: was: cpxs_fwd_delta *)
32 lemma cpxs_fwd_delta_drops (I) (G) (L) (K):
33 ∀V1,i. ⇩[i] L ≘ K.ⓑ[I]V1 →
35 ∀X2. ❨G,L❩ ⊢ #i ⬈* X2 →
36 ∨∨ #i ~ X2 | ❨G,L❩ ⊢ V2 ⬈* X2.
37 #I #G #L #K #V1 #i #HLK #V2 #HV12 #X2 #H
38 elim (cpxs_inv_lref1_drops … H) -H /2 width=1 by or_introl/
39 * #I0 #K0 #V0 #U0 #HLK0 #HVU0 #HU0
40 lapply (drops_mono … HLK0 … HLK) -HLK0 #H destruct
41 /4 width=9 by cpxs_lifts_bi, drops_isuni_fwd_drop2, or_intror/
44 (* Basic_1: was just: pr3_iso_beta *)
45 lemma cpxs_fwd_beta (p) (G) (L):
46 ∀V,W,T,X2. ❨G,L❩ ⊢ ⓐV.ⓛ[p]W.T ⬈* X2 →
47 ∨∨ ⓐV.ⓛ[p]W.T ~ X2 | ❨G,L❩ ⊢ ⓓ[p]ⓝW.V.T ⬈* X2.
48 #p #G #L #V #W #T #X2 #H elim (cpxs_inv_appl1 … H) -H *
49 [ #V0 #T0 #_ #_ #H destruct /2 width=1 by teqo_pair, or_introl/
51 elim (cpxs_inv_abst1 … HT0) -HT0 #W1 #T1 #HW1 #HT1 #H destruct
52 lapply (lsubr_cpxs_trans … HT1 (L.ⓓⓝW.V) ?) -HT1
53 /5 width=3 by cpxs_trans, cpxs_bind, cpxs_pair_sn, lsubr_beta, or_intror/
54 | #b #V1 #V2 #V0 #T1 #_ #_ #HT1 #_
55 elim (cpxs_inv_abst1 … HT1) -HT1 #W2 #T2 #_ #_ #H destruct
59 lemma cpxs_fwd_theta (p) (G) (L):
60 ∀V1,V,T,X2. ❨G,L❩ ⊢ ⓐV1.ⓓ[p]V.T ⬈* X2 →
62 ∨∨ ⓐV1.ⓓ[p]V.T ~ X2 | ❨G,L❩ ⊢ ⓓ[p]V.ⓐV2.T ⬈* X2.
63 #p #G #L #V1 #V #T #X2 #H #V2 #HV12
64 elim (cpxs_inv_appl1 … H) -H *
65 [ -HV12 #V0 #T0 #_ #_ #H destruct /2 width=1 by teqo_pair, or_introl/
67 elim (cpxs_inv_abbr1_dx … HT0) -HT0 *
68 [ #V3 #T3 #_ #_ #H destruct
69 | #X #HT2 #H #H0 destruct
70 elim (lifts_inv_bind1 … H) -H #W2 #T2 #HW2 #HT02 #H destruct
71 @or_intror @(cpxs_trans … HU) -X2 (**) (* explicit constructor *)
72 @(cpxs_trans … (+ⓓV.ⓐV2.ⓛ[q]W2.T2)) [ /3 width=1 by cpxs_flat_dx, cpxs_bind_dx/ ] -T
73 @(cpxs_strap2 … (ⓐV1.ⓛ[q]W.T0)) [2: /2 width=1 by cpxs_beta_dx/ ]
74 /4 width=7 by cpx_zeta, lifts_bind, lifts_flat/
76 | #q #V3 #V4 #V0 #T0 #HV13 #HV34 #HT0 #HU
77 @or_intror @(cpxs_trans … HU) -X2 (**) (* explicit constructor *)
78 elim (cpxs_inv_abbr1_dx … HT0) -HT0 *
79 [ #V5 #T5 #HV5 #HT5 #H destruct
80 /6 width=9 by cpxs_lifts_bi, drops_refl, drops_drop, cpxs_flat, cpxs_bind/
81 | #X #HT1 #H #H0 destruct
82 elim (lifts_inv_bind1 … H) -H #V5 #T5 #HV05 #HT05 #H destruct
83 lapply (cpxs_lifts_bi … HV13 (Ⓣ) … (L.ⓓV0) … HV12 … HV34) -V3 /3 width=1 by drops_refl, drops_drop/ #HV24
84 @(cpxs_trans … (+ⓓV.ⓐV2.ⓓ[q]V5.T5)) [ /3 width=1 by cpxs_flat_dx, cpxs_bind_dx/ ] -T
85 @(cpxs_strap2 … (ⓐV1.ⓓ[q]V0.T0)) [ /4 width=7 by cpx_zeta, lifts_bind, lifts_flat/ ] -V -V5 -T5
86 @(cpxs_strap2 … (ⓓ[q]V0.ⓐV2.T0)) /3 width=3 by cpxs_pair_sn, cpxs_bind_dx, cpx_theta/
91 lemma cpxs_fwd_cast (G) (L):
92 ∀W,T,X2. ❨G,L❩ ⊢ ⓝW.T ⬈* X2 →
93 ∨∨ ⓝW. T ~ X2 | ❨G,L❩ ⊢ T ⬈* X2 | ❨G,L❩ ⊢ W ⬈* X2.
95 elim (cpxs_inv_cast1 … H) -H /2 width=1 by or3_intro1, or3_intro2/ *
96 #W0 #T0 #_ #_ #H destruct /2 width=1 by teqo_pair, or3_intro0/
99 lemma cpxs_fwd_cnx (G) (L):
101 ∀X2. ❨G,L❩ ⊢ T1 ⬈* X2 → T1 ~ X2.
102 /3 width=5 by cpxs_inv_cnx1, teqg_teqo/ qed-.