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 (* 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)
29 "local environment refinement (native validity)"
30 'LRSubEqV a h G L1 L2 = (lsubv a h G L1 L2).
32 (* Basic inversion lemmas ***************************************************)
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
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 (a) (h) (G): ∀L2. G ⊢ ⋆ ⫃![a,h] L2 → L2 = ⋆.
44 /2 width=6 by lsubv_inv_atom_sn_aux/ qed-.
46 fact lsubv_inv_bind_sn_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 →
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] &
51 I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW.
52 #a #h #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 #HW #HL12 #J #K1 #H destruct /3 width=8 by ex5_3_intro, or_intror/
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] &
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 (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 → L2 = ⋆ → L1 = ⋆.
68 #a #h #G #L1 #L2 * -L1 -L2
70 | #I #L1 #L2 #_ #H destruct
71 | #L1 #L2 #W #V #_ #_ #_ #H destruct
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-.
79 fact lsubv_inv_bind_dx_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 →
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
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/
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-.
98 (* Basic properties *********************************************************)
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/