1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
15 include "basic_2/notation/relations/lrsubeqv_5.ma".
16 include "basic_2/dynamic/cnv.ma".
18 (* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE VALIDITY *************************)
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)
28 "local environment refinement (native validity)"
29 'LRSubEqV h a G L1 L2 = (lsubv h a G L1 L2).
31 (* Basic inversion lemmas ***************************************************)
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
37 | #I #L1 #L2 #_ #H destruct
38 | #L1 #L2 #W #V #_ #_ #H destruct
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-.
47 fact lsubv_inv_bind_sn_aux (h) (a) (G): ∀L1,L2. G ⊢ L1 ⫃![h,a] L2 →
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
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/
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-.
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
71 | #I #L1 #L2 #_ #H destruct
72 | #L1 #L2 #W #V #_ #_ #H destruct
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-.
81 fact lsubv_inv_bind_dx_aux (h) (a) (G):
82 ∀L1,L2. G ⊢ L1 ⫃![h,a] L2 →
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
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/
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-.
102 (* Advanced inversion lemmas ************************************************)
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
112 (* Basic properties *********************************************************)
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/
119 (* Basic_2A1: removed theorems 3:
120 lsubsv_lstas_trans lsubsv_sta_trans