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/dynamic/cnv_cpm_tdpos.ma".
17 (* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
19 (* Forward lemmas with positive rt-computation for terms ********************)
21 lemma cpms_fwd_tdpos_sn (a) (h) (o) (n) (G) (L):
22 ∀T1. ⦃G,L⦄ ⊢ T1 ![a,h] → 𝐏[h,o]⦃T1⦄ →
23 ∀T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 →
25 | ∃∃n1,n2,T. ⦃G,L⦄ ⊢ T1 ➡[n1,h] T & (T1 ≛[h,o] T → ⊥) & ⦃G,L⦄ ⊢ T ➡*[n2,h] T2 & n1+n2=n.
26 #a #h #o #n #G #L #T1 #H1T1 #H2T1 #T2 #H
27 @(cpms_ind_dx … H) -n -T2
28 [ /3 width=1 by or_introl, conj/
29 | #n1 #n2 #T #T2 #HT1 * *
30 [ #H1 #H2 #HT2 destruct -HT1
31 elim (cpm_fwd_tdpos_sn … H1T1 H2T1 … HT2) -H1T1 -H2T1
32 [ * #H1 #H2 destruct -HT2 /3 width=1 by or_introl, conj/
33 | #HnT2 >commutative_plus in ⊢ (??%); /4 width=7 by ex4_3_intro, or_intror/
35 | #m1 #m2 #T0 #H1T10 #H2T10 #HT0 #H #HT2 destruct -H1T1 -H2T1 -HT1
36 >associative_plus in ⊢ (??%); /4 width=7 by cpms_step_dx, ex4_3_intro, or_intror/