]> matita.cs.unibo.it Git - helm.git/blob - matita/matita/contribs/lambda_delta/Basic_2/grammar/aarity.ma
61a9666b5cd3aa1112dd50cb291a574e8cd282f1
[helm.git] / matita / matita / contribs / lambda_delta / 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  * Confluence of context-sensitive parallel reduction closed: 2011 September 21
17  * Confluence of context-free parallel reduction closed: 2011 September 6
18  * Specification started: 2011 April 17
19  * - Patience on me to gain peace and perfection! -
20  * [ suggested invocation to start formal specifications with ]
21  *)
22
23 include "Ground_2/star.ma".
24 include "Basic_2/notation.ma".
25
26 (* ATOMIC ARITY *************************************************************)
27
28 inductive aarity: Type[0] ≝
29   | AAtom: aarity                   (* atomic aarity construction *)
30   | APair: aarity → aarity → aarity (* binary aarity construction *)
31 .
32
33 interpretation "aarity construction (atomic)"
34    'Item0 = AAtom.
35
36 interpretation "aarity construction (binary)"
37    'SnItem2 A1 A2 = (APair A1 A2).
38
39 (* Basic inversion lemmas ***************************************************)
40
41 lemma discr_apair_xy_x: ∀A,B. ②B. A = B → False.
42 #A #B elim B -B
43 [ #H destruct
44 | #Y #X #IHY #_ #H destruct
45   -H >e0 in e1; normalize (**) (* destruct: one quality is not simplified, the destucted equality is not erased *)
46   /2 width=1/
47 ]
48 qed-.
49
50 lemma discr_tpair_xy_y: ∀B,A. ②B. A = A → False.
51 #B #A elim A -A
52 [ #H destruct
53 | #Y #X #_ #IHX #H destruct
54   -H (**) (* destruct: the destucted equality is not erased *)
55   /2 width=1/
56 ]
57 qed-.
58
59 (* Basic properties *********************************************************)
60
61 lemma aarity_eq_dec: ∀A1,A2:aarity. Decidable (A1 = A2).
62 #A1 elim A1 -A1
63 [ #A2 elim A2 -A2 /2 width=1/
64   #B2 #A2 #_ #_ @or_intror #H destruct
65 | #B1 #A1 #IHB1 #IHA1 #A2 elim A2 -A2
66   [ -IHB1 -IHA1 @or_intror #H destruct
67   | #B2 #A2 #_ #_ elim (IHB1 B2) -IHB1
68     [ #H destruct elim (IHA1 A2) -IHA1
69       [ #H destruct /2 width=1/
70       | #HA12 @or_intror #H destruct /2 width=1/
71       ]
72     | -IHA1 #HB12 @or_intror #H destruct /2 width=1/
73     ]
74   ]
75 ]
76 qed-.