]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/reduction/lpx_aaa.ma
e21810ea582ec56adb09cc452c207c4a37982768
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / reduction / lpx_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_lift.ma".
16 include "basic_2/static/lsuba_aaa.ma".
17 include "basic_2/reduction/lpx_ldrop.ma".
18
19 (* SN EXTENDED PARALLEL REDUCTION FOR LOCAL ENVIRONMENTS ********************)
20
21 (* Properties on atomic arity assignment for terms **************************)
22
23 (* Note: lemma 500 *)
24 lemma aaa_cpx_lpx_conf: ∀h,g,G,L1,T1,A. ⦃G, L1⦄ ⊢ T1 ⁝ A →
25                         ∀T2. ⦃G, L1⦄ ⊢ T1 ➡[h, g] T2 →
26                         ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → ⦃G, L2⦄ ⊢ T2 ⁝ A.
27 #h #g #G #L1 #T1 #A #H elim H -G -L1 -T1 -A
28 [ #g #L1 #k #X #H
29   elim (cpx_inv_sort1 … H) -H // * //
30 | #I #G #L1 #K1 #V1 #B #i #HLK1 #_ #IHV1 #X #H #L2 #HL12
31   elim (cpx_inv_lref1 … H) -H
32   [ #H destruct
33     elim (lpx_ldrop_conf … HLK1 … HL12) -L1 #X #H #HLK2
34     elim (lpx_inv_pair1 … H) -H #K2 #V2 #HK12 #HV12 #H destruct /3 width=6/
35   | * #J #Y #Z #V2 #H #HV12 #HV2
36     lapply (ldrop_mono … H … HLK1) -H #H destruct
37     elim (lpx_ldrop_conf … HLK1 … HL12) -L1 #Z #H #HLK2
38     elim (lpx_inv_pair1 … H) -H #K2 #V0 #HK12 #_ #H destruct
39     lapply (ldrop_fwd_ldrop2 … HLK2) -V0 /3 width=7/
40   ]
41 | #a #G #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12
42   elim (cpx_inv_abbr1 … H) -H *
43   [ #V2 #T2 #HV12 #HT12 #H destruct /4 width=2/
44   | #T2 #HT12 #HT2 #H destruct -IHV1
45     @(aaa_inv_lift … (L2.ⓓV1) … HT2) -HT2 /2 width=1/ /3 width=1/
46   ]
47 | #a #G #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12
48   elim (cpx_inv_abst1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct /4 width=1/
49 | #G #L1 #V1 #T1 #B #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12
50   elim (cpx_inv_appl1 … H) -H *
51   [ #V2 #T2 #HV12 #HT12 #H destruct /3 width=3/
52   | #b #V2 #W1 #W2 #U1 #U2 #HV12 #HW12 #HU12 #H1 #H2 destruct
53     lapply (IHV1 … HV12 … HL12) -IHV1 -HV12 #HV2
54     lapply (IHT1 (ⓛ{b}W2.U2) … HL12) -IHT1 /2 width=1/ -L1 #H
55     elim (aaa_inv_abst … H) -H #B0 #A0 #HW1 #HU2 #H destruct
56     lapply (lsuba_aaa_trans … HU2 (L2.ⓓⓝW2.V2) ?) -HU2 /3 width=3/
57   | #b #V #V2 #W1 #W2 #U1 #U2 #HV1 #HV2 #HW12 #HU12 #H1 #H2 destruct
58     lapply (aaa_lift G L2 … B … (L2.ⓓW2) … HV2) -HV2 /2 width=1/ #HV2
59     lapply (IHT1 (ⓓ{b}W2.U2) … HL12) -IHT1 /2 width=1/ -L1 #H
60     elim (aaa_inv_abbr … H) -H /3 width=3/
61   ]
62 | #G #L1 #V1 #T1 #A #_ #_ #IHV1 #IHT1 #X #H #L2 #HL12
63   elim (cpx_inv_cast1 … H) -H
64   [ * #V2 #T2 #HV12 #HT12 #H destruct /3 width=1/
65   | -IHV1 /2 width=1/
66   | -IHT1 /2 width=1/
67   ]
68 ]
69 qed-.
70
71 lemma aaa_cpx_conf: ∀h,g,G,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A → ∀T2. ⦃G, L⦄ ⊢ T1 ➡[h, g] T2 → ⦃G, L⦄ ⊢ T2 ⁝ A.
72 /2 width=7 by aaa_cpx_lpx_conf/ qed-.
73
74 lemma aaa_lpx_conf: ∀h,g,G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → ∀L2. ⦃G, L1⦄ ⊢ ➡[h, g] L2 → ⦃G, L2⦄ ⊢ T ⁝ A.
75 /2 width=7 by aaa_cpx_lpx_conf/ qed-.
76
77 lemma aaa_cpr_conf: ∀G,L,T1,A. ⦃G, L⦄ ⊢ T1 ⁝ A → ∀T2. ⦃G, L⦄ ⊢ T1 ➡ T2 → ⦃G, L⦄ ⊢ T2 ⁝ A.
78 /3 width=5 by aaa_cpx_conf, cpr_cpx/ qed-.
79
80 lemma aaa_lpr_conf: ∀G,L1,T,A. ⦃G, L1⦄ ⊢ T ⁝ A → ∀L2. ⦃G, L1⦄ ⊢ ➡ L2 → ⦃G, L2⦄ ⊢ T ⁝ A.
81 /3 width=5 by aaa_lpx_conf, lpr_lpx/ qed-.