]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/etc/frees/frees_append.etc
- fpbq
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / etc / frees / frees_append.etc
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/drop_append.ma".
16 include "basic_2/multiple/frees.ma".
17
18 (* CONTEXT-SENSITIVE FREE VARIABLES *****************************************)
19
20 (* Properties on append for local environments ******************************)
21
22 lemma frees_append: āˆ€L2,U,l,i. L2 āŠ¢ i Ļµ š…*[l]ā¦ƒUā¦„ ā†’ i ā‰¤ |L2| ā†’
23                     āˆ€L1. L1 @@ L2 āŠ¢ i Ļµ š…*[l]ā¦ƒUā¦„.
24 #L2 #U #l #i #H elim H -L2 -U -l -i /3 width=2 by frees_eq/
25 #I #L2 #K2 #U #W #l #i #j #Hlj #Hji #HnU #HLK2 #_ #IHW #Hi #L1
26 lapply (drop_fwd_length_minus2 ā€¦ HLK2) normalize #H0
27 lapply (drop_O1_append_sn_le ā€¦ HLK2 ā€¦ L1) -HLK2
28 [ -I -L1 -K2 -U -W -l /4 width=3 by ylt_yle_trans, ylt_inv_inj, lt_to_le/
29 | #HLK2 @(frees_be ā€¦ HnU HLK2) // -HnU -HLK2 @IHW -IHW
30   >(minus_plus_m_m (|K2|) 1) >H0 -H0 <yminus_inj >yminus_SO2
31   /3 width=1 by monotonic_yle_minus_dx, yle_pred/
32 ]
33 qed.
34
35 (* Inversion lemmas on append for local environments ************************)
36
37 fact frees_inv_append_aux: āˆ€L,U,l,i. L āŠ¢ i Ļµ š…*[l]ā¦ƒUā¦„ ā†’ āˆ€L1,L2. L = L1 @@ L2 ā†’
38                            i ā‰¤ |L2| ā†’ L2 āŠ¢ i Ļµ š…*[l]ā¦ƒUā¦„.
39 #L #U #l #i #H elim H -L -U -l -i /3 width=2 by frees_eq/
40 #Z #L #Y #U #X #l #i #j #Hlj #Hji #HnU #HLY #_ #IHW #L1 #L2 #H #Hi destruct
41 elim (drop_O1_lt (ā’») L2 j) [2: -Z -Y -L1 -X -U -l /3 width=3 by ylt_yle_trans, ylt_inv_inj/ ]
42 #I #K2 #W #HLK2 lapply (drop_fwd_length_minus2 ā€¦ HLK2) normalize #H0
43 lapply (drop_O1_inv_append1_le ā€¦ HLY ā€¦ HLK2) -HLY
44 [ -Z -I -Y -K2 -L1 -X -U -W -l /4 width=3 by ylt_yle_trans, ylt_inv_inj, lt_to_le/
45 | normalize #H destruct
46   @(frees_be ā€¦ HnU HLK2) -HnU -HLK2 // @IHW -IHW //
47   >(minus_plus_m_m (|K2|) 1) >H0 -H0 <yminus_inj >yminus_SO2
48   /3 width=1 by monotonic_yle_minus_dx, yle_pred/
49 ]
50 qed-.
51
52 lemma frees_inv_append: āˆ€L1,L2,U,l,i. L1 @@ L2 āŠ¢ i Ļµ š…*[l]ā¦ƒUā¦„ ā†’
53                         i ā‰¤ |L2| ā†’ L2 āŠ¢ i Ļµ š…*[l]ā¦ƒUā¦„.
54 /2 width=4 by frees_inv_append_aux/ qed-.