]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/etc_2A1/cpys0/lsuby.etc
update in binaries for λδ
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / etc_2A1 / cpys0 / lsuby.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/notation/relations/lrsubeq_2.ma".
16 include "basic_2/relocation/ldrop.ma".
17
18 (* LOCAL ENVIRONMENT REFINEMENT FOR EXTENDED SUBSTITUTION *******************)
19
20 inductive lsuby: relation lenv ≝
21 | lsuby_atom: ∀L. lsuby L (⋆)
22 | lsuby_pair: ∀I1,I2,L1,L2,V. lsuby L1 L2 → lsuby (L1.ⓑ{I1}V) (L2.ⓑ{I2}V)
23 .
24
25 interpretation
26   "local environment refinement (extended substitution)"
27   'LRSubEq L1 L2 = (lsuby L1 L2).
28
29 (* Basic properties *********************************************************)
30
31 lemma lsuby_refl: ∀L. L ⊆ L.
32 #L elim L -L /2 width=1 by lsuby_pair/
33 qed.
34
35 lemma lsuby_sym: ∀L1,L2. L1 ⊆ L2 → |L1| = |L2| → L2 ⊆ L1.
36 #L1 #L2 #H elim H -L1 -L2
37 [ #L1 #H >(length_inv_zero_dx … H) -L1 //
38 | #I1 #I2 #L1 #L2 #V #_ #IHL12 #H lapply (injective_plus_l … H) -H
39   /3 width=1 by lsuby_pair/
40 ]
41 qed-.
42
43 (* Basic inversion lemmas ***************************************************)
44
45 fact lsuby_inv_atom1_aux: ∀L1,L2. L1 ⊆ L2 → L1 = ⋆ → L2 = ⋆.
46 #L1 #L2 * -L1 -L2 //
47 #I1 #I2 #L1 #L2 #V #_ #H destruct
48 qed-.
49
50 lemma lsuby_inv_atom1: ∀L2. ⋆ ⊆ L2 → L2 = ⋆.
51 /2 width=3 by lsuby_inv_atom1_aux/ qed-.
52
53 fact lsuby_inv_pair1_aux: ∀L1,L2. L1 ⊆ L2 → ∀J1,K1,W. L1 = K1.ⓑ{J1}W →
54                           L2 = ⋆ ∨ ∃∃I2,K2. K1 ⊆ K2 & L2 = K2.ⓑ{I2}W.
55 #L1 #L2 * -L1 -L2
56 [ #L #J1 #K1 #W #H destruct /2 width=1 by or_introl/
57 | #I1 #I2 #L1 #L2 #V #HL12 #J1 #K1 #W #H destruct /3 width=4 by ex2_2_intro, or_intror/
58 ]
59 qed-.
60
61 lemma lsuby_inv_pair1: ∀I1,K1,L2,W. K1.ⓑ{I1}W ⊆ L2 →
62                        L2 = ⋆ ∨ ∃∃I2,K2. K1 ⊆ K2 & L2 = K2.ⓑ{I2}W.
63 /2 width=4 by lsuby_inv_pair1_aux/ qed-.
64
65 fact lsuby_inv_pair2_aux: ∀L1,L2. L1 ⊆ L2 → ∀J2,K2,W. L2 = K2.ⓑ{J2}W →
66                           ∃∃I1,K1. K1 ⊆ K2 & L1 = K1.ⓑ{I1}W.
67 #L1 #L2 * -L1 -L2
68 [ #L #J2 #K2 #W #H destruct
69 | #I1 #I2 #L1 #L2 #V #HL12 #J2 #K2 #W #H destruct /2 width=4 by ex2_2_intro/
70 ]
71 qed-.
72
73 lemma lsuby_inv_pair2: ∀I2,L1,K2,W. L1 ⊆ K2.ⓑ{I2}W  →
74                        ∃∃I1,K1. K1 ⊆ K2 & L1 = K1.ⓑ{I1}W.
75 /2 width=4 by lsuby_inv_pair2_aux/ qed-.
76
77 (* Basic forward lemmas *****************************************************)
78
79 lemma lsuby_fwd_length: ∀L1,L2. L1 ⊆ L2 → |L2| ≤ |L1|.
80 #L1 #L2 #H elim H -L1 -L2 /2 width=1 by monotonic_le_plus_l/
81 qed-.
82
83 lemma lsuby_ldrop_trans: ∀L1,L2. L1 ⊆ L2 →
84                          ∀I2,K2,W,s,i. ⇩[s, 0, i] L2 ≡ K2.ⓑ{I2}W →
85                          ∃∃I1,K1. K1 ⊆ K2 & ⇩[s, 0, i] L1 ≡ K1.ⓑ{I1}W.
86 #L1 #L2 #H elim H -L1 -L2
87 [ #L #J2 #K2 #W #s #i #H
88   elim (ldrop_inv_atom1 … H) -H #H destruct
89 | #I1 #I2 #L1 #L2 #V #HL12 #IHL12 #J2 #K2 #W #s #i #H
90   elim (ldrop_inv_O1_pair1 … H) -H * #Hi #HLK2 destruct [ -IHL12 | -HL12 ]
91   [ /3 width=4 by ldrop_pair, ex2_2_intro/
92   | elim (IHL12 … HLK2) -IHL12 -HLK2 * /3 width=4 by ldrop_drop_lt, ex2_2_intro/
93   ]
94 ]
95 qed-.