]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/reducibility/ltpr_aaa.ma
a7d12a5e22c11768c2c8571e56a68a4978d30f1d
[helm.git] / matita / matita / contribs / lambda_delta / basic_2 / reducibility / ltpr_aaa.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/aaa_ltpss.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 fact aaa_ltpr_tpr_conf_aux: ∀L,T,L1,T1,A. L1 ⊢ T1 ⁝ A → L = L1 → T = T1 →
24                             ∀L2. L1 ➡ L2 → ∀T2. T1 ➡ T2 → L2 ⊢ T2 ⁝ A.
25 #L #T @(cw_wf_ind … L T) -L -T #L #T #IH
26 #L1 #T1 #A * -L1 -T1 -A
27 [ -IH #L1 #k #H1 #H2 #L2 #_ #T2 #H destruct
28   >(tpr_inv_atom1 … H) -H //
29 | #I #L1 #K1 #V1 #B #i #HLK1 #HK1 #H1 #H2 #L2 #HL12 #T2 #H destruct
30   >(tpr_inv_atom1 … H) -T2
31   lapply (ldrop_pair2_fwd_cw … HLK1 (#i)) #HKV1
32   elim (ltpr_ldrop_conf … HLK1 … HL12) -HLK1 -HL12 #X #HLK2 #H
33   elim (ltpr_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct
34   lapply (IH … HKV1 … HK1 … HK12 … HV12) // -L1 -K1 -V1 /2 width=5/
35 | #L1 #V1 #T1 #B #A #HB #HA #H1 #H2 #L2 #HL12 #X #H destruct
36   elim (tpr_inv_abbr1 … H) -H *
37   [ #V2 #T0 #T2 #HV12 #HT10 #HT02 #H destruct
38     lapply (tps_lsubs_trans … HT02 (L2.ⓓV2) ?) -HT02 /2 width=1/ #HT02
39     lapply (IH … HB … HL12 … HV12) -HB /width=5/ #HB
40     lapply (IH … HA … (L2.ⓓV2) … HT10) -IH -HA -HT10 /width=5/ -T1 /2 width=1/ -L1 -V1 /3 width=5/
41   | -B #T #HT1 #HTX
42     elim (lift_total X 0 1) #X1 #HX1
43     lapply (tpr_lift … HTX … HT1 … HX1) -T #HTX1
44     lapply (IH … HA … (L2.ⓓV1) … HTX1) /width=5/ -T1 /2 width=1/ -L1 #HA
45     @(aaa_inv_lift … HA … HX1) /2 width=1/
46   ]
47 | #L1 #V1 #T1 #B #A #HB #HA #H1 #H2 #L2 #HL12 #X #H destruct
48   elim (tpr_inv_abst1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct
49   lapply (IH … HB … HL12 … HV12) -HB /width=5/ #HB
50   lapply (IH … HA … (L2.ⓛV2) … HT12) -IH -HA -HT12 /width=5/ -T1 /2 width=1/
51 | #L1 #V1 #T1 #B #A #HV1 #HT1 #H1 #H2 #L2 #HL12 #X #H destruct
52   elim (tpr_inv_appl1 … H) -H *
53   [ #V2 #T2 #HV12 #HT12 #H destruct
54     lapply (IH … HV1 … HL12 … HV12) -HV1 -HV12 /width=5/ #HB
55     lapply (IH … HT1 … HL12 … HT12) -IH -HT1 -HL12 -HT12 /width=5/ /2 width=3/
56   | #V2 #W2 #T0 #T2 #HV12 #HT02 #H1 #H2 destruct
57     elim (aaa_inv_abst … HT1) -HT1 #B0 #A0 #HB0 #HA0 #H destruct
58     lapply (IH … HV1 … HL12 … HV12) -HV1 -HV12 /width=5/ #HB
59     lapply (IH … HB0  … HL12 W2 ?) -HB0 /width=5/ #HB0
60     lapply (IH … HA0 … (L2.ⓛW2) … HT02) -IH -HA0 -HT02 /width=5/ -T0 /2 width=1/ -L1 -V1 /4 width=7/
61   | #V0 #V2 #W0 #W2 #T0 #T2 #HV10 #HW02 #HT02 #HV02 #H1 #H2 destruct
62     elim (aaa_inv_abbr … HT1) -HT1 #B0 #HW0 #HT0
63     lapply (IH … HW0  … HL12 … HW02) -HW0 /width=5/ #HW2
64     lapply (IH … HV1 … HL12 … HV10) -HV1 -HV10 /width=5/ #HV0
65     lapply (IH … HT0 … (L2.ⓓW2) … HT02) -IH -HT0 -HT02 /width=5/ -V1 -T0 /2 width=1/ -L1 -W0 #HT2
66     @(aaa_abbr … HW2) -HW2
67     @(aaa_appl … HT2) -HT2 /3 width=7/ (**) (* explict constructors, /5 width=7/ is too slow *)
68   ]
69 | #L1 #V1 #T1 #A #HV1 #HT1 #H1 #H2 #L2 #HL12 #X #H destruct
70   elim (tpr_inv_cast1 … H) -H
71   [ * #V2 #T2 #HV12 #HT12 #H destruct
72     lapply (IH … HV1 … HL12 … HV12) -HV1 -HV12 /width=5/ #HV2
73     lapply (IH … HT1 … HL12 … HT12) -IH -HT1 -HL12 -HT12 /width=5/ -L1 -V1 -T1 /2 width=1/
74   | -HV1 #HT1X
75      lapply (IH … HT1 … HL12 … HT1X) -IH -HT1 -HL12 -HT1X /width=5/
76   ]
77 ]
78 qed.
79
80 lemma aaa_ltpr_tpr_conf: ∀L1,T1,A. L1 ⊢ T1 ⁝ A → ∀L2. L1 ➡ L2 →
81                          ∀T2. T1 ➡ T2 → L2 ⊢ T2 ⁝ A.
82 /2 width=9/ qed.
83
84 lemma aaa_ltpr_conf: ∀L1,T,A. L1 ⊢ T ⁝ A → ∀L2. L1 ➡ L2 → L2 ⊢ T ⁝ A.
85 /2 width=5/ qed.
86
87 lemma aaa_tpr_conf: ∀L,T1,A. L ⊢ T1 ⁝ A → ∀T2. T1 ➡ T2 → L ⊢ T2 ⁝ A.
88 /2 width=5/ qed.