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 set "baseuri" "cic:/matita/datatypes/constructors/".
16 include "logic/equality.ma".
18 inductive void : Set \def.
20 inductive unit : Set ≝ something: unit.
22 inductive Prod (A,B:Type) : Type \def
23 pair : A \to B \to Prod A B.
25 interpretation "Pair construction" 'pair x y =
26 (cic:/matita/datatypes/constructors/Prod.ind#xpointer(1/1/1) _ _ x y).
28 notation "hvbox(\langle x break , y \rangle )" with precedence 89
31 interpretation "Product" 'product x y =
32 (cic:/matita/datatypes/constructors/Prod.ind#xpointer(1/1) x y).
34 notation "hvbox(x break \times y)" with precedence 89
35 for @{ 'product $x $y}.
37 definition fst \def \lambda A,B:Type.\lambda p: Prod A B.
39 [(pair a b) \Rightarrow a].
41 definition snd \def \lambda A,B:Type.\lambda p: Prod A B.
43 [(pair a b) \Rightarrow b].
45 interpretation "First projection" 'fst x =
46 (cic:/matita/datatypes/constructors/fst.con _ _ x).
48 notation "\fst x" with precedence 89
51 interpretation "Second projection" 'snd x =
52 (cic:/matita/datatypes/constructors/snd.con _ _ x).
54 notation "\snd x" with precedence 89
57 theorem eq_pair_fst_snd: \forall A,B:Type.\forall p:Prod A B.
58 p = 〈 (\fst p), (\snd p) 〉.
59 intros.elim p.simplify.reflexivity.
62 inductive Sum (A,B:Type) : Type \def
64 | inr : B \to Sum A B.
66 interpretation "Disjoint union" 'plus A B =
67 (cic:/matita/datatypes/constructors/Sum.ind#xpointer(1/1) A B).
69 inductive option (A:Type) : Type ≝
71 | Some : A → option A.