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