]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubsv.ma
d203f0da4a3990a38ec9243932984e27f628354e
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / lsubsv.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/equivalence/lsubss.ma".
16 include "basic_2/dynamic/snv.ma".
17
18 (* LOCAL ENVIRONMENT REFINEMENT FOR STRATIFIED NATIVE VALIDITY **************)
19
20 (* Note: this is not transitive *)
21 inductive lsubsv (h:sh) (g:sd h): relation lenv ≝
22 | lsubsv_atom: lsubsv h g (⋆) (⋆)
23 | lsubsv_pair: ∀I,L1,L2,V. lsubsv h g L1 L2 →
24                lsubsv h g (L1. ⓑ{I} V) (L2. ⓑ{I} V)
25 | lsubsv_abbr: ∀L1,L2,V1,V2,W1,W2,l. ⦃h, L1⦄ ⊢ V1 ¡[g] → ⦃h, L1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ →
26                L1 ⊢ W1 ⬌* W2 → ⦃h, L2⦄ ⊢ W2 ¡[g] → ⦃h, L2⦄ ⊢ W2 •[g] ⦃l, V2⦄ →
27                lsubsv h g L1 L2 → lsubsv h g (L1. ⓓV1) (L2. ⓛW2)
28 .
29
30 interpretation
31   "local environment refinement (stratified native validity)"
32   'CrSubEqV h g L1 L2 = (lsubsv h g L1 L2).
33
34 (* Basic inversion lemmas ***************************************************)
35
36 fact lsubsv_inv_atom1_aux: ∀h,g,L1,L2. h ⊢ L1 ¡⊑[g] L2 → L1 = ⋆ → L2 = ⋆.
37 #h #g #L1 #L2 * -L1 -L2
38 [ //
39 | #I #L1 #L2 #V #_ #H destruct
40 | #L1 #L2 #V1 #V2 #W1 #W2 #l #_ #_ #_ #_ #_ #_ #H destruct
41 ]
42 qed-.
43
44 lemma lsubsv_inv_atom1: ∀h,g,L2. h ⊢ ⋆ ¡⊑[g] L2 → L2 = ⋆.
45 /2 width=5 by lsubsv_inv_atom1_aux/ qed-.
46
47 fact lsubsv_inv_pair1_aux: ∀h,g,L1,L2. h ⊢ L1 ¡⊑[g] L2 →
48                            ∀I,K1,V1. L1 = K1. ⓑ{I} V1 →
49                            (∃∃K2. h ⊢ K1 ¡⊑[g] K2 & L2 = K2. ⓑ{I} V1) ∨
50                            ∃∃K2,V2,W1,W2,l. ⦃h, K1⦄ ⊢ V1 ¡[g] & ⦃h, K1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ &
51                                             K1 ⊢ W1 ⬌* W2 & ⦃h, K2⦄ ⊢ W2 ¡[g] & ⦃h, K2⦄ ⊢ W2 •[g] ⦃l, V2⦄ &
52                                             h ⊢ K1 ¡⊑[g] K2 & L2 = K2. ⓛW2 & I = Abbr.
53 #h #g #L1 #L2 * -L1 -L2
54 [ #J #K1 #U1 #H destruct
55 | #I #L1 #L2 #V #HL12 #J #K1 #U1 #H destruct /3 width=3/
56 | #L1 #L2 #V1 #V2 #W1 #W2 #l #HV1 #HVW1 #HW12 #HW2 #HWV2 #HL12 #J #K1 #U1 #H destruct /3 width=11/
57 ]
58 qed-.
59
60 lemma lsubsv_inv_pair1: ∀h,g,I,K1,L2,V1. h ⊢ K1. ⓑ{I} V1 ¡⊑[g] L2 →
61                         (∃∃K2. h ⊢ K1 ¡⊑[g] K2 & L2 = K2. ⓑ{I} V1) ∨
62                         ∃∃K2,V2,W1,W2,l. ⦃h, K1⦄ ⊢ V1 ¡[g] & ⦃h, K1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ &
63                                          K1 ⊢ W1 ⬌* W2 & ⦃h, K2⦄ ⊢ W2 ¡[g] & ⦃h, K2⦄ ⊢ W2 •[g] ⦃l, V2⦄ &
64                                          h ⊢ K1 ¡⊑[g] K2 & L2 = K2. ⓛW2 & I = Abbr.
65 /2 width=3 by lsubsv_inv_pair1_aux/ qed-.
66
67 fact lsubsv_inv_atom2_aux: ∀h,g,L1,L2. h ⊢ L1 ¡⊑[g] L2 → L2 = ⋆ → L1 = ⋆.
68 #h #g #L1 #L2 * -L1 -L2
69 [ //
70 | #I #L1 #L2 #V #_ #H destruct
71 | #L1 #L2 #V1 #V2 #W1 #W2 #l #_ #_ #_ #_ #_ #_ #H destruct
72 ]
73 qed-.
74
75 lemma lsubsv_inv_atom2: ∀h,g,L1. h ⊢ L1 ¡⊑[g] ⋆ → L1 = ⋆.
76 /2 width=5 by lsubsv_inv_atom2_aux/ qed-.
77
78 fact lsubsv_inv_pair2_aux: ∀h,g,L1,L2. h ⊢ L1 ¡⊑[g] L2 →
79                            ∀I,K2,W2. L2 = K2. ⓑ{I} W2 →
80                            (∃∃K1. h ⊢ K1 ¡⊑[g] K2 & L1 = K1. ⓑ{I} W2) ∨
81                            ∃∃K1,W1,V1,V2,l. ⦃h, K1⦄ ⊢ V1 ¡[g] & ⦃h, K1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ &
82                                             K1 ⊢ W1 ⬌* W2 & ⦃h, K2⦄ ⊢ W2 ¡[g] & ⦃h, K2⦄ ⊢ W2 •[g] ⦃l, V2⦄ &
83                                             h ⊢ K1 ¡⊑[g] K2 & L1 = K1. ⓓV1 & I = Abst.
84 #h #g #L1 #L2 * -L1 -L2
85 [ #J #K2 #U2 #H destruct
86 | #I #L1 #L2 #V #HL12 #J #K2 #U2 #H destruct /3 width=3/
87 | #L1 #L2 #V1 #V2 #W1 #W2 #l #HV #HVW1 #HW12 #HW2 #HWV2 #HL12 #J #K2 #U2 #H destruct /3 width=11/
88 ]
89 qed-.
90
91 lemma lsubsv_inv_pair2: ∀h,g,I,L1,K2,W2. h ⊢ L1 ¡⊑[g] K2. ⓑ{I} W2 →
92                         (∃∃K1. h ⊢ K1 ¡⊑[g] K2 & L1 = K1. ⓑ{I} W2) ∨
93                         ∃∃K1,W1,V1,V2,l. ⦃h, K1⦄ ⊢ V1 ¡[g] & ⦃h, K1⦄ ⊢ V1 •[g] ⦃l+1, W1⦄ &
94                                          K1 ⊢ W1 ⬌* W2 & ⦃h, K2⦄ ⊢ W2 ¡[g] & ⦃h, K2⦄ ⊢ W2 •[g] ⦃l, V2⦄ &
95                                          h ⊢ K1 ¡⊑[g] K2 & L1 = K1. ⓓV1 & I = Abst.
96 /2 width=3 by lsubsv_inv_pair2_aux/ qed-.
97
98 (* Basic_forward lemmas *****************************************************)
99
100 lemma lsubsv_fwd_lsubss: ∀h,g,L1,L2. h ⊢ L1 ¡⊑[g] L2 → h ⊢ L1 •⊑[g] L2.
101 #h #g #L1 #L2 #H elim H -L1 -L2 // /2 width=1/ /2 width=6/
102 qed-.
103
104 lemma lsubsv_fwd_lsubr1: ∀h,g,L1,L2. h ⊢ L1 ¡⊑[g] L2 → L1 ⊑ L2.
105 /3 width=3 by lsubsv_fwd_lsubss, lsubss_fwd_lsubr1/
106 qed-.
107
108 lemma lsubsv_fwd_lsubr2: ∀h,g,L1,L2. h ⊢ L1 ¡⊑[g] L2 → L1 ⊑ L2.
109 /3 width=3 by lsubsv_fwd_lsubss, lsubss_fwd_lsubr2/
110 qed-.
111
112 (* Basic properties *********************************************************)
113
114 lemma lsubsv_refl: ∀h,g,L. h ⊢ L ¡⊑[g] L.
115 #h #g #L elim L -L // /2 width=1/
116 qed.
117
118 lemma lsubsv_cprs_trans: ∀h,g,L1,L2. h ⊢ L1 ¡⊑[g] L2 →
119                          ∀T1,T2. L2 ⊢ T1 ➡* T2 → L1 ⊢ T1 ➡* T2.
120 /3 width=5 by lsubsv_fwd_lsubss, lsubss_cprs_trans/
121 qed-.