(* LOCAL ENVIRONMENT REFINEMENT FOR NATIVE VALIDITY *************************)
-(* Note: this is not transitive *)
inductive lsubv (a) (h) (G): relation lenv ≝
| lsubv_atom: lsubv a h G (⋆) (⋆)
| lsubv_bind: ∀I,L1,L2. lsubv a h G L1 L2 → lsubv a h G (L1.ⓘ{I}) (L2.ⓘ{I})
-| lsubv_beta: ∀L1,L2,W,V. ⦃G, L1⦄ ⊢ ⓝW.V ![a,h] → ⦃G, L2⦄ ⊢ W ![a,h] →
+| lsubv_beta: ∀L1,L2,W,V. ⦃G, L1⦄ ⊢ ⓝW.V ![a,h] →
lsubv a h G L1 L2 → lsubv a h G (L1.ⓓⓝW.V) (L2.ⓛW)
.
#a #h #G #L1 #L2 * -L1 -L2
[ //
| #I #L1 #L2 #_ #H destruct
-| #L1 #L2 #W #V #_ #_ #_ #H destruct
+| #L1 #L2 #W #V #_ #_ #H destruct
]
qed-.
fact lsubv_inv_bind_sn_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 →
∀I,K1. L1 = K1.ⓘ{I} →
∨∨ ∃∃K2. G ⊢ K1 ⫃![a,h] K2 & L2 = K2.ⓘ{I}
- | ∃∃K2,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] & ⦃G, K2⦄ ⊢ W ![a,h] &
+ | ∃∃K2,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] &
G ⊢ K1 ⫃![a,h] K2 &
I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW.
#a #h #G #L1 #L2 * -L1 -L2
[ #J #K1 #H destruct
| #I #L1 #L2 #HL12 #J #K1 #H destruct /3 width=3 by ex2_intro, or_introl/
-| #L1 #L2 #W #V #HWV #HW #HL12 #J #K1 #H destruct /3 width=8 by ex5_3_intro, or_intror/
+| #L1 #L2 #W #V #HWV #HL12 #J #K1 #H destruct /3 width=7 by ex4_3_intro, or_intror/
]
qed-.
(* Basic_2A1: uses: lsubsv_inv_pair1 *)
lemma lsubv_inv_bind_sn (a) (h) (G): ∀I,K1,L2. G ⊢ K1.ⓘ{I} ⫃![a,h] L2 →
∨∨ ∃∃K2. G ⊢ K1 ⫃![a,h] K2 & L2 = K2.ⓘ{I}
- | ∃∃K2,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] & ⦃G, K2⦄ ⊢ W ![a,h] &
+ | ∃∃K2,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] &
G ⊢ K1 ⫃![a,h] K2 &
I = BPair Abbr (ⓝW.V) & L2 = K2.ⓛW.
/2 width=3 by lsubv_inv_bind_sn_aux/ qed-.
#a #h #G #L1 #L2 * -L1 -L2
[ //
| #I #L1 #L2 #_ #H destruct
-| #L1 #L2 #W #V #_ #_ #_ #H destruct
+| #L1 #L2 #W #V #_ #_ #H destruct
]
qed-.
fact lsubv_inv_bind_dx_aux (a) (h) (G): ∀L1,L2. G ⊢ L1 ⫃![a,h] L2 →
∀I,K2. L2 = K2.ⓘ{I} →
∨∨ ∃∃K1. G ⊢ K1 ⫃![a,h] K2 & L1 = K1.ⓘ{I}
- | ∃∃K1,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] & ⦃G, K2⦄ ⊢ W ![a,h] &
+ | ∃∃K1,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] &
G ⊢ K1 ⫃![a,h] K2 & I = BPair Abst W & L1 = K1.ⓓⓝW.V.
#a #h #G #L1 #L2 * -L1 -L2
[ #J #K2 #H destruct
| #I #L1 #L2 #HL12 #J #K2 #H destruct /3 width=3 by ex2_intro, or_introl/
-| #L1 #L2 #W #V #HWV #HW #HL12 #J #K2 #H destruct /3 width=8 by ex5_3_intro, or_intror/
+| #L1 #L2 #W #V #HWV #HL12 #J #K2 #H destruct /3 width=7 by ex4_3_intro, or_intror/
]
qed-.
(* Basic_2A1: uses: lsubsv_inv_pair2 *)
lemma lsubv_inv_bind_dx (a) (h) (G): ∀I,L1,K2. G ⊢ L1 ⫃![a,h] K2.ⓘ{I} →
∨∨ ∃∃K1. G ⊢ K1 ⫃![a,h] K2 & L1 = K1.ⓘ{I}
- | ∃∃K1,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] & ⦃G, K2⦄ ⊢ W ![a,h] &
+ | ∃∃K1,W,V. ⦃G, K1⦄ ⊢ ⓝW.V ![a,h] &
G ⊢ K1 ⫃![a,h] K2 & I = BPair Abst W & L1 = K1.ⓓⓝW.V.
/2 width=3 by lsubv_inv_bind_dx_aux/ qed-.
+(* Advanced inversion lemmas ************************************************)
+
+lemma lsubv_inv_abst_sn (a) (h) (G): ∀K1,L2,W. G ⊢ K1.ⓛW ⫃![a,h] L2 →
+ ∃∃K2. G ⊢ K1 ⫃![a,h] K2 & L2 = K2.ⓛW.
+#a #h #G #K1 #L2 #W #H
+elim (lsubv_inv_bind_sn … H) -H // *
+#K2 #XW #XV #_ #_ #H1 #H2 destruct
+qed-.
+
(* Basic properties *********************************************************)
(* Basic_2A1: uses: lsubsv_refl *)