(* *)
(**************************************************************************)
-include "basic_2/notation/relations/normal_3.ma".
+include "basic_2/notation/relations/prednormal_3.ma".
include "basic_2/reduction/cpr.ma".
-(* CONTEXT-SENSITIVE NORMAL TERMS *******************************************)
+(* NORMAL TERMS FOR CONTEXT-SENSITIVE REDUCTION *****************************)
definition cnr: relation3 genv lenv term ≝ λG,L. NF … (cpr G L) (eq …).
interpretation
- "context-sensitive normality (term)"
- 'Normal G L T = (cnr G L T).
+ "normality for context-sensitive reduction (term)"
+ 'PRedNormal G L T = (cnr G L T).
(* Basic inversion lemmas ***************************************************)
-lemma cnr_inv_delta: â\88\80G,L,K,V,i. â\87©[i] L ≡ K.ⓓV → ⦃G, L⦄ ⊢ ➡ 𝐍⦃#i⦄ → ⊥.
+lemma cnr_inv_delta: â\88\80G,L,K,V,i. â¬\87[i] L ≡ K.ⓓV → ⦃G, L⦄ ⊢ ➡ 𝐍⦃#i⦄ → ⊥.
#G #L #K #V #i #HLK #H
elim (lift_total V 0 (i+1)) #W #HVW
lapply (H W ?) -H [ /3 width=6 by cpr_delta/ ] -HLK #H destruct
-elim (lift_inv_lref2_be … HVW) -HVW //
+elim (lift_inv_lref2_be … HVW) -HVW /2 width=1 by ylt_inj/
qed-.
lemma cnr_inv_abst: ∀a,G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐍⦃ⓛ{a}V.T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐍⦃V⦄ ∧ ⦃G, L.ⓛV⦄ ⊢ ➡ 𝐍⦃T⦄.
]
qed-.
-lemma cnr_inv_tau: ∀G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐍⦃ⓝV.T⦄ → ⊥.
+lemma cnr_inv_eps: ∀G,L,V,T. ⦃G, L⦄ ⊢ ➡ 𝐍⦃ⓝV.T⦄ → ⊥.
#G #L #V #T #H lapply (H T ?) -H
-/2 width=4 by cpr_tau, discr_tpair_xy_y/
+/2 width=4 by cpr_eps, discr_tpair_xy_y/
qed-.
(* Basic properties *********************************************************)
(* Basic_1: was: nf2_sort *)
-lemma cnr_sort: ∀G,L,k. ⦃G, L⦄ ⊢ ➡ 𝐍⦃⋆k⦄.
-#G #L #k #X #H
+lemma cnr_sort: ∀G,L,s. ⦃G, L⦄ ⊢ ➡ 𝐍⦃⋆s⦄.
+#G #L #s #X #H
>(cpr_inv_sort1 … H) //
qed.
+lemma cnr_lref_free: ∀G,L,i. |L| ≤ i → ⦃G, L⦄ ⊢ ➡ 𝐍⦃#i⦄.
+#G #L #i #Hi #X #H elim (cpr_inv_lref1 … H) -H // *
+#K #V1 #V2 #HLK lapply (drop_fwd_length_lt2 … HLK) -HLK
+#H elim (lt_refl_false i) /2 width=3 by lt_to_le_to_lt/
+qed.
+
+(* Basic_1: was only: nf2_csort_lref *)
+lemma cnr_lref_atom: ∀G,L,i. ⬇[i] L ≡ ⋆ → ⦃G, L⦄ ⊢ ➡ 𝐍⦃#i⦄.
+#G #L #i #HL @cnr_lref_free >(drop_fwd_length … HL) -HL //
+qed.
+
(* Basic_1: was: nf2_abst *)
lemma cnr_abst: ∀a,G,L,W,T. ⦃G, L⦄ ⊢ ➡ 𝐍⦃W⦄ → ⦃G, L.ⓛW⦄ ⊢ ➡ 𝐍⦃T⦄ → ⦃G, L⦄ ⊢ ➡ 𝐍⦃ⓛ{a}W.T⦄.
#a #G #L #W #T #HW #HT #X #H