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