X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=matita%2Fmatita%2Fcontribs%2Flambdadelta%2Fbasic_2%2Fgrammar%2Fterm.ma;h=e70058dc9f3be994f09fecc19e75e1e1b8e37a29;hb=5102e7f780e83c7fef1d3826f81dfd37ee4028bc;hp=9e7d860b4348b631df54670b7b8b1c301882cc9c;hpb=f62eeb3c7824564ccbe4fff6e75ddee46ca39cc0;p=helm.git diff --git a/matita/matita/contribs/lambdadelta/basic_2/grammar/term.ma b/matita/matita/contribs/lambdadelta/basic_2/grammar/term.ma index 9e7d860b4..e70058dc9 100644 --- a/matita/matita/contribs/lambdadelta/basic_2/grammar/term.ma +++ b/matita/matita/contribs/lambdadelta/basic_2/grammar/term.ma @@ -12,6 +12,23 @@ (* *) (**************************************************************************) +include "basic_2/notation/constructors/item0_1.ma". +include "basic_2/notation/constructors/snitem2_3.ma". +include "basic_2/notation/constructors/snbind2_4.ma". +include "basic_2/notation/constructors/snbind2pos_3.ma". +include "basic_2/notation/constructors/snbind2neg_3.ma". +include "basic_2/notation/constructors/snflat2_3.ma". +include "basic_2/notation/constructors/star_1.ma". +include "basic_2/notation/constructors/lref_1.ma". +include "basic_2/notation/constructors/gref_1.ma". +include "basic_2/notation/constructors/snabbr_3.ma". +include "basic_2/notation/constructors/snabbrpos_2.ma". +include "basic_2/notation/constructors/snabbrneg_2.ma". +include "basic_2/notation/constructors/snabst_3.ma". +include "basic_2/notation/constructors/snabstpos_2.ma". +include "basic_2/notation/constructors/snabstneg_2.ma". +include "basic_2/notation/constructors/snappl_2.ma". +include "basic_2/notation/constructors/sncast_2.ma". include "basic_2/grammar/item.ma". (* TERMS ********************************************************************) @@ -76,16 +93,34 @@ interpretation "native type annotation (term)" (* Basic properties *********************************************************) (* Basic_1: was: term_dec *) -axiom term_eq_dec: ∀T1,T2:term. Decidable (T1 = T2). +lemma eq_term_dec: ∀T1,T2:term. Decidable (T1 = T2). +#T1 elim T1 -T1 #I1 [| #V1 #T1 #IHV1 #IHT1 ] * #I2 [2,4: #V2 #T2 ] +[1,4: @or_intror #H destruct +| elim (eq_item2_dec I1 I2) #HI + [ elim (IHV1 V2) -IHV1 #HV + [ elim (IHT1 T2) -IHT1 /2 width=1 by or_introl/ #HT ] + ] + @or_intror #H destruct /2 width=1 by/ +| elim (eq_item0_dec I1 I2) /2 width=1 by or_introl/ #HI + @or_intror #H destruct /2 width=1 by/ +] +qed-. (* Basic inversion lemmas ***************************************************) +fact destruct_tatom_tatom_aux: ∀I1,I2. ⓪{I1} = ⓪{I2} → I1 = I2. +#I1 #I2 #H destruct // +qed-. + +fact destruct_tpair_tpair_aux: ∀I1,I2,T1,T2,V1,V2. ②{I1}T1.V1 = ②{I2}T2.V2 → + ∧∧T1 = T2 & I1 = I2 & V1 = V2. +#I1 #I2 #T1 #T2 #V1 #V2 #H destruct /2 width=1 by and3_intro/ +qed-. + lemma discr_tpair_xy_x: ∀I,T,V. ②{I} V. T = V → ⊥. #I #T #V elim V -V [ #J #H destruct -| #J #W #U #IHW #_ #H destruct - -H >e0 in e1; normalize (**) (* destruct: one quality is not simplified, the destucted equality is not erased *) - /2 width=1/ +| #J #W #U #IHW #_ #H elim (destruct_tpair_tpair_aux … H) -H /2 width=1 by/ (**) (* destruct lemma needed *) ] qed-. @@ -93,9 +128,7 @@ qed-. lemma discr_tpair_xy_y: ∀I,V,T. ②{I} V. T = T → ⊥. #I #V #T elim T -T [ #J #H destruct -| #J #W #U #_ #IHU #H destruct - -H (**) (* destruct: the destucted equality is not erased *) - /2 width=1/ +| #J #W #U #_ #IHU #H elim (destruct_tpair_tpair_aux … H) -H /2 width=1 by/ (**) (* destruct lemma needed *) ] qed-. @@ -103,16 +136,16 @@ lemma eq_false_inv_tpair_sn: ∀I,V1,T1,V2,T2. (②{I} V1. T1 = ②{I} V2. T2 → ⊥) → (V1 = V2 → ⊥) ∨ (V1 = V2 ∧ (T1 = T2 → ⊥)). #I #V1 #T1 #V2 #T2 #H -elim (term_eq_dec V1 V2) /3 width=1/ #HV12 destruct -@or_intror @conj // #HT12 destruct /2 width=1/ +elim (eq_term_dec V1 V2) /3 width=1 by or_introl/ #HV12 destruct +@or_intror @conj // #HT12 destruct /2 width=1 by/ qed-. lemma eq_false_inv_tpair_dx: ∀I,V1,T1,V2,T2. (②{I} V1. T1 = ②{I} V2. T2 → ⊥) → (T1 = T2 → ⊥) ∨ (T1 = T2 ∧ (V1 = V2 → ⊥)). #I #V1 #T1 #V2 #T2 #H -elim (term_eq_dec T1 T2) /3 width=1/ #HT12 destruct -@or_intror @conj // #HT12 destruct /2 width=1/ +elim (eq_term_dec T1 T2) /3 width=1 by or_introl/ #HT12 destruct +@or_intror @conj // #HT12 destruct /2 width=1 by/ qed-. (* Basic_1: removed theorems 3: