]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/reducibility/cnf_cif.ma
- matita: reset_font_size () added after matita.conf.xml is read to set
[helm.git] / matita / matita / contribs / lambda_delta / basic_2 / reducibility / cnf_cif.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/substitution/tps_lift.ma".
16 include "basic_2/unfold/tpss.ma".
17 include "basic_2/reducibility/cif.ma".
18 include "basic_2/reducibility/cnf_lift.ma".
19
20 (* CONTEXT-SENSITIVE NORMAL TERMS *******************************************)
21
22 (* Main properties **********************************************************)
23
24 lemma tps_cif_eq: ∀L,T1,T2,d,e. L ⊢ T1 ▶[d, e] T2 → L ⊢ 𝐈⦃T1⦄ → T1 = T2.
25 #L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e
26 [ //
27 | #L #K #V #W #i #d #e #_ #_ #HLK #_ #H -d -e
28   elim (cif_inv_delta … HLK ?) //
29 | #L #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #H
30   elim (cif_inv_bind … H) -H #HV1 #HT1 * #H destruct
31   lapply (IHV12 … HV1) -IHV12 -HV1 #H destruct /3 width=1/
32 | #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #H
33   elim (cif_inv_flat … H) -H #HV1 #HT1 #_ #_ /3 width=1/
34 ]
35 qed.
36
37 lemma tpss_cif_eq: ∀L,T1,T2,d,e. L ⊢ T1 ▶*[d, e] T2 → L ⊢ 𝐈⦃T1⦄ → T1 = T2.
38 #L #T1 #T2 #d #e #H @(tpss_ind … H) -T2 //
39 #T #T2 #_ #HT2 #IHT1 #HT1
40 lapply (IHT1 HT1) -IHT1 #H destruct /2 width=5/
41 qed.
42
43 lemma tpr_cif_eq: ∀T1,T2. T1 ➡ T2 → ∀L. L ⊢ 𝐈⦃T1⦄ → T1 = T2.
44 #T1 #T2 #H elim H -T1 -T2
45 [ //
46 | * #V1 #V2 #T1 #T2 #_ #_ #IHV1 #IHT1 #L #H
47   [ elim (cif_inv_appl … H) -H #HV1 #HT1 #_
48     >IHV1 -IHV1 // -HV1 >IHT1 -IHT1 //
49   | elim (cif_inv_ri2 … H) /2 width=1/
50   ]
51 | #a #V1 #V2 #W #T1 #T2 #_ #_ #_ #_ #L #H
52   elim (cif_inv_appl … H) -H #_ #_ #H
53   elim (simple_inv_bind … H)
54 | #a * #V1 #V2 #T1 #T #T2 #_ #_ #HT2 #IHV1 #IHT1 #L #H
55   [ lapply (tps_lsubs_trans … HT2 (L.ⓓV2) ?) -HT2 /2 width=1/ #HT2
56     elim (cif_inv_bind … H) -H #HV1 #HT1 * #H destruct
57     lapply (IHV1 … HV1) -IHV1 -HV1 #H destruct
58     lapply (IHT1 … HT1) -IHT1 #H destruct
59     lapply (tps_cif_eq … HT2 ?) -HT2 //
60   | <(tps_inv_refl_SO2 … HT2 ?) -HT2 //
61     elim (cif_inv_ib2 … H) -H /2 width=1/ /3 width=2/
62   ]
63 | #a #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #L #H
64   elim (cif_inv_appl … H) -H #_ #_ #H
65   elim (simple_inv_bind … H)
66 | #V1 #T1 #T #T2 #_ #_ #_ #L #H
67   elim (cif_inv_ri2 … H) /2 width=1/
68 | #V1 #T1 #T2 #_ #_ #L #H
69   elim (cif_inv_ri2 … H) /2 width=1/
70 ]
71 qed.
72
73 lemma cpr_cif_eq: ∀L,T1,T2. L ⊢ T1 ➡ T2 → L ⊢ 𝐈⦃T1⦄ → T1 = T2.
74 #L #T1 #T2 * #T0 #HT10 #HT02 #HT1
75 lapply (tpr_cif_eq … HT10 … HT1) -HT10 #H destruct /2 width=5/
76 qed.
77
78 theorem cif_cnf: ∀L,T. L ⊢ 𝐈⦃T⦄ → L ⊢ 𝐍⦃T⦄.
79 /3 width=3/ qed.
80
81 (* Note: this property is unusual *)
82 lemma cnf_crf_false: ∀L,T. L ⊢ 𝐑⦃T⦄ → L ⊢ 𝐍⦃T⦄ → ⊥.
83 #L #T #H elim H -L -T
84 [ #L #K #V #i #HLK #H
85   elim (cnf_inv_delta … HLK H)
86 | #L #V #T #_ #IHV #H
87   elim (cnf_inv_appl … H) -H /2 width=1/
88 | #L #V #T #_ #IHT #H
89   elim (cnf_inv_appl … H) -H /2 width=1/
90 | #I #L #V #T * #H1 #H2 destruct
91   [ elim (cnf_inv_zeta … H2)
92   | elim (cnf_inv_tau … H2)
93   ]
94 |5,6: #a * [ elim a ] #L #V #T * #H1 #_ #IH #H2 destruct
95   [1,3: elim (cnf_inv_abbr … H2) -H2 /2 width=1/
96   |*: elim (cnf_inv_abst … H2) -H2 /2 width=1/
97   ]
98 | #a #L #V #W #T #H
99   elim (cnf_inv_appl … H) -H #_ #_ #H
100   elim (simple_inv_bind … H)
101 | #a #L #V #W #T #H 
102   elim (cnf_inv_appl … H) -H #_ #_ #H
103   elim (simple_inv_bind … H)
104 ]
105 qed.
106
107 theorem cnf_cif: ∀L,T. L ⊢ 𝐍⦃T⦄ → L ⊢ 𝐈⦃T⦄.
108 /2 width=4/ qed.