]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/reducibility/cnf_lift.ma
0e1a8551fb962e40e9c54aa965cf75c5fbfb17ce
[helm.git] / matita / matita / contribs / lambda_delta / basic_2 / reducibility / cnf_lift.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "basic_2/reducibility/cpr_lift.ma".
16 include "basic_2/reducibility/cpr_cpr.ma".
17 include "basic_2/reducibility/cnf.ma".
18
19 (* CONTEXT-SENSITIVE NORMAL TERMS *******************************************)
20
21 (* Advanced inversion lemmas ************************************************)
22
23 lemma cnf_inv_delta: ∀L,K,V,i. ⇩[0, i] L ≡ K.ⓓV → L ⊢ 𝐍⦃#i⦄ → ⊥.
24 #L #K #V #i #HLK #H
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 //
28 qed-.
29
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 //
34 ]
35 qed-.
36
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 //
41 ]
42 qed-.
43
44 (* Advanced properties ******************************************************)
45
46 (* Basic_1: was only: nf2_csort_lref *)
47 lemma cnf_lref_atom: ∀L,i. ⇩[0, i] L ≡ ⋆ → L  ⊢ 𝐍⦃#i⦄.
48 #L #i #HLK #X #H
49 elim (cpr_inv_lref1 … H) // *
50 #K0 #V0 #V1 #HLK0 #_ #_ #_
51 lapply (ldrop_mono … HLK … HLK0) -L #H destruct
52 qed.
53
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
60 qed.
61
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 //
67 qed.
68
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 //
74 qed.
75
76 (* Relocation properties ****************************************************)
77
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 //
85 qed.