X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbasic_2%2Fsyntax%2Flenv.ma;fp=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbasic_2%2Fsyntax%2Flenv.ma;h=cfefa7fd876f9ac5f317cc08935474d666b389f2;hb=09b4420070d6a71990e16211e499b51dbb0742cb;hp=0000000000000000000000000000000000000000;hpb=bba53a83579540bc3925d47d679e2aad22e85755;p=helm.git diff --git a/matita/matita/contribs/lambdadelta/basic_2/syntax/lenv.ma b/matita/matita/contribs/lambdadelta/basic_2/syntax/lenv.ma new file mode 100644 index 000000000..cfefa7fd8 --- /dev/null +++ b/matita/matita/contribs/lambdadelta/basic_2/syntax/lenv.ma @@ -0,0 +1,75 @@ +(**************************************************************************) +(* ___ *) +(* ||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/constructors/star_0.ma". +include "basic_2/notation/constructors/dxbind2_3.ma". +include "basic_2/notation/constructors/dxabbr_2.ma". +include "basic_2/notation/constructors/dxabst_2.ma". +include "basic_2/syntax/term.ma". + +(* LOCAL ENVIRONMENTS *******************************************************) + +(* local environments *) +inductive lenv: Type[0] ≝ +| LAtom: lenv (* empty *) +| LPair: lenv → bind2 → term → lenv (* binary binding construction *) +. + +interpretation "sort (local environment)" + 'Star = LAtom. + +interpretation "local environment binding construction (binary)" + 'DxBind2 L I T = (LPair L I T). + +interpretation "abbreviation (local environment)" + 'DxAbbr L T = (LPair L Abbr T). + +interpretation "abstraction (local environment)" + 'DxAbst L T = (LPair L Abst T). + +definition ceq: relation3 lenv term term ≝ λL,T1,T2. T1 = T2. + +definition cfull: relation3 lenv term term ≝ λL,T1,T2. ⊤. + +(* Basic properties *********************************************************) + +lemma eq_lenv_dec: ∀L1,L2:lenv. Decidable (L1 = L2). +#L1 elim L1 -L1 [| #L1 #I1 #V1 #IHL1 ] * [2,4: #L2 #I2 #V2 ] +[1,4: @or_intror #H destruct +| elim (eq_bind2_dec I1 I2) #HI + [ elim (eq_term_dec V1 V2) #HV + [ elim (IHL1 L2) -IHL1 /2 width=1 by or_introl/ #HL ] + ] + @or_intror #H destruct /2 width=1 by/ +| /2 width=1 by or_introl/ +] +qed-. + +(* Basic inversion lemmas ***************************************************) + +fact destruct_lpair_lpair_aux: ∀I1,I2,L1,L2,V1,V2. L1.ⓑ{I1}V1 = L2.ⓑ{I2}V2 → + ∧∧L1 = L2 & I1 = I2 & V1 = V2. +#I1 #I2 #L1 #L2 #V1 #V2 #H destruct /2 width=1 by and3_intro/ +qed-. + +lemma discr_lpair_x_xy: ∀I,V,L. L = L.ⓑ{I}V → ⊥. +#I #V #L elim L -L +[ #H destruct +| #L #J #W #IHL #H + elim (destruct_lpair_lpair_aux … H) -H #H1 #H2 #H3 destruct /2 width=1 by/ (**) (* destruct lemma needed *) +] +qed-. + +lemma discr_lpair_xy_x: ∀I,V,L. L.ⓑ{I}V = L→ ⊥. +/2 width=4 by discr_lpair_x_xy/ qed-.