]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/etc/cny/cpx_cpzs.etc
milestone update in ground_2 and basic_2A
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / etc / cny / cpx_cpzs.etc
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "basic_2/delta_equivalence/cpzs.ma".
16 include "basic_2/reduction/cpx.ma".
17
18 fact destruct_tsort_tsort: ∀k1,k2. ⋆k1 = ⋆k2 → k1 = k2.
19 #k1 #k2 #H destruct //
20 qed-.
21
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.
25
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.
29
30 (* CONTEXT-SENSITIVE EXTENDED PARALLEL REDUCTION FOR TERMS ******************)
31
32 (* Forward lemmas on delta-equivalence for terms ****************************)
33
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
37 [ /2 width=1 by conj/
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
43 (*  
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/
46   ]
47 *)
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/
53   ]
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/
59   ]
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
66   ]
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
70   ]
71 ]
72  
73