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