]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/snv_lstas_lpr.ma
some renaming and some typos corrected ...
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / snv_lstas_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_aaa.ma".
17 include "basic_2/dynamic/snv_cpcs.ma".
18 include "basic_2/dynamic/lsubsv_lstas.ma".
19
20 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
21
22 (* Properties on sn parallel reduction for local environments ***************)
23
24 fact lstas_cpr_lpr_aux: ∀h,g,G0,L0,T0.
25                         (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_lstas h g G1 L1 T1) →
26                         (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpr_lpr h g G1 L1 T1) →
27                         (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
28                         (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) →
29                         ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_lstas_cpr_lpr h g G1 L1 T1.
30 #h #g #G0 #L0 #T0 #IH4 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ]
31 [ #k #_ #_ #_ #_ #l1 #l2 #_ #_ #X2 #H2 #X3 #H3 #L2 #_ -IH4 -IH3 -IH2 -IH1
32   >(lstas_inv_sort1 … H2) -X2
33   >(cpr_inv_sort1 … H3) -X3 /2 width=3 by ex2_intro/
34 | #i #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH4 -IH3
35   [ lapply (lstas_inv_O … H2) -H2 #H destruct -IH1 -H1 -l1 /4 width=5 by lpr_cpcs_conf, cpr_cpcs_dx, ex2_intro/ ]
36   elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #HK0 #HX0
37   elim (da_inv_lref … Hl1) -Hl1 * #K1 [ #V1 | #W1 #l0 ] #HLK1 [ #HVl1 | #HWl1 #H destruct ]
38   lapply (drop_mono … HK0 … HLK1) -HK0 #H destruct
39   elim (lstas_inv_lref1 … H2) -H2 * #K0 #V0 #W0 [2,4: #X0 ] #HK0 [1,2: #_ -X0 ] #HVW0 #HX2
40   lapply (drop_mono … HK0 … HLK1) -HK0 #H destruct
41   [ lapply (le_plus_to_le_r … Hl21) -Hl21 #Hl21 ]
42   lapply (fqup_lref … G1 … HLK1) #HKV1
43   elim (lpr_drop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
44   elim (lpr_inv_pair1 … H) -H #K2 [ #W2 | #V2 ] #HK12 [ #HW12 | #HV12 ] #H destruct
45   lapply (drop_fwd_drop2 … HLK2) #H2
46   elim (cpr_inv_lref1 … H3) -H3
47   [1,3: #H destruct -HLK1
48   |2,4: * #K0 #V0 #X0 #H #HVX0 #HX0
49         lapply (drop_mono … H … HLK1) -H -HLK1 #H destruct
50   ]
51   [ lapply (IH2 … HWl1 … HW12 … HK12) /2 width=1 by fqup_fpbg/ -IH2 #H
52     elim (da_inv_sta … H) -H
53     elim (IH1 … HWl1 … HVW0 … HW12 … HK12) -IH1 -HVW0 /2 width=1 by fqup_fpbg/ #V2 #HWV2 #HV2
54     elim (lift_total V2 0 (i+1))
55     /3 width=12 by cpcs_lift, lstas_ldec, ex2_intro/
56   | elim (IH1 … HVl1 … HVW0 … HV12 … HK12) -IH1 -HVl1 -HVW0 -HV12 -HK12 -IH2 /2 width=1 by fqup_fpbg/ #W2 #HVW2 #HW02
57     elim (lift_total W2 0 (i+1))
58     /4 width=12 by cpcs_lift, lstas_ldef, ex2_intro/
59   | elim (IH1 … HVl1 … HVW0 … HVX0 … HK12) -IH1 -HVl1 -HVW0 -HVX0 -HK12 -IH2 -V2 /2 width=1 by fqup_fpbg/ -l1 #W2 #HXW2 #HW02
60     elim (lift_total W2 0 (i+1))
61     /3 width=12 by cpcs_lift, lstas_lift, ex2_intro/
62   ]
63 | #p #_ #_ #HT0 #H1 destruct -IH4 -IH3 -IH2 -IH1
64   elim (snv_inv_gref … H1)
65 | #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH4 -IH3 -IH2
66   elim (snv_inv_bind … H1) -H1 #_ #HT1
67   lapply (da_inv_bind … Hl1) -Hl1 #Hl1
68   elim (lstas_inv_bind1 … H2) -H2 #U1 #HTU1 #H destruct
69   elim (cpr_inv_bind1 … H3) -H3 *
70   [ #V2 #T2 #HV12 #HT12 #H destruct
71     elim (IH1 … Hl1 … HTU1 … HT12 (L2.ⓑ{I}V2)) -IH1 -Hl1 -HTU1 -HT12 /2 width=1 by fqup_fpbg, lpr_pair/ -T1
72     /4 width=5 by cpcs_bind2, lpr_cpr_conf, lstas_bind, ex2_intro/
73   | #T3 #HT13 #HXT3 #H1 #H2 destruct
74     elim (IH1 … Hl1 … HTU1 … HT13 (L2.ⓓV1)) -IH1 -Hl1 -HTU1 -HT13 /2 width=1 by fqup_fpbg, lpr_pair/ -T1 -HL12 #U3 #HTU3 #HU13
75     elim (lstas_inv_lift1 … HTU3 L2 … HXT3) -T3
76     /5 width=8 by cpcs_cpr_strap1, cpcs_bind1, cpr_zeta, drop_drop, ex2_intro/
77   ]
78 | #V1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 #Hl21 #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct
79   elim (snv_inv_appl … H1) -H1 #a #W1 #W10 #U10 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HTU10
80   lapply (da_inv_flat … Hl1) -Hl1 #Hl1
81   elim (lstas_inv_appl1 … H2) -H2 #U1 #HTU1 #H destruct
82   elim (cpr_inv_appl1 … H3) -H3 *
83   [ #V2 #T2 #HV12 #HT12 #H destruct -a -l0 -W1 -W10 -U10 -HV1 -IH4 -IH3 -IH2
84     elim (IH1 … Hl1 … HTU1 … HT12 … HL12) -IH1 -Hl1 -HTU1
85     /4 width=5 by fqup_fpbg, cpcs_flat, lpr_cpr_conf, lstas_appl, ex2_intro/
86   | #b #V2 #W2 #W3 #T2 #T3 #HV12 #HW23 #HT23 #H1 #H2 destruct
87     elim (snv_inv_bind … HT1) -HT1 #HW2 #HT2
88     lapply (da_inv_bind … Hl1) -Hl1 #Hl1
89     elim (lstas_inv_bind1 … HTU1) -HTU1 #U2 #HTU2 #H destruct
90     elim (cpds_inv_abst1 … HTU10) -HTU10 #W0 #U0 #HW20 #_ #H destruct
91     lapply (cprs_div … HW10 … HW20) -W0 #HW12
92     lapply (da_sta_conf … HVW1 … Hl0) <minus_plus_m_m #H
93     elim (snv_fwd_da … HW2) #l #Hl
94     lapply (IH4 … HV1 … 1 … Hl0 W1 ?) /2 width=1 by fqup_fpbg, sta_lstas/ #HW1
95     lapply (da_cpcs_aux … IH3 IH2 … H … Hl … HW12) // -H
96     /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, sta_fpbs/ #H destruct
97     lapply (IH3 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HV2
98     lapply (IH2 … Hl0 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HV2l
99     elim (IH1 … 1 … Hl0 … W1 … HV12 … HL12) /2 width=1 by fqup_fpbg, sta_lstas/ -HVW1 #W4 #H #HW14
100     lapply (lstas_inv_SO … H) #HV2W4
101     lapply (da_sta_conf … HV2W4 … HV2l) <minus_plus_m_m #HW4l
102     lapply (IH4 … HV2 … HV2l … H) -H /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_fpbs/ #HW4
103     lapply (IH3 … HW23 … HL12) /2 width=1 by fqup_fpbg/ #HW3
104     lapply (IH2 … Hl … HW23 … HL12) /2 width=1 by fqup_fpbg/ #HW3l
105     elim (IH1 … Hl1 … HTU2 … HT23 (L2.ⓛW3)) -HTU2 /2 width=1 by fqup_fpbg, lpr_pair/ #U3 #HTU3 #HU23
106     lapply (cpcs_cpr_strap1 … HW12 … HW23) #H
107     lapply (lpr_cpcs_conf … HL12 … H) -H #H
108     lapply (cpcs_canc_sn … HW14 H) -H #HW43
109     elim (lsubsv_lstas_trans … g … HTU3 … Hl21 … (L2.ⓓⓝW3.V2)) -HTU3
110     [ #U4 #HT3U4 #HU43 -HW12 -HW3 -HW3l -W4 -IH2 -IH3 -IH4
111       @(ex2_intro … (ⓓ{b}ⓝW3.V2.U4)) /2 width=1 by lstas_bind/ -HT3U4
112       @(cpcs_canc_dx … (ⓓ{b}ⓝW3.V2.U3)) /2 width=1 by cpcs_bind_dx/ -HU43
113       @(cpcs_cpr_strap1 … (ⓐV2.ⓛ{b}W3.U3)) /2 width=1 by cpr_beta/
114       /4 width=3 by cpcs_flat, cpcs_bind2, lpr_cpr_conf/
115     | -U3
116       @(lsubsv_beta … l) /3 width=7 by fqup_fpbg/
117       #W #W0 #l0 #Hl0 #HV2W #HW30
118       lapply (lstas_sta_conf_pos … HV2W4 … HV2W) -HV2W #HW4W
119       @(lstas_cpcs_lpr_aux … IH3 IH2 IH1 … Hl0 … HW4W … Hl0 … HW30 … HW43) //
120       [ /3 width=9 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_sta_fpbs/
121       | /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_fpbs/
122       ]
123     | -IH1 -IH3 -IH4 /3 width=9 by fqup_fpbg, lpr_pair/
124     ]
125   | #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HV02 #HW02 #HT02 #H1 #H2 destruct -a -l0 -W1 -W10 -HV1 -IH4 -IH3 -IH2
126     elim (snv_inv_bind … HT1) -HT1 #_ #HT0
127     lapply (da_inv_bind … Hl1) -Hl1 #Hl1
128     elim (lstas_inv_bind1 … HTU1) -HTU1 #U0 #HTU0 #H destruct
129     elim (IH1 … Hl1 … HTU0 … HT02 (L2.ⓓW2)) -IH1 -Hl1 -HTU0 /2 width=1 by fqup_fpbg, lpr_pair/ -T0 #U2 #HTU2 #HU02
130     lapply (lpr_cpr_conf … HL12 … HV10) -HV10 #HV10
131     lapply (lpr_cpr_conf … HL12 … HW02) -L1 #HW02
132     lapply (cpcs_bind2 b … HW02 … HU02) -HW02 -HU02 #HU02
133     lapply (cpcs_flat … HV10 … HU02 Appl) -HV10 -HU02 #HU02
134     lapply (cpcs_cpr_strap1 … HU02 (ⓓ{b}W2.ⓐV2.U2) ?)
135     /4 width=3 by lstas_appl, lstas_bind, cpr_theta, ex2_intro/
136   ]
137 | #W1 #T1 #HG0 #HL0 #HT0 #H1 #l1 #l2 @(nat_ind_plus … l2) -l2 [ #_ | #l2 #_ #Hl21 ] #Hl1 #X2 #H2 #X3 #H3 #L2 #HL12 destruct -IH4 -IH3 -IH2
138   [ lapply (lstas_inv_O … H2) -H2 #H destruct -IH1 -H1 -l1 /4 width=5 by lpr_cpcs_conf, cpr_cpcs_dx, ex2_intro/ ]
139   elim (snv_inv_cast … H1) -H1 #U1 #l #_ #HT1 #_ #_ #_ -U1 -l
140   lapply (da_inv_flat … Hl1) -Hl1 #Hl1
141   lapply (lstas_inv_cast1 … H2) -H2 #HTU1
142   elim (cpr_inv_cast1 … H3) -H3
143   [ * #U2 #T2 #_ #HT12 #H destruct
144     elim (IH1 … Hl1 … HTU1 … HT12 … HL12) -IH1 -Hl1 -HTU1 -HL12
145     /3 width=3 by fqup_fpbg, lstas_cast, ex2_intro/
146   | #HT1X3
147     elim (IH1 … Hl1 … HTU1 … HT1X3 … HL12) -IH1 -Hl1 -HTU1 -HL12
148     /2 width=3 by fqup_fpbg, ex2_intro/
149   ]
150 ]
151 qed-.