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 = (pair _ _ x y).
26 interpretation "Product" 'product x y = (Prod x y).
28 definition fst \def \lambda A,B:Type.\lambda p: Prod A B.
30 [(pair a b) \Rightarrow a].
32 definition snd \def \lambda A,B:Type.\lambda p: Prod A B.
34 [(pair a b) \Rightarrow b].
36 interpretation "pair pi1" 'pi1 = (fst _ _).
37 interpretation "pair pi2" 'pi2 = (snd _ _).
38 interpretation "pair pi1" 'pi1a x = (fst _ _ x).
39 interpretation "pair pi2" 'pi2a x = (snd _ _ x).
40 interpretation "pair pi1" 'pi1b x y = (fst _ _ x y).
41 interpretation "pair pi2" 'pi2b x y = (snd _ _ x y).
43 theorem eq_pair_fst_snd: \forall A,B:Type.\forall p:Prod A B.
44 p = 〈 \fst p, \snd p 〉.
45 intros.elim p.simplify.reflexivity.
48 inductive Sum (A,B:Type) : Type \def
50 | inr : B \to Sum A B.
52 interpretation "Disjoint union" 'plus A B = (Sum A B).
54 inductive option (A:Type) : Type ≝
56 | Some : A → option A.