include "basic_2/notation/relations/statictype_5.ma".
include "basic_2/grammar/genv.ma".
-include "basic_2/relocation/ldrop.ma".
+include "basic_2/substitution/drop.ma".
include "basic_2/static/sh.ma".
(* STATIC TYPE ASSIGNMENT ON TERMS ******************************************)
(* activate genv *)
inductive sta (h:sh): relation4 genv lenv term term ≝
| sta_sort: ∀G,L,k. sta h G L (⋆k) (⋆(next h k))
-| sta_ldef: ∀G,L,K,V,W,U,i. ⇩[0, i] L ≡ K.ⓓV → sta h G K V W →
+| sta_ldef: ∀G,L,K,V,W,U,i. ⇩[i] L ≡ K.ⓓV → sta h G K V W →
⇧[0, i + 1] W ≡ U → sta h G L (#i) U
-| sta_ldec: ∀G,L,K,W,V,U,i. ⇩[0, i] L ≡ K.ⓛW → sta h G K W V →
+| sta_ldec: ∀G,L,K,W,V,U,i. ⇩[i] L ≡ K.ⓛW → sta h G K W V →
⇧[0, i + 1] W ≡ U → sta h G L (#i) U
| sta_bind: ∀a,I,G,L,V,T,U. sta h G (L.ⓑ{I}V) T U →
sta h G L (ⓑ{a,I}V.T) (ⓑ{a,I}V.U)
/2 width=5 by sta_inv_sort1_aux/ qed-.
fact sta_inv_lref1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀j. T = #j →
- (∃∃K,V,W. ⇩[0, j] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h] W &
- ⇧[0, j + 1] W ≡ U
+ (∃∃K,V,W. ⇩[j] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h] W &
+ ⇧[0, j+1] W ≡ U
) ∨
- (∃∃K,W,V. ⇩[0, j] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V &
- ⇧[0, j + 1] W ≡ U
+ (∃∃K,W,V. ⇩[j] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V &
+ ⇧[0, j+1] W ≡ U
).
#h #G #L #T #U * -G -L -T -U
[ #G #L #k #j #H destruct
-| #G #L #K #V #W #U #i #HLK #HVW #HWU #j #H destruct /3 width=6/
-| #G #L #K #W #V #U #i #HLK #HWV #HWU #j #H destruct /3 width=6/
+| #G #L #K #V #W #U #i #HLK #HVW #HWU #j #H destruct /3 width=6 by or_introl, ex3_3_intro/
+| #G #L #K #W #V #U #i #HLK #HWV #HWU #j #H destruct /3 width=6 by or_intror, ex3_3_intro/
| #a #I #G #L #V #T #U #_ #j #H destruct
| #G #L #V #T #U #_ #j #H destruct
| #G #L #W #T #U #_ #j #H destruct
(* Basic_1: was sty0_gen_lref *)
lemma sta_inv_lref1: ∀h,G,L,U,i. ⦃G, L⦄ ⊢ #i •[h] U →
- (∃∃K,V,W. ⇩[0, i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h] W &
- ⇧[0, i + 1] W ≡ U
+ (∃∃K,V,W. ⇩[i] L ≡ K.ⓓV & ⦃G, K⦄ ⊢ V •[h] W &
+ ⇧[0, i+1] W ≡ U
) ∨
- (∃∃K,W,V. ⇩[0, i] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V &
- ⇧[0, i + 1] W ≡ U
+ (∃∃K,W,V. ⇩[i] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V &
+ ⇧[0, i+1] W ≡ U
).
/2 width=3 by sta_inv_lref1_aux/ qed-.
[ #G #L #k #b #J #X #Y #H destruct
| #G #L #K #V #W #U #i #_ #_ #_ #b #J #X #Y #H destruct
| #G #L #K #W #V #U #i #_ #_ #_ #b #J #X #Y #H destruct
-| #a #I #G #L #V #T #U #HTU #b #J #X #Y #H destruct /2 width=3/
+| #a #I #G #L #V #T #U #HTU #b #J #X #Y #H destruct /2 width=3 by ex2_intro/
| #G #L #V #T #U #_ #b #J #X #Y #H destruct
| #G #L #W #T #U #_ #b #J #X #Y #H destruct
]
| #G #L #K #V #W #U #i #_ #_ #_ #X #Y #H destruct
| #G #L #K #W #V #U #i #_ #_ #_ #X #Y #H destruct
| #a #I #G #L #V #T #U #_ #X #Y #H destruct
-| #G #L #V #T #U #HTU #X #Y #H destruct /2 width=3/
+| #G #L #V #T #U #HTU #X #Y #H destruct /2 width=3 by ex2_intro/
| #G #L #W #T #U #_ #X #Y #H destruct
]
qed-.
(* Basic_1: was: sty0_gen_cast *)
lemma sta_inv_cast1: ∀h,G,L,X,Y,U. ⦃G, L⦄ ⊢ ⓝY.X •[h] U → ⦃G, L⦄ ⊢ X •[h] U.
/2 width=4 by sta_inv_cast1_aux/ qed-.
-
-(* Inversion lrmmas on static type assignment for terms *********************)
-
-lemma da_inv_sta: ∀h,g,G,L,T,l. ⦃G, L⦄ ⊢ T ▪[h, g] l →
- ∃U. ⦃G, L⦄ ⊢ T •[h] U.
-#h #g #G #L #T #l #H elim H -G -L -T -l
-[ /2 width=2/
-| #G #L #K #V #i #l #HLK #_ * #W #HVW
- elim (lift_total W 0 (i+1)) /3 width=7/
-| #G #L #K #W #i #l #HLK #_ * #V #HWV
- elim (lift_total W 0 (i+1)) /3 width=7/
-| #a #I #G #L #V #T #l #_ * /3 width=2/
-| * #G #L #V #T #l #_ * /3 width=2/
-]
-qed-.
-
-(* Properties on static type assignment for terms ***************************)
-
-lemma sta_da: ∀h,g,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U →
- ∃l. ⦃G, L⦄ ⊢ T ▪[h, g] l.
-#h #g #G #L #T #U #H elim H -G -L -T -U
-[ #G #L #k elim (deg_total h g k) /3 width=2/
-| #G #L #K #V #W #W0 #i #HLK #_ #_ * /3 width=5/
-| #G #L #K #W #V #W0 #i #HLK #_ #_ * /3 width=5/
-| #a #I #G #L #V #T #U #_ * /3 width=2/
-| #G #L #V #T #U #_ * /3 width=2/
-| #G #L #W #T #U #_ * /3 width=2/
-]
-qed-.