]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_cpm_tdpos.ma
update in static_2 and basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / cnv_cpm_tdpos.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 "static_2/syntax/tdpos.ma".
16 include "basic_2/dynamic/cnv_cpm_tdeq.ma".
17
18 (* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
19
20 (* Forward lemmas with positive rt-transition for terms *********************)
21
22 lemma cpm_tdeq_fwd_tdpos_sn (a) (h) (o) (n) (G):
23                             ∀L,T1. ⦃G,L⦄ ⊢ T1 ![a,h] →
24                             ∀T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 → T1 ≛[h,o] T2 → 𝐏[h,o]⦃T1⦄ →
25                             ∧∧ T1 = T2 & 0 = n.
26 #a #h #o #n #G #L #T1 #H0 #T2 #H1 #H2
27 @(cpm_tdeq_ind … H0 … H1 H2) -L -T1 -T2
28 [ /2 width=1 by conj/
29 | #L #s #_ #H1 #H
30   elim (tdpos_inv_sort … H) -H #d #H2
31   lapply (deg_mono … H2 H1) -H1 -H2 #H destruct
32 | #p #I #L #V #T1 #_ #_ #T2 #_ #_ #IH #H
33   elim (tdpos_inv_pair … H) -H #_ #HT1
34   elim IH // -IH -HT1 #H1 #H2 destruct
35   /2 width=1 by conj/
36 | #m #_ #L #V #_ #W #_ #q #T1 #U1 #_ #_ #T2 #_ #_ #IH #H -a -m -q -G -L -W -U1
37   elim (tdpos_inv_pair … H) -H #_ #HT1
38   elim IH // -IH -HT1 #H1 #H2 destruct
39   /2 width=1 by conj/
40 | #L #U0 #U1 #T1 #_ #_ #U2 #_ #_ #_ #T2 #_ #_ #_ #IHU #IHT #H
41   elim (tdpos_inv_pair … H) -H #HU1 #HT1
42   elim IHU // -IHU -HU1 #H1 #H2 destruct
43   elim IHT // -IHT -HT1 #H1 #H2 destruct
44   /2 width=1 by conj/
45 ]
46 qed-.
47
48 lemma cpm_fwd_tdpos_sn (a) (h) (o) (n) (G) (L):
49                        ∀T1. ⦃G,L⦄ ⊢ T1 ![a,h] → 𝐏[h,o]⦃T1⦄ →
50                        ∀T2. ⦃G,L⦄ ⊢ T1 ➡[n,h] T2 →
51                        ∨∨ ∧∧ T1 = T2 & 0 = n | (T1 ≛[h,o] T2 → ⊥).
52 #a #h #o #n #G #L #T1 #H1T1 #H2T1 #T2 #HT12
53 elim (tdeq_dec h o T1 T2) #H
54 /3 width=9 by cpm_tdeq_fwd_tdpos_sn, or_intror, or_introl/
55 qed-.