]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/Basic_2/grammar/term.ma
- main lemmas about abstract reducibility candidates closed
[helm.git] / matita / matita / contribs / lambda_delta / Basic_2 / grammar / term.ma
1 (**************************************************************************)
2 (*       ___                                                              *)
3 (*      ||M||                                                             *)
4 (*      ||A||       A project by Andrea Asperti                           *)
5 (*      ||T||                                                             *)
6 (*      ||I||       Developers:                                           *)
7 (*      ||T||         The HELM team.                                      *)
8 (*      ||A||         http://helm.cs.unibo.it                             *)
9 (*      \   /                                                             *)
10 (*       \ /        This file is distributed under the terms of the       *)
11 (*        v         GNU General Public License Version 2                  *)
12 (*                                                                        *)
13 (**************************************************************************)
14
15 include "Basic_2/grammar/item.ma".
16
17 (* TERMS ********************************************************************)
18
19 (* terms *)
20 inductive term: Type[0] ≝
21   | TAtom: item0 → term               (* atomic item construction *)
22   | TPair: item2 → term → term → term (* binary item construction *)
23 .
24
25 interpretation "term construction (atomic)"
26    'Item0 I = (TAtom I).
27
28 interpretation "term construction (binary)"
29    'SnItem2 I T1 T2 = (TPair I T1 T2).
30
31 interpretation "term binding construction (binary)"
32    'SnBind2 I T1 T2 = (TPair (Bind2 I) T1 T2).
33
34 interpretation "term flat construction (binary)"
35    'SnFlat2 I T1 T2 = (TPair (Flat2 I) T1 T2).
36
37 interpretation "sort (term)"
38    'Star k = (TAtom (Sort k)).
39
40 interpretation "local reference (term)"
41    'LRef i = (TAtom (LRef i)).
42
43 interpretation "global reference (term)"
44    'GRef p = (TAtom (GRef p)).
45
46 interpretation "abbreviation (term)"
47    'SnAbbr T1 T2 = (TPair (Bind2 Abbr) T1 T2).
48
49 interpretation "abstraction (term)"
50    'SnAbst T1 T2 = (TPair (Bind2 Abst) T1 T2).
51
52 interpretation "application (term)"
53    'SnAppl T1 T2 = (TPair (Flat2 Appl) T1 T2).
54
55 interpretation "native type annotation (term)"
56    'SnCast T1 T2 = (TPair (Flat2 Cast) T1 T2).
57
58 (* Basic inversion lemmas ***************************************************)
59
60 lemma discr_tpair_xy_x: ∀I,T,V. ②{I} V. T = V → False.
61 #I #T #V elim V -V
62 [ #J #H destruct
63 | #J #W #U #IHW #_ #H destruct
64   -H >e0 in e1; normalize (**) (* destruct: one quality is not simplified, the destucted equality is not erased *)
65   /2 width=1/
66 ]
67 qed-.
68
69 (* Basic_1: was: thead_x_y_y *)
70 lemma discr_tpair_xy_y: ∀I,V,T. ②{I} V. T = T → False.
71 #I #V #T elim T -T
72 [ #J #H destruct
73 | #J #W #U #_ #IHU #H destruct
74   -H (**) (* destruct: the destucted equality is not erased *)
75   /2 width=1/
76 ]
77 qed-.
78
79 (* Basic properties *********************************************************)
80
81 (* Basic_1: was: term_dec *)
82 axiom term_eq_dec: ∀T1,T2:term. Decidable (T1 = T2).
83
84 (* Basic_1: removed theorems 3:
85             not_void_abst not_abbr_void not_abst_void
86 *)