include "basic_2/substitution/lsubr.ma".
-(* LOCAL ENVIRONMENT REFINEMENT FOR SUBSTITUTION ****************************)
+(* RESTRICTED LOCAL ENVIRONMENT REFINEMENT **********************************)
-fact lsubr_inv_abbr1_aux: ∀L1,L2. L1 ⊑ L2 → ∀K1,W. L1 = K1.ⓓW →
+(* Auxiliary inversion lemmas ***********************************************)
+
+fact lsubr_inv_bind1_aux: ∀L1,L2. L1 ⊑ L2 → ∀I,K1,X. L1 = K1.ⓑ{I}X →
∨∨ L2 = ⋆
- | ∃∃K2. K1 ⊑ K2 & L2 = K2.ⓓW
- | ∃∃K2,W2. K1 ⊑ K2 & L2 = K2.ⓛW2.
+ | ∃∃K2. K1 ⊑ K2 & L2 = K2.ⓑ{I}X
+ | ∃∃K2,V,W. K1 ⊑ K2 & L2 = K2.ⓛW &
+ I = Abbr & X = ⓝW.V.
#L1 #L2 * -L1 -L2
-[ #L #K1 #W #H destruct /2 width=1/
-| #L1 #L2 #V #HL12 #K1 #W #H destruct /3 width=3/
-| #I #L1 #L2 #V1 #V2 #HL12 #K1 #W #H destruct /3 width=4/
+[ #L #J #K1 #X #H destruct /2 width=1/
+| #I #L1 #L2 #V #HL12 #J #K1 #X #H destruct /3 width=3/
+| #L1 #L2 #V #W #HL12 #J #K1 #X #H destruct /3 width=6/
]
qed-.
-lemma lsubr_inv_abbr1: ∀K1,L2,W. K1.ⓓW ⊑ L2 →
+lemma lsubr_inv_bind1: ∀I,K1,L2,X. K1.ⓑ{I}X ⊑ L2 →
∨∨ L2 = ⋆
- | ∃∃K2. K1 ⊑ K2 & L2 = K2.ⓓW
- | ∃∃K2,W2. K1 ⊑ K2 & L2 = K2.ⓛW2.
-/2 width=3 by lsubr_inv_abbr1_aux/ qed-.
-
-fact lsubr_inv_abst1_aux: ∀L1,L2. L1 ⊑ L2 → ∀K1,W1. L1 = K1.ⓛW1 →
- L2 = ⋆ ∨
- ∃∃K2,W2. K1 ⊑ K2 & L2 = K2.ⓛW2.
-#L1 #L2 * -L1 -L2
-[ #L #K1 #W1 #H destruct /2 width=1/
-| #L1 #L2 #V #_ #K1 #W1 #H destruct
-| #I #L1 #L2 #V1 #V2 #HL12 #K1 #W1 #H destruct /3 width=4/
-]
-qed-.
-
-lemma lsubr_inv_abst1: ∀K1,L2,W1. K1.ⓛW1 ⊑ L2 →
- L2 = ⋆ ∨
- ∃∃K2,W2. K1 ⊑ K2 & L2 = K2.ⓛW2.
-/2 width=4 by lsubr_inv_abst1_aux/ qed-.
+ | ∃∃K2. K1 ⊑ K2 & L2 = K2.ⓑ{I}X
+ | ∃∃K2,V,W. K1 ⊑ K2 & L2 = K2.ⓛW &
+ I = Abbr & X = ⓝW.V.
+/2 width=3 by lsubr_inv_bind1_aux/ qed-.
(* Main properties **********************************************************)
#L1 #L #H elim H -L1 -L
[ #L1 #X #H
lapply (lsubr_inv_atom1 … H) -H //
-| #L1 #L #V #_ #IHL1 #X #H
- elim (lsubr_inv_abbr1 … H) -H // *
- #L2 [2: #V2 ] #HL2 #H destruct /3 width=1/
-| #I #L1 #L #V1 #V #_ #IHL1 #X #H
+| #I #L1 #L #V #_ #IHL1 #X #H
+ elim (lsubr_inv_bind1 … H) -H // *
+ #L2 [2: #V2 #W2 ] #HL2 #H1 [ #H2 #H3 ] destruct /3 width=1/
+| #L1 #L #V1 #W #_ #IHL1 #X #H
elim (lsubr_inv_abst1 … H) -H // *
- #L2 #V2 #HL2 #H destruct /3 width=1/
+ #L2 #HL2 #H destruct /3 width=1/
]
qed-.