]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv.ma
update in ground_2, static_2, basic_2, apps_2, alpha_1
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / dynamic / lsubv.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/notation/relations/lrsubeqv_5.ma".
16 include "basic_2/dynamic/cnv.ma".
17
18 (* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE VALIDITY *************************)
19
20 inductive lsubv (h) (a) (G): relation lenv ≝
21 | lsubv_atom: lsubv h a G (⋆) (⋆)
22 | lsubv_bind: ∀I,L1,L2. lsubv h a G L1 L2 → lsubv h a G (L1.ⓘ[I]) (L2.ⓘ[I])
23 | lsubv_beta: ∀L1,L2,W,V. ❪G,L1❫ ⊢ ⓝW.V ![h,a] →
24               lsubv h a G L1 L2 → lsubv h a G (L1.ⓓⓝW.V) (L2.ⓛW)
25 .
26
27 interpretation
28   "local environment refinement (native validity)"
29   'LRSubEqV h a G L1 L2 = (lsubv h a G L1 L2).
30
31 (* Basic inversion lemmas ***************************************************)
32
33 fact lsubv_inv_atom_sn_aux (h) (a) (G):
34      ∀L1,L2. G ⊢ L1 ⫃![h,a] L2 → L1 = ⋆ → L2 = ⋆.
35 #h #a #G #L1 #L2 * -L1 -L2
36 [ //
37 | #I #L1 #L2 #_ #H destruct
38 | #L1 #L2 #W #V #_ #_ #H destruct
39 ]
40 qed-.
41
42 (* Basic_2A1: uses: lsubsv_inv_atom1 *)
43 lemma lsubv_inv_atom_sn (h) (a) (G):
44       ∀L2. G ⊢ ⋆ ⫃![h,a] L2 → L2 = ⋆.
45 /2 width=6 by lsubv_inv_atom_sn_aux/ qed-.
46
47 fact lsubv_inv_bind_sn_aux (h) (a) (G): ∀L1,L2. G ⊢ L1 ⫃![h,a] L2 →
48      ∀I,K1. L1 = K1.ⓘ[I] →
49      ∨∨ ∃∃K2. G ⊢ K1 ⫃![h,a] K2 & L2 = K2.ⓘ[I]
50       | ∃∃K2,W,V. ❪G,K1❫ ⊢ ⓝW.V ![h,a] & G ⊢ K1 ⫃![h,a] K2
51                 & I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW.
52 #h #a #G #L1 #L2 * -L1 -L2
53 [ #J #K1 #H destruct
54 | #I #L1 #L2 #HL12 #J #K1 #H destruct /3 width=3 by ex2_intro, or_introl/
55 | #L1 #L2 #W #V #HWV #HL12 #J #K1 #H destruct /3 width=7 by ex4_3_intro, or_intror/
56 ]
57 qed-.
58
59 (* Basic_2A1: uses: lsubsv_inv_pair1 *)
60 lemma lsubv_inv_bind_sn (h) (a) (G):
61       ∀I,K1,L2. G ⊢ K1.ⓘ[I] ⫃![h,a] L2 →
62       ∨∨ ∃∃K2. G ⊢ K1 ⫃![h,a] K2 & L2 = K2.ⓘ[I]
63        | ∃∃K2,W,V. ❪G,K1❫ ⊢ ⓝW.V ![h,a] & G ⊢ K1 ⫃![h,a] K2
64                  & I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW.
65 /2 width=3 by lsubv_inv_bind_sn_aux/ qed-.
66
67 fact lsubv_inv_atom_dx_aux (h) (a) (G):
68      ∀L1,L2. G ⊢ L1 ⫃![h,a] L2 → L2 = ⋆ → L1 = ⋆.
69 #h #a #G #L1 #L2 * -L1 -L2
70 [ //
71 | #I #L1 #L2 #_ #H destruct
72 | #L1 #L2 #W #V #_ #_ #H destruct
73 ]
74 qed-.
75
76 (* Basic_2A1: uses: lsubsv_inv_atom2 *)
77 lemma lsubv_inv_atom_dx (h) (a) (G):
78       ∀L1. G ⊢ L1 ⫃![h,a] ⋆ → L1 = ⋆.
79 /2 width=6 by lsubv_inv_atom_dx_aux/ qed-.
80
81 fact lsubv_inv_bind_dx_aux (h) (a) (G):
82      ∀L1,L2. G ⊢ L1 ⫃![h,a] L2 →
83      ∀I,K2. L2 = K2.ⓘ[I] →
84      ∨∨ ∃∃K1. G ⊢ K1 ⫃![h,a] K2 & L1 = K1.ⓘ[I]
85       | ∃∃K1,W,V. ❪G,K1❫ ⊢ ⓝW.V ![h,a] &
86                   G ⊢ K1 ⫃![h,a] K2 & I = BPair Abst W & L1 = K1.ⓓⓝW.V.
87 #h #a #G #L1 #L2 * -L1 -L2
88 [ #J #K2 #H destruct
89 | #I #L1 #L2 #HL12 #J #K2 #H destruct /3 width=3 by ex2_intro, or_introl/
90 | #L1 #L2 #W #V #HWV #HL12 #J #K2 #H destruct /3 width=7 by ex4_3_intro, or_intror/
91 ]
92 qed-.
93
94 (* Basic_2A1: uses: lsubsv_inv_pair2 *)
95 lemma lsubv_inv_bind_dx (h) (a) (G):
96       ∀I,L1,K2. G ⊢ L1 ⫃![h,a] K2.ⓘ[I] →
97       ∨∨ ∃∃K1. G ⊢ K1 ⫃![h,a] K2 & L1 = K1.ⓘ[I]
98        | ∃∃K1,W,V. ❪G,K1❫ ⊢ ⓝW.V ![h,a] &
99                    G ⊢ K1 ⫃![h,a] K2 & I = BPair Abst W & L1 = K1.ⓓⓝW.V.
100 /2 width=3 by lsubv_inv_bind_dx_aux/ qed-.
101
102 (* Advanced inversion lemmas ************************************************)
103
104 lemma lsubv_inv_abst_sn (h) (a) (G):
105       ∀K1,L2,W. G ⊢ K1.ⓛW ⫃![h,a] L2 →
106       ∃∃K2. G ⊢ K1 ⫃![h,a] K2 & L2 = K2.ⓛW.
107 #h #a #G #K1 #L2 #W #H
108 elim (lsubv_inv_bind_sn … H) -H // *
109 #K2 #XW #XV #_ #_ #H1 #H2 destruct
110 qed-.
111
112 (* Basic properties *********************************************************)
113
114 (* Basic_2A1: uses: lsubsv_refl *)
115 lemma lsubv_refl (h) (a) (G): reflexive … (lsubv h a G).
116 #h #a #G #L elim L -L /2 width=1 by lsubv_atom, lsubv_bind/
117 qed.
118
119 (* Basic_2A1: removed theorems 3:
120               lsubsv_lstas_trans lsubsv_sta_trans
121               lsubsv_fwd_lsubd
122 *)