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/prednormal_5.ma".
16 include "basic_2/rt_transition/cpr.ma".
18 (* NORMAL TERMS FOR CONTEXT-SENSITIVE R-TRANSITION **************************)
20 definition cnr (h) (n) (G) (L): predicate term ≝
21 NF … (cpm h G L n) (eq …).
24 "normality for context-sensitive r-transition (term)"
25 'PRedNormal h n G L T = (cnr h n G L T).
27 (* Basic inversion lemmas ***************************************************)
29 lemma cnr_inv_abst (h) (p) (G) (L):
30 ∀V,T. ❪G,L❫ ⊢ ➡𝐍[h,0] ⓛ[p]V.T →
31 ∧∧ ❪G,L❫ ⊢ ➡𝐍[h,0] V & ❪G,L.ⓛV❫ ⊢ ➡𝐍[h,0] T.
32 #h #p #G #L #V1 #T1 #HVT1 @conj
33 [ #V2 #HV2 lapply (HVT1 (ⓛ[p]V2.T1) ?) -HVT1 /2 width=2 by cpr_pair_sn/ -HV2 #H destruct //
34 | #T2 #HT2 lapply (HVT1 (ⓛ[p]V1.T2) ?) -HVT1 /2 width=2 by cpm_bind/ -HT2 #H destruct //
38 (* Basic_2A1: was: cnr_inv_abbr *)
39 lemma cnr_inv_abbr_neg (h) (G) (L):
40 ∀V,T. ❪G,L❫ ⊢ ➡𝐍[h,0] -ⓓV.T →
41 ∧∧ ❪G,L❫ ⊢ ➡𝐍[h,0] V & ❪G,L.ⓓV❫ ⊢ ➡𝐍[h,0] T.
42 #h #G #L #V1 #T1 #HVT1 @conj
43 [ #V2 #HV2 lapply (HVT1 (-ⓓV2.T1) ?) -HVT1 /2 width=2 by cpr_pair_sn/ -HV2 #H destruct //
44 | #T2 #HT2 lapply (HVT1 (-ⓓV1.T2) ?) -HVT1 /2 width=2 by cpm_bind/ -HT2 #H destruct //
48 (* Basic_2A1: was: cnr_inv_eps *)
49 lemma cnr_inv_cast (h) (G) (L):
50 ∀V,T. ❪G,L❫ ⊢ ➡𝐍[h,0] ⓝV.T → ⊥.
51 #h #G #L #V #T #H lapply (H T ?) -H
52 /2 width=4 by cpm_eps, discr_tpair_xy_y/
55 (* Basic properties *********************************************************)
57 (* Basic_1: was: nf2_sort *)
58 lemma cnr_sort (h) (G) (L):
59 ∀s. ❪G,L❫ ⊢ ➡𝐍[h,0] ⋆s.
61 >(cpr_inv_sort1 … H) //
64 lemma cnr_gref (h) (G) (L):
65 ∀l. ❪G,L❫ ⊢ ➡𝐍[h,0] §l.
67 >(cpr_inv_gref1 … H) //
70 (* Basic_1: was: nf2_abst *)
71 lemma cnr_abst (h) (p) (G) (L):
72 ∀W,T. ❪G,L❫ ⊢ ➡𝐍[h,0] W → ❪G,L.ⓛW❫ ⊢ ➡𝐍[h,0] T → ❪G,L❫ ⊢ ➡𝐍[h,0] ⓛ[p]W.T.
73 #h #p #G #L #W #T #HW #HT #X #H
74 elim (cpm_inv_abst1 … H) -H #W0 #T0 #HW0 #HT0 #H destruct
75 <(HW … HW0) -W0 <(HT … HT0) -T0 //
78 lemma cnr_abbr_neg (h) (G) (L):
79 ∀V,T. ❪G,L❫ ⊢ ➡𝐍[h,0] V → ❪G,L.ⓓV❫ ⊢ ➡𝐍[h,0] T → ❪G,L❫ ⊢ ➡𝐍[h,0] -ⓓV.T.
80 #h #G #L #V #T #HV #HT #X #H
81 elim (cpm_inv_abbr1 … H) -H *
82 [ #V0 #T0 #HV0 #HT0 #H destruct
83 <(HV … HV0) -V0 <(HT … HT0) -T0 //
84 | #T0 #_ #_ #H destruct
89 (* Basic_1: removed theorems 1: nf2_abst_shift *)