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