]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/nta_cpcs.ma
update in ground_2, static_2, basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / nta_cpcs.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_equivalence/cpcs_cprs.ma".
16 include "basic_2/dynamic/nta.ma".
17
18 (* NATIVE TYPE ASSIGNMENT FOR TERMS *****************************************)
19
20 (* Properties with r-equivalence for terms **********************************)
21
22 lemma nta_conv_cnv (h) (a) (G) (L) (T):
23                    ∀U1. ❪G,L❫ ⊢ T :[h,a] U1 →
24                    ∀U2. ❪G,L❫  ⊢ U1 ⬌*[h] U2 → ❪G,L❫ ⊢ U2 ![h,a] → ❪G,L❫ ⊢ T :[h,a] U2.
25 #h #a #G #L #T #U1 #H1 #U2 #HU12 #HU2
26 elim (cnv_inv_cast … H1) -H1 #X1 #HU1 #HT #HUX1 #HTX1
27 lapply (cpcs_cprs_conf … HUX1 … HU12) -U1 #H
28 elim (cpcs_inv_cprs … H) -H #X2 #HX12 #HU12
29 /3 width=5 by cnv_cast, cpms_cprs_trans/
30 qed-.
31
32 (* Basic_1: was by definition: ty3_conv *)
33 (* Basic_2A1: was by definition: nta_conv ntaa_conv *)
34 lemma nta_conv (h) (a) (G) (L) (T):
35                ∀U1. ❪G,L❫ ⊢ T :[h,a] U1 →
36                ∀U2. ❪G,L❫  ⊢ U1 ⬌*[h] U2 →
37                ∀W2. ❪G,L❫ ⊢ U2 :[h,a] W2 → ❪G,L❫ ⊢ T :[h,a] U2.
38 #h #a #G #L #T #U1 #H1 #U2 #HU12 #W2 #H2
39 /3 width=3 by nta_conv_cnv, nta_fwd_cnv_sn/
40 qed-.
41
42 (* Inversion lemmas with r-equivalence for terms ***************************)
43
44 (* Basic_1: was: ty3_gen_sort *)
45 (* Basic_2A1: was: nta_inv_sort1 *)
46 lemma nta_inv_sort_sn (h) (a) (G) (L) (X2):
47       ∀s. ❪G,L❫ ⊢ ⋆s :[h,a] X2 →
48       ∧∧ ❪G,L❫ ⊢ ⋆(⫯[h]s) ⬌*[h] X2 & ❪G,L❫ ⊢ X2 ![h,a].
49 #h #a #G #L #X2 #s #H
50 elim (cnv_inv_cast … H) -H #X1 #HX2 #_ #HX21 #H
51 lapply (cpms_inv_sort1 … H) -H #H destruct
52 /3 width=1 by cpcs_cprs_sn, conj/
53 qed-.
54
55 lemma nta_inv_ldec_sn_cnv (h) (a) (G) (K) (V):
56       ∀X2. ❪G,K.ⓛV❫ ⊢ #0 :[h,a] X2 →
57       ∃∃U. ❪G,K❫ ⊢ V ![h,a] & ⇧[1] V ≘ U & ❪G,K.ⓛV❫ ⊢ U ⬌*[h] X2 & ❪G,K.ⓛV❫ ⊢ X2 ![h,a].
58 #h #a #G #Y #X #X2 #H
59 elim (cnv_inv_cast … H) -H #X1 #HX2 #H1 #HX21 #H2
60 elim (cnv_inv_zero … H1) -H1 #Z #K #V #HV #H destruct
61 elim (cpms_inv_ell_sn … H2) -H2 *
62 [ #_ #H destruct
63 | #m #W #HVW #HWX1 #H destruct
64   elim (lifts_total V (𝐔❨1❩)) #U #HVU
65   lapply (cpms_lifts_bi … HVW (Ⓣ) … (K.ⓛV) … HVU … HWX1) -W
66   [ /3 width=1 by drops_refl, drops_drop/ ] #HUX1
67   /3 width=5 by cprs_div, ex4_intro/
68 ]
69 qed-.