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/notation/relations/preditnormal_4.ma".
16 include "static_2/syntax/tweq.ma".
17 include "basic_2/rt_computation/cpms.ma".
19 (* NORMAL TERMS FOR T-UNUNBOUND WHD RT-TRANSITION ***************************)
21 definition cnuw (h) (G) (L): predicate term ≝
22 λT1. ∀n,T2. ⦃G,L⦄ ⊢ T1 ➡*[n,h] T2 → T1 ≅ T2.
25 "normality for t-unbound weak head context-sensitive parallel rt-transition (term)"
26 'PRedITNormal h G L T = (cnuw h G L T).
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
36 | elim (cpm_inv_lref1 … H) -H *
37 [ #H1 #H2 destruct /2 width=1 by conj/
38 | #Z #Y #X0 #_ #_ #H destruct
43 lemma cpm_inv_zero1_unit (n) (h) (I) (K) (G):
44 ∀X2. ⦃G,K.ⓤ{I}⦄ ⊢ #0 ➡[n,h] X2 → ∧∧ X2 = #0 & n = 0.
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
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
57 | #n1 #n2 #X #X2 #_ * #HX #Hn1 #HX2 destruct
58 elim (cpm_inv_lref1_ctop … HX2) -HX2 #H1 #H2 destruct
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
67 | #n1 #n2 #X #X2 #_ * #HX #Hn1 #HX2 destruct
68 elim (cpm_inv_zero1_unit … HX2) -HX2 #H1 #H2 destruct
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
77 | #n1 #n2 #X #X2 #_ * #HX #Hn1 #HX2 destruct
78 elim (cpm_inv_gref1 … HX2) -HX2 #H1 #H2 destruct
83 (* Basic properties *********************************************************)
85 lemma cnuw_sort (h) (G) (L): ∀s. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] ⋆s.
87 lapply (cpms_inv_sort1 … H) -H #H destruct //
90 lemma cnuw_ctop (h) (G): ∀i. ⦃G,⋆⦄ ⊢ ➡𝐍𝐖*[h] #i.
92 elim (cpms_inv_lref1_ctop … H) -H #H #_ destruct //
95 lemma cnuw_zero_unit (h) (G) (L): ∀I. ⦃G,L.ⓤ{I}⦄ ⊢ ➡𝐍𝐖*[h] #0.
97 elim (cpms_inv_zero1_unit … H) -H #H #_ destruct //
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 //
105 (* Basic_inversion lemmas ***************************************************)
107 lemma cnuw_inv_zero_pair (h) (I) (G) (L): ∀V. ⦃G,L.ⓑ{I}V⦄ ⊢ ➡𝐍𝐖*[h] #0 → ⊥.
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/ ]
113 lapply (tweq_inv_lref_sn … HW) -HW #H destruct
114 /2 width=5 by lifts_inv_lref2_uni_lt/
117 lemma cnuw_inv_cast (h) (G) (L):
118 ∀V,T. ⦃G,L⦄ ⊢ ➡𝐍𝐖*[h] ⓝV.T → ⊥.
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/
124 (* Basic forward lemmas *****************************************************)
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/