X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Fsoftware%2Fmatita%2Flibrary%2Fdatatypes%2Fconstructors.ma;h=dd2a1760b9c640c7853fafbeb33babe2d7670ad2;hb=7782637e13656ec7d1d0ccc84e0d8cf894431187;hp=3567dd915463c8b6c2f809ed8218987a67e78042;hpb=437246a8e84268383a2f53f76442d811af3e8056;p=helm.git diff --git a/helm/software/matita/library/datatypes/constructors.ma b/helm/software/matita/library/datatypes/constructors.ma index 3567dd915..dd2a1760b 100644 --- a/helm/software/matita/library/datatypes/constructors.ma +++ b/helm/software/matita/library/datatypes/constructors.ma @@ -17,7 +17,9 @@ include "logic/equality.ma". inductive void : Set \def. -inductive Prod (A,B:Set) : Set \def +inductive unit : Set ≝ something: unit. + +inductive Prod (A,B:Type) : Type \def pair : A \to B \to Prod A B. interpretation "Pair construction" 'pair x y = @@ -32,11 +34,11 @@ interpretation "Product" 'product x y = notation "hvbox(x break \times y)" with precedence 89 for @{ 'product $x $y}. -definition fst \def \lambda A,B:Set.\lambda p: Prod A B. +definition fst \def \lambda A,B:Type.\lambda p: Prod A B. match p with [(pair a b) \Rightarrow a]. -definition snd \def \lambda A,B:Set.\lambda p: Prod A B. +definition snd \def \lambda A,B:Type.\lambda p: Prod A B. match p with [(pair a b) \Rightarrow b]. @@ -52,22 +54,18 @@ interpretation "Second projection" 'snd x = notation "\snd x" with precedence 89 for @{ 'snd $x}. -theorem eq_pair_fst_snd: \forall A,B:Set.\forall p:Prod A B. +theorem eq_pair_fst_snd: \forall A,B:Type.\forall p:Prod A B. p = 〈 (\fst p), (\snd p) 〉. intros.elim p.simplify.reflexivity. qed. -inductive Sum (A,B:Set) : Set \def +inductive Sum (A,B:Type) : Type \def inl : A \to Sum A B | inr : B \to Sum A B. -inductive ProdT (A,B:Type) : Type \def -pairT : A \to B \to ProdT A B. - -definition fstT \def \lambda A,B:Type.\lambda p: ProdT A B. -match p with -[(pairT a b) \Rightarrow a]. +interpretation "Disjoint union" 'plus A B = + (cic:/matita/datatypes/constructors/Sum.ind#xpointer(1/1) A B). -definition sndT \def \lambda A,B:Type.\lambda p: ProdT A B. -match p with -[(pairT a b) \Rightarrow b]. \ No newline at end of file +inductive option (A:Type) : Type ≝ + None : option A + | Some : A → option A. \ No newline at end of file