]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/basic_2/substitution/ldrop_append.ma
- lambda_delta: we updated some notation
[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/grammar/lenv_append.ma".
16 include "basic_2/substitution/ldrop.ma".
17
18 (* DROPPING *****************************************************************)
19
20 (* Properties on append for local environments ******************************)
21
22 lemma ldrop_append_O1_ge: ∀K,L1,L2,e. ⇩[0, e] L1 @@ L2 ≡ K →
23                           |L2| ≤ e → ⇩[0, e - |L2|] L1 ≡ K.
24 #K #L1 #L2 elim L2 -L2 normalize //
25 #L2 #I #V #IHL2 #e #H #H1e
26 elim (ldrop_inv_O1 … H) -H * #H2e #HL12 destruct
27 [ lapply (le_n_O_to_eq … H1e) -H1e -IHL2
28   >commutative_plus normalize #H destruct
29 | <minus_plus >minus_minus_comm /3 width=1/
30 ]
31 qed.
32
33 lemma ldrop_append_O1_lt: ∀K,L1,L2,e. ⇩[0, e] L1 @@ L2 ≡ K → e < |L2| →
34                           ∃∃K2. ⇩[0, e] L2 ≡ K2 & K = L1 @@ K2.
35 #K #L1 #L2 elim L2 -L2
36 [ #e #_ #H elim (lt_zero_false … H)
37 | #L2 #I #V #IHL2 #e normalize #HL12 #H1e
38   elim (ldrop_inv_O1 … HL12) -HL12 * #H2e #HL12 destruct
39   [ -H1e -IHL2 /3 width=3/
40   | elim (IHL2 … HL12 ?) -IHL2 -HL12 /2 width=1/ -H1e #K2 #HLK2 #H destruct /3 width=3/
41   ]
42 ]
43 qed.