]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/rt_computation/cnuw.ma
update in static_2 and basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / rt_computation / cnuw.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/notation/relations/preditnormal_4.ma".
16 include "static_2/syntax/tweq.ma".
17 include "basic_2/rt_computation/cpms.ma".
18
19 (* NORMAL TERMS FOR T-UNUNBOUND WHD RT-TRANSITION ***************************)
20
21 definition cnuw (h) (G) (L): predicate term ≝
22            λT1. ∀n,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → T1 ≅ T2.
23
24 interpretation
25   "normality for t-unbound weak head context-sensitive parallel rt-transition (term)"
26   'PRedITNormal h G L T = (cnuw h G L T).
27
28 lemma cpm_inv_lref1_ctop (n) (h) (G):
29       ∀X2,i. ⦃G,⋆⦄ ⊢ #i ➡[n,h] X2 → ∧∧ X2 = #i & n = 0.
30 #n #h #G #X2 * [| #i ] #H
31 [ elim (cpm_inv_zero1 … H) -H *
32   [ #H1 #H2 destruct /2 width=1 by conj/
33   | #Y #X1 #X2 #_ #_ #H destruct
34   | #m #Y #X1 #X2 #_ #_ #H destruct
35   ]
36 | elim (cpm_inv_lref1 … H) -H *
37   [ #H1 #H2 destruct /2 width=1 by conj/
38   | #Z #Y #X0 #_ #_ #H destruct
39   ]
40 ]
41 qed.
42
43 lemma cpm_inv_zero1_unit (n) (h) (I) (K) (G):
44       ∀X2. ⦃G,K.ⓤ{I}⦄ ⊢ #0 ➡[n,h] X2 → ∧∧ X2 = #0 & n = 0.
45 #n #h #I #G #K #X2 #H
46 elim (cpm_inv_zero1 … H) -H *
47 [ #H1 #H2 destruct /2 width=1 by conj/
48 | #Y #X1 #X2 #_ #_ #H destruct
49 | #m #Y #X1 #X2 #_ #_ #H destruct
50 ]
51 qed.
52
53 lemma cpms_inv_lref1_ctop (n) (h) (G):
54       ∀X2,i. ⦃G,⋆⦄ ⊢ #i ➡*[n,h] X2 → ∧∧ X2 = #i & n = 0.
55 #n #h #G #X2 #i #H @(cpms_ind_dx … H) -X2
56 [ /2 width=1 by conj/
57 | #n1 #n2 #X #X2 #_ * #HX #Hn1 #HX2 destruct
58   elim (cpm_inv_lref1_ctop … HX2) -HX2 #H1 #H2 destruct
59   /2 width=1 by conj/
60 ]
61 qed-.
62
63 lemma cpms_inv_zero1_unit (n) (h) (I) (K) (G):
64       ∀X2. ⦃G,K.ⓤ{I}⦄ ⊢ #0 ➡*[n,h] X2 → ∧∧ X2 = #0 & n = 0.
65 #n #h #I #G #K #X2 #H @(cpms_ind_dx … H) -X2
66 [ /2 width=1 by conj/
67 | #n1 #n2 #X #X2 #_ * #HX #Hn1 #HX2 destruct
68   elim (cpm_inv_zero1_unit … HX2) -HX2 #H1 #H2 destruct
69   /2 width=1 by conj/
70 ]
71 qed-.
72
73 lemma cpms_inv_gref1 (n) (h) (G) (L):
74       ∀X2,l. ⦃G,L⦄ ⊢ §l ➡*[n,h] X2 → ∧∧ X2 = §l & n = 0.
75 #n #h #G #L #X2 #l #H @(cpms_ind_dx … H) -X2
76 [ /2 width=1 by conj/
77 | #n1 #n2 #X #X2 #_ * #HX #Hn1 #HX2 destruct
78   elim (cpm_inv_gref1 … HX2) -HX2 #H1 #H2 destruct
79   /2 width=1 by conj/
80 ]
81 qed-.
82
83 (* Basic properties *********************************************************)
84
85 lemma cnuw_sort (h) (G) (L): ∀s. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] ⋆s.
86 #h #G #L #s1 #n #X #H
87 lapply (cpms_inv_sort1 … H) -H #H destruct //
88 qed.
89
90 lemma cnuw_ctop (h) (G): ∀i. ⦃G,⋆⦄ ⊢ ➡𝐍𝐖*[h] #i.
91 #h #G #i #n #X #H
92 elim (cpms_inv_lref1_ctop … H) -H #H #_ destruct //
93 qed.
94
95 lemma cnuw_zero_unit (h) (G) (L): ∀I. ⦃G,L.ⓤ{I}⦄ ⊢ ➡𝐍𝐖*[h] #0.
96 #h #G #L #I #n #X #H
97 elim (cpms_inv_zero1_unit … H) -H #H #_ destruct //
98 qed.
99
100 lemma cnuw_gref (h) (G) (L): ∀l. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] §l.
101 #h #G #L #l1 #n #X #H
102 elim (cpms_inv_gref1 … H) -H #H #_ destruct //
103 qed.
104
105 (* Basic_inversion lemmas ***************************************************)
106
107 lemma cnuw_inv_zero_pair (h) (I) (G) (L): ∀V. ⦃G,L.ⓑ{I}V⦄ ⊢ ➡𝐍𝐖*[h] #0 → ⊥.
108 #h * #G #L #V #H
109 elim (lifts_total V (𝐔❴1❵)) #W #HVW
110 [ lapply (H 0 W ?) [ /3 width=3 by cpm_cpms, cpm_delta/ ]
111 | lapply (H 1 W ?) [ /3 width=3 by cpm_cpms, cpm_ell/ ]
112 ] -H #HW
113 lapply (tweq_inv_lref_sn … HW) -HW #H destruct
114 /2 width=5 by lifts_inv_lref2_uni_lt/
115 qed-.
116
117 lemma cnuw_inv_cast (h) (G) (L):
118       ∀V,T. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] ⓝV.T → ⊥.
119 #h #G #L #V #T #H
120 lapply (H 0 T ?) [ /3 width=1 by cpm_cpms, cpm_eps/ ] -H #H
121 /2 width=3 by tweq_inv_cast_sn_XY_Y/
122 qed-.
123
124 (* Basic forward lemmas *****************************************************)
125
126 lemma cnuw_fwd_appl (h) (G) (L):
127       ∀V,T. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] ⓐV.T → ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] T.
128 #h #G #L #V #T1 #HT1 #n #T2 #HT12
129 lapply (HT1 n (ⓐV.T2) ?) -HT1
130 /2 width=3 by cpms_appl_dx, tweq_inv_appl_bi/
131 qed-.