]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_aaa.ma
update in basic_2 and apps_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / cnv_aaa.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/cpms_aaa.ma".
16 include "basic_2/dynamic/cnv.ma".
17
18 (* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
19
20 (* Forward lemmas on atomic arity assignment for terms **********************)
21
22 (* Basic_2A1: uses: snv_fwd_aaa *)
23 lemma cnv_fwd_aaa (h) (a):
24       ∀G,L,T. ❪G,L❫ ⊢ T ![h,a] → ∃A. ❪G,L❫ ⊢ T ⁝ A.
25 #h #a #G #L #T #H elim H -G -L -T
26 [ /2 width=2 by aaa_sort, ex_intro/
27 | #I #G #L #V #_ * /3 width=2 by aaa_zero, ex_intro/
28 | #I #G #L #K #_ * /3 width=2 by aaa_lref, ex_intro/
29 | #p * #G #L #V #T #_ #_ * #B #HV * #A #HA
30   /3 width=2 by aaa_abbr, aaa_abst, ex_intro/
31 | #n #p #G #L #V #W #T0 #U0 #_ #_ #_ #HVW #HTU0 * #B #HV * #X #HT
32   lapply (cpms_aaa_conf … HV … HVW) -HVW #H1W
33   lapply (cpms_aaa_conf … HT … HTU0) -HTU0 #H
34   elim (aaa_inv_abst … H) -H #B0 #A #H2W #HU #H destruct
35   lapply (aaa_mono … H2W … H1W) -W #H destruct
36   /3 width=4 by aaa_appl, ex_intro/
37 | #G #L #U #T #U0 #_ #_ #HU0 #HTU0 * #B #HU * #A #HT
38   lapply (cpms_aaa_conf … HU … HU0) -HU0 #HU0
39   lapply (cpms_aaa_conf … HT … HTU0) -HTU0 #H
40   lapply (aaa_mono … H … HU0) -U0 #H destruct
41   /3 width=3 by aaa_cast, ex_intro/
42 ]
43 qed-.
44
45 (* Forward lemmas with t_bound rt_transition for terms **********************)
46
47 lemma cnv_fwd_cpm_SO (h) (a) (G) (L):
48       ∀T. ❪G,L❫ ⊢ T ![h,a] → ∃U. ❪G,L❫ ⊢ T ➡[h,1] U.
49 #h #a #G #L #T #H
50 elim (cnv_fwd_aaa … H) -H #A #HA
51 /2 width=2 by aaa_cpm_SO/
52 qed-.
53
54 (* Forward lemmas with t_bound rt_computation for terms *********************)
55
56 lemma cnv_fwd_cpms_total (h) (a) (n) (G) (L):
57       ∀T. ❪G,L❫ ⊢ T ![h,a] → ∃U. ❪G,L❫ ⊢ T ➡*[h,n] U.
58 #h #a #n #G #L #T #H
59 elim (cnv_fwd_aaa … H) -H #A #HA
60 /2 width=2 by cpms_total_aaa/
61 qed-.
62
63 lemma cnv_fwd_cpms_abst_dx_le (h) (a) (G) (L) (W) (p):
64       ∀T. ❪G,L❫ ⊢ T ![h,a] →
65       ∀n1,U1. ❪G,L❫ ⊢ T ➡*[h,n1] ⓛ[p]W.U1 → ∀n2. n1 ≤ n2 →
66       ∃∃U2. ❪G,L❫ ⊢ T ➡*[h,n2] ⓛ[p]W.U2 & ❪G,L.ⓛW❫ ⊢ U1 ➡*[h,n2-n1] U2.
67 #h #a #G #L #W #p #T #H
68 elim (cnv_fwd_aaa … H) -H #A #HA
69 /2 width=2 by cpms_abst_dx_le_aaa/
70 qed-.
71
72 (* Advanced properties ******************************************************)
73
74 lemma cnv_appl_ge (h) (a) (n1) (p) (G) (L):
75       ∀n2. n1 ≤ n2 → ad a n2 →
76       ∀V. ❪G,L❫ ⊢ V ![h,a] → ∀T. ❪G,L❫ ⊢ T ![h,a] →
77       ∀X. ❪G,L❫ ⊢ V ➡*[h,1] X → ∀W. ❪G,L❫ ⊢ W ➡*[h,0] X →
78       ∀U. ❪G,L❫ ⊢ T ➡*[h,n1] ⓛ[p]W.U → ❪G,L❫ ⊢ ⓐV.T ![h,a].
79 #h #a #n1 #p #G #L #n2 #Hn12 #Ha #V #HV #T #HT #X #HVX #W #HW #X #HTX
80 elim (cnv_fwd_cpms_abst_dx_le  … HT … HTX … Hn12) #U #HTU #_ -n1
81 /4 width=11 by cnv_appl, cpms_bind, cpms_cprs_trans/
82 qed.