]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/etc/cny/cpzs.etc
milestone update in ground_2 and basic_2A
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / etc / cny / 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/notation/relations/pdeltaconvstar_6.ma".
16 include "basic_2/substitution/cpye_lift.ma".
17
18 (* CONTEXT-SENSITIVE EXTENDED DELTA-EQUIVALENCE FOR TERMS *******************)
19
20 definition cpzs: ynat → ynat → relation4 genv lenv term term ≝
21                  λd,e,G,L,T1,T2.
22                  ∃∃T. ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T⦄ & ⦃G, L⦄ ⊢ T2 ▶*[d, e] 𝐍⦃T⦄.
23
24 interpretation "context-sensitive extended delta-equivalence (term)"
25    'PDeltaConvStar G L T1 d e T2 = (cpzs d e G L T1 T2).
26
27 (* Basic properties **********************************************************)
28
29 lemma cpye_div: ∀G,L,T1,T,d,e.  ⦃G, L⦄ ⊢ T1 ▶*[d, e] 𝐍⦃T⦄ →
30                 ∀T2. ⦃G, L⦄ ⊢ T2 ▶*[d, e] 𝐍⦃T⦄ → ⦃G, L⦄ ⊢ T1 ◆*[d, e] T2.
31 /2 width=3 by ex2_intro/ qed.
32
33 lemma cpzs_refl: ∀G,L,d,e. reflexive … (cpzs d e G L).
34 #G #L #d #e #T elim (cpye_total G L T d e) /2 width=3 by cpye_div/
35 qed.
36
37 lemma cpzs_bind: ∀G,L,V1,V2,d,e. ⦃G, L⦄ ⊢ V1 ◆*[d, e] V2 →
38                  ∀I,T1,T2. ⦃G, L.ⓑ{I}V1⦄ ⊢ T1 ◆*[⫯d, e] T2 →
39                  ∀a. ⦃G, L⦄ ⊢ ⓑ{a,I}V1.T1 ◆*[d, e] ⓑ{a,I}V2.T2.
40 #G #L #V1 #V2 #d #e * #V #HV1 #HV2 #I #T1 #T2 *
41 /5 width=10 by cpye_div, cpye_bind, leqy_cpye_trans, cny_bind, lsuby_succ/
42 qed.
43
44 lemma cpzs_flat: ∀G,L,V1,V2,d,e. ⦃G, L⦄ ⊢ V1 ◆*[d, e] V2 →
45                  ∀T1,T2. ⦃G, L⦄ ⊢ T1 ◆*[d, e] T2 →
46                  ∀I. ⦃G, L⦄ ⊢ ⓕ{I}V1.T1 ◆*[d, e] ⓕ{I}V2.T2.
47 #G #L #V1 #V2 #d #e * #V #HV1 #HV2 #T1 #T2 *
48 /3 width=5 by cpye_div, cpye_flat, cny_flat/
49 qed.
50
51 (* Basic inversion lemmas ***************************************************)
52
53 lemma cpzs_inv_sort: ∀G,L,d,e,k1,k2. ⦃G, L⦄ ⊢ ⋆k1 ◆*[d, e] ⋆k2 → k1 = k2.
54 #G #L #d #e #k1 #k2 * #X #H1 #H2
55 lapply (cpye_inv_sort1 … H1) -H1 #H1
56 lapply (cpye_inv_sort1 … H2) -H2 #H2
57 destruct //
58 qed-.
59
60 lemma cpzs_inv_bind: ∀a1,a2,I1,I2,G,L,V1,V2,T1,T2,d,e. ⦃G, L⦄ ⊢ ⓑ{a1,I1}V1.T1 ◆*[d, e] ⓑ{a2,I2}V2.T2 →
61                      ∧∧ a1 = a2 & I1 = I2
62                       & ⦃G, L⦄ ⊢ V1 ◆*[d, e] V2 & ⦃G, L.ⓑ{I1}V1⦄ ⊢ T1 ◆*[⫯d, e] T2.
63 #a1 #a2 #I1 #I2 #G #L #V1 #V2 #T1 #T2 #d #e * #X #H1 #H2
64 elim (cpye_inv_bind1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H1
65 elim (cpye_inv_bind1 … H2) -H2 #W2 #U2 #HW12 #HU12 #H2
66 destruct /5 width=8 by cpye_div, leqy_cpye_trans, lsuby_succ, and4_intro/
67 qed-.
68
69 lemma cpzs_inv_flat: ∀I1,I2,G,L,V1,V2,T1,T2,d,e. ⦃G, L⦄ ⊢ ⓕ{I1}V1.T1 ◆*[d, e] ⓕ{I2}V2.T2 →
70                      ∧∧ I1 = I2
71                       & ⦃G, L⦄ ⊢ V1 ◆*[d, e] V2 & ⦃G, L⦄ ⊢ T1 ◆*[d, e] T2.
72 #I1 #I2 #G #L #V1 #V2 #T1 #T2 #d #e * #X #H1 #H2
73 elim (cpye_inv_flat1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H1
74 elim (cpye_inv_flat1 … H2) -H2 #W2 #U2 #HW12 #HU12 #H2
75 destruct /3 width=3 by cpye_div, and3_intro/
76 qed-.
77
78 lemma cpzs_inv_flat_bind: ∀a2,I1,I2,G,L,V1,V2,T1,T2,d,e. ⦃G, L⦄ ⊢ ⓕ{I1}V1.T1 ◆*[d, e] ⓑ{a2,I2}V2.T2 → ⊥.
79 #a2 #I1 #I2 #G #L #V1 #V2 #T1 #T2 #d #e * #X #H1 #H2
80 elim (cpye_inv_flat1 … H1) -H1 #V2 #T2 #HV12 #HT12 #H1
81 elim (cpye_inv_bind1 … H2) -H2 #W2 #U2 #HW12 #HU12 #H2
82 destruct
83 qed-.