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