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/static/lsubd_da.ma".
16 include "basic_2/computation/cpds_cpds.ma".
17 include "basic_2/dynamic/snv_aaa.ma".
18 include "basic_2/dynamic/snv_cpcs.ma".
20 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
22 (* Properties on degree assignment for terms ********************************)
24 fact da_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 = G1 → L0 = L1 → T0 = T1 → IH_da_cpr_lpr h g G1 L1 T1.
28 #h #g #G0 #L0 #T0 #IH2 #IH1 #G1 #L1 * * [|||| * ]
29 [ #k #_ #_ #_ #_ #l #H2 #X3 #H3 #L2 #_ -IH2 -IH1
30 lapply (da_inv_sort … H2) -H2
31 lapply (cpr_inv_sort1 … H3) -H3 #H destruct /2 width=1 by da_sort/
32 | #i #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH2
33 elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #H #HX0
34 elim (da_inv_lref … H2) -H2 * #K1 [ #V1 | #W1 #l1 ] #HLK1 [ #HV1 | #HW1 #H ] destruct
35 lapply (ldrop_mono … H … HLK1) -H #H destruct
36 elim (cpr_inv_lref1 … H3) -H3
38 lapply (fqup_lref … G1 … HLK1)
39 elim (lpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #H #HLK2
40 elim (lpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
41 /4 width=10 by da_ldef, da_ldec, fqup_fpbg/
42 |2,4: * #K0 #V0 #W0 #H #HVW0 #HW0
43 lapply (ldrop_mono … H … HLK1) -H #H destruct
44 lapply (fqup_lref … G1 … HLK1)
45 elim (lpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #H #HLK2
46 elim (lpr_inv_pair1 … H) -H #K2 #V2 #HK12 #_ #H destruct
47 lapply (ldrop_fwd_drop2 … HLK2) -V2
48 /4 width=8 by da_lift, fqup_fpbg/
50 | #p #_ #_ #HT0 #H1 destruct -IH2 -IH1
51 elim (snv_inv_gref … H1)
52 | #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH2
53 elim (snv_inv_bind … H1) -H1 #_ #HT1
54 lapply (da_inv_bind … H2) -H2
55 elim (cpr_inv_bind1 … H3) -H3 *
56 [ #V2 #T2 #HV12 #HT12 #H destruct
57 /4 width=9 by da_bind, fqup_fpbg, lpr_pair/
58 | #T2 #HT12 #HT2 #H1 #H2 destruct
59 /4 width=11 by da_inv_lift, fqup_fpbg, lpr_pair, ldrop_drop/
61 | #V1 #T1 #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct
62 elim (snv_inv_appl … H1) -H1 #b0 #W1 #W0 #T0 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HT10
63 lapply (da_inv_flat … H2) -H2 #Hl
64 elim (cpr_inv_appl1 … H3) -H3 *
65 [ #V2 #T2 #HV12 #HT12 #H destruct -IH2 /4 width=7 by da_flat, fqup_fpbg/
66 | #b #V2 #W #W2 #U1 #U2 #HV12 #HW2 #HU12 #H1 #H2 destruct
67 elim (snv_inv_bind … HT1) -HT1 #HW #HU1
68 lapply (da_inv_bind … Hl) -Hl #Hl
69 elim (cpds_inv_abst1 … HT10) -HT10 #W3 #U3 #HW3 #_ #H destruct -U3
70 lapply (cprs_div … HW3 … HW10) -W3 #HWW1
71 lapply (da_sta_conf … HVW1 … Hl0) <minus_plus_m_m #H
72 elim (snv_fwd_da … HW) #l1 #Hl1
73 lapply (snv_lstas_aux … IH2 … HV1 … 1 … Hl0 W1 ?) /2 width=2 by fqup_fpbg, sta_lstas/ #HW1
74 lapply (da_cpcs_aux … IH2 IH1 … Hl1 … H … HWW1) -H
75 /3 width=5 by fpbg_fpbs_trans, fqup_fpbg, sta_fpbs/ #H destruct
76 lapply (IH1 … HV1 … Hl0 … HV12 … HL12) -HV1 -Hl0 -HV12 [ /2 by fqup_fpbg/ ] #Hl0
77 lapply (IH1 … Hl1 … HW2 … HL12) -Hl1 // /2 width=1 by fqup_fpbg/ -HW
78 lapply (IH1 … HU1 … Hl … HU12 (L2.ⓛW2) ?) -IH1 -HU1 -Hl -HU12 [1,2: /2 by fqup_fpbg, lpr_pair/ ] -HL12 -HW2
79 /4 width=6 by da_bind, lsubd_da_trans, lsubd_abbr/
80 | #b #V #V2 #W #W2 #U1 #U2 #HV1 #HV2 #HW2 #HU12 #H1 #H2 destruct -IH2 -V -W0 -T0 -l0 -HV1 -HVW1
81 elim (snv_inv_bind … HT1) -HT1 #_
82 lapply (da_inv_bind … Hl) -Hl
83 /5 width=9 by da_bind, da_flat, fqup_fpbg, lpr_pair/
85 | #W1 #T1 #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH2
86 elim (snv_inv_cast … H1) -H1 #U1 #l0 #HW1 #HT1 #Hl0 #HTU1 #HUW1
87 lapply (da_inv_flat … H2) -H2 #Hl
88 elim (cpr_inv_cast1 … H3) -H3
89 [ * #W2 #T2 #HW12 #HT12 #H destruct /4 width=7 by da_flat, fqup_fpbg/
90 | /3 width=7 by fqup_fpbg/