]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_lpce.ma
update in basic_2
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / cnv_lpce.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/rt_transition/lpr_drops.ma".
16 include "basic_2/rt_computation/cpms_lpr.ma".
17 include "basic_2/rt_computation/fpbg_fqup.ma".
18 include "basic_2/rt_conversion/cpce_drops.ma".
19 include "basic_2/rt_conversion/lpce_drops.ma".
20 include "basic_2/dynamic/cnv_drops.ma".
21
22 (* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************)
23
24 definition IH (h) (a): relation3 genv lenv term ≝
25            λG,L0,T0. ⦃G,L0⦄ ⊢ T0 ![h,a] →
26            ∀n,T1. ⦃G,L0⦄ ⊢ T0 ➡[n,h] T1 → ∀T2. ⦃G,L0⦄ ⊢ T0 ⬌η[h] T2 →
27            ∀L1. ⦃G,L0⦄ ⊢ ➡[h] L1 → ∀L2. ⦃G,L0⦄ ⊢ ⬌η[h] L2 →
28            ∃∃T. ⦃G,L1⦄ ⊢ T1 ⬌η[h] T & ⦃G,L2⦄ ⊢ T2 ➡[n,h] T.
29
30 (* Properties with eta-conversion for full local environments ***************)  
31
32 lemma pippo_aux (h) (a) (G0) (L0) (T0):
33                 (∀G,L,T. ⦃G0,L0,T0⦄ >[h] ⦃G,L,T⦄ → IH h a G L T) →
34                 IH h a G0 L0 T0.
35 #h #a #G0 #L0 * *
36 [ #s #_ #_ #n #X1 #HX1 #X2 #HX2 #L1 #HL01 #L2 #HL02
37   elim (cpm_inv_sort1 … HX1) -HX1 #H #Hn destruct
38   lapply (cpce_inv_sort_sn … HX2) -HX2 #H destruct
39   /3 width=3 by cpce_sort, cpm_sort, ex2_intro/
40 | #i #IH #Hi #n #X1 #HX1 #X2 #HX2 #L1 #HL01 #L2 #HL02
41   elim (cnv_inv_lref_drops … Hi) -Hi #I #K0 #W0 #HLK0 #HW0
42   elim (lpr_drops_conf … HLK0 … HL01) [| // ] #Y1 #H1 #HLK1
43   elim (lpr_inv_pair_sn … H1) -H1 #K1 #W1 #HK01 #HW01 #H destruct
44   elim (lpce_drops_conf … HLK0 … HL02) [| // ] #Y2 #H2 #HLK2
45   elim (lpce_inv_pair_sn … H2) -H2 #K2 #W2 #HK02 #HW02 #H destruct
46   elim (cpm_inv_lref1_drops … HX1) -HX1 *
47   [ #H1 #H2 destruct
48     elim (cpce_inv_lref_sn_drops_pair … HX2 … HLK0) -HX2 *
49     [ #H1 #H2 destruct -L0 -K0 -W0
50       /3 width=3 by cpce_ldef_drops, ex2_intro/
51     | #H1 #HW #H2 destruct -L0 -W2 -HW0 -HK02
52       @(ex2_intro … (#i)) [| // ]
53       @(cpce_ldec_drops … HLK1) -HLK1 #n #p #V0 #U0 #HWU0
54       /4 width=10 by lpr_cpms_trans, cpms_step_sn/
55     | #n #p #W01 #W02 #V0 #V01 #V02 #U0 #H1 #HWU0 #HW001 #HW012 #HV001 #HV012 #H2 destruct 
56     ]
57   | lapply (drops_isuni_fwd_drop2 … HLK1) [ // ] -W1 #HLK1
58     #Y0 #X0 #W1 #HLY0 #HW01 #HWX1 -HL01 -HL02
59     lapply (drops_mono … HLY0 … HLK0) -HLY0 #H destruct
60     lapply (cpce_inv_lref_sn_drops_ldef … HX2 … HLK0) -HX2 #H destruct
61     elim (IH … HW0 … HW01 … HW02 … HK01 … HK02)
62     [| /3 width=2 by fqup_fpbg, fqup_lref/ ] -L0 -K0 #W #HW1 #HW2
63     elim (lifts_total W (𝐔❴↑i❵)) #V #HWV
64     /3 width=9 by cpce_lifts_bi, cpm_delta_drops, ex2_intro/
65   | lapply (drops_isuni_fwd_drop2 … HLK1) [ // ] -W1 #HLK1
66     #m #Y0 #X0 #W1 #HLY0 #HW01 #HWX1 #H destruct -HL01 -HL02
67     lapply (drops_mono … HLY0 … HLK0) -HLY0 #H destruct
68     elim (cpce_inv_lref_sn_drops_ldec … HX2 … HLK0) -HX2 *
69     [ #_ #H destruct
70       elim (IH … HW0 … HW01 … HW02 … HK01 … HK02)
71       [| /3 width=2 by fqup_fpbg, fqup_lref/ ] -L0 -K0 #W #HW1 #HW2
72       elim (lifts_total W (𝐔❴↑i❵)) #V #HWV
73       /3 width=9 by cpce_lifts_bi, cpm_ell_drops, ex2_intro/
74     | lapply (drops_isuni_fwd_drop2 … HLK2) [ // ] -W2 #HLK2
75       #n #p #W01 #W02 #V0 #V01 #V02 #U0 #_ #HW001 #HW012 #_ #_ #H destruct -V0 -V01 -U0
76       elim (IH … HW0 … HW01 … HW001 … HK01 … HK02)
77       [| /3 width=2 by fqup_fpbg, fqup_lref/ ] -L0 -K0 #W #HW1 #HW2
78       elim (lifts_total W (𝐔❴↑i❵)) #V #HWV
79       /4 width=11 by cpce_lifts_bi, cpm_lifts_bi, cpm_ee, ex2_intro/
80     ]
81   ]
82 | #l #_ #_ #n #X1 #HX1 #X2 #HX2 #L1 #HL01 #L2 #HL02
83   elim (cpm_inv_gref1 … HX1) -HX1 #H1 #H2 destruct
84   lapply (cpce_inv_gref_sn … HX2) -HX2 #H destruct
85   /3 width=3 by cpce_gref, cpr_refl, ex2_intro/
86
87 (*
88 lemma cpce_inv_eta_drops (h) (n) (G) (L) (i):
89       ∀X. ⦃G,L⦄ ⊢ #i ⬌η[h] X →
90       ∀K,W. ⇩*[i] L ≘ K.ⓛW →
91       ∀p,V1,U. ⦃G,K⦄ ⊢ W ➡*[n,h] ⓛ{p}V1.U →
92       ∀V2. ⦃G,K⦄ ⊢ V1 ⬌η[h] V2 →
93       ∀W2. ⇧*[↑i] V2 ≘ W2 → X = +ⓛW2.ⓐ#0.#↑i.
94
95 theorem cpce_mono_cnv (h) (a) (G) (L):
96         ∀T. ⦃G,L⦄ ⊢ T ![h,a] →
97         ∀T1. ⦃G,L⦄ ⊢ T ⬌η[h] T1 → ∀T2. ⦃G,L⦄ ⊢ T ⬌η[h] T2 → T1 = T2.
98 #h #a #G #L #T #HT
99 *)