(* ********************************************************************** *)
(* Progetto FreeScale *)
(* *)
-(* Sviluppato da: Cosimo Oliboni, oliboni@cs.unibo.it *)
-(* Cosimo Oliboni, oliboni@cs.unibo.it *)
+(* Sviluppato da: Ing. Cosimo Oliboni, oliboni@cs.unibo.it *)
+(* Ultima modifica: 05/08/2009 *)
(* *)
(* ********************************************************************** *)
(* NATURALI *)
(* ******** *)
-inductive nat : Type ≝
+ninductive nat : Type ≝
O : nat
| S : nat → nat.
+(*
interpretation "Natural numbers" 'N = nat.
default "natural numbers" cic:/matita/common/nat/nat.ind.
alias num (instance 0) = "natural number".
+*)
nlet rec eq_nat (n1,n2:nat) on n1 ≝
match n1 with
[ O ⇒ false | (S q) ⇒ le_nat p q ]
].
+interpretation "natural 'less or equal to'" 'leq x y = (le_nat x y).
+
+ndefinition lt_nat ≝ λn1,n2:nat.(le_nat n1 n2) ⊗ (⊖ (eq_nat n1 n2)).
+
+interpretation "natural 'less than'" 'lt x y = (lt_nat x y).
+
+ndefinition ge_nat ≝ λn1,n2:nat.(⊖ (le_nat n1 n2)) ⊕ (eq_nat n1 n2).
+
+interpretation "natural 'greater or equal to'" 'geq x y = (ge_nat x y).
+
+ndefinition gt_nat ≝ λn1,n2:nat.⊖ (le_nat n1 n2).
+
+interpretation "natural 'greater than'" 'gt x y = (gt_nat x y).
+
nlet rec plus (n1,n2:nat) on n1 ≝
match n1 with
[ O ⇒ n2