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/dynamic/snv_lift.ma".
16 include "basic_2/dynamic/snv_cpcs.ma".
17 include "basic_2/dynamic/lsubsv_snv.ma".
19 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
21 (* Properties on context-free parallel reduction for local environments *****)
23 fact snv_cpx_lpx_aux: ∀h,g,G0,L0,T0.
24 (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_lstas_cpr_lpr h g G1 L1 T1) →
25 (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_da_cpr_lpr h g G1 L1 T1) →
26 (∀G1,L1,T1. ⦃G0, L0, T0⦄ >≡[h, g] ⦃G1, L1, T1⦄ → IH_snv_cpx_lpx h g G1 L1 T1) →
27 ∀G1,L1,T1. G0 = G1 → L0 = L1 → T0 = T1 → IH_snv_cpx_lpx h g G1 L1 T1.
28 #h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ]
29 [ #k #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #_ destruct -IH3 -IH2 -IH1 -H1
30 elim (cpx_inv_sort1 … H2) -H2 // * //
31 | #i #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct -IH3 -IH2
32 elim (snv_inv_lref … H1) -H1 #I #K1 #V1 #HLK1 #HV1
33 elim (lpx_ldrop_conf … HLK1 … HL12) -HL12 #X #H #HLK2
34 elim (lpx_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
35 lapply (fqup_lref … G1 … HLK1) #HKL
36 elim (cpx_inv_lref1 … H2) -H2
37 [ #H destruct -HLK1 /4 width=10 by fqup_fpbg, snv_lref/
38 | * #I0 #K0 #V0 #W0 #H #HVW0 #W0 -HV12
39 lapply (ldrop_mono … H … HLK1) -HLK1 -H #H destruct
40 lapply (ldrop_fwd_drop2 … HLK2) -HLK2 /4 width=8 by fqup_fpbg, snv_lift/
42 | #p #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct -IH3 -IH2 -IH1
43 elim (snv_inv_gref … H1)
44 | #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct -IH3 -IH2
45 elim (snv_inv_bind … H1) -H1 #HV1 #HT1
46 elim (cpx_inv_bind1 … H2) -H2 *
47 [ #V2 #T2 #HV12 #HT12 #H destruct /4 width=8 by fqup_fpbg, snv_bind, lpx_pair/
48 | #T2 #HT12 #HXT2 #H1 #H2 destruct -HV1
49 /4 width=10 by fqup_fpbg, snv_inv_lift, lpx_pair, ldrop_drop/
51 | #V1 #T1 #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct
52 elim (snv_inv_appl … H1) -H1 #a #W10 #W1 #U1 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HTU1
53 elim (cpx_inv_appl1 … H2) -H2 *
54 [ #V2 #T2 #HV12 #HT12 #H destruct
55 lapply (IH1 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HV2
56 lapply (IH1 … HT12 … HL12) /2 width=1 by fqup_fpbg/ #HT2
57 (* lapply (IH2 … Hl0 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #H2l0
58 elim (sta_cpr_lpr_aux … IH3 … Hl0 … HVW1 … HV12 … HL12) -Hl0 -HVW1 -HV12 /2 width=1 by fqup_fpbg/ -HV1 #W2 #HVW2 #HW12
59 elim (cpds_cpr_lpr_aux … IH2 IH3 … HTU1 … HT12 … HL12) /2 width=1 by fqup_fpbg/ -HT12 -HTU1 #X #HTU2 #H
60 elim (cprs_inv_abst1 … H) -H #W20 #U2 #HW120 #_ #H destruct
61 lapply (lpr_cprs_conf … HL12 … HW10) -L1 #HW10
62 lapply (cpcs_cprs_strap1 … HW10 … HW120) -W1 #HW120
63 lapply (cpcs_canc_sn … HW12 HW120) -W10 #HW20
64 elim (cpcs_inv_cprs … HW20) -HW20 #W0 #HW20 #HW200
65 lapply (cpds_cprs_trans … (ⓛ{a}W0.U2) HTU2 ?)
66 /2 width=7 by snv_appl, cprs_bind/ *)
67 | #b #V2 #W20 #W2 #T20 #T2 #HV12 #HW202 #HT202 #H1 #H2 destruct
68 elim (snv_inv_bind … HT1) -HT1 #HW20 #HT20
69 elim (cpds_inv_abst1 … HTU1) -HTU1 #W30 #T30 #HW230 #_ #H destruct -T30
70 lapply (cprs_div … HW10 … HW230) -W30 #HW120
71 lapply (snv_sta_aux … IH1 … Hl0 … HVW1) /2 width=1 by fqup_fpbg/ #HW10
72 lapply (da_sta_conf … HVW1 … Hl0) <minus_plus_m_m #HlW10
73 elim (snv_fwd_da … HW20) #l #Hl
74 lapply (da_cpcs_aux … IH1 IH2 … HlW10 … Hl … HW120) // -HlW10
75 /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, sta_fpbs/ #H destruct
76 (* lapply (IH2 … Hl0 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #HlV2
77 lapply (IH2 … Hl … HW202 … HL12) /2 width=1 by fqup_fpbg/ #HlW2
78 elim (sta_cpr_lpr_aux … IH3 … Hl0 … HVW1 … HV12 … HL12) /2 width=1 by fqup_fpbg/ #W3 #HV2W3 #HW103
79 lapply (da_sta_conf … HV2W3 … HlV2) <minus_plus_m_m #HlW3
80 lapply (cpcs_cpr_strap1 … HW120 … HW202) -HW120 #HW102
81 lapply (lpr_cpcs_conf … HL12 … HW102) -HW102 #HW102
82 lapply (cpcs_canc_sn … HW103 … HW102) -W10 #HW32
83 lapply (IH1 … HV12 … HL12) /2 width=1 by fqup_fpbg/ -HV1 #HV2
84 lapply (IH1 … HW202 … HL12) /2 width=1 by fqup_fpbg/ -HW20 #HW2
85 lapply (IH1 … HT20 … HT202 … (L2.ⓛW2) ?) /2 width=1 by fqup_fpbg, lpr_pair/ -HT20 #HT2
86 lapply (snv_sta_aux … IH4 … HlV2 … HV2W3)
87 /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_fpbs/ #HW3
88 lapply (lsubsv_snv_trans … HT2 (L2.ⓓⓝW2.V2) ?) -HT2 /3 width=3 by snv_bind, snv_cast/
89 @(lsubsv_abbr … l) /3 width=7 by fqup_fpbg/ #W #W0 #l0 #Hl0 #HV2W #HW20
90 lapply (lstas_sta_conf_pos … HV2W3 … HV2W) -HV2W #HW3W
91 @(lstas_cpcs_lpr_aux … IH1 IH2 IH3 … HlW3 … HW3W … HlW2 … HW20 … HW32) //
92 [ /3 width=9 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_sta_fpbs/
93 | /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, cpr_lpr_fpbs/
95 | #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HV02 #HW02 #HT02 #H1 #H2 destruct
96 elim (snv_inv_bind … HT1) -HT1 #HW0 #HT0
97 elim (cpds_inv_abbr_abst … HTU1) -HTU1 #X #HTU0 #HX #H destruct
98 elim (lift_inv_bind1 … HX) -HX #W3 #U3 #HW13 #_ #H destruct
99 (* lapply (lpr_cpr_conf … HL12 … HW10) -HW10 #HW10
100 elim (cpds_cpr_lpr_aux … IH2 IH3 … HTU0 … HT02 (L2.ⓓW2)) /2 width=1 by fqup_fpbg, lpr_pair/ -HTU0 #X #HTU2 #H
101 elim (cprs_inv_abst1 … H) -H #W #U2 #HW1 #_ #H destruct -U3
102 elim (sta_cpr_lpr_aux … IH3 … HVW1 … HV10 … HL12) /2 width=2 by fqup_fpbg/ -IH3 -HVW1 #X #H1 #H2
103 lapply (cpcs_canc_sn … H2 HW10) -W10 #H2
104 elim (lift_total X 0 1) #W20 #H3
105 lapply (sta_lift … H1 (L2.ⓓW2) … HV02 … H3) /2 width=2 by ldrop_drop/ -H1 #HVW20
106 lapply (cpcs_lift … (L2.ⓓW2) … H3 … HW13 H2) /2 width=2 by ldrop_drop/ -HW13 -H3 -H2 #HW320
107 lapply (cpcs_cprs_strap1 … HW320 … HW1) -W3 #HW20
108 elim (cpcs_inv_cprs … HW20) -HW20 #W3 #HW203 #HW3
109 lapply (cpds_cprs_trans … (ⓛ{a}W3.U2) HTU2 ?) /2 width=1 by cprs_bind/ -HW3 -HTU2 #HTU2
110 lapply (IH2 … Hl0 … HV10 … HL12) /2 width=1 by fqup_fpbg/ -IH2 -Hl0 #Hl0
111 lapply (da_lift … Hl0 (L2.ⓓW2) … HV02) /2 width=2 by ldrop_drop/ -Hl0 #Hl0
112 lapply (IH1 … HW02 … HL12) /2 width=1 by fqup_fpbg/ -HW0 #HW2
113 lapply (IH1 … HV10 … HL12) /2 width=1 by fqup_fpbg/ -HV1 -HV10 #HV0
114 lapply (IH1 … HT02 (L2.ⓓW2) ?) /2 width=1 by fqup_fpbg, lpr_pair/ -L1 #HT2
115 lapply (snv_lift … HV0 (L2.ⓓW2) … HV02) /3 width=7 by snv_bind, snv_appl, ldrop_drop/ *)
117 | #W1 #T1 #HG0 #HL0 #HT0 #H1 #X #H2 #L2 #HL12 destruct
118 elim (snv_inv_cast … H1) -H1 #U1 #l0 #HW1 #HT1 #Hl0 #HTU1 #HUW1
119 elim (cpx_inv_cast1 … H2) -H2
120 [ * #W2 #T2 #HW12 #HT12 #H destruct
121 (* lapply (cpcs_cprs_strap1 … HUW1 W2 ?) /2 width=1 by cpr_cprs/ -HUW1 #H1
122 *) lapply (IH1 … HW12 … HL12) /2 width=1 by fqup_fpbg/ -HW1 -HW12 #HW2
123 lapply (IH1 … HT12 … HL12) /2 width=1 by fqup_fpbg/ -IH1 #HT2
124 (* elim (sta_cpr_lpr_aux … IH3 … Hl0 … HTU1 … HT12 … HL12) /2 width=2 by fqup_fpbg/ -IH3 -HTU1 #U2 #HTU2 #HU12
125 lapply (IH2 … Hl0 … HT12 … HL12) /2 width=1 by fqup_fpbg/ -IH2 -HT1 -HT12 -Hl0 #Hl0
126 /4 width=7 by snv_cast, lpr_cpcs_conf, cpcs_canc_sn/ *)
127 | #H -IH3 -IH2 -HW1 -HTU1 -HUW1
128 lapply (IH1 … H … HL12) -IH1 -H -HL12 /2 width=1 by fqup_fpbg/
129 | #H -IH3 -IH2 -HTU1 -HUW1
130 lapply (IH1 … H … HL12) -IH1 -H -HL12 /2 width=1 by fqup_fpbg/
135 snv_lstas, snv_cpr_lpr