X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fmatita%2Flibrary%2Fdatatypes%2Fconstructors.ma;h=92b27d64e904d543b696040a750419a701a29997;hb=HEAD;hp=3be6bc9d10bf1ef8592e83467d5701848f3e54c2;hpb=9725ce192edbff9cc1c0af04a60065c1bfd31ca6;p=helm.git diff --git a/helm/software/matita/library/datatypes/constructors.ma b/helm/software/matita/library/datatypes/constructors.ma index 3be6bc9d1..92b27d64e 100644 --- a/helm/software/matita/library/datatypes/constructors.ma +++ b/helm/software/matita/library/datatypes/constructors.ma @@ -12,68 +12,45 @@ (* *) (**************************************************************************) -set "baseuri" "cic:/matita/datatypes/constructors/". include "logic/equality.ma". inductive void : Set \def. inductive unit : Set ≝ something: unit. -inductive Prod (A,B:Set) : Set \def +inductive Prod (A,B:Type) : Type \def pair : A \to B \to Prod A B. -interpretation "Pair construction" 'pair x y = - (cic:/matita/datatypes/constructors/Prod.ind#xpointer(1/1/1) _ _ x y). +interpretation "Pair construction" 'pair x y = (pair ? ? x y). -notation "hvbox(\langle x break , y \rangle )" with precedence 89 -for @{ 'pair $x $y}. +interpretation "Product" 'product x y = (Prod x y). -interpretation "Product" 'product x y = - (cic:/matita/datatypes/constructors/Prod.ind#xpointer(1/1) 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]. -interpretation "First projection" 'fst x = - (cic:/matita/datatypes/constructors/fst.con _ _ x). - -notation "\fst x" with precedence 89 -for @{ 'fst $x}. - -interpretation "Second projection" 'snd x = - (cic:/matita/datatypes/constructors/snd.con _ _ x). - -notation "\snd x" with precedence 89 -for @{ 'snd $x}. +interpretation "pair pi1" 'pi1 = (fst ? ?). +interpretation "pair pi2" 'pi2 = (snd ? ?). +interpretation "pair pi1" 'pi1a x = (fst ? ? x). +interpretation "pair pi2" 'pi2a x = (snd ? ? x). +interpretation "pair pi1" 'pi1b x y = (fst ? ? x y). +interpretation "pair pi2" 'pi2b x y = (snd ? ? x y). -theorem eq_pair_fst_snd: \forall A,B:Set.\forall p:Prod A B. -p = 〈 (\fst p), (\snd p) 〉. +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]. - -definition sndT \def \lambda A,B:Type.\lambda p: ProdT A B. -match p with -[(pairT a b) \Rightarrow b]. +interpretation "Disjoint union" 'plus A B = (Sum A B). inductive option (A:Type) : Type ≝ None : option A - | Some : A → option A. \ No newline at end of file + | Some : A → option A.