X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbasic_2%2Fcomputation%2Fcsn.ma;h=9aead33d3bc6b710b85b1979d1348b20a2c500f7;hb=f95f6cb21b86f3dad114b21f687aa5df36088064;hp=3ed31016442ad1c05ebf1cbdd72073e28045cf34;hpb=e8998d29ab83e7b6aa495a079193705b2f6743d3;p=helm.git diff --git a/matita/matita/contribs/lambdadelta/basic_2/computation/csn.ma b/matita/matita/contribs/lambdadelta/basic_2/computation/csn.ma index 3ed310164..9aead33d3 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/computation/csn.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/computation/csn.ma @@ -12,72 +12,110 @@ (* *) (**************************************************************************) -include "basic_2/reducibility/cnf.ma". +include "basic_2/notation/relations/sn_4.ma". +include "basic_2/reduction/cnx.ma". -(* CONTEXT-SENSITIVE STRONGLY NORMALIZING TERMS *****************************) +(* CONTEXT-SENSITIVE EXTENDED STRONGLY NORMALIZING TERMS ********************) -definition csn: lenv → predicate term ≝ λL. SN … (cpr L) (eq …). +definition csn: ∀h. sd h → lenv → predicate term ≝ + λh,g,L. SN … (cpx h g L) (eq …). interpretation - "context-sensitive strong normalization (term)" - 'SN L T = (csn L T). + "context-sensitive extended strong normalization (term)" + 'SN h g L T = (csn h g L T). (* Basic eliminators ********************************************************) -lemma csn_ind: ∀L. ∀R:predicate term. - (∀T1. L ⊢ ⬊* T1 → - (∀T2. L ⊢ T1 ➡ T2 → (T1 = T2 → ⊥) → R T2) → +lemma csn_ind: ∀h,g,L. ∀R:predicate term. + (∀T1. ⦃h, L⦄ ⊢ ⬊*[g] T1 → + (∀T2. ⦃h, L⦄ ⊢ T1 ➡[g] T2 → (T1 = T2 → ⊥) → R T2) → R T1 ) → - ∀T. L ⊢ ⬊* T → R T. -#L #R #H0 #T1 #H elim H -T1 #T1 #HT1 #IHT1 + ∀T. ⦃h, L⦄ ⊢ ⬊*[g] T → R T. +#h #g #L #R #H0 #T1 #H elim H -T1 #T1 #HT1 #IHT1 @H0 -H0 /3 width=1/ -IHT1 /4 width=1/ qed-. (* Basic properties *********************************************************) -(* Basic_1: was: sn3_pr2_intro *) -lemma csn_intro: ∀L,T1. - (∀T2. L ⊢ T1 ➡ T2 → (T1 = T2 → ⊥) → L ⊢ ⬊* T2) → L ⊢ ⬊* T1. +(* Basic_1: was just: sn3_pr2_intro *) +lemma csn_intro: ∀h,g,L,T1. + (∀T2. ⦃h, L⦄ ⊢ T1 ➡[g] T2 → (T1 = T2 → ⊥) → ⦃h, L⦄ ⊢ ⬊*[g] T2) → + ⦃h, L⦄ ⊢ ⬊*[g] T1. /4 width=1/ qed. -(* Basic_1: was: sn3_nf2 *) -lemma csn_cnf: ∀L,T. L ⊢ 𝐍⦃T⦄ → L ⊢ ⬊* T. -/2 width=1/ qed. - -lemma csn_cpr_trans: ∀L,T1. L ⊢ ⬊* T1 → ∀T2. L ⊢ T1 ➡ T2 → L ⊢ ⬊* T2. -#L #T1 #H elim H -T1 #T1 #HT1 #IHT1 #T2 #HLT12 +lemma csn_cpx_trans: ∀h,g,L,T1. ⦃h, L⦄ ⊢ ⬊*[g] T1 → + ∀T2. ⦃h, L⦄ ⊢ T1 ➡[g] T2 → ⦃h, L⦄ ⊢ ⬊*[g] T2. +#h #g #L #T1 #H elim H -T1 #T1 #HT1 #IHT1 #T2 #HLT12 @csn_intro #T #HLT2 #HT2 elim (term_eq_dec T1 T2) #HT12 [ -IHT1 -HLT12 destruct /3 width=1/ | -HT1 -HT2 /3 width=4/ +qed-. + +(* Basic_1: was just: sn3_nf2 *) +lemma cnx_csn: ∀h,g,L,T. ⦃h, L⦄ ⊢ 𝐍[g]⦃T⦄ → ⦃h, L⦄ ⊢ ⬊*[g] T. +/2 width=1/ qed. + +lemma cnx_sort: ∀h,g,L,k. ⦃h, L⦄ ⊢ ⬊*[g] ⋆k. +#h #g #L #k elim (deg_total h g k) +#l generalize in match k; -k @(nat_ind_plus … l) -l /3 width=1/ +#l #IHl #k #Hkl lapply (deg_next_SO … Hkl) -Hkl +#Hkl @csn_intro #X #H #HX elim (cpx_inv_sort1 … H) -H +[ #H destruct elim HX // +| -HX * #l0 #_ #H destruct -l0 /2 width=1/ +] qed. -(* Basic_1: was: sn3_cast *) -lemma csn_cast: ∀L,W. L ⊢ ⬊* W → ∀T. L ⊢ ⬊* T → L ⊢ ⬊* ⓝW. T. -#L #W #HW elim HW -W #W #_ #IHW #T #HT @(csn_ind … HT) -T #T #HT #IHT +(* Basic_1: was just: sn3_cast *) +lemma csn_cast: ∀h,g,L,W. ⦃h, L⦄ ⊢ ⬊*[g] W → + ∀T. ⦃h, L⦄ ⊢ ⬊*[g] T → ⦃h, L⦄ ⊢ ⬊*[g] ⓝW.T. +#h #g #L #W #HW @(csn_ind … HW) -W #W #HW #IHW #T #HT @(csn_ind … HT) -T #T #HT #IHT @csn_intro #X #H1 #H2 -elim (cpr_inv_cast1 … H1) -H1 +elim (cpx_inv_cast1 … H1) -H1 [ * #W0 #T0 #HLW0 #HLT0 #H destruct elim (eq_false_inv_tpair_sn … H2) -H2 - [ /3 width=3/ - | -HLW0 * #H destruct /3 width=1/ + [ /3 width=3 by csn_cpx_trans/ + | -HLW0 * #H destruct /3 width=1/ ] -| /3 width=3/ +|2,3: /3 width=3 by csn_cpx_trans/ ] qed. (* Basic forward lemmas *****************************************************) -fact csn_fwd_flat_dx_aux: ∀L,U. L ⊢ ⬊* U → ∀I,V,T. U = ⓕ{I} V. T → L ⊢ ⬊* T. -#L #U #H elim H -H #U0 #_ #IH #I #V #T #H destruct +fact csn_fwd_pair_sn_aux: ∀h,g,L,U. ⦃h, L⦄ ⊢ ⬊*[g] U → + ∀I,V,T. U = ②{I}V.T → ⦃h, L⦄ ⊢ ⬊*[g] V. +#h #g #L #U #H elim H -H #U0 #_ #IH #I #V #T #H destruct +@csn_intro #V2 #HLV2 #HV2 +@(IH (②{I}V2.T)) -IH // /2 width=1/ -HLV2 #H destruct /2 width=1/ +qed-. + +(* Basic_1: was just: sn3_gen_head *) +lemma csn_fwd_pair_sn: ∀h,g,I,L,V,T. ⦃h, L⦄ ⊢ ⬊*[g] ②{I}V.T → ⦃h, L⦄ ⊢ ⬊*[g] V. +/2 width=5 by csn_fwd_pair_sn_aux/ qed-. + +fact csn_fwd_bind_dx_aux: ∀h,g,L,U. ⦃h, L⦄ ⊢ ⬊*[g] U → + ∀a,I,V,T. U = ⓑ{a,I}V.T → ⦃h, L.ⓑ{I}V⦄ ⊢ ⬊*[g] T. +#h #g #L #U #H elim H -H #U0 #_ #IH #a #I #V #T #H destruct @csn_intro #T2 #HLT2 #HT2 -@(IH (ⓕ{I} V. T2)) -IH // /2 width=1/ -HLT2 #H destruct /2 width=1/ -qed. +@(IH (ⓑ{a,I} V. T2)) -IH // /2 width=1/ -HLT2 #H destruct /2 width=1/ +qed-. + +(* Basic_1: was just: sn3_gen_bind *) +lemma csn_fwd_bind_dx: ∀h,g,a,I,L,V,T. ⦃h, L⦄ ⊢ ⬊*[g] ⓑ{a,I}V.T → ⦃h, L.ⓑ{I}V⦄ ⊢ ⬊*[g] T. +/2 width=4 by csn_fwd_bind_dx_aux/ qed-. + +fact csn_fwd_flat_dx_aux: ∀h,g,L,U. ⦃h, L⦄ ⊢ ⬊*[g] U → + ∀I,V,T. U = ⓕ{I}V.T → ⦃h, L⦄ ⊢ ⬊*[g] T. +#h #g #L #U #H elim H -H #U0 #_ #IH #I #V #T #H destruct +@csn_intro #T2 #HLT2 #HT2 +@(IH (ⓕ{I}V.T2)) -IH // /2 width=1/ -HLT2 #H destruct /2 width=1/ +qed-. -(* Basic_1: was: sn3_gen_flat *) -lemma csn_fwd_flat_dx: ∀I,L,V,T. L ⊢ ⬊* ⓕ{I} V. T → L ⊢ ⬊* T. -/2 width=5/ qed-. +(* Basic_1: was just: sn3_gen_flat *) +lemma csn_fwd_flat_dx: ∀h,g,I,L,V,T. ⦃h, L⦄ ⊢ ⬊*[g] ⓕ{I}V.T → ⦃h, L⦄ ⊢ ⬊*[g] T. +/2 width=5 by csn_fwd_flat_dx_aux/ qed-. (* Basic_1: removed theorems 14: sn3_cdelta