# Primitive recursion example

If we want to show primitive recursion for

sgn(x) = 0 if x = 0 and 1 otherwise

Is it enough to say that sgn(0) = 0 and sgn(x+1) = 1?

Is there any details omitting here or anything needed to be polished?

Also, to show that x monus y = (x-y) if x >= y and 0 otherwise, where we have the monus function N^2 --> N as primitive recusive, is it enough to say that:

x monus 1 is primitive recursive as 0 monus 1 = 0, but not sure what else to continue here.

-

Your first one is fine. For the second one, $x \dot{-} 1$ is primitive recursive, so you can set up a primitive recursion for $x\dot{-} y$ using this.
$$x \dot{-} 0 = x$$
$$x \dot{-} (a+1) = (x \dot{-} a) \dot{-} 1$$