Module NdefOpsProp (Import N : NAxiomsRecSig').
Include NStrongRecProp N.
(** Nullity Test *)
Definition if_zero (A : Type) (a b : A) (n : N.t) : A :=
recursion a (fun _ _ => b) n.
Arguments if_zero [A] a b n.
Instance if_zero_wd (A : Type) :
Proper (Logic.eq ==> Logic.eq ==> N.eq ==> Logic.eq) (@if_zero A).
(*****************************************************)
(**                   Addition                       *)
Definition def_add (x y : N.t) := recursion y (fun _ => S) x.
Local Infix "+++" := def_add (at level 50, left associativity).
Instance def_add_wd : Proper (N.eq ==> N.eq ==> N.eq) def_add.
(*****************************************************)
(**                  Multiplication                  *)
Definition def_mul (x y : N.t) := recursion 0 (fun _ p => p +++ x) y.
Local Infix "**" := def_mul (at level 40, left associativity).
Instance def_mul_wd : Proper (N.eq ==> N.eq ==> N.eq) def_mul.

Theorem def_mul_mul : forall n m, n ** m == n * m.