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/cif.ma".
16 include "basic_2/reducibility/cnf_lift.ma".
18 (* CONTEXT-SENSITIVE NORMAL TERMS *******************************************)
20 (* Main properties **********************************************************)
22 lemma tps_cif_eq: ∀L,T1,T2,d,e. L ⊢ T1 ▶[d, e] T2 → L ⊢ 𝐈⦃T1⦄ → T1 = T2.
23 #L #T1 #T2 #d #e #H elim H -L -T1 -T2 -d -e
25 | #L #K #V #W #i #d #e #_ #_ #HLK #_ #H -d -e
26 elim (cif_inv_delta … HLK ?) //
27 | #L #a #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #H
28 elim (cif_inv_bind … H) -H #HV1 #HT1 * #H destruct
29 lapply (IHV12 … HV1) -IHV12 -HV1 #H destruct /3 width=1/
30 | #L #I #V1 #V2 #T1 #T2 #d #e #_ #_ #IHV12 #IHT12 #H
31 elim (cif_inv_flat … H) -H #HV1 #HT1 #_ #_ /3 width=1/
35 lemma tpss_cif_eq: ∀L,T1,T2,d,e. L ⊢ T1 ▶*[d, e] T2 → L ⊢ 𝐈⦃T1⦄ → T1 = T2.
36 #L #T1 #T2 #d #e #H @(tpss_ind … H) -T2 //
37 #T #T2 #_ #HT2 #IHT1 #HT1
38 lapply (IHT1 HT1) -IHT1 #H destruct /2 width=5/
41 lemma tpr_cif_eq: ∀T1,T2. T1 ➡ T2 → ∀L. L ⊢ 𝐈⦃T1⦄ → T1 = T2.
42 #T1 #T2 #H elim H -T1 -T2
44 | * #V1 #V2 #T1 #T2 #_ #_ #IHV1 #IHT1 #L #H
45 [ elim (cif_inv_appl … H) -H #HV1 #HT1 #_
46 >IHV1 -IHV1 // -HV1 >IHT1 -IHT1 //
47 | elim (cif_inv_ri2 … H) /2 width=1/
49 | #a #V1 #V2 #W #T1 #T2 #_ #_ #_ #_ #L #H
50 elim (cif_inv_appl … H) -H #_ #_ #H
51 elim (simple_inv_bind … H)
52 | #a * #V1 #V2 #T1 #T #T2 #_ #_ #HT2 #IHV1 #IHT1 #L #H
53 [ lapply (tps_lsubs_trans … HT2 (L.ⓓV2) ?) -HT2 /2 width=1/ #HT2
54 elim (cif_inv_bind … H) -H #HV1 #HT1 * #H destruct
55 lapply (IHV1 … HV1) -IHV1 -HV1 #H destruct
56 lapply (IHT1 … HT1) -IHT1 #H destruct
57 lapply (tps_cif_eq … HT2 ?) -HT2 //
58 | <(tps_inv_refl_SO2 … HT2 ?) -HT2 //
59 elim (cif_inv_ib2 … H) -H /2 width=1/ /3 width=2/
61 | #a #V #V1 #V2 #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #L #H
62 elim (cif_inv_appl … H) -H #_ #_ #H
63 elim (simple_inv_bind … H)
64 | #V1 #T1 #T #T2 #_ #_ #_ #L #H
65 elim (cif_inv_ri2 … H) /2 width=1/
66 | #V1 #T1 #T2 #_ #_ #L #H
67 elim (cif_inv_ri2 … H) /2 width=1/
71 lemma cpr_cif_eq: ∀L,T1,T2. L ⊢ T1 ➡ T2 → L ⊢ 𝐈⦃T1⦄ → T1 = T2.
72 #L #T1 #T2 * #T0 #HT10 #HT02 #HT1
73 lapply (tpr_cif_eq … HT10 … HT1) -HT10 #H destruct /2 width=5/
76 theorem cif_cnf: ∀L,T. L ⊢ 𝐈⦃T⦄ → L ⊢ 𝐍⦃T⦄.
79 (* Note: this property is unusual *)
80 lemma cnf_crf_false: ∀L,T. L ⊢ 𝐑⦃T⦄ → L ⊢ 𝐍⦃T⦄ → ⊥.
83 elim (cnf_inv_delta … HLK H)
85 elim (cnf_inv_appl … H) -H /2 width=1/
87 elim (cnf_inv_appl … H) -H /2 width=1/
88 | #I #L #V #T * #H1 #H2 destruct
89 [ elim (cnf_inv_zeta … H2)
90 | elim (cnf_inv_tau … H2)
92 |5,6: #a * [ elim a ] #L #V #T * #H1 #_ #IH #H2 destruct
93 [1,3: elim (cnf_inv_abbr … H2) -H2 /2 width=1/
94 |*: elim (cnf_inv_abst … H2) -H2 /2 width=1/
97 elim (cnf_inv_appl … H) -H #_ #_ #H
98 elim (simple_inv_bind … H)
100 elim (cnf_inv_appl … H) -H #_ #_ #H
101 elim (simple_inv_bind … H)
105 theorem cnf_cif: ∀L,T. L ⊢ 𝐍⦃T⦄ → L ⊢ 𝐈⦃T⦄.