]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/etc/cpr/ltpr_aaa.etc
- basic_2: induction for preservation results now uses supclosure
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / etc / cpr / ltpr_aaa.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/static/aaa_ltpss_dx.ma".
16 include "basic_2/static/lsuba_aaa.ma".
17 include "basic_2/reducibility/ltpr_ldrop.ma".
18
19 (* CONTEXT-FREE PARALLEL REDUCTION ON LOCAL ENVIRONMENTS ********************)
20
21 (* Properties about atomic arity assignment on terms ************************)
22
23 lemma aaa_ltpr_tpr_conf: ∀L1,T1,A. L1 ⊢ T1 ⁝ A → ∀L2. L1 ➡ L2 →
24                          ∀T2. T1 ➡ T2 → L2 ⊢ T2 ⁝ A.
25 #L1 #T1 @(f2_ind … fw … L1 T1) -L1 -T1 #n #IH #L1 * *
26 [1,2,3:
27   #i #Hn #X #H1 #L2 #HL12 #Y #H2 destruct
28   >(tpr_inv_atom1 … H2) -Y
29 |4,5: [ #a ] * #V1 #T1 #Hn #X #H1 #L2 #HL12 #Y #H2 destruct
30 ]
31 [ >(aaa_inv_sort … H1) -X //
32 | elim (aaa_inv_lref … H1) #I #K1 #V1 #HLK1 #HA
33   lapply (ldrop_pair2_fwd_fw … HLK1 (#i)) #HKV1
34   elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #Y #H #HLK2
35   elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
36   lapply (IH … HKV1 … HA … HK12 … HV12) -L1 -K1 -V1 /2 width=5/
37 | elim (aaa_inv_gref … H1)
38 | elim (aaa_inv_abbr … H1) -H1 #B #HB #HA
39   elim (tpr_inv_abbr1 … H2) -H2 *
40   [ #V2 #T #T2 #HV12 #HT1 #HT2 #H destruct
41     lapply (tps_lsubr_trans … HT2 (L2.ⓓV2) ?) -HT2 /2 width=1/ #HT2
42     lapply (IH … HB … HL12 … HV12) -HB /width=5/ #HB
43     lapply (IH … HA … (L2.ⓓV2) … HT1) -IH -HA -HT1 /width=5/ -T1 /2 width=1/ -L1 -V1 /3 width=5/
44   | -B #T #HT1 #HXT #H destruct
45     lapply (IH … HA … (L2.ⓓV1) … HT1) /width=5/ -T1 /2 width=1/ -L1 #HA
46     @(aaa_inv_lift … HA … HXT) /2 width=1/
47   ]
48 | elim (aaa_inv_abst … H1) -H1 #B #A #HB #HA #H destruct
49   elim (tpr_inv_abst1 … H2) -H2 #V2 #T2 #HV12 #HT12 #H destruct
50   lapply (IH … HB … HL12 … HV12) -HB /width=5/ #HB
51   lapply (IH … HA … (L2.ⓛV2) … HT12) -IH -HA -HT12 /width=5/ -T1 /2 width=1/
52 | elim (aaa_inv_appl … H1) -H1 #B #HB #HA
53   elim (tpr_inv_appl1 … H2) -H2 *
54   [ #V2 #T2 #HV12 #HT12 #H destruct
55     lapply (IH … HB … HL12 … HV12) -HB -HV12 /width=5/ #HB
56     lapply (IH … HA … HL12 … HT12) -IH -HA -HL12 -HT12 /width=5/ /2 width=3/
57   | #b #V2 #W2 #T0 #T2 #HV12 #HT02 #H1 #H2 destruct
58     elim (aaa_inv_abst … HA) -HA #B0 #A0 #HB0 #HA0 #H destruct
59     lapply (IH … HB … HL12 … HV12) -HB -HV12 /width=5/ #HB
60     lapply (IH … HB0  … HL12 W2 ?) -HB0 /width=5/ #HB0
61     lapply (IH … HA0 … (L2.ⓛW2) … HT02) -IH -HA0 -HT02 // /2 width=1/ -T0 -L1 -V1 /4 width=7/
62   | #b #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HW02 #HT02 #HV02 #H1 #H2 destruct
63     elim (aaa_inv_abbr … HA) -HA #B0 #HW0 #HT0
64     lapply (IH … HW0  … HL12 … HW02) -HW0 /width=5/ #HW2
65     lapply (IH … HB … HL12 … HV10) -HB -HV10 /width=5/ #HV0
66     lapply (IH … HT0 … (L2.ⓓW2) … HT02) -IH -HT0 -HT02 // /2 width=1/ -V1 -T0 -L1 -W0 #HT2
67     @(aaa_abbr … HW2) -HW2
68     @(aaa_appl … HT2) -HT2 /3 width=7/ (**) (* explict constructors, /5 width=7/ is too slow *)
69   ]
70 | elim (aaa_inv_cast … H1) -H1 #HV1 #HT1
71   elim (tpr_inv_cast1 … H2) -H2
72   [ * #V2 #T2 #HV12 #HT12 #H destruct
73     lapply (IH … HV1 … HL12 … HV12) -HV1 -HV12 /width=5/ #HV2
74     lapply (IH … HT1 … HL12 … HT12) -IH -HT1 -HL12 -HT12 /width=5/ -L1 -V1 -T1 /2 width=1/
75   | -HV1 #HT1X
76      lapply (IH … HT1 … HL12 … HT1X) -IH -HT1 -HL12 -HT1X /width=5/
77   ]
78 ]
79 qed.
80
81 lemma aaa_ltpr_conf: ∀L1,T,A. L1 ⊢ T ⁝ A → ∀L2. L1 ➡ L2 → L2 ⊢ T ⁝ A.
82 /2 width=5/ qed.
83
84 lemma aaa_tpr_conf: ∀L,T1,A. L ⊢ T1 ⁝ A → ∀T2. T1 ➡ T2 → L ⊢ T2 ⁝ A.
85 /2 width=5/ qed.