X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2Fcontribs%2Flambda_delta%2FBasic_2%2Fgrammar%2Fterm.ma;h=6e8370d497251de2cfd69bfba097e5418823bb77;hb=44c1079dabf1d3c0b69d0155ddbaea8627ec901c;hp=3b6614361654328f5548874c8edc738713f32fbb;hpb=55dc00c1c44cc21c7ae179cb9df03e7446002c46;p=helm.git diff --git a/matita/matita/contribs/lambda_delta/Basic_2/grammar/term.ma b/matita/matita/contribs/lambda_delta/Basic_2/grammar/term.ma index 3b6614361..6e8370d49 100644 --- a/matita/matita/contribs/lambda_delta/Basic_2/grammar/term.ma +++ b/matita/matita/contribs/lambda_delta/Basic_2/grammar/term.ma @@ -12,7 +12,7 @@ (* *) (**************************************************************************) -include "Basic-2/grammar/item.ma". +include "Basic_2/grammar/item.ma". (* TERMS ********************************************************************) @@ -22,14 +22,96 @@ inductive term: Type[0] ≝ | TPair: item2 → term → term → term (* binary item construction *) . -interpretation "sort (term)" 'Star k = (TAtom (Sort k)). +interpretation "term construction (atomic)" + 'Item0 I = (TAtom I). -interpretation "local reference (term)" 'LRef i = (TAtom (LRef i)). +interpretation "term construction (binary)" + 'SnItem2 I T1 T2 = (TPair I T1 T2). -interpretation "term construction (atomic)" 'SItem I = (TAtom I). +interpretation "term binding construction (binary)" + 'SnBind2 I T1 T2 = (TPair (Bind2 I) T1 T2). -interpretation "term construction (binary)" 'SItem I T1 T2 = (TPair I T1 T2). +interpretation "term flat construction (binary)" + 'SnFlat2 I T1 T2 = (TPair (Flat2 I) T1 T2). -interpretation "term binding construction (binary)" 'SBind I T1 T2 = (TPair (Bind I) T1 T2). +interpretation "sort (term)" + 'Star k = (TAtom (Sort k)). -interpretation "term flat construction (binary)" 'SFlat I T1 T2 = (TPair (Flat I) T1 T2). +interpretation "local reference (term)" + 'LRef i = (TAtom (LRef i)). + +interpretation "global reference (term)" + 'GRef p = (TAtom (GRef p)). + +interpretation "abbreviation (term)" + 'SnAbbr T1 T2 = (TPair (Bind2 Abbr) T1 T2). + +interpretation "abstraction (term)" + 'SnAbst T1 T2 = (TPair (Bind2 Abst) T1 T2). + +interpretation "application (term)" + 'SnAppl T1 T2 = (TPair (Flat2 Appl) T1 T2). + +interpretation "native type annotation (term)" + 'SnCast T1 T2 = (TPair (Flat2 Cast) T1 T2). + +(* Basic properties *********************************************************) + +(* Basic_1: was: term_dec *) +axiom term_eq_dec: ∀T1,T2:term. Decidable (T1 = T2). + +(* Basic inversion lemmas ***************************************************) + +lemma discr_tpair_xy_x: ∀I,T,V. ②{I} V. T = V → False. +#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/ +] +qed-. + +(* Basic_1: was: thead_x_y_y *) +lemma discr_tpair_xy_y: ∀I,V,T. ②{I} V. T = T → False. +#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/ +] +qed-. + +lemma eq_false_inv_tpair_sn: ∀I,V1,T1,V2,T2. + (②{I} V1. T1 = ②{I} V2. T2 → False) → + (V1 = V2 → False) ∨ (V1 = V2 ∧ (T1 = T2 → False)). +#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/ +qed-. + +lemma eq_false_inv_tpair_dx: ∀I,V1,T1,V2,T2. + (②{I} V1. T1 = ②{I} V2. T2 → False) → + (T1 = T2 → False) ∨ (T1 = T2 ∧ (V1 = V2 → False)). +#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/ +qed-. + +lemma eq_false_inv_beta: ∀V1,V2,W1,W2,T1,T2. + (ⓐV1. ⓛW1. T1 = ⓐV2. ⓛW2 .T2 →False) → + (W1 = W2 → False) ∨ + (W1 = W2 ∧ (ⓓV1. T1 = ⓓV2. T2 → False)). +#V1 #V2 #W1 #W2 #T1 #T2 #H +elim (eq_false_inv_tpair_sn … H) -H +[ #HV12 elim (term_eq_dec W1 W2) /3 width=1/ + #H destruct @or_intror @conj // #H destruct /2 width=1/ +| * #H1 #H2 destruct + elim (eq_false_inv_tpair_sn … H2) -H2 /3 width=1/ + * #H #HT12 destruct + @or_intror @conj // #H destruct /2 width=1/ +] +qed. + +(* Basic_1: removed theorems 3: + not_void_abst not_abbr_void not_abst_void +*)