]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/dynamic/lsubv.ma
bba857ac84e1bffb6b6b48a4f2108974507d4b38
[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 (* Note: this is not transitive *)
21 inductive lsubv (a) (h) (G): relation lenv ≝
22 | lsubv_atom: lsubv a h G (⋆) (⋆)
23 | lsubv_bind: ∀I,L1,L2. lsubv a h G L1 L2 → lsubv a h G (L1.ⓘ{I}) (L2.ⓘ{I})
24 | lsubv_beta: ∀L1,L2,W,V. ⦃G, L1⦄ ⊢ ⓝW.V ![a,h] → ⦃G, L2⦄ ⊢ W ![a,h] →
25               lsubv a h G L1 L2 → lsubv a h G (L1.ⓓⓝW.V) (L2.ⓛW)
26 .
27
28 interpretation
29   "local environment refinement (native validity)"
30   'LRSubEqV a h G L1 L2 = (lsubv a h G L1 L2).
31
32 (* Basic inversion lemmas ***************************************************)
33
34 fact lsubv_inv_atom_sn_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → L1 = ⋆ → L2 = ⋆.
35 #a #h #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 (a) (h) (G): ∀L2. G ⊢ ⋆ ⫃![a,h] L2 → L2 = ⋆.
44 /2 width=6 by lsubv_inv_atom_sn_aux/ qed-.
45
46 fact lsubv_inv_bind_sn_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 →
47                            ∀I,K1. L1 = K1.ⓘ{I} →
48                            ∨∨ ∃∃K2. G ⊢ K1 ⫃![a,h] K2 & L2 = K2.ⓘ{I}
49                             | ∃∃K2,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] & ⦃G, K2⦄ ⊢ W ![a,h] &
50                                         G ⊢ K1 ⫃![a,h] K2 &
51                                         I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW.
52 #a #h #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 #HW #HL12 #J #K1 #H destruct /3 width=8 by ex5_3_intro, or_intror/
56 ]
57 qed-.
58
59 (* Basic_2A1: uses: lsubsv_inv_pair1 *)
60 lemma lsubv_inv_bind_sn (a) (h) (G): ∀I,K1,L2. G ⊢ K1.ⓘ{I} ⫃![a,h] L2 →
61                         ∨∨ ∃∃K2. G ⊢ K1 ⫃![a,h] K2 & L2 = K2.ⓘ{I}
62                          | ∃∃K2,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] & ⦃G, K2⦄ ⊢ W ![a,h] &
63                                      G ⊢ K1 ⫃![a,h] 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 (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → L2 = ⋆ → L1 = ⋆.
68 #a #h #G #L1 #L2 * -L1 -L2
69 [ //
70 | #I #L1 #L2 #_ #H destruct
71 | #L1 #L2 #W #V #_ #_ #_ #H destruct
72 ]
73 qed-.
74
75 (* Basic_2A1: uses: lsubsv_inv_atom2 *)
76 lemma lsubv_inv_atom2 (a) (h) (G): ∀L1. G ⊢ L1 ⫃![a,h] ⋆ → L1 = ⋆.
77 /2 width=6 by lsubv_inv_atom_dx_aux/ qed-.
78
79 fact lsubv_inv_bind_dx_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 →
80                            ∀I,K2. L2 = K2.ⓘ{I} →
81                            ∨∨ ∃∃K1. G ⊢ K1 ⫃![a,h] K2 & L1 = K1.ⓘ{I}
82                             | ∃∃K1,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] & ⦃G, K2⦄ ⊢ W ![a,h] &
83                                         G ⊢ K1 ⫃![a,h] K2 & I = BPair Abst W & L1 = K1.ⓓⓝW.V.
84 #a #h #G #L1 #L2 * -L1 -L2
85 [ #J #K2 #H destruct
86 | #I #L1 #L2 #HL12 #J #K2 #H destruct /3 width=3 by ex2_intro, or_introl/
87 | #L1 #L2 #W #V #HWV #HW #HL12 #J #K2 #H destruct /3 width=8 by ex5_3_intro, or_intror/
88 ]
89 qed-.
90
91 (* Basic_2A1: uses: lsubsv_inv_pair2 *)
92 lemma lsubv_inv_bind_dx (a) (h) (G): ∀I,L1,K2. G ⊢ L1 ⫃![a,h] K2.ⓘ{I} →
93                         ∨∨ ∃∃K1. G ⊢ K1 ⫃![a,h] K2 & L1 = K1.ⓘ{I}
94                          | ∃∃K1,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] & ⦃G, K2⦄ ⊢ W ![a,h] &
95                                      G ⊢ K1 ⫃![a,h] K2 & I = BPair Abst W & L1 = K1.ⓓⓝW.V.
96 /2 width=3 by lsubv_inv_bind_dx_aux/ qed-.
97
98 (* Basic properties *********************************************************)
99
100 (* Basic_2A1: uses: lsubsv_refl *)
101 lemma lsubv_refl (a) (h) (G): reflexive … (lsubv a h G).
102 #a #h #G #L elim L -L /2 width=1 by lsubv_atom, lsubv_bind/
103 qed.