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 Prod (A,B:Set) : Set \def
21 pair : A \to B \to Prod A B.
23 interpretation "Pair construction" 'pair x y =
24 (cic:/matita/datatypes/constructors/Prod.ind#xpointer(1/1/1) _ _ x y).
26 notation "hvbox(\langle x break , y \rangle )" with precedence 89
29 interpretation "Product" 'product x y =
30 (cic:/matita/datatypes/constructors/Prod.ind#xpointer(1/1) x y).
32 notation "hvbox(x break \times y)" with precedence 89
33 for @{ 'product $x $y}.
35 definition fst \def \lambda A,B:Set.\lambda p: Prod A B.
37 [(pair a b) \Rightarrow a].
39 definition snd \def \lambda A,B:Set.\lambda p: Prod A B.
41 [(pair a b) \Rightarrow b].
43 interpretation "First projection" 'fst x =
44 (cic:/matita/datatypes/constructors/fst.con _ _ x).
46 notation "\fst x" with precedence 89
49 interpretation "Second projection" 'snd x =
50 (cic:/matita/datatypes/constructors/snd.con _ _ x).
52 notation "\snd x" with precedence 89
55 theorem eq_pair_fst_snd: \forall A,B:Set.\forall p:Prod A B.
56 p = 〈 (\fst p), (\snd p) 〉.
57 intros.elim p.simplify.reflexivity.
60 inductive Sum (A,B:Set) : Set \def
62 | inr : B \to Sum A B.
64 inductive ProdT (A,B:Type) : Type \def
65 pairT : A \to B \to ProdT A B.
67 definition fstT \def \lambda A,B:Type.\lambda p: ProdT A B.
69 [(pairT a b) \Rightarrow a].
71 definition sndT \def \lambda A,B:Type.\lambda p: ProdT A B.
73 [(pairT a b) \Rightarrow b].