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/reducibility/cpr_lift.ma".
16 include "basic_2/reducibility/cpr_cpr.ma".
17 include "basic_2/reducibility/cnf.ma".
19 (* CONTEXT-SENSITIVE NORMAL TERMS *******************************************)
21 (* Advanced inversion lemmas ************************************************)
23 lemma cnf_inv_delta: ∀L,K,V,i. ⇩[0, i] L ≡ K.ⓓV → L ⊢ 𝐍⦃#i⦄ → ⊥.
25 elim (lift_total V 0 (i+1)) #W #HVW
26 lapply (H W ?) -H [ /3 width=6/ ] -HLK #H destruct
27 elim (lift_inv_lref2_be … HVW ? ?) -HVW //
30 lemma cnf_inv_abst: ∀a,L,V,T. L ⊢ 𝐍⦃ⓛ{a}V.T⦄ → L ⊢ 𝐍⦃V⦄ ∧ L.ⓛV ⊢ 𝐍⦃T⦄.
31 #a #L #V1 #T1 #HVT1 @conj
32 [ #V2 #HV2 lapply (HVT1 (ⓛ{a}V2.T1) ?) -HVT1 /2 width=2/ -HV2 #H destruct //
33 | #T2 #HT2 lapply (HVT1 (ⓛ{a}V1.T2) ?) -HVT1 /2 width=2/ -HT2 #H destruct //
37 lemma cnf_inv_abbr: ∀L,V,T. L ⊢ 𝐍⦃-ⓓV.T⦄ → L ⊢ 𝐍⦃V⦄ ∧ L.ⓓV ⊢ 𝐍⦃T⦄.
38 #L #V1 #T1 #HVT1 @conj
39 [ #V2 #HV2 lapply (HVT1 (-ⓓV2.T1) ?) -HVT1 /2 width=2/ -HV2 #H destruct //
40 | #T2 #HT2 lapply (HVT1 (-ⓓV1.T2) ?) -HVT1 /2 width=2/ -HT2 #H destruct //
44 (* Advanced properties ******************************************************)
46 (* Basic_1: was only: nf2_csort_lref *)
47 lemma cnf_lref_atom: ∀L,i. ⇩[0, i] L ≡ ⋆ → L ⊢ 𝐍⦃#i⦄.
49 elim (cpr_inv_lref1 … H) // *
50 #K0 #V0 #V1 #HLK0 #_ #_ #_
51 lapply (ldrop_mono … HLK … HLK0) -L #H destruct
54 (* Basic_1: was: nf2_lref_abst *)
55 lemma cnf_lref_abst: ∀L,K,V,i. ⇩[0, i] L ≡ K. ⓛV → L ⊢ 𝐍⦃#i⦄.
56 #L #K #V #i #HLK #X #H
57 elim (cpr_inv_lref1 … H) // *
58 #K0 #V0 #V1 #HLK0 #_ #_ #_
59 lapply (ldrop_mono … HLK … HLK0) -L #H destruct
62 (* Basic_1: was: nf2_abst *)
63 lemma cnf_abst: ∀a,I,L,V,W,T. L ⊢ 𝐍⦃W⦄ → L. ⓑ{I} V ⊢ 𝐍⦃T⦄ → L ⊢ 𝐍⦃ⓛ{a}W.T⦄.
64 #a #I #L #V #W #T #HW #HT #X #H
65 elim (cpr_inv_abst1 … H I V) -H #W0 #T0 #HW0 #HT0 #H destruct
66 >(HW … HW0) -W0 >(HT … HT0) -T0 //
69 (* Basic_1: was only: nf2_appl_lref *)
70 lemma cnf_appl_simple: ∀L,V,T. L ⊢ 𝐍⦃V⦄ → L ⊢ 𝐍⦃T⦄ → 𝐒⦃T⦄ → L ⊢ 𝐍⦃ⓐV.T⦄.
71 #L #V #T #HV #HT #HS #X #H
72 elim (cpr_inv_appl1_simple … H ?) -H // #V0 #T0 #HV0 #HT0 #H destruct
73 >(HV … HV0) -V0 >(HT … HT0) -T0 //
76 (* Relocation properties ****************************************************)
78 (* Basic_1: was: nf2_lift *)
79 lemma cnf_lift: ∀L0,L,T,T0,d,e.
80 L ⊢ 𝐍⦃T⦄ → ⇩[d, e] L0 ≡ L → ⇧[d, e] T ≡ T0 → L0 ⊢ 𝐍⦃T0⦄.
81 #L0 #L #T #T0 #d #e #HLT #HL0 #HT0 #X #H
82 elim (cpr_inv_lift1 … HL0 … HT0 … H) -L0 #T1 #HT10 #HT1
83 <(HLT … HT1) in HT0; -L #HT0
84 >(lift_mono … HT10 … HT0) -T1 -X //