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/unfold/ltpss_sn_alt.ma".
16 include "basic_2/reducibility/ltpr.ma".
17 include "basic_2/reducibility/cpr_tpss.ma".
18 include "basic_2/reducibility/cpr_cpr.ma".
19 include "basic_2/reducibility/cfpr_ltpss.ma".
21 (* CONTEXT-SENSITIVE PARALLEL REDUCTION ON CLOSURES *************************)
23 (* Advanced properties ******************************************************)
25 lemma fpr_all: ∀L1,L. L1 ➡ L → ∀L2,T1,T2. L ⊢ T1 ➡ T2 →
26 L ⊢ ▶* [0, |L|] L2 → ⦃L1, T1⦄ ➡ ⦃L2, T2⦄.
27 #L1 #L #H elim H -L1 -L
28 [ #L2 #T1 #T2 #HT12 #HL2
29 lapply (ltpss_sn_inv_atom1 … HL2) -HL2 #H destruct
30 lapply (cpr_inv_atom … HT12) -HT12 /2 width=1/
31 | #I #L1 #L #V1 #V #_ #HV1 #IH #X #T1 #T2 #HT12 #H
32 elim (ltpss_sn_inv_tpss21 … H ?) -H // <minus_plus_m_m #L2 #V2 #HL2 #HV2 #H destruct
33 lapply (cpr_bind_dx false … HV1 HT12) -HV1 -HT12 #HT12
34 lapply (cpr_tpss_trans … HT12 (-ⓑ{I}V2.T2) ?) -HT12 /2 width=1/ -HV2 /3 width=1/
38 (* Advanced inversion lemmas ************************************************)
40 lemma cfpr_inv_all: ∀L1,L2,L0,T1,T2. L0 ⊢ ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ →
41 ∃∃L. L0 @@ L1 ➡ L0 @@ L & L0 @@ L ⊢ T1 ➡ T2 &
42 L0 @@ L ⊢ ▶* [0, |L0| + |L|] L0 @@ L2.
43 #L1 @(lenv_ind_dx … L1) -L1
45 elim (cfpr_inv_atom1 … H) -H #HT12 #H destruct /3 width=4/
46 | #I #L1 #V1 #IH #X #L0 #T1 #T2 #H
47 elim (cfpr_inv_pair1 … H) -H #L2 #V #V2 #HV1 #HV2 #HT12 #H destruct
48 elim (IH … HT12) -IH -HT12 #L #HL1 #HT12 #HL2
49 elim (ltpr_inv_append1 … HL1) -HL1 #X #Y #HX #HY #H
50 lapply (ltpr_fwd_length … HX) -HX #HX
51 elim (append_inj_dx … H ?) -H // -HX #_ #H destruct -X
52 lapply (ltpss_sn_fwd_length … HL2) >append_length >append_length #H
53 lapply (injective_plus_r … H) -H #H
54 @(ex3_1_intro … (⋆.ⓑ{I}V@@Y)) <append_assoc // -HT12
55 <append_assoc [ /3 width=1/ ] -HV1 -HY
56 >append_length <associative_plus
57 @(ltpss_sn_dx_trans_eq … HL2) -HL2 >H -H >commutative_plus /3 width=1/
61 lemma fpr_inv_all: ∀L1,L2,T1,T2. ⦃L1, T1⦄ ➡ ⦃L2, T2⦄ →
62 ∃∃L. L1 ➡ L & L ⊢ T1 ➡ T2 & L ⊢ ▶* [0, |L|] L2.
64 lapply (fpr_cfpr … H) -H #H
65 elim (cfpr_inv_all … H) -H /2 width=4/