]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_cpms.ma
update in ground_2, static_2, basic_2, apps_2, alpha_1
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / nta_cpms.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/rt_computation/cprs_cprs.ma".
16 include "basic_2/dynamic/cnv_aaa.ma".
17 include "basic_2/dynamic/nta.ma".
18
19 (* NATIVE TYPE ASSIGNMENT FOR TERMS *****************************************)
20
21 (* Properties with advanced rt_computation for terms ************************)
22
23 (* Basic_2A1: uses by definition nta_appl ntaa_appl *)
24 lemma nta_appl_abst (h) (a) (p) (G) (L):
25       ∀n. ad a n →
26       ∀V,W. ❪G,L❫ ⊢ V :[h,a] W →
27       ∀T,U. ❪G,L.ⓛW❫ ⊢ T :[h,a] U → ❪G,L❫ ⊢ ⓐV.ⓛ[p]W.T :[h,a] ⓐV.ⓛ[p]W.U.
28 #h #a #p #G #L #n #Ha #V #W #H1 #T #U #H2
29 elim (cnv_inv_cast … H1) -H1 #X1 #HW #HV #HWX1 #HVX1
30 elim (cnv_inv_cast … H2) -H2 #X2 #HU #HT #HUX2 #HTX2
31 /4 width=11 by cnv_appl_ge, cnv_cast, cnv_bind, cpms_appl_dx, cpms_bind_dx/
32 qed.
33
34 (* Basic_1: was by definition: ty3_appl *)
35 (* Basic_2A1: was nta_appl_old *)
36 lemma nta_appl (h) (a) (p) (G) (L):
37       ∀n. 1 ≤ n → ad a n →
38       ∀V,W. ❪G,L❫ ⊢ V :[h,a] W →
39       ∀T,U. ❪G,L❫ ⊢ T :[h,a] ⓛ[p]W.U → ❪G,L❫ ⊢ ⓐV.T :[h,a] ⓐV.ⓛ[p]W.U.
40 #h #a #p #G #L #n #Hn #Ha #V #W #H1 #T #U #H2
41 elim (cnv_inv_cast … H1) -H1 #X1 #HW #HV #HWX1 #HVX1
42 elim (cnv_inv_cast … H2) -H2 #X2 #HU #HT #HUX2 #HTX2
43 elim (cpms_inv_abst_sn … HUX2) #W0 #U0 #HW0 #HU0 #H destruct
44 elim (cprs_conf … HWX1 … HW0) -HW0 #X0 #HX10 #HWX0
45 @(cnv_cast … (ⓐV.ⓛ[p]W0.U0)) (**) (* full auto too slow *)
46 [ /2 width=11 by cnv_appl_ge/
47 | /3 width=11 by cnv_appl_ge, cpms_cprs_trans/
48 | /2 width=1 by cpms_appl_dx/
49 | /2 width=1 by cpms_appl_dx/
50 ]
51 qed.
52
53 (* Inversion lemmas with advanced rt_computation for terms ******************)
54
55 lemma nta_inv_abst_bi_cnv (h) (a) (p) (G) (K) (W):
56       ∀T,U. ❪G,K❫ ⊢ ⓛ[p]W.T :[h,a] ⓛ[p]W.U →
57       ∧∧ ❪G,K❫ ⊢ W ![h,a] & ❪G,K.ⓛW❫ ⊢ T :[h,a] U.
58 #h #a #p #G #K #W #T #U #H
59 elim (cnv_inv_cast … H) -H #X #HWU #HWT #HUX #HTX
60 elim (cnv_inv_bind … HWU) -HWU #HW #HU
61 elim (cnv_inv_bind … HWT) -HWT #_ #HT
62 elim (cpms_inv_abst_sn … HUX) -HUX #W0 #X0 #_ #HUX0 #H destruct
63 elim (cpms_inv_abst_bi … HTX) -HTX #_ #_ #HTX0 -W0
64 /3 width=3 by cnv_cast, conj/
65 qed-.