1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/rt_computation/cpms_aaa.ma".
16 include "basic_2/dynamic/cnv.ma".
18 (* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
20 (* Forward lemmas on atomic arity assignment for terms **********************)
22 (* Basic_2A1: uses: snv_fwd_aaa *)
23 lemma cnv_fwd_aaa (h) (a): ∀G,L,T. ⦃G,L⦄ ⊢ T ![h,a] → ∃A. ⦃G,L⦄ ⊢ T ⁝ A.
24 #h #a #G #L #T #H elim H -G -L -T
25 [ /2 width=2 by aaa_sort, ex_intro/
26 | #I #G #L #V #_ * /3 width=2 by aaa_zero, ex_intro/
27 | #I #G #L #K #_ * /3 width=2 by aaa_lref, ex_intro/
28 | #p * #G #L #V #T #_ #_ * #B #HV * #A #HA
29 /3 width=2 by aaa_abbr, aaa_abst, ex_intro/
30 | #n #p #G #L #V #W #T0 #U0 #_ #_ #_ #HVW #HTU0 * #B #HV * #X #HT
31 lapply (cpms_aaa_conf … HV … HVW) -HVW #H1W
32 lapply (cpms_aaa_conf … HT … HTU0) -HTU0 #H
33 elim (aaa_inv_abst … H) -H #B0 #A #H2W #HU #H destruct
34 lapply (aaa_mono … H2W … H1W) -W #H destruct
35 /3 width=4 by aaa_appl, ex_intro/
36 | #G #L #U #T #U0 #_ #_ #HU0 #HTU0 * #B #HU * #A #HT
37 lapply (cpms_aaa_conf … HU … HU0) -HU0 #HU0
38 lapply (cpms_aaa_conf … HT … HTU0) -HTU0 #H
39 lapply (aaa_mono … H … HU0) -U0 #H destruct
40 /3 width=3 by aaa_cast, ex_intro/
44 (* Forward lemmas with t_bound rt_transition for terms **********************)
46 lemma cnv_fwd_cpm_SO (h) (a) (G) (L):
47 ∀T. ⦃G,L⦄ ⊢ T ![h,a] → ∃U. ⦃G,L⦄ ⊢ T ➡[1,h] U.
49 elim (cnv_fwd_aaa … H) -H #A #HA
50 /2 width=2 by aaa_cpm_SO/
53 (* Forward lemmas with t_bound rt_computation for terms *********************)
55 lemma cnv_fwd_cpms_total (h) (a) (n) (G) (L):
56 ∀T. ⦃G,L⦄ ⊢ T ![h,a] → ∃U. ⦃G,L⦄ ⊢ T ➡*[n,h] U.
58 elim (cnv_fwd_aaa … H) -H #A #HA
59 /2 width=2 by cpms_total_aaa/
62 lemma cnv_fwd_cpms_abst_dx_le (h) (a) (G) (L) (W) (p):
63 ∀T. ⦃G,L⦄ ⊢ T ![h,a] →
64 ∀n1,U1. ⦃G,L⦄ ⊢ T ➡*[n1,h] ⓛ{p}W.U1 → ∀n2. n1 ≤ n2 →
65 ∃∃U2. ⦃G,L⦄ ⊢ T ➡*[n2,h] ⓛ{p}W.U2 & ⦃G,L.ⓛW⦄ ⊢ U1 ➡*[n2-n1,h] U2.
66 #h #a #G #L #W #p #T #H
67 elim (cnv_fwd_aaa … H) -H #A #HA
68 /2 width=2 by cpms_abst_dx_le_aaa/
71 (* Advanced properties ******************************************************)
73 lemma cnv_appl_ge (h) (a) (n1) (p) (G) (L):
74 ∀n2. n1 ≤ n2 → ad a n2 →
75 ∀V. ⦃G,L⦄ ⊢ V ![h,a] → ∀T. ⦃G,L⦄ ⊢ T ![h,a] →
76 ∀X. ⦃G,L⦄ ⊢ V ➡*[1,h] X → ∀W. ⦃G,L⦄ ⊢ W ➡*[h] X →
77 ∀U. ⦃G,L⦄ ⊢ T ➡*[n1,h] ⓛ{p}W.U → ⦃G,L⦄ ⊢ ⓐV.T ![h,a].
78 #h #a #n1 #p #G #L #n2 #Hn12 #Ha #V #HV #T #HT #X #HVX #W #HW #X #HTX
79 elim (cnv_fwd_cpms_abst_dx_le … HT … HTX … Hn12) #U #HTU #_ -n1
80 /4 width=11 by cnv_appl, cpms_bind, cpms_cprs_trans/