0% found this document useful (0 votes)
4 views

Exercise Week 1

Uploaded by

Mka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Exercise Week 1

Uploaded by

Mka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Exercises for week 1 (I2CA)

(1) For each of the following statements, point out which ones are definitions and which ones
are theorems for x, y ∈ N . prove the theorems using only definitions and statements
proven above.
a) x = x + 0
b) x = 0 + x
c) x + (y + 1) = (x + y) + 1
d) (x + 1) + y = (y + x) + 1
e) x ∗ 0 = 0
f) 0 ∗ x = 0
g) 5 + 1 = 6
h) 7 + 4 = 11

Solution:
a) remember the definition 3 of addition from the book: x+0 = x and x+S(y) = S(x+y),
however in this exercise it is written as x = x + 0, so symbolically speaking, it’s not the
same expression, unless we know the symmetric property of ”=” operator.

b) again, expression involves adding 0 from left, however in definition we have addition of
0 from right, thus we have to prove this fact, thus it’s not a definition(we could’ve defined
0 like this as well however, it’s not existing definition in the book, however this fact is
provable from the definitions and we show it here).
we prove it by induction on x, for x = 0 → 0 = 0 + 0 = 0 by definition of addition now
let our induction hypothesis be x = 0 + x then S(x) = S(0 + x) = 0 + S(x) where at
first we use induction hypothesis and at last, definition of addition. by transitivity of ”=”
operator S(x) = 0 + S(x) , which proves inductive step.
c) this is also a theorem, which requires proof. one way to prove it is to notice that it’s a
special case of the general associativity law that was proven during the lecture, however
here is another proof: x + (y + 1) = x + S(y) = S(x + y) = x + y + 1
where at first we use definition of counting by 1, then we use definition of addition and at
last again we use definition of counting by adding 1.
d) this is also a theorem, which can be proved by using a combination of associative and
commutative laws that was proven during the lecture. (x + 1) + y = S(x) + y = y + S(x) =
S(y + x) = y + x + 1
e) x ∗ 0 = 0 (check definition 5 from the book), where 0 is on the right of multiplication
operator, thus x ∗ 0 = 0 is the definition.
f) however, things are changed here, 0 ∗ x = 0 is a theorem, which requires proof, because
it wasn’t part of the multiplication definition. we prove this by induction.
0 ∗ 0 = 0 by the definition of multiplication
0 ∗ x = 0 is our induction hypothesis
0 ∗ S(x) = 0 ∗ x + 0 = 0 + 0 = 0 where we use induction hypothesis when we write
0 ∗ x + 0 = 0 + 0 g) 5 + 1 = 6 is the definition of 6 (check definition 2 from the book)
h) 7 + 4 = 11 is a theorem, here we assume that we know commutativity and associativity
of addition. proof: 7 + 4 = 7 + (3 + 1) = 7 + (2 + 1 + 1) = 7 + (1 + 1 + 1 + 1) =
(7 + 1) + 1 + 1 + 1 = 8 + 1 + 1 + 1 = 9 + 1 + 1 = 10 + 1 = 1 ∗ 101 + 1 ∗ 100 = 11
(2) Prove Lemma 5.
Lemma 5:
(1) (x + y) ∗ z = x ∗ z + y ∗ z (distributivity with respect to addition)
(2) (x ∗ y) ∗ z = x ∗ (y ∗ z) (associativity of multiplication)
(3) x ∗ y = y ∗ x (commutativity of multiplication)
(1) again we use induction on z, (x + y) ∗ 0 = 0 = x ∗ 0 + y ∗ 0 = 0 + 0 = 0 so base case
holds. now our induction hypothesis IH: (x + y) ∗ z = x ∗ z + y ∗ z and inductive step:
(x+y)∗S(z) = (x+y)∗z+(x+y) = x∗z+y∗z+(x+y) = x∗z+x+y∗z+y = x∗S(z)+y∗S(z)

