3.3 Arithmetic[0NN]

We will define the addition operation between natural numbers, formally

+:×,(h,k)h+k.

Definition 136

[292]Having fixed the parameter h, we define the operation h+, which will be a function fh: given by fh(n)=h+n, using a recursive definition: we wish to express the rules

  • h+0=h ,

  • n,h+S(n)=S(h+n) .

To this end, set A=, and g(n,a)=S(a), we rewrite the above as recursive rules for fh

  • fh(0)=h ,

  • n,fh(S(n))=g(n,fh(n))=S(fh(n)) .

This defines recursively fh. Considering then the parameter h as a variable, we have constructed the addition operation, and we define the operation ”+” between natural numbers as h+n=fh(n).

This operation is commutative and associative, as shown below.

Note that h+0=fh(0)=h (basis of recursion); also 0+n=f0(n)=n (shows easily by induction).

To prove that it is commutative, we first show that

Lemma 137

[27N](Solved on 2022-11-03) n,h,fS(h)(n)=S(fh(n))

Proof

Recall that S(fh(n))=fh(S(n)) by recursive definition; Consider

P(n)h,fS(h)(n)=S(fh(n));

P(0) is the clause

h,fS(h)(0)=S(fh(0))=S(h)

which is true because it is the initial value of the recursive definition fS(h) and fh. For the inductive step we assume that P(n) is true and we study P(S(n)), within which we can say

fS(h)(S(n))=(1)S(fS(h)(n))=(2)SS(fh(n))=(3)S(fh(S(n))

where in (1) we used the recursive definition of fh with S(h) instead h, in (2) we used the inductive hypothesis, and in (3) we used the recursive definition of fh. This completes the inductive step.

(Note, in the first step, how important it is that in the definition of P(n) there is h,).

Proposition 138

[27P](Replaces 27Y) Addition is commutative.

Proof

By the lemma we can write

S(h)+n=S(h+n)=h+S(n)
139

intuitively the formula is symmetric and therefore also the definition of addition must have a symmetry. Precisely, let f~n(h)=.fh(n) then f~n(0)=n (as already noted) and for the lemma 137 f~n(S(h))=S(f~n(h)) but then f~ satisfies the same recursive relation as f and therefore they are identical, so fh(n)=fn(h). (The idea is that if we had defined addition. recursively starting from left instead of right, we would have achieved the same result).

At this point we can give a name to 1=S(0) and notice that S(n)=n+1. So from now on we could do without the symbol S.

With similar procedures we show that addition is associative.

Proposition 140

[27Q]Addition is associative.

Proof

Consider

P(h)n,m,(n+m)+h=n+(m+h);

Obviously P(0) is true, moreover P(Sh) is proven (omitting ”n,m”) like this

(n+m)+Sh=S(n+m)+h=(Sn+m)+h=P(n)=Sn+(m+h)=n+S(m+h)=n+(m+Sh)\qedhere

Multiplication is similarly defined.

Definition 141

[28V](Solved on 2022-11-03) We fix the parameter m, and we define recursively (m×) through

  • m×0=0

  • n,m×(n+1)=m×n+m;

then we can prove the known properties (commutativity, associativity, distributivity).

E141

[27R]Rewrite some notions seen above, such as the principle of induction, and the definition of addition, using n+1 instead of S(n).

E141

[27S] (Solved on 2022-11-03) Show that the function fh(n)=(h+n) is injective. Hidden solution: [UNACCESSIBLE UUID ’27T’]

E141

[27V] Prove the cancellation property: if n+h=m+h then n=m.

Hidden solution: [UNACCESSIBLE UUID ’286’]

E141

[27W] (Solved on 2022-11-03) We have n+m=0 if and only if n=0m=0. Hidden solution: [UNACCESSIBLE UUID ’285’]

E141

[27X] (Solved on 2022-11-03) You have n×m=0 if and only if n=0m=0. Hidden solution: [UNACCESSIBLE UUID ’284’]

E141

[28T]Prove that multiplication is commutative. Hint prove by induction in n

m,n,(m+1)×n=m×n+n,

then reason as in Prop. 138. Hidden solution: [UNACCESSIBLE UUID ’28W’]

E141

[281]Show that addition distributes over multiplication. Hint prove by induction in h

m,n,h, m×(n+h)=m×n+m×h.

Hidden solution: [UNACCESSIBLE UUID ’28Y’]

E141

[27Z]Prerequisites:7.Show that multiplication is associative. Hint prove by induction in h

m,n,h,(m×n)×h=m×(n×h).

Hidden solution: [UNACCESSIBLE UUID ’28X’]

E141

[280] Fix n0 and h, write a recursive definition of exponentiation nh. Then prove that nh+k=nnnk and (nh)k=n(hk).

Hidden solution: [UNACCESSIBLE UUID ’2DG’]

In the following we will simply write nm instead of n×m.