]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/static_2/syntax/item.ma
update in ground
[helm.git] / matita / matita / contribs / lambdadelta / static_2 / syntax / item.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 "ground/lib/bool.ma".
16 include "ground/arith/nat.ma".
17
18 (* ITEMS ********************************************************************)
19
20 definition sfull: relation2 nat nat ≝
21            λs1,s2. ⊤.
22
23 (* atomic items *)
24 inductive item0: Type[0] ≝
25 | Sort: nat → item0 (* sort: starting at 0 *)
26 | LRef: nat → item0 (* reference by index: starting at 0 *)
27 | GRef: nat → item0 (* reference by position: starting at 0 *)
28 .
29
30 (* unary binding items *)
31 inductive bind1: Type[0] ≝
32 | Void: bind1 (* exclusion *)
33 .
34
35 (* binary binding items *)
36 inductive bind2: Type[0] ≝
37 | Abbr: bind2 (* abbreviation *)
38 | Abst: bind2 (* abstraction *)
39 .
40
41 (* binary non-binding items *)
42 inductive flat2: Type[0] ≝
43 | Appl: flat2 (* application *)
44 | Cast: flat2 (* explicit type annotation *)
45 .
46
47 (* binary items *)
48 inductive item2: Type[0] ≝
49 | Bind2: bool → bind2 → item2 (* polarized binding item *)
50 | Flat2: flat2 → item2        (* non-binding item *)
51 .
52
53 (* Basic inversion lemmas ***************************************************)
54
55 fact destruct_sort_sort_aux: ∀s1,s2. Sort s1 = Sort s2 → s1 = s2.
56 #s1 #s2 #H destruct //
57 qed-.
58
59 (* Basic properties *********************************************************)
60
61 lemma sfull_dec:
62       ∀s1,s2. Decidable (sfull s1 s2).
63 /2 width=1 by or_introl/ qed-.
64
65 lemma eq_item0_dec:
66       ∀I1,I2:item0. Decidable (I1 = I2).
67 * #i1 * #i2 [2,3,4,6,7,8: @or_intror #H destruct ]
68 [2: elim (eq_nat_dec i1 i2) |1,3: elim (eq_nat_dec i1 i2) ] /2 width=1 by or_introl/
69 #Hni12 @or_intror #H destruct /2 width=1 by/
70 qed-.
71
72 lemma eq_bind1_dec:
73       ∀I1,I2:bind1. Decidable (I1 = I2).
74 * * /2 width=1 by or_introl/
75 qed-.
76
77 (* Basic_1: was: bind_dec *)
78 lemma eq_bind2_dec:
79       ∀I1,I2:bind2. Decidable (I1 = I2).
80 * * /2 width=1 by or_introl/
81 @or_intror #H destruct
82 qed-.
83
84 (* Basic_1: was: flat_dec *)
85 lemma eq_flat2_dec:
86       ∀I1,I2:flat2. Decidable (I1 = I2).
87 * * /2 width=1 by or_introl/
88 @or_intror #H destruct
89 qed-.
90
91 (* Basic_1: was: kind_dec *)
92 lemma eq_item2_dec:
93       ∀I1,I2:item2. Decidable (I1 = I2).
94 * [ #p1 ] #I1 * [1,3: #p2 ] #I2
95 [2,3: @or_intror #H destruct
96 | elim (eq_bool_dec p1 p2) #Hp
97   [ elim (eq_bind2_dec I1 I2) /2 width=1 by or_introl/ #HI ]
98   @or_intror #H destruct /2 width=1 by/
99 | elim (eq_flat2_dec I1 I2) /2 width=1 by or_introl/ #HI
100   @or_intror #H destruct /2 width=1 by/
101 ]
102 qed-.
103
104 (* Basic_1: removed theorems 21:
105             s_S s_plus s_plus_sym s_minus minus_s_s s_le s_lt s_inj s_inc
106             s_arith0 s_arith1
107             r_S r_plus r_plus_sym r_minus r_dis s_r r_arith0 r_arith1
108             not_abbr_abst bind_dec_not
109 *)