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/delta_equivalence/cpzs.ma".
16 include "basic_2/reduction/cpx.ma".
18 fact destruct_tsort_tsort: ∀k1,k2. ⋆k1 = ⋆k2 → k1 = k2.
19 #k1 #k2 #H destruct //
22 axiom cpzs_inv_subst: ∀I,G,L,K,V1,V2,W2,i.
23 ⇩[i] L ≡ K.ⓑ{I}V1 → ⇧[O, i+1] V2 ≡ W2 →
24 ⦃G, L⦄ ⊢ #i ◆*[O, ∞] W2 → ⦃G, K⦄⊢ V1 ◆*[O, ∞] V2.
26 axiom cpzs_subst: ∀I,G,L,K,V1,V2,W2,i.
27 ⇩[i] L ≡ K.ⓑ{I}V1 → ⇧[O, i+1] V2 ≡ W2 →
28 ⦃G, K⦄⊢ V1 ◆*[O, ∞] V2 → ⦃G, L⦄ ⊢ #i ◆*[O, ∞] W2.
30 (* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************)
32 (* Forward lemmas on delta-equivalence for terms ****************************)
34 lemma cpx_fwd_cpys_cpzs: ∀h,g,G,L,T1,T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 →
35 ∀d,e. ⦃G, L⦄ ⊢ T1 ◆*[d, e] T2 ↔ ⦃G, L⦄ ⊢ T1 ▶*[d, e] T2.
36 #h #g #G #L #T1 #T2 #H elim H -G -L -T1 -T2
38 | #G #L #k #l #_ #d #e @conj #H lapply (next_lt h k)
39 [ <(cpzs_inv_sort … H)
40 | lapply (cpys_inv_sort1 … H) -H #H >(destruct_tsort_tsort … H)
41 ] -H #H elim (lt_refl_false … H)
42 | #I #G #L #K #V1 #V2 #W2 #i #HLK #_ #HVW2 #IHV12 #d #e @conj #H
44 [ @(cpys_subst … HLK … HVW2) // >yminus_Y_inj /3 width=7 by cpzs_inv_subst/
45 | elim (cpys_inv_lref1_ldrop … H … HLK … HVW2) -H /3 width=7 by cpzs_subst/
48 | #a #I #G #L #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #d #e
49 elim (IHV12 d e) -IHV12 elim (IHT12 (⫯d) e) -IHT12
50 #IHTdx #IHTsn #IHVdx #IHVsn @conj #H
51 [ elim (cpzs_inv_bind … H) -H /3 width=1 by cpys_bind/
52 | elim (cpys_inv_bind1 … H) -H #X1 #X2 #H1 #H2 #H destruct /3 width=1 by cpzs_bind/
54 | #I #G #L #V1 #V2 #T1 #T2 #_ #_ #IHV12 #IHT12 #d #e
55 elim (IHV12 d e) -IHV12 elim (IHT12 (d) e) -IHT12
56 #IHTdx #IHTsn #IHVdx #IHVsn @conj #H
57 [ elim (cpzs_inv_flat … H) -H /3 width=1 by cpys_flat/
58 | elim (cpys_inv_flat1 … H) -H #X1 #X2 #H1 #H2 #H destruct /3 width=1 by cpzs_flat/
60 | #G #L #V #U1 #U2 #T2 #_ #HTU2 #_ #d #e @conj #H
61 | #G #L #V1 #T1 #T2 #_ #_ #d #e @conj #H
62 | #G #L #V1 #V2 #T1 #HV12 #_ #d #e @conj #H
63 | #a #G #L #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #d #e @conj #H
64 [ elim (cpzs_inv_flat_bind … H)
65 | elim (cpys_inv_flat1 … H) -H #X1 #X2 #H1 #H2 #H destruct
67 | #a #G #L #V1 #V #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #d #e @conj #H
68 [ elim (cpzs_inv_flat_bind … H)
69 | elim (cpys_inv_flat1 … H) -H #X1 #X2 #H1 #H2 #H destruct