]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambdadelta/basic_2/grammar/aarity.ma
1c4dcdd04878503f7cfac7ccd3e2bf73a41a61fe
[helm.git] / matita / matita / contribs / lambdadelta / basic_2 / grammar / aarity.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 (* THE FORMAL SYSTEM λδ: MATITA SOURCE FILES
16  * Initial invocation: - Patience on me to gain peace and perfection! -
17  *)
18
19 include "ground_2/star.ma".
20 include "basic_2/notation.ma".
21
22 (* ATOMIC ARITY *************************************************************)
23
24 inductive aarity: Type[0] ≝
25   | AAtom: aarity                   (* atomic aarity construction *)
26   | APair: aarity → aarity → aarity (* binary aarity construction *)
27 .
28
29 interpretation "aarity construction (atomic)"
30    'Item0 = AAtom.
31
32 interpretation "aarity construction (binary)"
33    'SnItem2 A1 A2 = (APair A1 A2).
34
35 (* Basic inversion lemmas ***************************************************)
36
37 lemma discr_apair_xy_x: ∀A,B. ②B. A = B → ⊥.
38 #A #B elim B -B
39 [ #H destruct
40 | #Y #X #IHY #_ #H destruct
41   -H >e0 in e1; normalize (**) (* destruct: one quality is not simplified, the destucted equality is not erased *)
42   /2 width=1/
43 ]
44 qed-.
45
46 lemma discr_tpair_xy_y: ∀B,A. ②B. A = A → ⊥.
47 #B #A elim A -A
48 [ #H destruct
49 | #Y #X #_ #IHX #H destruct
50   -H (**) (* destruct: the destucted equality is not erased *)
51   /2 width=1/
52 ]
53 qed-.
54
55 (* Basic properties *********************************************************)
56
57 lemma aarity_eq_dec: ∀A1,A2:aarity. Decidable (A1 = A2).
58 #A1 elim A1 -A1
59 [ #A2 elim A2 -A2 /2 width=1/
60   #B2 #A2 #_ #_ @or_intror #H destruct
61 | #B1 #A1 #IHB1 #IHA1 #A2 elim A2 -A2
62   [ -IHB1 -IHA1 @or_intror #H destruct
63   | #B2 #A2 #_ #_ elim (IHB1 B2) -IHB1
64     [ #H destruct elim (IHA1 A2) -IHA1
65       [ #H destruct /2 width=1/
66       | #HA12 @or_intror #H destruct /2 width=1/
67       ]
68     | -IHA1 #HB12 @or_intror #H destruct /2 width=1/
69     ]
70   ]
71 ]
72 qed-.