1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/grammar/lenv_append.ma".
16 include "basic_2/substitution/drop.ma".
18 (* DROPPING *****************************************************************)
20 (* Properties on append for local environments ******************************)
22 fact drop_O1_append_sn_le_aux: ∀L1,L2,s,l,m. ⬇[s, l, m] L1 ≡ L2 →
24 ∀L. ⬇[s, 0, m] L @@ L1 ≡ L @@ L2.
25 #L1 #L2 #s #l #m #H elim H -L1 -L2 -l -m //
26 [ #l #m #_ #_ #H >(yle_inv_O2 … H) -m //
27 | /4 width=1 by drop_drop, yle_inv_succ/
28 | #I #L1 #L2 #V1 #V2 #l #m #_ #_ #_ #H elim (ysucc_inv_O_dx … H)
32 lemma drop_O1_append_sn_le: ∀L1,L2,s,m. ⬇[s, yinj 0, m] L1 ≡ L2 → m ≤ |L1| →
33 ∀L. ⬇[s, 0, m] L @@ L1 ≡ L @@ L2.
34 /2 width=3 by drop_O1_append_sn_le_aux/ qed.
36 (* Inversion lemmas on append for local environments ************************)
38 lemma drop_O1_inv_append1_ge: ∀K,L1,L2,s,m. ⬇[s, 0, m] L1 @@ L2 ≡ K →
39 ∀m0. |L2| + m0 = m → ⬇[s, 0, m0] L1 ≡ K.
40 #K #L1 #L2 elim L2 -L2
41 [ #s #m #H #m0 >yplus_O1 #H0 destruct //
42 | #L2 #I #V #IHL2 #s #m #H #m0 >yplus_succ1
43 #H0 elim (drop_inv_O1_pair1 … H) -H * #Hm #HL12 destruct
44 [ elim (ysucc_inv_O_dx … Hm)
50 lemma drop_O1_inv_append1_le: ∀K,L1,L2,s,m. ⬇[s, 0, m] L1 @@ L2 ≡ K → m ≤ |L2| →
51 ∀K2. ⬇[s, 0, m] L2 ≡ K2 → K = L1 @@ K2.
52 #K #L1 #L2 elim L2 -L2
53 [ #s #m #H1 #H2 #K2 #H3 lapply (yle_inv_O2 … H2) -H2
54 #H2 elim (drop_inv_atom1 … H3) -H3 #H3 #_ destruct
55 >(drop_inv_O2 … H1) -H1 //
56 | #L2 #I #V #IHL2 #s #m @(ynat_ind … m) -m [ -IHL2 || -IHL2 ]
58 lapply (drop_inv_O2 … H1) -H1 #H1
59 lapply (drop_inv_O2 … H2) -H2 #H2 destruct //
60 | /3 width=7 by drop_inv_drop1, yle_inv_succ/
61 | #_ #H lapply (yle_inv_Y1 … H) -H
62 #H elim (ylt_yle_false (|L2.ⓑ{I}V|) (∞)) //