]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/nta.ma
update in basic_2 and static_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / nta.ma
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/colon_6.ma".
16 include "basic_2/notation/relations/colon_5.ma".
17 include "basic_2/notation/relations/colonstar_5.ma".
18 include "basic_2/dynamic/cnv.ma".
19
20 (* NATIVE TYPE ASSIGNMENT FOR TERMS *****************************************)
21
22 definition nta (a) (h): relation4 genv lenv term term ≝
23                         λG,L,T,U. ⦃G,L⦄ ⊢ ⓝU.T ![a,h].
24
25 interpretation "native type assignment (term)"
26    'Colon a h G L T U = (nta a h G L T U).
27
28 interpretation "restricted native type assignment (term)"
29    'Colon h G L T U = (nta true h G L T U).
30
31 interpretation "extended native type assignment (term)"
32    'ColonStar h G L T U = (nta false h G L T U).
33
34 (* Basic properties *********************************************************)
35
36 (* Basic_1: was by definition: ty3_sort *)
37 (* Basic_2A1: was by definition: nta_sort ntaa_sort *)
38 lemma nta_sort (a) (h) (G) (L) (s): ⦃G,L⦄ ⊢ ⋆s :[a,h] ⋆(next h s).
39 #a #h #G #L #s /2 width=3 by cnv_sort, cnv_cast, cpms_sort/
40 qed.
41
42 lemma nta_bind_cnv (a) (h) (G) (K):
43       ∀V. ⦃G,K⦄ ⊢ V ![a,h] →
44       ∀I,T,U. ⦃G,K.ⓑ{I}V⦄ ⊢ T :[a,h] U →
45       ∀p. ⦃G,K⦄ ⊢ ⓑ{p,I}V.T :[a,h] ⓑ{p,I}V.U.
46 #a #h #G #K #V #HV #I #T #U #H #p
47 elim (cnv_inv_cast … H) -H #X #HU #HT #HUX #HTX
48 /3 width=5 by cnv_bind, cnv_cast, cpms_bind_dx/
49 qed.
50
51 (* Basic_2A1: was by definition: nta_cast *)
52 lemma nta_cast (a) (h) (G) (L):
53       ∀T,U. ⦃G,L⦄ ⊢ T :[a,h] U → ⦃G,L⦄ ⊢ ⓝU.T :[a,h] U.
54 #a #h #G #L #T #U #H
55 elim (cnv_inv_cast … H) #X #HU #HT #HUX #HTX
56 /3 width=3 by cnv_cast, cpms_eps/
57 qed.
58
59 (* Basic_1: was by definition: ty3_cast *)
60 lemma nta_cast_old (a) (h) (G) (L):
61       ∀T0,T1. ⦃G,L⦄ ⊢ T0 :[a,h] T1 →
62       ∀T2. ⦃G,L⦄ ⊢ T1 :[a,h] T2 → ⦃G,L⦄ ⊢ ⓝT1.T0 :[a,h] ⓝT2.T1.
63 #a #h #G #L #T0 #T1 #H1 #T2 #H2
64 elim (cnv_inv_cast … H1) #X1 #_ #_ #HTX1 #HTX01
65 elim (cnv_inv_cast … H2) #X2 #_ #_ #HTX2 #HTX12
66 /3 width=3 by cnv_cast, cpms_eps/
67 qed.
68
69 (* Basic_forward lemmas *****************************************************)
70
71 lemma nta_fwd_cnv_sn (a) (h) (G) (L):
72                      ∀T,U. ⦃G,L⦄ ⊢ T :[a,h] U → ⦃G,L⦄ ⊢ T ![a,h].
73 #a #h #G #L #T #U #H
74 elim (cnv_inv_cast … H) -H #X #_ #HT #_ #_ //
75 qed-.
76
77 (* Note: this is nta_fwd_correct_cnv *)
78 lemma nta_fwd_cnv_dx (a) (h) (G) (L):
79                      ∀T,U. ⦃G,L⦄ ⊢ T :[a,h] U → ⦃G,L⦄ ⊢ U ![a,h].
80 #a #h #G #L #T #U #H
81 elim (cnv_inv_cast … H) -H #X #HU #_ #_ #_ //
82 qed-.
83
84 (*
85
86 | nta_ldef: ∀L,K,V,W,U,i. ⇩[0, i] L ≡ K. ⓓV → nta h K V W →
87             ⇧[0, i + 1] W ≡ U → nta h L (#i) U
88 | nta_ldec: ∀L,K,W,V,U,i. ⇩[0, i] L ≡ K. ⓛW → nta h K W V →
89             ⇧[0, i + 1] W ≡ U → nta h L (#i) U
90 .
91
92 (* Basic properties *********************************************************)
93
94 lemma nta_ind_alt: ∀h. ∀R:lenv→relation term.
95    (∀L,k. R L ⋆k ⋆(next h k)) →
96    (∀L,K,V,W,U,i.
97       ⇩[O, i] L ≡ K.ⓓV → ⦃h, K⦄ ⊢ V : W → ⇧[O, i + 1] W ≡ U →
98       R K V W → R L (#i) U 
99    ) →
100    (∀L,K,W,V,U,i.
101       ⇩[O, i] L ≡ K.ⓛW → ⦃h, K⦄ ⊢ W : V → ⇧[O, i + 1] W ≡ U →
102       R K W V → R L (#i) U
103    ) →
104    (∀I,L,V,W,T,U.
105       ⦃h, L⦄ ⊢ V : W → ⦃h, L.ⓑ{I}V⦄ ⊢ T : U →
106       R L V W → R (L.ⓑ{I}V) T U → R L (ⓑ{I}V.T) (ⓑ{I}V.U)
107    ) →
108    (∀L,V,W,T,U.
109       ⦃h, L⦄ ⊢ V : W → ⦃h, L⦄ ⊢ (ⓛW.T):(ⓛW.U) →
110       R L V W →R L (ⓛW.T) (ⓛW.U) →R L (ⓐV.ⓛW.T) (ⓐV.ⓛW.U)
111    ) →
112    (∀L,V,W,T,U.
113       ⦃h, L⦄ ⊢ T : U → ⦃h, L⦄ ⊢ (ⓐV.U) : W →
114       R L T U → R L (ⓐV.U) W → R L (ⓐV.T) (ⓐV.U)
115    ) →
116    (∀L,T,U,W.
117       ⦃h, L⦄ ⊢ T : U → ⦃h, L⦄ ⊢ U : W →
118       R L T U → R L U W → R L (ⓝU.T) U
119    ) →
120    (∀L,T,U1,U2,V2.
121       ⦃h, L⦄ ⊢ T : U1 → L ⊢ U1 ⬌* U2 → ⦃h, L⦄ ⊢ U2 : V2 →
122       R L T U1 →R L U2 V2 →R L T U2
123    ) →
124    ∀L,T,U. ⦃h, L⦄ ⊢ T : U → R L T U.
125 #h #R #H1 #H2 #H3 #H4 #H5 #H6 #H7 #H8 #L #T #U #H elim (nta_ntaa … H) -L -T -U
126 // /3 width=1 by ntaa_nta/ /3 width=3 by ntaa_nta/ /3 width=4 by ntaa_nta/
127 /3 width=7 by ntaa_nta/
128 qed-.
129
130 *)
131
132 (* Basic_1: removed theorems 4:
133             ty3_getl_subst0 ty3_fsubst0 ty3_csubst0 ty3_subst0
134 *)
135 (* Basic_2A1: removed theorems 2:
136    ntaa_nta nta_ntaa
137 *)