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