]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/snv_ssta_lpr.ma
lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / snv_ssta_lpr.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/computation/cpds_cpds.ma".
16 include "basic_2/dynamic/snv_cpcs.ma".
17 include "basic_2/dynamic/lsubsv_ssta.ma".
18
19 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
20
21 (* Properties on sn parallel reduction for local environments ***************)
22
23 fact ssta_cpr_lpr_aux: ∀h,g,L0,T0.
24                        (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_ssta h g L1 T1) →
25                        (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_snv_cpr_lpr h g L1 T1) →
26                        (∀L1,T1. h ⊢ ⦃L0, T0⦄ >[g] ⦃L1, T1⦄ → IH_ssta_cpr_lpr h g L1 T1) →
27                        ∀L1,T1. L0 = L1 → T0 = T1 → IH_ssta_cpr_lpr h g L1 T1.
28 #h #g #L0 #T0 #IH3 #IH2 #IH1 #L1 * * [|||| *]
29 [ #k #_ #_ #_ #X2 #l #H2 #X3 #H3 #L2 #HL12 -IH3 -IH2 -IH1
30   elim (ssta_inv_sort1 … H2) -H2 #Hkl #H destruct
31   >(cpr_inv_sort1 … H3) -X3 /4 width=6/
32 | #i #HL0 #HT0 #H1 #X2 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH3 -IH2
33   elim (snv_inv_lref … H1) -H1 #I0 #K0 #V0 #H #HV1
34   elim (ssta_inv_lref1 … H2) -H2 * #K1
35   #V1 #W1 [| #l0 ] #HLK1 #HVW1 #HWU1 [| #H destruct ]
36   lapply (ldrop_mono … H … HLK1) -H #H destruct
37   lapply (fsupp_lref … HLK1) #HKV1
38   elim (lpr_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
39   elim (lpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
40   lapply (ldrop_fwd_ldrop2 … HLK2) #H2
41   elim (cpr_inv_lref1 … H3) -H3
42   [1,3: #H destruct -HLK1
43   |2,4: * #K0 #V0 #W0 #H #HVW0 #HW0
44         lapply (ldrop_mono … H … HLK1) -H -HLK1 #H destruct
45   ]
46   [ elim (IH1 … HVW1 … HV12 … HK12) -IH1 -HVW1 // [2: /2 width=1/ ] -K1 -V1 #W2 #HVW2 #HW12
47     elim (lift_total W2 0 (i+1)) #U2 #HWU2
48     lapply (cpcs_lift … H2 … HWU1 … HWU2 HW12) -H2 -W1 /3 width=6/
49   | elim (IH1 … HVW1 … HV12 … HK12) -IH1 -HVW1 // [2: /2 width=1/ ] #W2 #HVW2 #_
50     elim (lift_total V2 0 (i+1)) #U2 #HVU2
51     lapply (lpr_cpr_conf … HK12 … HV12) -HV12 #HV12
52     lapply (cpcs_lift … H2 … HWU1 … HVU2 HV12) -H2 -V1 /3 width=6/
53   | elim (IH1 … HVW1 … HVW0 … HK12) -IH1 -HVW1 // [2: /2 width=1/ ] -K1 -V1 #W2 #HVW2 #HW12
54     elim (lift_total W2 0 (i+1)) #U2 #HWU2
55     lapply (ssta_lift … HVW2 … H2 … HW0 … HWU2) -HVW2 -HW0
56     lapply (cpcs_lift … H2 … HWU1 … HWU2 HW12) -H2 -W1 /3 width=6/
57   ]
58 | #p #_ #HT0 #H1 destruct -IH3 -IH2 -IH1
59   elim (snv_inv_gref … H1)
60 | #a #I #V1 #T1 #HL0 #HT0 #H1 #X2 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH3 -IH2
61   elim (snv_inv_bind … H1) -H1 #_ #HT1
62   elim (ssta_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct
63   elim (cpr_inv_bind1 … H3) -H3 *
64   [ #V2 #T2 #HV12 #HT12 #H destruct
65     elim (IH1 … HTU1 … HT12 (L2.ⓑ{I}V2)) // [2,3: /2 width=1/ ] -T1
66     lapply (lpr_cpr_conf … HL12 … HV12) -L1 /3 width=5/
67   | #T2 #HT12 #HT2 #H1 #H2 destruct
68     elim (IH1 … HTU1 … HT12 (L2.ⓓV1)) -IH1 -HTU1 // [2,3: /2 width=1/ ] -T1 -HL12 #U2 #HTU2 #HU12
69     elim (ssta_inv_lift1 … HTU2 … HT2) -T2 [3: /2 width=1/ |2: skip ] #U #HXU #HU2
70     lapply (cpcs_bind1 true … V1 V1 … HU12) // -HU12 #HU12
71     lapply (cpcs_cpr_strap1 … HU12 U ?) -HU12 /2 width=3/
72   ]
73 | #V1 #T1 #HL0 #HT0 #H1 #X2 #l #H2 #X3 #H3 #L2 #HL12 destruct
74   elim (snv_inv_appl … H1) -H1 #a #W1 #W10 #U10 #l0 #HV1 #HT1 #HVW1 #HW10 #HTU10
75   elim (ssta_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct
76   elim (cpr_inv_appl1 … H3) -H3 *
77   [ #V2 #T2 #HV12 #HT12 #H destruct -a -l0 -W1 -W10 -U10 -HV1 -IH3 -IH2
78     elim (IH1 … HTU1 … HT12 … HL12) -IH1 -HTU1 // [2: /2 width=1/ ] -T1 #U2 #HTU2 #HU12
79     lapply (lpr_cpr_conf … HL12 … HV12) -L1 /3 width=5/
80   | #b #V2 #W2 #W20 #T2 #T20 #HV12 #HW20 #HT20 #H1 #H2 destruct
81     elim (snv_inv_bind … HT1) -HT1 #HW2 #HT2
82     elim (ssta_inv_bind1 … HTU1) -HTU1 #U2 #HTU2 #H destruct
83     elim (cpds_inv_abst1 … HTU10) -HTU10 #W0 #U0 #HW0 #_ #H destruct
84     lapply (cprs_div … HW10 … HW0) -W0 #HW12
85     elim (ssta_fwd_correct … HVW1) <minus_plus_m_m #X1 #HWX1
86     elim (snv_fwd_ssta … HW2) #l1 #V22 #HWV22
87     lapply (IH3 … HVW1) -IH3 // [ /2 width=1/ ] #HW1
88     elim (ssta_cpcs_lpr_aux … IH2 IH1 … HWX1 … HWV22 … L1) -HWX1 //
89     [2: /2 width=1/
90     |3: /4 width=4 by ygt_yprs_trans, fsupp_ygt, sstas_yprs, ssta_sstas/
91     ] #H #_ destruct -X1
92     lapply (IH2 … HV1 … HV12 … HL12) [ /2 width=1/ ] #HV2    
93     lapply (IH2 … HW2 … HW20 … HL12) [ /2 width=1/ ] -IH2 #H2W20
94     elim (IH1 … HVW1 … HV12 … HL12) -HVW1 // -HV1 [2: /2 width=1/ ] #W12 #HVW12 #HW112
95     elim (IH1 … HWV22 … HW20 … HL12) -HWV22 // -HW2 [2: /2 width=1/ ] #V20 #HWV20 #_
96     elim (IH1 … HTU2 … HT20 (L2.ⓛW20)) -IH1 -HTU2 -HT20 // [2,3: /2 width=1/ ] -HT2 #U20 #HTU20 #HU20
97     lapply (lpr_cpcs_conf … HL12 … HW12) -HW12 #HW12
98     lapply (lpr_cpr_conf … HL12 … HW20) -HW20 #HW20
99     lapply (lpr_cpr_conf … HL12 … HV12) -L1 #HV12
100     lapply (cpcs_canc_sn … HW12 HW112) -W1 #HW12
101     lapply (cpcs_canc_sn … HW12 HW20) -HW12 #HW12
102     elim (lsubsv_ssta_trans … HTU20 (L2.ⓓⓝW20.V2)) -HTU20
103     [ #U #HTU20 #HUU20 -HVW12 -HWV20 -HW12
104       @(ex2_intro … (ⓓ{b}ⓝW20.V2.U)) [ /3 width=1/ ] -HTU20
105       @(cpcs_canc_dx … (ⓓ{b}ⓝW20.V2.U20)) [2: /2 width=1/ ] -HUU20
106       @(cpcs_cpr_strap1 … (ⓐV2.ⓛ{b}W20.U20)) [2: /2 width=1/ ]
107       /3 by cpcs_bind2, cpcs_flat/
108     | -HU20 -HW20 -HV12 /3 width=5 by lsubsv_abbr, snv_cast/ 
109     ]
110   | #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HV02 #HW02 #HT02 #H1 #H2 destruct -a -l0 -W1 -W10 -HV1 -IH3 -IH2
111     elim (ssta_inv_bind1 … HTU1) -HTU1 #U0 #HTU0 #H destruct
112     elim (snv_inv_bind … HT1) -HT1 #_ #HT0
113     elim (IH1 … HTU0 … HT02 (L2.ⓓW2)) -IH1 -HTU0 // [2,3: /2 width=1/ ] -T0 #U2 #HTU2 #HU02
114     lapply (lpr_cpr_conf … HL12 … HV10) -HV10 #HV10
115     lapply (lpr_cpr_conf … HL12 … HW02) -L1 #HW02
116     lapply (cpcs_bind2 b … HW02 … HU02) -HW02 -HU02 #HU02
117     lapply (cpcs_flat … HV10 … HU02 Appl) -HV10 -HU02 #HU02
118     lapply (cpcs_cpr_strap1 … HU02 (ⓓ{b}W2.ⓐV2.U2) ?) [ /2 width=3/ ] -V0 /4 width=3/
119   ]
120 | #U0 #T1 #HL0 #HT0 #H1 #X2 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH3 -IH2
121   elim (snv_inv_cast … H1) -H1 #T0 #l0 #_ #HT1 #HT10 #_
122   lapply (ssta_inv_cast1 … H2) -H2 #HTU1
123   elim (ssta_mono … HT10 … HTU1) -HT10 #H1 #H2 destruct
124   elim (cpr_inv_cast1 … H3) -H3
125   [ * #U2 #T2 #_ #HT12 #H destruct
126     elim (IH1 … HTU1 … HT12 … HL12) -IH1 -HTU1 -HL12 // [2: /2 width=1/ ] -T1 -U0 /3 width=3/
127   | #HT1X3
128     elim (IH1 … HTU1 … HT1X3 … HL12) -IH1 -HTU1 -HL12 // [2: /2 width=1/ ] -U0 -T1 /2 width=3/
129   ]
130 ]
131 qed-.