]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/snv_da_lpr.ma
- bug fix in the induction for the closure property
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / snv_da_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/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".
19
20 (* STRATIFIED NATIVE VALIDITY FOR TERMS *************************************)
21
22 (* Properties on degree assignment for terms ********************************)
23
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_lsstas 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 = G1 → L0 = L1 → T0 = T1 → IH_da_cpr_lpr h g G1 L1 T1.
29 #h #g #G0 #L0 #T0 #IH3 #IH2 #IH1 #G1 #L1 * * [|||| * ]
30 [ #k #_ #_ #_ #_ #l #H2 #X3 #H3 #L2 #_ -IH3 -IH2 -IH1
31   lapply (da_inv_sort … H2) -H2
32   lapply (cpr_inv_sort1 … H3) -H3 #H destruct /2 width=1/
33 | #i #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH3 -IH2
34   elim (snv_inv_lref … H1) -H1 #I0 #K0 #X0 #H #HX0
35   elim (da_inv_lref … H2) -H2 * #K1 [ #V1 | #W1 #l1 ] #HLK1 [ #HV1 | #HW1 #H ] destruct
36   lapply (ldrop_mono … H … HLK1) -H #H destruct
37   elim (cpr_inv_lref1 … H3) -H3
38   [1,3: #H destruct
39     lapply (fqup_lref … G1 … HLK1)
40     elim (lpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #H #HLK2
41     elim (lpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
42     /4 width=10 by da_ldef, da_ldec, fqup_fpbr/
43   |2,4: * #K0 #V0 #W0 #H #HVW0 #HW0
44     lapply (ldrop_mono … H … HLK1) -H #H destruct
45     lapply (fqup_lref … G1 … HLK1)
46     elim (lpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #H #HLK2
47     elim (lpr_inv_pair1 … H) -H #K2 #V2 #HK12 #_ #H destruct
48     lapply (ldrop_fwd_ldrop2 … HLK2) -V2
49     /4 width=7 by da_lift, fqup_fpbr/
50   ]
51 | #p #_ #_ #HT0 #H1 destruct -IH3 -IH2 -IH1
52   elim (snv_inv_gref … H1)
53 | #a #I #V1 #T1 #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH2
54   elim (snv_inv_bind … H1) -H1 #_ #HT1
55   lapply (da_inv_bind … H2) -H2
56   elim (cpr_inv_bind1 … H3) -H3 *
57   [ #V2 #T2 #HV12 #HT12 #H destruct
58     /4 width=9 by da_bind, fqup_fpbr, lpr_pair/
59   | #T2 #HT12 #HT2 #H1 #H2 destruct
60     /4 width=11 by da_inv_lift, fqup_fpbr, lpr_pair, ldrop_ldrop/
61   ]
62 | #V1 #T1 #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct
63   elim (snv_inv_appl … H1) -H1 #b0 #W1 #W0 #T0 #l0 #HV1 #HT1 #Hl0 #HVW1 #HW10 #HT10
64   lapply (da_inv_flat … H2) -H2 #Hl
65   elim (cpr_inv_appl1 … H3) -H3 *
66   [ #V2 #T2 #HV12 #HT12 #H destruct -IH3 -IH2 /4 width=7 by da_flat, fqup_fpbr/
67   | #b #V2 #W #W2 #U1 #U2 #HV12 #HW2 #HU12 #H1 #H2 destruct
68     elim (snv_inv_bind … HT1) -HT1 #HW #HU1
69     lapply (da_inv_bind … Hl) -Hl #Hl
70     elim (cpds_inv_abst1 … HT10) -HT10 #W3 #U3 #HW3 #_ #H destruct -U3
71     lapply (cprs_div … HW3 … HW10) -W3 #HWW1
72     lapply (ssta_da_conf … HVW1 … Hl0) <minus_plus_m_m #H
73     elim (snv_fwd_da … HW) #l1 #Hl1
74     lapply (IH3 … HV1 … 1 … Hl0 W1 ?) /2 width=2 by fqup_fpbr, ssta_lsstas/ #HW1
75     lapply (da_cpcs_aux … IH2 IH1 … Hl1 … H … HWW1) -H
76     /3 width=5 by fpbr_fpbs_trans, fqup_fpbr, ssta_fpbs/ #H destruct
77     lapply (IH1 … HV1 … Hl0 … HV12 … HL12) -HV1 -Hl0 -HV12 [ /2 by fqup_fpbr/ ] #Hl0
78     lapply (IH1 … Hl1 … HW2 … HL12) -Hl1 // /2 width=1 by fqup_fpbr/ -HW
79     lapply (IH1 … HU1 … Hl … HU12 (L2.ⓛW2) ?) -IH1 -HU1 -Hl -HU12 [1,2: /2 by fqup_fpbr, lpr_pair/ ] -HL12 -HW2
80     /4 width=6 by da_bind, lsubd_da_trans, lsubd_abbr/
81   | #b #V #V2 #W #W2 #U1 #U2 #HV1 #HV2 #HW2 #HU12 #H1 #H2 destruct -IH3 -IH2 -V -W0 -T0 -l0 -HV1 -HVW1
82     elim (snv_inv_bind … HT1) -HT1 #_
83     lapply (da_inv_bind … Hl) -Hl
84     /5 width=9 by da_bind, da_flat, fqup_fpbr, lpr_pair/
85   ]
86 | #W1 #T1 #HG0 #HL0 #HT0 #H1 #l #H2 #X3 #H3 #L2 #HL12 destruct -IH3 -IH2
87   elim (snv_inv_cast … H1) -H1 #U1 #l0 #HW1 #HT1 #Hl0 #HTU1 #HUW1
88   lapply (da_inv_flat … H2) -H2 #Hl
89   elim (cpr_inv_cast1 … H3) -H3
90   [ * #W2 #T2 #HW12 #HT12 #H destruct /4 width=7 by da_flat, fqup_fpbr/
91   | /3 width=7 by fqup_fpbr/
92   ]
93 ]
94 qed-.