X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbasic_2%2Fetc%2Fsta%2Fsta.etc;fp=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbasic_2%2Fetc%2Fsta%2Fsta.etc;h=0000000000000000000000000000000000000000;hb=ff7754f834f937bfe2384c7703cf63f552885395;hp=d143c006f862561b3569402bcd23a6f232bc7576;hpb=4720368dcf18593959c6d21484f62fb5b61f3d26;p=helm.git diff --git a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta.etc b/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta.etc deleted file mode 100644 index d143c006f..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/etc/sta/sta.etc +++ /dev/null @@ -1,172 +0,0 @@ -(**************************************************************************) -(* ___ *) -(* ||M|| *) -(* ||A|| A project by Andrea Asperti *) -(* ||T|| *) -(* ||I|| Developers: *) -(* ||T|| The HELM team. *) -(* ||A|| http://helm.cs.unibo.it *) -(* \ / *) -(* \ / This file is distributed under the terms of the *) -(* v GNU General Public License Version 2 *) -(* *) -(**************************************************************************) - -include "basic_2/notation/relations/statictype_5.ma". -include "basic_2/grammar/genv.ma". -include "basic_2/relocation/ldrop.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 → - ⇧[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 → - ⇧[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) -| sta_appl: ∀G,L,V,T,U. sta h G L T U → sta h G L (ⓐV.T) (ⓐV.U) -| sta_cast: ∀G,L,W,T,U. sta h G L T U → sta h G L (ⓝW.T) U -. - -interpretation "static type assignment (term)" - 'StaticType h G L T U = (sta h G L T U). - -(* Basic inversion lemmas ************************************************) - -fact sta_inv_sort1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀k0. T = ⋆k0 → - U = ⋆(next h k0). -#h #G #L #T #U * -G -L -T -U -[ #G #L #k #k0 #H destruct // -| #G #L #K #V #W #U #i #_ #_ #_ #k0 #H destruct -| #G #L #K #W #V #U #i #_ #_ #_ #k0 #H destruct -| #a #I #G #L #V #T #U #_ #k0 #H destruct -| #G #L #V #T #U #_ #k0 #H destruct -| #G #L #W #T #U #_ #k0 #H destruct -qed-. - -(* Basic_1: was: sty0_gen_sort *) -lemma sta_inv_sort1: ∀h,G,L,U,k. ⦃G, L⦄ ⊢ ⋆k •[h] U → U = ⋆(next h k). -/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,W,V. ⇩[0, 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/ -| #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 -] -qed-. - -(* 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,W,V. ⇩[0, i] L ≡ K.ⓛW & ⦃G, K⦄ ⊢ W •[h] V & - ⇧[0, i + 1] W ≡ U - ). -/2 width=3 by sta_inv_lref1_aux/ qed-. - -fact sta_inv_gref1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀p0. T = §p0 → ⊥. -#h #G #L #T #U * -G -L -T -U -[ #G #L #k #p0 #H destruct -| #G #L #K #V #W #U #i #_ #_ #_ #p0 #H destruct -| #G #L #K #W #V #U #i #_ #_ #_ #p0 #H destruct -| #a #I #G #L #V #T #U #_ #p0 #H destruct -| #G #L #V #T #U #_ #p0 #H destruct -| #G #L #W #T #U #_ #p0 #H destruct -qed-. - -lemma sta_inv_gref1: ∀h,G,L,U,p. ⦃G, L⦄ ⊢ §p •[h] U → ⊥. -/2 width=8 by sta_inv_gref1_aux/ qed-. - -fact sta_inv_bind1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀b,J,X,Y. T = ⓑ{b,J}Y.X → - ∃∃Z. ⦃G, L.ⓑ{J}Y⦄ ⊢ X •[h] Z & U = ⓑ{b,J}Y.Z. -#h #G #L #T #U * -G -L -T -U -[ #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/ -| #G #L #V #T #U #_ #b #J #X #Y #H destruct -| #G #L #W #T #U #_ #b #J #X #Y #H destruct -] -qed-. - -(* Basic_1: was: sty0_gen_bind *) -lemma sta_inv_bind1: ∀h,b,J,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓑ{b,J}Y.X •[h] U → - ∃∃Z. ⦃G, L.ⓑ{J}Y⦄ ⊢ X •[h] Z & U = ⓑ{b,J}Y.Z. -/2 width=3 by sta_inv_bind1_aux/ qed-. - -fact sta_inv_appl1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀X,Y. T = ⓐY.X → - ∃∃Z. ⦃G, L⦄ ⊢ X •[h] Z & U = ⓐY.Z. -#h #G #L #T #U * -G -L -T -U -[ #G #L #k #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 #W #T #U #_ #X #Y #H destruct -] -qed-. - -(* Basic_1: was: sty0_gen_appl *) -lemma sta_inv_appl1: ∀h,G,L,Y,X,U. ⦃G, L⦄ ⊢ ⓐY.X •[h] U → - ∃∃Z. ⦃G, L⦄ ⊢ X •[h] Z & U = ⓐY.Z. -/2 width=3 by sta_inv_appl1_aux/ qed-. - -fact sta_inv_cast1_aux: ∀h,G,L,T,U. ⦃G, L⦄ ⊢ T •[h] U → ∀X,Y. T = ⓝY.X → - ⦃G, L⦄ ⊢ X •[h] U. -#h #G #L #T #U * -G -L -T -U -[ #G #L #k #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 #_ #X #Y #H destruct -| #G #L #W #T #U #HTU #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-.