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