Content deleted Content added
Line 31:
::add(S(''n''),''x'')=''S''(''P''<sub>1</sub><sup>3</sup>(add(''n'',''x''),''n'',''x''))
:Note that ''P''<sub>
;[[Subtraction]]: We can define ''limited subtraction'', i.e. subtraction that bottoms out at 0 (since we have no concept of negative numbers yet). First we must define the "predecessor" function, which acts as the opposite of the successor function.
Line 47:
:Now we can define subtraction in a very similar way to how we defined addition.
::sub(0,''x'')=''P''<sub>
::sub(S(''n''),''x'')=pred(''P''<sub>
:(Note that for the sake of simplicity, the order of the arguments has been switched from the "standard" definition to fit the requirements of primitive recursion, i.e. sub(''a'',''b'') corresponds to ''b''-''a''. This could easily be rectified using composition with suitable projections.)
|