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 (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)
28 "local environment refinement (native validity)"
29 'LRSubEqV a h G L1 L2 = (lsubv a h G L1 L2).
31 (* Basic inversion lemmas ***************************************************)
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
36 | #I #L1 #L2 #_ #H destruct
37 | #L1 #L2 #W #V #_ #_ #H destruct
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-.
45 fact lsubv_inv_bind_sn_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 →
47 ∨∨ ∃∃K2. G ⊢ K1 ⫃![a,h] K2 & L2 = K2.ⓘ{I}
48 | ∃∃K2,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] &
50 I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW.
51 #a #h #G #L1 #L2 * -L1 -L2
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/
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] &
63 I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW.
64 /2 width=3 by lsubv_inv_bind_sn_aux/ qed-.
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
69 | #I #L1 #L2 #_ #H destruct
70 | #L1 #L2 #W #V #_ #_ #H destruct
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-.
78 fact lsubv_inv_bind_dx_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 →
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
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/
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-.
97 (* Advanced inversion lemmas ************************************************)
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
106 (* Basic properties *********************************************************)
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/
113 (* Basic_2A1: removed theorems 3:
114 lsubsv_lstas_trans lsubsv_sta_trans