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/tpss_lift.ma".
16 include "Basic_2/reducibility/tpr_lift.ma".
17 include "Basic_2/reducibility/cpr.ma".
19 (* CONTEXT-SENSITIVE PARALLEL REDUCTION ON TERMS ****************************)
21 (* Advanced properties ******************************************************)
23 lemma cpr_cdelta: ∀L,K,V1,W1,W2,i.
24 ↓[0, i] L ≡ K. 𝕓{Abbr} V1 → K ⊢ V1 [0, |L| - i - 1] ≫* W1 →
25 ↑[0, i + 1] W1 ≡ W2 → L ⊢ #i ⇒ W2.
26 #L #K #V1 #W1 #W2 #i #HLK #HVW1 #HW12
27 lapply (ldrop_fwd_ldrop2_length … HLK) #Hi
28 @ex2_1_intro [2: // | skip | @tpss_subst /width=6/ ] (**) (* /3 width=6/ is too slow *)
31 (* Advanced inversion lemmas ************************************************)
33 (* Basic_1: was: pr2_gen_lref *)
34 lemma cpr_inv_lref1: ∀L,T2,i. L ⊢ #i ⇒ T2 →
36 ∃∃K,V1,T1. ↓[0, i] L ≡ K. 𝕓{Abbr} V1 &
37 K ⊢ V1 [0, |L| - i - 1] ≫* T1 &
41 >(tpr_inv_atom1 … H) -H #H
42 elim (tpss_inv_lref1 … H) -H /2 width=1/
46 (* Basic_1: was: pr2_gen_abst *)
47 lemma cpr_inv_abst1: ∀V1,T1,U2. 𝕔{Abst} V1. T1 ⇒ U2 →
48 ∃∃V2,T2. V1 ⇒ V2 & T1 ⇒ T2 & U2 = 𝕔{Abst} V2. T2.
51 (* Relocation properties ****************************************************)
53 (* Basic_1: was: pr2_lift *)
54 lemma cpr_lift: ∀L,K,d,e. ↓[d, e] L ≡ K →
55 ∀T1,U1. ↑[d, e] T1 ≡ U1 → ∀T2,U2. ↑[d, e] T2 ≡ U2 →
56 K ⊢ T1 ⇒ T2 → L ⊢ U1 ⇒ U2.
57 #L #K #d #e #HLK #T1 #U1 #HTU1 #T2 #U2 #HTU2 * #T #HT1 #HT2
58 elim (lift_total T d e) #U #HTU
59 lapply (tpr_lift … HT1 … HTU1 … HTU) -T1 #HU1
60 elim (lt_or_ge (|K|) d) #HKd
61 [ lapply (tpss_lift_le … HT2 … HLK HTU … HTU2) -T2 -T -HLK [ /2 width=1/ | /3 width=4/ ]
62 | lapply (tpss_lift_be … HT2 … HLK HTU … HTU2) -T2 -T -HLK // /3 width=4/
66 (* Basic_1: was: pr2_gen_lift *)
67 lemma cpr_inv_lift: ∀L,K,d,e. ↓[d, e] L ≡ K →
68 ∀T1,U1. ↑[d, e] T1 ≡ U1 → ∀U2. L ⊢ U1 ⇒ U2 →
69 ∃∃T2. ↑[d, e] T2 ≡ U2 & K ⊢ T1 ⇒ T2.
70 #L #K #d #e #HLK #T1 #U1 #HTU1 #U2 * #U #HU1 #HU2
71 elim (tpr_inv_lift … HU1 … HTU1) -U1 #T #HTU #T1
72 elim (lt_or_ge (|L|) d) #HLd
73 [ elim (tpss_inv_lift1_le … HU2 … HLK … HTU ?) -U -HLK [ /5 width=4/ | /2 width=1/ ]
74 | elim (lt_or_ge (|L|) (d + e)) #HLde
75 [ elim (tpss_inv_lift1_be_up … HU2 … HLK … HTU ? ?) -U -HLK // [ /5 width=4/ | /2 width=1/ ]
76 | elim (tpss_inv_lift1_be … HU2 … HLK … HTU ? ?) -U -HLK // /5 width=4/