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