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_4.ma".
16 include "basic_2/rt_transition/cpr.ma".
18 (* NORMAL TERMS FOR CONTEXT-SENSITIVE R-TRANSITION **************************)
20 definition cnr (h) (G) (L): predicate term ≝ NF … (cpm h G L 0) (eq …).
23 "normality for context-sensitive r-transition (term)"
24 'PRedNormal h G L T = (cnr h G L T).
26 (* Basic inversion lemmas ***************************************************)
28 lemma cnr_inv_abst (h) (p) (G) (L):
29 ∀V,T. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃ⓛ{p}V.T⦄ → ∧∧ ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃V⦄ & ⦃G,L.ⓛV⦄ ⊢ ➡[h] 𝐍⦃T⦄.
30 #h #p #G #L #V1 #T1 #HVT1 @conj
31 [ #V2 #HV2 lapply (HVT1 (ⓛ{p}V2.T1) ?) -HVT1 /2 width=2 by cpr_pair_sn/ -HV2 #H destruct //
32 | #T2 #HT2 lapply (HVT1 (ⓛ{p}V1.T2) ?) -HVT1 /2 width=2 by cpm_bind/ -HT2 #H destruct //
36 (* Basic_2A1: was: cnr_inv_abbr *)
37 lemma cnr_inv_abbr_neg (h) (G) (L):
38 ∀V,T. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃-ⓓV.T⦄ → ∧∧ ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃V⦄ & ⦃G,L.ⓓV⦄ ⊢ ➡[h] 𝐍⦃T⦄.
39 #h #G #L #V1 #T1 #HVT1 @conj
40 [ #V2 #HV2 lapply (HVT1 (-ⓓV2.T1) ?) -HVT1 /2 width=2 by cpr_pair_sn/ -HV2 #H destruct //
41 | #T2 #HT2 lapply (HVT1 (-ⓓV1.T2) ?) -HVT1 /2 width=2 by cpm_bind/ -HT2 #H destruct //
45 (* Basic_2A1: was: cnr_inv_eps *)
46 lemma cnr_inv_cast (h) (G) (L): ∀V,T. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃ⓝV.T⦄ → ⊥.
47 #h #G #L #V #T #H lapply (H T ?) -H
48 /2 width=4 by cpm_eps, discr_tpair_xy_y/
51 (* Basic properties *********************************************************)
53 (* Basic_1: was: nf2_sort *)
54 lemma cnr_sort (h) (G) (L): ∀s. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃⋆s⦄.
56 >(cpr_inv_sort1 … H) //
59 lemma cnr_gref (h) (G) (L): ∀l. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃§l⦄.
61 >(cpr_inv_gref1 … H) //
64 (* Basic_1: was: nf2_abst *)
65 lemma cnr_abst (h) (p) (G) (L):
66 ∀W,T. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃W⦄ → ⦃G,L.ⓛW⦄ ⊢ ➡[h] 𝐍⦃T⦄ → ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃ⓛ{p}W.T⦄.
67 #h #p #G #L #W #T #HW #HT #X #H
68 elim (cpm_inv_abst1 … H) -H #W0 #T0 #HW0 #HT0 #H destruct
69 <(HW … HW0) -W0 <(HT … HT0) -T0 //
72 lemma cnr_abbr_neg (h) (G) (L):
73 ∀V,T. ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃V⦄ → ⦃G,L.ⓓV⦄ ⊢ ➡[h] 𝐍⦃T⦄ → ⦃G,L⦄ ⊢ ➡[h] 𝐍⦃-ⓓV.T⦄.
74 #h #G #L #V #T #HV #HT #X #H
75 elim (cpm_inv_abbr1 … H) -H *
76 [ #V0 #T0 #HV0 #HT0 #H destruct
77 <(HV … HV0) -V0 <(HT … HT0) -T0 //
78 | #T0 #_ #_ #H destruct
83 (* Basic_1: removed theorems 1: nf2_abst_shift *)