1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| A.Asperti, C.Sacerdoti Coen, *)
8 (* ||A|| E.Tassi, S.Zacchiroli *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU Lesser General Public License Version 2.1 *)
13 (**************************************************************************)
15 include "logic/equality.ma".
17 inductive void : Set \def.
19 inductive unit : Set ≝ something: unit.
21 inductive Prod (A,B:Type) : Type \def
22 pair : A \to B \to Prod A B.
24 interpretation "Pair construction" 'pair x y =
25 (cic:/matita/datatypes/constructors/Prod.ind#xpointer(1/1/1) _ _ x y).
27 notation "hvbox(\langle x break , y \rangle )" with precedence 89
30 interpretation "Product" 'product x y =
31 (cic:/matita/datatypes/constructors/Prod.ind#xpointer(1/1) x y).
33 notation "hvbox(x break \times y)" with precedence 89
34 for @{ 'product $x $y}.
36 definition fst \def \lambda A,B:Type.\lambda p: Prod A B.
38 [(pair a b) \Rightarrow a].
40 definition snd \def \lambda A,B:Type.\lambda p: Prod A B.
42 [(pair a b) \Rightarrow b].
44 interpretation "First projection" 'fst x =
45 (cic:/matita/datatypes/constructors/fst.con _ _ x).
47 notation "\fst x" with precedence 89
50 interpretation "Second projection" 'snd x =
51 (cic:/matita/datatypes/constructors/snd.con _ _ x).
53 notation "\snd x" with precedence 89
56 theorem eq_pair_fst_snd: \forall A,B:Type.\forall p:Prod A B.
57 p = 〈 (\fst p), (\snd p) 〉.
58 intros.elim p.simplify.reflexivity.
61 inductive Sum (A,B:Type) : Type \def
63 | inr : B \to Sum A B.
65 interpretation "Disjoint union" 'plus A B =
66 (cic:/matita/datatypes/constructors/Sum.ind#xpointer(1/1) A B).
68 inductive option (A:Type) : Type ≝
70 | Some : A → option A.