From 282511a928532676813d99d08594cd5f98fcb80e Mon Sep 17 00:00:00 2001 From: Ferruccio Guidi Date: Tue, 12 Jun 2018 15:48:33 +0200 Subject: [PATCH] renaming in basic_2 nv is now cnv --- .../lambdadelta/basic_2/dynamic/cnv.ma | 141 ++++++++++++++++++ .../basic_2/dynamic/{nv_aaa.ma => cnv_aaa.ma} | 6 +- .../dynamic/{nv_drops.ma => cnv_drops.ma} | 62 ++++---- .../dynamic/{nv_fqus.ma => cnv_fqus.ma} | 42 +++--- .../basic_2/dynamic/{nv_fsb.ma => cnv_fsb.ma} | 8 +- .../lambdadelta/basic_2/dynamic/nv.ma | 141 ------------------ .../lambdadelta/basic_2/dynamic/partial.txt | 2 +- .../lambdadelta/basic_2/web/basic_2_src.tbl | 4 +- 8 files changed, 203 insertions(+), 203 deletions(-) create mode 100644 matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv.ma rename matita/matita/contribs/lambdadelta/basic_2/dynamic/{nv_aaa.ma => cnv_aaa.ma} (91%) rename matita/matita/contribs/lambdadelta/basic_2/dynamic/{nv_drops.ma => cnv_drops.ma} (74%) rename matita/matita/contribs/lambdadelta/basic_2/dynamic/{nv_fqus.ma => cnv_fqus.ma} (60%) rename matita/matita/contribs/lambdadelta/basic_2/dynamic/{nv_fsb.ma => cnv_fsb.ma} (81%) delete mode 100644 matita/matita/contribs/lambdadelta/basic_2/dynamic/nv.ma diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv.ma new file mode 100644 index 000000000..bfa880d6c --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv.ma @@ -0,0 +1,141 @@ +(**************************************************************************) +(* ___ *) +(* ||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/exclaim_5.ma". +include "basic_2/rt_computation/cpms.ma". + +(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) + +(* activate genv *) +(* Basic_2A1: uses: snv *) +inductive cnv (a) (h): relation3 genv lenv term ≝ +| cnv_sort: ∀G,L,s. cnv a h G L (⋆s) +| cnv_zero: ∀I,G,K,V. cnv a h G K V → cnv a h G (K.ⓑ{I}V) (#0) +| cnv_lref: ∀I,G,K,i. cnv a h G K (#i) → cnv a h G (K.ⓘ{I}) (#↑i) +| cnv_bind: ∀p,I,G,L,V,T. cnv a h G L V → cnv a h G (L.ⓑ{I}V) T → cnv a h G L (ⓑ{p,I}V.T) +| cnv_appl: ∀n,p,G,L,V,W0,T,U0. (a = Ⓣ → n = 1) → cnv a h G L V → cnv a h G L T → + ⦃G, L⦄ ⊢ V ➡*[1, h] W0 → ⦃G, L⦄ ⊢ T ➡*[n, h] ⓛ{p}W0.U0 → cnv a h G L (ⓐV.T) +| cnv_cast: ∀G,L,U,T,U0. cnv a h G L U → cnv a h G L T → + ⦃G, L⦄ ⊢ U ➡*[h] U0 → ⦃G, L⦄ ⊢ T ➡*[1, h] U0 → cnv a h G L (ⓝU.T) +. + +interpretation "context-sensitive native validity (term)" + 'Exclaim a h G L T = (cnv a h G L T). + +(* Basic inversion lemmas ***************************************************) + +fact cnv_inv_zero_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → X = #0 → + ∃∃I,K,V. ⦃G, K⦄ ⊢ V ![a, h] & L = K.ⓑ{I}V. +#a #h #G #L #X * -G -L -X +[ #G #L #s #H destruct +| #I #G #K #V #HV #_ /2 width=5 by ex2_3_intro/ +| #I #G #K #i #_ #H destruct +| #p #I #G #L #V #T #_ #_ #H destruct +| #n #p #G #L #V #W0 #T #U0 #_ #_ #_ #_ #_ #H destruct +| #G #L #U #T #U0 #_ #_ #_ #_ #H destruct +] +qed-. + +lemma cnv_inv_zero (a) (h): ∀G,L. ⦃G, L⦄ ⊢ #0 ![a, h] → + ∃∃I,K,V. ⦃G, K⦄ ⊢ V ![a, h] & L = K.ⓑ{I}V. +/2 width=3 by cnv_inv_zero_aux/ qed-. + +fact cnv_inv_lref_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀i. X = #(↑i) → + ∃∃I,K. ⦃G, K⦄ ⊢ #i ![a, h] & L = K.ⓘ{I}. +#a #h #G #L #X * -G -L -X +[ #G #L #s #j #H destruct +| #I #G #K #V #_ #j #H destruct +| #I #G #L #i #Hi #j #H destruct /2 width=4 by ex2_2_intro/ +| #p #I #G #L #V #T #_ #_ #j #H destruct +| #n #p #G #L #V #W0 #T #U0 #_ #_ #_ #_ #_ #j #H destruct +| #G #L #U #T #U0 #_ #_ #_ #_ #j #H destruct +] +qed-. + +lemma cnv_inv_lref (a) (h): ∀G,L,i. ⦃G, L⦄ ⊢ #↑i ![a, h] → + ∃∃I,K. ⦃G, K⦄ ⊢ #i ![a, h] & L = K.ⓘ{I}. +/2 width=3 by cnv_inv_lref_aux/ qed-. + +fact cnv_inv_gref_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀l. X = §l → ⊥. +#a #h #G #L #X * -G -L -X +[ #G #L #s #l #H destruct +| #I #G #K #V #_ #l #H destruct +| #I #G #K #i #_ #l #H destruct +| #p #I #G #L #V #T #_ #_ #l #H destruct +| #n #p #G #L #V #W0 #T #U0 #_ #_ #_ #_ #_ #l #H destruct +| #G #L #U #T #U0 #_ #_ #_ #_ #l #H destruct +] +qed-. + +(* Basic_2A1: uses: snv_inv_gref *) +lemma cnv_inv_gref (a) (h): ∀G,L,l. ⦃G, L⦄ ⊢ §l ![a, h] → ⊥. +/2 width=8 by cnv_inv_gref_aux/ qed-. + +fact cnv_inv_bind_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → + ∀p,I,V,T. X = ⓑ{p,I}V.T → + ∧∧ ⦃G, L⦄ ⊢ V ![a, h] + & ⦃G, L.ⓑ{I}V⦄ ⊢ T ![a, h]. +#a #h #G #L #X * -G -L -X +[ #G #L #s #q #Z #X1 #X2 #H destruct +| #I #G #K #V #_ #q #Z #X1 #X2 #H destruct +| #I #G #K #i #_ #q #Z #X1 #X2 #H destruct +| #p #I #G #L #V #T #HV #HT #q #Z #X1 #X2 #H destruct /2 width=1 by conj/ +| #n #p #G #L #V #W0 #T #U0 #_ #_ #_ #_ #_ #q #Z #X1 #X2 #H destruct +| #G #L #U #T #U0 #_ #_ #_ #_ #q #Z #X1 #X2 #H destruct +] +qed-. + +(* Basic_2A1: uses: snv_inv_bind *) +lemma cnv_inv_bind (a) (h): ∀p,I,G,L,V,T. ⦃G, L⦄ ⊢ ⓑ{p,I}V.T ![a, h] → + ∧∧ ⦃G, L⦄ ⊢ V ![a, h] + & ⦃G, L.ⓑ{I}V⦄ ⊢ T ![a, h]. +/2 width=4 by cnv_inv_bind_aux/ qed-. + +fact cnv_inv_appl_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀V,T. X = ⓐV.T → + ∃∃n,p,W0,U0. a = Ⓣ → n = 1 & ⦃G, L⦄ ⊢ V ![a, h] & ⦃G, L⦄ ⊢ T ![a, h] & + ⦃G, L⦄ ⊢ V ➡*[1, h] W0 & ⦃G, L⦄ ⊢ T ➡*[n, h] ⓛ{p}W0.U0. +#a #h #G #L #X * -L -X +[ #G #L #s #X1 #X2 #H destruct +| #I #G #K #V #_ #X1 #X2 #H destruct +| #I #G #K #i #_ #X1 #X2 #H destruct +| #p #I #G #L #V #T #_ #_ #X1 #X2 #H destruct +| #n #p #G #L #V #W0 #T #U0 #Ha #HV #HT #HVW0 #HTU0 #X1 #X2 #H destruct /3 width=7 by ex5_4_intro/ +| #G #L #U #T #U0 #_ #_ #_ #_ #X1 #X2 #H destruct +] +qed-. + +(* Basic_2A1: uses: snv_inv_appl *) +lemma cnv_inv_appl (a) (h): ∀G,L,V,T. ⦃G, L⦄ ⊢ ⓐV.T ![a, h] → + ∃∃n,p,W0,U0. a = Ⓣ → n = 1 & ⦃G, L⦄ ⊢ V ![a, h] & ⦃G, L⦄ ⊢ T ![a, h] & + ⦃G, L⦄ ⊢ V ➡*[1, h] W0 & ⦃G, L⦄ ⊢ T ➡*[n, h] ⓛ{p}W0.U0. +/2 width=3 by cnv_inv_appl_aux/ qed-. + +fact cnv_inv_cast_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀U,T. X = ⓝU.T → + ∃∃U0. ⦃G, L⦄ ⊢ U ![a, h] & ⦃G, L⦄ ⊢ T ![a, h] & + ⦃G, L⦄ ⊢ U ➡*[h] U0 & ⦃G, L⦄ ⊢ T ➡*[1, h] U0. +#a #h #G #L #X * -G -L -X +[ #G #L #s #X1 #X2 #H destruct +| #I #G #K #V #_ #X1 #X2 #H destruct +| #I #G #K #i #_ #X1 #X2 #H destruct +| #p #I #G #L #V #T #_ #_ #X1 #X2 #H destruct +| #n #p #G #L #V #W0 #T #U0 #_ #_ #_ #_ #_ #X1 #X2 #H destruct +| #G #L #U #T #U0 #HV #HT #HU0 #HTU0 #X1 #X2 #H destruct /2 width=3 by ex4_intro/ +] +qed-. + +(* Basic_2A1: uses: snv_inv_appl *) +lemma cnv_inv_cast (a) (h): ∀G,L,U,T. ⦃G, L⦄ ⊢ ⓝU.T ![a, h] → + ∃∃U0. ⦃G, L⦄ ⊢ U ![a, h] & ⦃G, L⦄ ⊢ T ![a, h] & + ⦃G, L⦄ ⊢ U ➡*[h] U0 & ⦃G, L⦄ ⊢ T ➡*[1, h] U0. +/2 width=3 by cnv_inv_cast_aux/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nv_aaa.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_aaa.ma similarity index 91% rename from matita/matita/contribs/lambdadelta/basic_2/dynamic/nv_aaa.ma rename to matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_aaa.ma index 2ed2b630a..18e245959 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nv_aaa.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_aaa.ma @@ -13,14 +13,14 @@ (**************************************************************************) include "basic_2/rt_computation/cpms_aaa.ma". -include "basic_2/dynamic/nv.ma". +include "basic_2/dynamic/cnv.ma". -(* NATIVE VALIDITY FOR TERMS ************************************************) +(* CONTEXT_SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) (* Forward lemmas on atomic arity assignment for terms **********************) (* Basic_2A1: uses: snv_fwd_aaa *) -lemma nv_fwd_aaa (a) (h): ∀G,L,T. ⦃G, L⦄ ⊢ T ![a, h] → ∃A. ⦃G, L⦄ ⊢ T ⁝ A. +lemma cnv_fwd_aaa (a) (h): ∀G,L,T. ⦃G, L⦄ ⊢ T ![a, h] → ∃A. ⦃G, L⦄ ⊢ T ⁝ A. #a #h #G #L #T #H elim H -G -L -T [ /2 width=2 by aaa_sort, ex_intro/ | #I #G #L #V #_ * /3 width=2 by aaa_zero, ex_intro/ diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nv_drops.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_drops.ma similarity index 74% rename from matita/matita/contribs/lambdadelta/basic_2/dynamic/nv_drops.ma rename to matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_drops.ma index 9d32d0345..cebadeb67 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nv_drops.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_drops.ma @@ -13,37 +13,37 @@ (**************************************************************************) include "basic_2/rt_computation/cpms_drops.ma". -include "basic_2/dynamic/nv.ma". +include "basic_2/dynamic/cnv.ma". -(* NATIVE VALIDITY FOR TERMS ************************************************) +(* CONTEXT_SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) (* Advanced dproperties *****************************************************) (* Basic_2A1: uses: snv_lref *) -lemma nv_lref_drops (a) (h) (G): ∀I,K,V,i,L. ⦃G, K⦄ ⊢ V ![a, h] → - ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G, L⦄ ⊢ #i ![a, h]. +lemma cnv_lref_drops (a) (h) (G): ∀I,K,V,i,L. ⦃G, K⦄ ⊢ V ![a, h] → + ⬇*[i] L ≘ K.ⓑ{I}V → ⦃G, L⦄ ⊢ #i ![a, h]. #a #h #G #I #K #V #i elim i -i [ #L #HV #H lapply (drops_fwd_isid … H ?) -H // #H destruct - /2 width=1 by nv_zero/ + /2 width=1 by cnv_zero/ | #i #IH #L #HV #H elim (drops_inv_succ … H) -H #J0 #K0 #HK0 #H destruct - /3 width=1 by nv_lref/ + /3 width=1 by cnv_lref/ ] qed. (* Advanced inversion lemmas ************************************************) (* Basic_2A1: uses: snv_inv_lref *) -lemma nv_inv_lref_drops (a) (h) (G): - ∀i,L. ⦃G, L⦄ ⊢ #i ![a, h] → - ∃∃I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V & ⦃G, K⦄ ⊢ V ![a, h]. +lemma cnv_inv_lref_drops (a) (h) (G): + ∀i,L. ⦃G, L⦄ ⊢ #i ![a, h] → + ∃∃I,K,V. ⬇*[i] L ≘ K.ⓑ{I}V & ⦃G, K⦄ ⊢ V ![a, h]. #a #h #G #i elim i -i [ #L #H - elim (nv_inv_zero … H) -H #I #K #V #HV #H destruct + elim (cnv_inv_zero … H) -H #I #K #V #HV #H destruct /3 width=5 by drops_refl, ex2_3_intro/ | #i #IH #X #H - elim (nv_inv_lref … H) -H #I #L #HL #H destruct + elim (cnv_inv_lref … H) -H #I #L #HL #H destruct elim (IH … HL) -IH -HL #J #K #V #HLK #HV /3 width=5 by drops_drop, ex2_3_intro/ ] @@ -52,13 +52,13 @@ qed-. (* Properties with generic slicing for local environments *******************) (* Basic_2A1: uses: snv_lift *) -lemma sv_lifts (a) (h): ∀G. d_liftable1 (nv a h G). +lemma csv_lifts (a) (h): ∀G. d_liftable1 (cnv a h G). #a #h #G #K #T @(fqup_wf_ind_eq (Ⓣ) … G K T) -G -K -T #G0 #K0 #T0 #IH #G #K * * [|||| * ] [ #s #HG #HK #HT #_ #b #f #L #_ #X #H2 destruct >(lifts_inv_sort1 … H2) -X -K -f // | #i #HG #HK #HT #H1 #b #f #L #HLK #X #H2 destruct - elim (nv_inv_lref_drops … H1) -H1 #I0 #K0 #V #HK0 #HV + elim (cnv_inv_lref_drops … H1) -H1 #I0 #K0 #V #HK0 #HV elim (lifts_inv_lref1 … H2) -H2 #j #Hf #H destruct (**) (* this should be a lemma *) lapply (drops_trans … HLK … HK0 ??) -HLK [3,6: |*: // ] #H @@ -67,37 +67,37 @@ lemma sv_lifts (a) (h): ∀G. d_liftable1 (nv a h G). elim (drops_inv_skip2 … HY) -HY #Z #L0 #HLK0 #HZ #H destruct elim (liftsb_inv_pair_sn … HZ) -HZ #W #HVW #H destruct (**) (* end of the lemma *) - /4 width=8 by nv_lref_drops, fqup_lref, drops_inv_gen/ + /4 width=8 by cnv_lref_drops, fqup_lref, drops_inv_gen/ | #l #HG #HK #HT #H1 #b #f #L #_ #X #_ destruct - elim (nv_inv_gref … H1) + elim (cnv_inv_gref … H1) | #p #I #V #T #HG #HK #HT #H1 #b #f #L #HLK #X #H2 destruct - elim (nv_inv_bind … H1) -H1 #HV #HT + elim (cnv_inv_bind … H1) -H1 #HV #HT elim (lifts_inv_bind1 … H2) -H2 #W #U #HVW #HTU #H destruct - /5 width=8 by nv_bind, drops_skip, ext2_pair/ + /5 width=8 by cnv_bind, drops_skip, ext2_pair/ | #V #T #HG #HK #HT #H1 #b #f #L #HLK #X #H2 destruct - elim (nv_inv_appl … H1) #n #p #W0 #U0 #Ha #HV #HT #HVW0 #HTW0 + elim (cnv_inv_appl … H1) #n #p #W0 #U0 #Ha #HV #HT #HVW0 #HTW0 elim (lifts_inv_flat1 … H2) -H2 #W #U #HVW #HTU #H destruct elim (lifts_total W0 f) elim (lifts_total U0 (⫯f)) - /4 width=17 by nv_appl, cpms_lifts_bi, lifts_bind/ + /4 width=17 by cnv_appl, cpms_lifts_bi, lifts_bind/ | #V #T #HG #HK #HT #H1 #b #f #L #HLK #X #H2 destruct - elim (nv_inv_cast … H1) #U0 #HV #HT #HVU0 #HTU0 + elim (cnv_inv_cast … H1) #U0 #HV #HT #HVU0 #HTU0 elim (lifts_inv_flat1 … H2) -H2 #W #U #HVW #HTU #H destruct elim (lifts_total U0 f) - /3 width=12 by nv_cast, cpms_lifts_bi/ + /3 width=12 by cnv_cast, cpms_lifts_bi/ ] qed-. (* Inversion lemmas with generic slicing for local environments *************) (* Basic_2A1: uses: snv_inv_lift *) -lemma nv_inv_lifts (a) (h): ∀G. d_deliftable1 (nv a h G). +lemma cnv_inv_lifts (a) (h): ∀G. d_deliftable1 (cnv a h G). #a #h #G #L #U @(fqup_wf_ind_eq (Ⓣ) … G L U) -G -L -U #G0 #L0 #U0 #IH #G #L * * [|||| * ] [ #s #HG #HL #HU #H1 #b #f #K #HLK #X #H2 destruct >(lifts_inv_sort2 … H2) -X -L -f // | #j #HG #HL #HU #H1 #b #f #K #HLK #X #H2 destruct - elim (nv_inv_lref_drops … H1) -H1 #I0 #L0 #W #HL0 #HW + elim (cnv_inv_lref_drops … H1) -H1 #I0 #L0 #W #HL0 #HW elim (lifts_inv_lref2 … H2) -H2 #i #Hf #H destruct (**) (* this should be a lemma *) lapply (drops_split_div … HLK (𝐔❴i❵) ???) -HLK [4,8: * |*: // ] #Y0 #HK #HLY0 @@ -106,27 +106,27 @@ lemma nv_inv_lifts (a) (h): ∀G. d_deliftable1 (nv a h G). elim (drops_inv_skip1 … HLY0) -HLY0 #Z #K0 #HLK0 #HZ #H destruct elim (liftsb_inv_pair_dx … HZ) -HZ #V #HVW #H destruct (**) (* end of the lemma *) - /4 width=8 by nv_lref_drops, fqup_lref, drops_inv_F/ + /4 width=8 by cnv_lref_drops, fqup_lref, drops_inv_F/ | #l #HG #HL #HU #H1 #b #f #K #_ #X #_ destruct - elim (nv_inv_gref … H1) + elim (cnv_inv_gref … H1) | #p #I #W #U #HG #HL #HU #H1 #b #f #K #HLK #X #H2 destruct - elim (nv_inv_bind … H1) -H1 #HW #HU + elim (cnv_inv_bind … H1) -H1 #HW #HU elim (lifts_inv_bind2 … H2) -H2 #V #T #HVW #HTU #H destruct - /5 width=8 by nv_bind, drops_skip, ext2_pair/ + /5 width=8 by cnv_bind, drops_skip, ext2_pair/ | #W #U #HG #HL #HU #H1 #b #f #K #HLK #X #H2 destruct - elim (nv_inv_appl … H1) #n #p #W0 #U0 #Ha #HW #HU #HW0 #HU0 + elim (cnv_inv_appl … H1) #n #p #W0 #U0 #Ha #HW #HU #HW0 #HU0 elim (lifts_inv_flat2 … H2) -H2 #V #T #HVW #HTU #H destruct elim (cpms_inv_lifts_sn … HW0 … HLK … HVW) -HW0 #V0 #HVW0 #HV0 elim (cpms_inv_lifts_sn … HU0 … HLK … HTU) -HU0 #X0 #H #HT0 elim (lifts_inv_bind2 … H) -H #X #T0 #HX #HTU0 #H destruct lapply (lifts_inj … HX … HVW0) -HX #H destruct - /3 width=8 by nv_appl/ + /3 width=8 by cnv_appl/ | #W #U #HG #HL #HU #H1 #b #f #K #HLK #X #H2 destruct - elim (nv_inv_cast … H1) #U0 #HW #HU #HWU0 #HU0 + elim (cnv_inv_cast … H1) #U0 #HW #HU #HWU0 #HU0 elim (lifts_inv_flat2 … H2) -H2 #V #T #HVW #HTU #H destruct elim (cpms_inv_lifts_sn … HWU0 … HLK … HVW) -HWU0 #V0 #HVU0 #HV0 elim (cpms_inv_lifts_sn … HU0 … HLK … HTU) -HU0 #X #HX #HTV0 lapply (lifts_inj … HX … HVU0) -HX #H destruct - /3 width=8 by nv_cast/ + /3 width=8 by cnv_cast/ ] qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nv_fqus.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_fqus.ma similarity index 60% rename from matita/matita/contribs/lambdadelta/basic_2/dynamic/nv_fqus.ma rename to matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_fqus.ma index af3fba488..341a3b1cb 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nv_fqus.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_fqus.ma @@ -13,52 +13,52 @@ (**************************************************************************) include "basic_2/s_computation/fqus_fqup.ma". -include "basic_2/dynamic/nv_drops.ma". +include "basic_2/dynamic/cnv_drops.ma". -(* NATIVE VALIDITY FOR TERMS ************************************************) +(* CONTEXT_SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) (* Properties with supclosure ***********************************************) (* Basic_2A1: uses: snv_fqu_conf *) -lemma nv_fqu_conf (a) (h): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ → - ⦃G1, L1⦄ ⊢ T1 ![a, h] → ⦃G2, L2⦄ ⊢ T2 ![a, h]. +lemma cnv_fqu_conf (a) (h): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐ ⦃G2, L2, T2⦄ → + ⦃G1, L1⦄ ⊢ T1 ![a, h] → ⦃G2, L2⦄ ⊢ T2 ![a, h]. #a #h #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -G1 -G2 -L1 -L2 -T1 -T2 [ #I1 #G1 #L1 #V1 #H - elim (nv_inv_zero … H) -H #I2 #L2 #V2 #HV2 #H destruct // + elim (cnv_inv_zero … H) -H #I2 #L2 #V2 #HV2 #H destruct // | * [ #p #I1 | * ] #G1 #L1 #V1 #T1 #H - [ elim (nv_inv_bind … H) -H // - | elim (nv_inv_appl … H) -H // - | elim (nv_inv_cast … H) -H // + [ elim (cnv_inv_bind … H) -H // + | elim (cnv_inv_appl … H) -H // + | elim (cnv_inv_cast … H) -H // ] | #p #I1 #G1 #L1 #V1 #T1 #H - elim (nv_inv_bind … H) -H // + elim (cnv_inv_bind … H) -H // | #p #I1 #G1 #L1 #V1 #T1 #H destruct | * #G1 #L1 #V1 #T1 #H - [ elim (nv_inv_appl … H) -H // - | elim (nv_inv_cast … H) -H // + [ elim (cnv_inv_appl … H) -H // + | elim (cnv_inv_cast … H) -H // ] | #I1 #G1 #L1 #T1 #U1 #HTU1 #HU - /4 width=7 by nv_inv_lifts, drops_refl, drops_drop/ + /4 width=7 by cnv_inv_lifts, drops_refl, drops_drop/ ] qed-. (* Basic_2A1: uses: snv_fquq_conf *) -lemma nv_fquq_conf (a) (h): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ → - ⦃G1, L1⦄ ⊢ T1 ![a, h] → ⦃G2, L2⦄ ⊢ T2 ![a, h]. +lemma cnv_fquq_conf (a) (h): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐⸮ ⦃G2, L2, T2⦄ → + ⦃G1, L1⦄ ⊢ T1 ![a, h] → ⦃G2, L2⦄ ⊢ T2 ![a, h]. #a #h #G1 #G2 #L1 #L2 #T1 #T2 #H elim H -H [|*] -/2 width=5 by nv_fqu_conf/ +/2 width=5 by cnv_fqu_conf/ qed-. (* Basic_2A1: uses: snv_fqup_conf *) -lemma nv_fqup_conf (a) (h): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ → - ⦃G1, L1⦄ ⊢ T1 ![a, h] → ⦃G2, L2⦄ ⊢ T2 ![a, h]. +lemma cnv_fqup_conf (a) (h): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐+ ⦃G2, L2, T2⦄ → + ⦃G1, L1⦄ ⊢ T1 ![a, h] → ⦃G2, L2⦄ ⊢ T2 ![a, h]. #a #h #G1 #G2 #L1 #L2 #T1 #T2 #H @(fqup_ind … H) -G2 -L2 -T2 -/3 width=5 by fqup_strap1, nv_fqu_conf/ +/3 width=5 by fqup_strap1, cnv_fqu_conf/ qed-. (* Basic_2A1: uses: snv_fqus_conf *) -lemma nv_fqus_conf (a) (h): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ → - ⦃G1, L1⦄ ⊢ T1 ![a, h] → ⦃G2, L2⦄ ⊢ T2 ![a, h]. +lemma cnv_fqus_conf (a) (h): ∀G1,G2,L1,L2,T1,T2. ⦃G1, L1, T1⦄ ⊐* ⦃G2, L2, T2⦄ → + ⦃G1, L1⦄ ⊢ T1 ![a, h] → ⦃G2, L2⦄ ⊢ T2 ![a, h]. #a #h #G1 #G2 #L1 #L2 #T1 #T2 #H elim (fqus_inv_fqup … H) -H [|*] -/2 width=5 by nv_fqup_conf/ +/2 width=5 by cnv_fqup_conf/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nv_fsb.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_fsb.ma similarity index 81% rename from matita/matita/contribs/lambdadelta/basic_2/dynamic/nv_fsb.ma rename to matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_fsb.ma index 47eb36f67..e7c4a6c61 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nv_fsb.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/cnv_fsb.ma @@ -13,13 +13,13 @@ (**************************************************************************) include "basic_2/rt_computation/fsb_aaa.ma". -include "basic_2/dynamic/nv_aaa.ma". +include "basic_2/dynamic/cnv_aaa.ma". -(* NATIVE VALIDITY FOR TERMS ************************************************) +(* CONTEXT-SENSITIVE NATIVE VALIDITY FOR TERMS ******************************) (* Forward lemmas with strongly rst-normalizing closures ********************) (* Basic_2A1: uses: snv_fwd_fsb *) -lemma nv_fwd_fsb (a) (h) (o): ∀G,L,T. ⦃G, L⦄ ⊢ T ![a, h] → ≥[h, o] 𝐒⦃G, L, T⦄. -#a #h #o #G #L #T #H elim (nv_fwd_aaa … H) -H /2 width=2 by aaa_fsb/ +lemma cnv_fwd_fsb (a) (h) (o): ∀G,L,T. ⦃G, L⦄ ⊢ T ![a, h] → ≥[h, o] 𝐒⦃G, L, T⦄. +#a #h #o #G #L #T #H elim (cnv_fwd_aaa … H) -H /2 width=2 by aaa_fsb/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nv.ma b/matita/matita/contribs/lambdadelta/basic_2/dynamic/nv.ma deleted file mode 100644 index 4f21d09b0..000000000 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/nv.ma +++ /dev/null @@ -1,141 +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/exclaim_5.ma". -include "basic_2/rt_computation/cpms.ma". - -(* NATIVE VALIDITY FOR TERMS ************************************************) - -(* activate genv *) -(* Basic_2A1: uses: snv *) -inductive nv (a) (h): relation3 genv lenv term ≝ -| nv_sort: ∀G,L,s. nv a h G L (⋆s) -| nv_zero: ∀I,G,K,V. nv a h G K V → nv a h G (K.ⓑ{I}V) (#0) -| nv_lref: ∀I,G,K,i. nv a h G K (#i) → nv a h G (K.ⓘ{I}) (#↑i) -| nv_bind: ∀p,I,G,L,V,T. nv a h G L V → nv a h G (L.ⓑ{I}V) T → nv a h G L (ⓑ{p,I}V.T) -| nv_appl: ∀n,p,G,L,V,W0,T,U0. (a = Ⓣ → n = 1) → nv a h G L V → nv a h G L T → - ⦃G, L⦄ ⊢ V ➡*[1, h] W0 → ⦃G, L⦄ ⊢ T ➡*[n, h] ⓛ{p}W0.U0 → nv a h G L (ⓐV.T) -| nv_cast: ∀G,L,U,T,U0. nv a h G L U → nv a h G L T → - ⦃G, L⦄ ⊢ U ➡*[h] U0 → ⦃G, L⦄ ⊢ T ➡*[1, h] U0 → nv a h G L (ⓝU.T) -. - -interpretation "native validity (term)" - 'Exclaim a h G L T = (nv a h G L T). - -(* Basic inversion lemmas ***************************************************) - -fact nv_inv_zero_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → X = #0 → - ∃∃I,K,V. ⦃G, K⦄ ⊢ V ![a, h] & L = K.ⓑ{I}V. -#a #h #G #L #X * -G -L -X -[ #G #L #s #H destruct -| #I #G #K #V #HV #_ /2 width=5 by ex2_3_intro/ -| #I #G #K #i #_ #H destruct -| #p #I #G #L #V #T #_ #_ #H destruct -| #n #p #G #L #V #W0 #T #U0 #_ #_ #_ #_ #_ #H destruct -| #G #L #U #T #U0 #_ #_ #_ #_ #H destruct -] -qed-. - -lemma nv_inv_zero (a) (h): ∀G,L. ⦃G, L⦄ ⊢ #0 ![a, h] → - ∃∃I,K,V. ⦃G, K⦄ ⊢ V ![a, h] & L = K.ⓑ{I}V. -/2 width=3 by nv_inv_zero_aux/ qed-. - -fact nv_inv_lref_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀i. X = #(↑i) → - ∃∃I,K. ⦃G, K⦄ ⊢ #i ![a, h] & L = K.ⓘ{I}. -#a #h #G #L #X * -G -L -X -[ #G #L #s #j #H destruct -| #I #G #K #V #_ #j #H destruct -| #I #G #L #i #Hi #j #H destruct /2 width=4 by ex2_2_intro/ -| #p #I #G #L #V #T #_ #_ #j #H destruct -| #n #p #G #L #V #W0 #T #U0 #_ #_ #_ #_ #_ #j #H destruct -| #G #L #U #T #U0 #_ #_ #_ #_ #j #H destruct -] -qed-. - -lemma nv_inv_lref (a) (h): ∀G,L,i. ⦃G, L⦄ ⊢ #↑i ![a, h] → - ∃∃I,K. ⦃G, K⦄ ⊢ #i ![a, h] & L = K.ⓘ{I}. -/2 width=3 by nv_inv_lref_aux/ qed-. - -fact nv_inv_gref_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀l. X = §l → ⊥. -#a #h #G #L #X * -G -L -X -[ #G #L #s #l #H destruct -| #I #G #K #V #_ #l #H destruct -| #I #G #K #i #_ #l #H destruct -| #p #I #G #L #V #T #_ #_ #l #H destruct -| #n #p #G #L #V #W0 #T #U0 #_ #_ #_ #_ #_ #l #H destruct -| #G #L #U #T #U0 #_ #_ #_ #_ #l #H destruct -] -qed-. - -(* Basic_2A1: uses: snv_inv_gref *) -lemma nv_inv_gref (a) (h): ∀G,L,l. ⦃G, L⦄ ⊢ §l ![a, h] → ⊥. -/2 width=8 by nv_inv_gref_aux/ qed-. - -fact nv_inv_bind_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → - ∀p,I,V,T. X = ⓑ{p,I}V.T → - ∧∧ ⦃G, L⦄ ⊢ V ![a, h] - & ⦃G, L.ⓑ{I}V⦄ ⊢ T ![a, h]. -#a #h #G #L #X * -G -L -X -[ #G #L #s #q #Z #X1 #X2 #H destruct -| #I #G #K #V #_ #q #Z #X1 #X2 #H destruct -| #I #G #K #i #_ #q #Z #X1 #X2 #H destruct -| #p #I #G #L #V #T #HV #HT #q #Z #X1 #X2 #H destruct /2 width=1 by conj/ -| #n #p #G #L #V #W0 #T #U0 #_ #_ #_ #_ #_ #q #Z #X1 #X2 #H destruct -| #G #L #U #T #U0 #_ #_ #_ #_ #q #Z #X1 #X2 #H destruct -] -qed-. - -(* Basic_2A1: uses: snv_inv_bind *) -lemma nv_inv_bind (a) (h): ∀p,I,G,L,V,T. ⦃G, L⦄ ⊢ ⓑ{p,I}V.T ![a, h] → - ∧∧ ⦃G, L⦄ ⊢ V ![a, h] - & ⦃G, L.ⓑ{I}V⦄ ⊢ T ![a, h]. -/2 width=4 by nv_inv_bind_aux/ qed-. - -fact nv_inv_appl_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀V,T. X = ⓐV.T → - ∃∃n,p,W0,U0. a = Ⓣ → n = 1 & ⦃G, L⦄ ⊢ V ![a, h] & ⦃G, L⦄ ⊢ T ![a, h] & - ⦃G, L⦄ ⊢ V ➡*[1, h] W0 & ⦃G, L⦄ ⊢ T ➡*[n, h] ⓛ{p}W0.U0. -#a #h #G #L #X * -L -X -[ #G #L #s #X1 #X2 #H destruct -| #I #G #K #V #_ #X1 #X2 #H destruct -| #I #G #K #i #_ #X1 #X2 #H destruct -| #p #I #G #L #V #T #_ #_ #X1 #X2 #H destruct -| #n #p #G #L #V #W0 #T #U0 #Ha #HV #HT #HVW0 #HTU0 #X1 #X2 #H destruct /3 width=7 by ex5_4_intro/ -| #G #L #U #T #U0 #_ #_ #_ #_ #X1 #X2 #H destruct -] -qed-. - -(* Basic_2A1: uses: snv_inv_appl *) -lemma nv_inv_appl (a) (h): ∀G,L,V,T. ⦃G, L⦄ ⊢ ⓐV.T ![a, h] → - ∃∃n,p,W0,U0. a = Ⓣ → n = 1 & ⦃G, L⦄ ⊢ V ![a, h] & ⦃G, L⦄ ⊢ T ![a, h] & - ⦃G, L⦄ ⊢ V ➡*[1, h] W0 & ⦃G, L⦄ ⊢ T ➡*[n, h] ⓛ{p}W0.U0. -/2 width=3 by nv_inv_appl_aux/ qed-. - -fact nv_inv_cast_aux (a) (h): ∀G,L,X. ⦃G, L⦄ ⊢ X ![a, h] → ∀U,T. X = ⓝU.T → - ∃∃U0. ⦃G, L⦄ ⊢ U ![a, h] & ⦃G, L⦄ ⊢ T ![a, h] & - ⦃G, L⦄ ⊢ U ➡*[h] U0 & ⦃G, L⦄ ⊢ T ➡*[1, h] U0. -#a #h #G #L #X * -G -L -X -[ #G #L #s #X1 #X2 #H destruct -| #I #G #K #V #_ #X1 #X2 #H destruct -| #I #G #K #i #_ #X1 #X2 #H destruct -| #p #I #G #L #V #T #_ #_ #X1 #X2 #H destruct -| #n #p #G #L #V #W0 #T #U0 #_ #_ #_ #_ #_ #X1 #X2 #H destruct -| #G #L #U #T #U0 #HV #HT #HU0 #HTU0 #X1 #X2 #H destruct /2 width=3 by ex4_intro/ -] -qed-. - -(* Basic_2A1: uses: snv_inv_appl *) -lemma nv_inv_cast (a) (h): ∀G,L,U,T. ⦃G, L⦄ ⊢ ⓝU.T ![a, h] → - ∃∃U0. ⦃G, L⦄ ⊢ U ![a, h] & ⦃G, L⦄ ⊢ T ![a, h] & - ⦃G, L⦄ ⊢ U ➡*[h] U0 & ⦃G, L⦄ ⊢ T ➡*[1, h] U0. -/2 width=3 by nv_inv_cast_aux/ qed-. diff --git a/matita/matita/contribs/lambdadelta/basic_2/dynamic/partial.txt b/matita/matita/contribs/lambdadelta/basic_2/dynamic/partial.txt index 71d809d22..8c90c20b4 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/dynamic/partial.txt +++ b/matita/matita/contribs/lambdadelta/basic_2/dynamic/partial.txt @@ -1 +1 @@ -nv.ma nv_drops.ma nv_fqus.ma nv_aaa.ma nv_fsb.ma +cnv.ma cnv_drops.ma cnv_fqus.ma cnv_aaa.ma cnv_fsb.ma diff --git a/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl b/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl index 0ddb5a0b2..e0976dd36 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl +++ b/matita/matita/contribs/lambdadelta/basic_2/web/basic_2_src.tbl @@ -33,11 +33,11 @@ table { } ] *) - [ { "native validity" * } { + [ { "context-sensitive native validity" * } { (* [ [ "" ] "shnv ( ⦃?,?⦄ ⊢ ? ¡[?,?,?] )" * ] *) - [ [ "for terms" ] "nv" + "( ⦃?,?⦄ ⊢ ? ![?,?] )" "nv_drops" + "nv_fqus" + "nv_aaa" + "nv_fsb" (* + "snv_lpr" + "snv_scpes" + "snv_preserve" *) * ] + [ [ "for terms" ] "cnv" + "( ⦃?,?⦄ ⊢ ? ![?,?] )" "cnv_drops" + "cnv_fqus" + "cnv_aaa" + "cnv_fsb" (* + "snv_lpr" + "snv_scpes" + "snv_preserve" *) * ] } ] } -- 2.39.2