]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/library/datatypes/constructors.ma
Some dualization clean-up.
[helm.git] / helm / software / matita / library / datatypes / constructors.ma
index 2ac1cb376804ad8e89dbd2a805cbd9c1c1284065..92b27d64e904d543b696040a750419a701a29997 100644 (file)
 (*                                                                        *)
 (**************************************************************************)
 
-set "baseuri" "cic:/matita/datatypes/constructors/".
 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.
 
-definition fst \def \lambda A,B:Set.\lambda p: Prod A B.
+interpretation "Pair construction" 'pair x y = (pair ? ? x y).
+
+interpretation "Product" 'product x y = (Prod x y).
+
+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].
 
-theorem eq_pair_fst_snd: \forall A,B:Set.\forall p: Prod A B.
-p = pair A B (fst A B p) (snd A B p).
+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: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.
+
+interpretation "Disjoint union" 'plus A B = (Sum A B).
+
+inductive option (A:Type) : Type ≝
+   None : option A
+ | Some : A → option A.