(2) again we use induction on z. (x∗y)∗0 = 0 = x∗(y∗0) = x∗0 = 0 IH: (x∗y)∗z = x∗(y∗z)
Inductive step: (x ∗ y) ∗ S(z) = (x ∗ y) ∗ z + (x ∗ y) = x ∗ (y ∗ z) + (x ∗ y) = x ∗ (y ∗ z + y) =
x ∗ (y ∗ S(z))
now I will prove right hand distributivity.
z ∗ (x + y) = z ∗ x + z ∗ y, basecase : 0 ∗ (x + y) = 0 (Exercise 1, part f) IH : z ∗ (x + y) =
z ∗ x + z ∗ y, IS : S(z) ∗ (x + y) = (z + 1)(x + y) = z ∗ (x + y) + (x + y) we used Lemma 6
1 ∗ x = x and definition of counting by adding 1. z ∗ (x + y) + (x + y) = z ∗ x + z ∗ y + x + y =
z ∗ x + x = (z + 1) ∗ x + (z + 1) ∗ y = S(z) ∗ x + S(z) ∗ y where we used (1) (right hand side
distributivity) and 1 ∗ y = y . this proved right hand distributivity thus this proves (2).
(3) we prove by induction on y, x ∗ 0 = 0 ∗ x = 0 IH: x ∗ y = y ∗ x, we have to prove:
x ∗ S(y) = S(y) ∗ x x ∗ S(y) = x ∗ y + x = y ∗ x + x = (y + 1) ∗ x = S(y) ∗ x where we
used induction hypothesis where we exchanged x ∗ y with y ∗ x and then already proved
distributivity with respect to addition (1).

(4) (a) prove: 2n ∗ 2m = 2n+m

Solution: we prove by induction on m. base case: 2n ∗ 20 = 2n ∗ 1 = 2n = 2n+0 = 2n


IH: 2n ∗ 2m = 2n+m
IS: 2n ∗ 2S(m) = 2n ∗ (2m ∗ 2) = 2n+m ∗ 2 = 2S(n+m) = 2n+S(m) at first we use definition
of exponentiation,then associativity of multiplication which is proved in lemma 5. after
that we use induction hypothesis, then we use definition of exponentiation and then we
use definition of addition (n + S(m) = S(n + m)).
(b) during the lecture we’ve discussed about following inequality: #(A ◦ B) ≤ #A · #B
. give an example of sets A and B such that strict inequality holds i.e #(A ◦ B) < #A · #B

Solution:
consider sets A = {000, 00} and B = {01, 001}. now: A ◦ B = {04 1, 03 1, 05 1} thus
#(A ◦ B) = 3 < 2 ∗ 2 = 4

(5) Prove the following properties of exponentiation for a, b, c ∈ N


(I) (a ∗ b)c = ac ∗ bc
(II) (ab )c = ab∗c

Solution:
(I) we do induction on c, base case: (a ∗ b)0 = 1 = a0 ∗ b0 = 1 ∗ 1 = 1 induction hypothesis:
(a ∗ b)c = ac ∗ bc induction step: (a ∗ b)S(c) = (a ∗ b)c ∗ (a ∗ b) = ac ∗ bc ∗ (a ∗ b) = ac ∗ a ∗ bc ∗ b =
aS(c) ∗ bS(c) . which proves inductive step.
(II) again we do induction on c, base case: (ab )0 = 1 = ab∗0 = a0 = 1 , so base case is true.
induction hypothesis: (ab )c = ab∗c inductive step: (ab )S(c) = (ab )c ∗ (ab ) = ab∗c ∗ ab =
ab∗c+b = ab∗S(c)
Lemma: an ∗ am = a(n+m) proof: induction on m, base case: an ∗ a0 = an ∗ 1 = an = an+0
IH: an ∗ am = a(n+m)
Inductive step: an ∗ aS(m) = an ∗ (am ∗ a) = (an ∗ am ) ∗ a = a(n+m) ∗ a = aS(n+m) = an+S(m)

(6) (a) prove: 19 + 1 = 20


Lemma: 1 ∗ x = x
proof: 19 = 1 ∗ 101 + 9 ∗ 100 = 1 ∗ 10 + 9 = 10 + 9 → (10 + 9) + 1 = 10 + (9 + 1) = 10 + 10 =
1 ∗ 101 + 0 ∗ 100 + 1 ∗ 101 + 0 ∗ 100 = 1 ∗ 101 + 1 ∗ 101 + 0 ∗ 100 = (1 + 1) ∗ 101 + 0 ∗ 100 =
2 ∗ 101 + 0 ∗ 100 = 20
(b) prove: #(A ◦ B) ≤ (#A) · (#B)

proof:
by the definition, A◦B = {a◦b|a ∈ A, b ∈ B} how many pairs a, b exist such that a ∈ A and
b ∈ B , by combinatorial argument this is simply n = #A ∗ #B . so from here, #(A ◦ B)
can’t be larger than n, this proves ≤ inequality, however fact that equality doesn’t always
hold, can be shown by counterexample.

You might also like