]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2A/static/aaa_lift.ma
update in lambdadelta
[helm.git] / matita / matita / contribs / lambdadelta / basic_2A / static / aaa_lift.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_2A/substitution/drop_drop.ma".
16 include "basic_2A/static/aaa.ma".
17
18 (* ATONIC ARITY ASSIGNMENT ON TERMS *****************************************)
19
20 (* Properties on basic relocation *******************************************)
21
22 lemma aaa_lift: ∀G,L1,T1,A. ⦃G, L1⦄ ⊢ T1 ⁝ A → ∀L2,s,l,m. ⬇[s, l, m] L2 ≡ L1 →
23                 ∀T2. ⬆[l, m] T1 ≡ T2 → ⦃G, L2⦄ ⊢ T2 ⁝ A.
24 #G #L1 #T1 #A #H elim H -G -L1 -T1 -A
25 [ #G #L1 #k #L2 #s #l #m #_ #T2 #H
26   >(lift_inv_sort1 … H) -H //
27 | #I #G #L1 #K1 #V1 #B #i #HLK1 #_ #IHB #L2 #s #l #m #HL21 #T2 #H
28   elim (lift_inv_lref1 … H) -H * #Hil #H destruct
29   [ elim (drop_trans_le … HL21 … HLK1) -L1 /2 width=2 by lt_to_le/ #X #HLK2 #H
30     elim (drop_inv_skip2 … H) -H /2 width=1 by lt_plus_to_minus_r/ -Hil #K2 #V2 #HK21 #HV12 #H destruct
31     /3 width=9 by aaa_lref/
32   | lapply (drop_trans_ge … HL21 … HLK1 ?) -L1
33     /3 width=9 by aaa_lref, drop_inv_gen/
34   ]
35 | #a #G #L1 #V1 #T1 #B #A #_ #_ #IHB #IHA #L2 #s #l #m #HL21 #X #H
36   elim (lift_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct
37   /4 width=5 by aaa_abbr, drop_skip/
38 | #a #G #L1 #V1 #T1 #B #A #_ #_ #IHB #IHA #L2 #s #l #m #HL21 #X #H
39   elim (lift_inv_bind1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct
40   /4 width=5 by aaa_abst, drop_skip/
41 | #G #L1 #V1 #T1 #B #A #_ #_ #IHB #IHA #L2 #s #l #m #HL21 #X #H
42   elim (lift_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct
43   /3 width=5 by aaa_appl/
44 | #G #L1 #V1 #T1 #A #_ #_ #IH1 #IH2 #L2 #s #l #m #HL21 #X #H
45   elim (lift_inv_flat1 … H) -H #V2 #T2 #HV12 #HT12 #H destruct
46   /3 width=5 by aaa_cast/
47 ]
48 qed.
49
50 lemma aaa_inv_lift: ∀G,L2,T2,A. ⦃G, L2⦄ ⊢ T2 ⁝ A → ∀L1,s,l,m. ⬇[s, l, m] L2 ≡ L1 →
51                     ∀T1. ⬆[l, m] T1 ≡ T2 → ⦃G, L1⦄ ⊢ T1 ⁝ A.
52 #G #L2 #T2 #A #H elim H -G -L2 -T2 -A
53 [ #G #L2 #k #L1 #s #l #m #_ #T1 #H
54   >(lift_inv_sort2 … H) -H //
55 | #I #G #L2 #K2 #V2 #B #i #HLK2 #_ #IHB #L1 #s #l #m #HL21 #T1 #H
56   elim (lift_inv_lref2 … H) -H * #Hil #H destruct
57   [ elim (drop_conf_lt … HL21 … HLK2) -L2 /3 width=9 by aaa_lref/
58   | lapply (drop_conf_ge … HL21 … HLK2 ?) -L2 /3 width=9 by aaa_lref/
59   ]
60 | #a #G #L2 #V2 #T2 #B #A #_ #_ #IHB #IHA #L1 #s #l #m #HL21 #X #H
61   elim (lift_inv_bind2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
62   /4 width=5 by aaa_abbr, drop_skip/
63 | #a #G #L2 #V2 #T2 #B #A #_ #_ #IHB #IHA #L1 #s #l #m #HL21 #X #H
64   elim (lift_inv_bind2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
65   /4 width=5 by aaa_abst, drop_skip/
66 | #G #L2 #V2 #T2 #B #A #_ #_ #IHB #IHA #L1 #s #l #m #HL21 #X #H
67   elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
68   /3 width=5 by aaa_appl/
69 | #G #L2 #V2 #T2 #A #_ #_ #IH1 #IH2 #L1 #s #l #m #HL21 #X #H
70   elim (lift_inv_flat2 … H) -H #V1 #T1 #HV12 #HT12 #H destruct
71   /3 width=5 by aaa_cast/
72 ]
73 qed-.