]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/etc_2A1/nta/nta_nta.etc
milestone in basic_2, λδ-2A reconstructed
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / etc_2A1 / nta / nta_nta.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/dynamic/nta_lift.ma".
16
17 (* NATIVE TYPE ASSIGNMENT ON TERMS ******************************************)
18
19 (* Main properties **********************************************************)
20
21 (* Basic_1: was: ty3_unique *)
22 theorem nta_mono: ∀h,L,T,U1. ⦃h, L⦄ ⊢ T : U1 → ∀U2. ⦃h, L⦄ ⊢ T : U2 →
23                   L ⊢ U1 ⬌* U2.
24 #h #L #T #U1 #H elim H -L -T -U1
25 [ #L #k #X #H
26   lapply (nta_inv_sort1 … H) -H //
27 | #L #K #V #W11 #W12 #i #HLK #_ #HW112 #IHVW11 #X #H
28   elim (nta_inv_lref1 … H) -H * #K0 #V0 #W21 #W22 #HLK0 #HVW21 #HW212 #HX
29   lapply (ldrop_mono … HLK0 … HLK) -HLK0 #H destruct
30   lapply (ldrop_fwd_ldrop2 … HLK) -HLK #HLK
31   @(cpcs_trans … HX) -X /3 width=9 by cpcs_lift/ (**) (* to slow without trace *)
32 | #L #K #W #V1 #V #i #HLK #_ #HWV #_ #X #H
33   elim (nta_inv_lref1 … H) -H * #K0 #W0 #V2 #V0 #HLK0 #_ #HWV0 #HX
34   lapply (ldrop_mono … HLK0 … HLK) -HLK0 -HLK #H destruct
35   lapply (lift_mono … HWV0 … HWV) -HWV0 -HWV #H destruct //
36 | #I #L #V #W1 #T #U1 #_ #_ #_ #IHTU1 #X #H
37   elim (nta_inv_bind1 … H) -H #W2 #U2 #_ #HTU2 #H
38   @(cpcs_trans … H) -X /3 width=1/
39 | #L #V #W1 #T #U1 #_ #_ #_ #IHTU1 #X #H
40   elim (nta_fwd_pure1 … H) -H #U2 #W2 #_ #HTU2 #H
41   @(cpcs_trans … H) -X /3 width=1/
42 | #L #V #W1 #T #U1 #_ #_ #IHTU1 #_ #X #H
43   elim (nta_fwd_pure1 … H) -H #U2 #W2 #_ #HTU2 #H
44   @(cpcs_trans … H) -X /3 width=1/
45 | #L #T #U1 #_ #_ #X #H
46   elim (nta_inv_cast1 … H) -H //
47 | #L #T #U11 #U12 #V12 #_ #HU112 #_ #IHTU11 #_ #U2 #HTU2
48   @(cpcs_canc_sn … HU112) -U12 /2 width=1/
49 ]
50 qed-.
51
52 (* Advanced properties ******************************************************)
53
54 lemma nta_cast_alt: ∀h,L,T,W,U. ⦃h, L⦄ ⊢ T : W → ⦃h, L⦄ ⊢ T : U →
55              ⦃h, L⦄ ⊢ ⓝW.T : U.
56 #h #L #T #W #U #HTW #HTU
57 lapply (nta_mono … HTW … HTU) #HWU
58 elim (nta_fwd_correct … HTU) -HTU /3 width=3/
59 qed.