]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/substitution/ldrop_append.ma
- we introduced the pointer_step rc in the perspective of proving
[helm.git] / matita / matita / contribs / lambda_delta / basic_2 / substitution / ldrop_append.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/substitution/ldrop.ma".
16
17 (* DROPPING *****************************************************************)
18
19 (* Properties on append for local environments ******************************)
20
21 fact ldrop_O1_append_sn_le_aux: ∀L1,L2,d,e. ⇩[d, e] L1 ≡ L2 → 
22                                 d = 0 → e ≤ |L1| →
23                                 ∀L. ⇩[0, e] L @@ L1 ≡ L @@ L2.
24 #L1 #L2 #d #e #H elim H -L1 -L2 -d -e normalize // /4 width=1/
25 #d #e #_ #H #L -d
26 lapply (le_n_O_to_eq … H) -H //
27 qed-.
28
29 lemma ldrop_O1_append_sn_le: ∀L1,L2,e. ⇩[0, e] L1 ≡ L2 → e ≤ |L1| →
30                              ∀L. ⇩[0, e] L @@ L1 ≡ L @@ L2.
31 /2 width=3 by ldrop_O1_append_sn_le_aux/ qed.
32
33 (* Inversion lemmas on append for local environments ************************)
34
35 lemma ldrop_O1_inv_append1_ge: ∀K,L1,L2,e. ⇩[0, e] L1 @@ L2 ≡ K →
36                                |L2| ≤ e → ⇩[0, e - |L2|] L1 ≡ K.
37 #K #L1 #L2 elim L2 -L2 normalize //
38 #L2 #I #V #IHL2 #e #H #H1e
39 elim (ldrop_inv_O1 … H) -H * #H2e #HL12 destruct
40 [ lapply (le_n_O_to_eq … H1e) -H1e -IHL2
41   >commutative_plus normalize #H destruct
42 | <minus_plus >minus_minus_comm /3 width=1/
43 ]
44 qed-.
45
46 lemma ldrop_O1_inv_append1_le: ∀K,L1,L2,e. ⇩[0, e] L1 @@ L2 ≡ K → e ≤ |L2| →
47                                ∀K2. ⇩[0, e] L2 ≡ K2 → K = L1 @@ K2.
48 #K #L1 #L2 elim L2 -L2 normalize
49 [ #e #H1 #H2 #K2 #H3
50   lapply (le_n_O_to_eq … H2) -H2 #H2
51   lapply (ldrop_inv_atom1 … H3) -H3 #H3 destruct
52   >(ldrop_inv_refl … H1) -H1 //
53 | #L2 #I #V #IHL2 #e @(nat_ind_plus … e) -e [ -IHL2 ]
54   [ #H1 #_ #K2 #H2
55     lapply (ldrop_inv_refl … H1) -H1 #H1
56     lapply (ldrop_inv_refl … H2) -H2 #H2 destruct //
57   | #e #_ #H1 #H1e #K2 #H2
58     lapply (ldrop_inv_ldrop1 … H1 ?) -H1 //
59     lapply (ldrop_inv_ldrop1 … H2 ?) -H2 // /3 width=4/
60   ]
61 ]
62 qed-.