0% found this document useful (0 votes)
11 views43 pages

MATB101notes 2025

MATB 111 is a mathematics module focusing on abstract concepts such as logic, set theory, relations, and functions, aimed at enhancing logical thinking skills essential for Computer Science. The course emphasizes understanding definitions and theorem statements before attempting exercises, and introduces various logical connectives and their truth tables. Key concepts include propositions, tautologies, contradictions, and logical equivalences, with a strong focus on proof techniques and the importance of clear mathematical language.

Uploaded by

sinazo.soyana18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views43 pages

MATB101notes 2025

MATB 111 is a mathematics module focusing on abstract concepts such as logic, set theory, relations, and functions, aimed at enhancing logical thinking skills essential for Computer Science. The course emphasizes understanding definitions and theorem statements before attempting exercises, and introduces various logical connectives and their truth tables. Key concepts include propositions, tautologies, contradictions, and logical equivalences, with a strong focus on proof techniques and the importance of clear mathematical language.

Uploaded by

sinazo.soyana18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

MATB 111 - NOTES

1 Introduction :
This module continues your studies from MATA and will include the following topics :
Logic
Set theory
Relations
Functions
Introduction to formal axiomatic theory
Introduction to integer theory
Many of you are studying Computer Science, so should be aware of the importance of logical thinking [in
programming]. We endeavour in this module to strengthen such thinking skills and hopefully this will
strengthen your Computer Science skills as well.

The major di¤erence between this course and the previous course MATA, is that this course is more
abstract and less "technique driven" ie. more theory and fewer examples. Much emphasis will be put
on "how to prove". Thus the …rst important factor to get right is one’s approach to mathematics.
Learn the de…nitions …rst (as they are the foundation on which the rest of the work is based) and then
any theorem statements in a section. Only at this stage should you attempt any exercises - for only now
will you have the necessary tools to attack the problems.
Read the exercise and understand what is being asked before putting pen to paper.
The best approach to the learning of proofs of theorems:

Know what is given and what is required to be proved. Do not get the two confused!
Understand what type of proof technique is being applied ie. direct or indirect.
Each line of the proof must be understood and must be able to be supported by sound reasoning.

Only now should you attempt to do the theorem yourself by writing it out yourself. Do NOT try to
"parrot fashion learn". It leads to problems!

Remember that mathematics is a language and hence if symbols are used - understand what the symbols
stand for. Become familiar with the language by writing out the de…nitions and theorem statements.
The more familiar you become with the language, the easier it is.

By approaching your mathematics in the above manner, you will …nd that mathematics can be mastered
and can actually be quite fun.

2 LOGIC
We start this module with a relook and extention of your knowledge of logic already learnt in MATA.
We include much of what you did in MATA for completeness of the notes.

De…nition 1 [proposition ] : A proposition is a statement that is either true or false in truth value.

Example 1 2 + 2 = 4 a mathematical proposition that has truth value true

Example 2 the earth is ‡at a proposition that has truth value false

Now a question that could and should spring to mind : what is an example of something that is not a
proposition ? Consider the question : what is a rational number? This question cannot have a truth
value of true or false assigned to it, so it is not an example of a proposition. Another non proposition is
: do you like winter ?

1
Now if a proposition is a statement that is either true or false, surely we can alter the proposition by
creating the negated [or not] form of the proposition. eg the world is not ‡at ; 2 + 2 6= 4

We introduce the following symbol (:) and if A represents a proposition then :A will be the negated
form of A: What do you think will be the truth value of :A?

De…nition 2 [not] : Let A be a proposition. We de…ne :A by means of the truth table below :
A :A
T F
F T
where T denotes true and F denotes false

Now we investigate ways to create new propositions from given ones and how to determine their truth
values. We shall use connectives like "and" ; "or" "if....then". Before we can consider such though we
consider the number of di¤erent lines in a truth table necessary to show all possible di¤erent combinations
of truth values. Let us have two di¤erent propositions say A and B: Then we see there are four di¤erent
truth combinations.

A B
T T
T F
F T
F F

What if three di¤erent combinations ? As each proposition can be either true or false there will be a
total of 8 = 23 truth combinations. Now if we place A then B then C we note that half of A0 s values
must be true and half false. We thus give 4 lines of true and then 4 lines of false. Now for B we do a
similar thing but for the true’s of A half will have B being true and half being false, thus we alternate
2 lines true followed by 2 lines false and then …nally for C we will alternate true and false per line. [see
below]. Note if A; B; C; D then 24 = 16 lines and A will have 8 true followed 8 false, B will have 4 true
followed by 4 false, C will have 2 true followed by 2 false and …nally D will alternate true and false.
A B C
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F

We now return to connectives. We shall brie‡y introduce each one and then de…ne formally.

"AND" : This is mathematically also called conjunction. When do you think a proposition A AND
B will be true? Surely this will be only under the condition when both A and B are true? Hence we
de…ne conjunction [which gets symbol ^] as follows

De…nition 3 [conjunction] : Let A and B be propositions. Then we de…ne A ^ B as follows :


A B A^B
T T T
T F F
F T F
F F F

2
"OR" : This is mathematically also called disjunction. In English the use of OR can be ambiguous
as to whether include or exclude eg either the colour green or red is in the badge [here we could have
either colour or both] eg he is wanted dead or alive [both not possible]. As mathematics does
not want ambiguities, we shall decide which of the two we shall use and we have opted for the inclusive
one. Thus an OR statement will only be false if both are false. We use _ for the connective symbol and
hence get :

De…nition 4 [disjunction] : Let A and B be propositions. Then we de…ne A _ B as follows :


A B A_B
T T T
T F T
F T T
F F F

"IF....THEN" : Mathematically this is called implication. Consider the implication if X then Y. We


call X the hypothesis [or premise] and Y the conclusion. How should we decide on the truth table of such
? Consider the statement : if it rains you must stay indoors. What if it is not raining ? Then whether
you stay indoors or not, will not get you into trouble. The only time you will get into trouble is if it is
raining and you do not stay indoors. ie when the hypothesis is true but the conclusion false. Thus we
use ) for implication and we de…ne :

De…nition 5 [implication ] : Let A and B be propositions. Then we de…ne A ) B as follows :


A B A)B
T T T
T F F
F T T
F F T

Remark 1 now take note of the di¤ erence between "only if" and "if"
Consider the statement : only if it rains, you must stay indoors :
this is equivalent to : if you stay indoors then it is raining. So be careful of interpreting an only if
statement/proposition.

Consider now the two propositions A ^ (B ) A) and (A ^ B) ) A


A B A ^ B (A ^ B) ) A (B ) A) A ^ (B ) A)
T T T T T T
T F F T T T
F T F T F F
F F F T T F
What do we note ? We see that the two propositions are not the same. This means that one needs be
very careful when writing a proposition down to give exactly what you mean and use of brackets can
make a big change. Now what would have been meant if we wrote A ^ B ) A?

In ordinary arithmetic you have an order of preference for opertations : BODMAS so if we wrote 2+3 4
the calculation would be 2 + (3 4) = 2 + 12 = 14
The order of preference for logical connectives is :

…rst : Brackets
:
^
_
last : )

3
Thus if we wrote A ^ B ) A it would have been calculated as (A ^ B) ) A: If you wanted A ^ (B ) A)
then brackets would have to be inserted.

Now take note of the column under (A ^ B) ) A all the truth values are true no matter what the
individual truth values of the component propositions. ie we have a proposition that is always true. We
thus de…ne

De…nition 6 [tautology] : a proposition that is always true no matter what the truth value of the under-
lying propositions is called a tautology

Remark 2 we shall introduce the following non standard symbol for a tautology : Tt

Surely though we can then get a proposition that is always false.Yes you take the negation of a tautology
and you will have a proposition that always false and we thus de…ne :

De…nition 7 [contradiction] : a proposition that is always false no matter what the truth value of the
underlying propositions is called a contradiction.

Remark 3 we introduce the non standard symbol of Cf for a contradiction.

Remark 4 an example of a Cf is :[(A ^ B) ) A]

Example 3 consider :A ^ A : the truth table looks like :


A :A :A ^ A
T F F
F T F
and thus we can conclude that :A ^ A a contradiction and hence :[:A ^ A] a tautology.

Now consider the following truth table

A B A_B :[A _ B] :A :B :A ^ :B
T T T F F F F
T F T F F T F
F T T F T F F
F F F T T T T

What do you note ?


(i) there are propositions that have both true and false truth values depending on the underlying
component truth values. Some texts will say such a proposition is a contingent proposition.
(ii) if we look at the column under :[A _ B] and that under :A ^ :B they are exactly the same.
From a logical point of view they are the same. This proves a very useful concept so we de…ne the concept
of logical equivalence and use the symbol .

De…nition 8 [logical equivalence] : We say X Y if the propositions X and Y have the same truth
values with all possible variations of the truth values of the underlying propositions of X and Y:

Remark 5 Important to note is the order of the truth values, for consider the following :
A B A)B B)A
T T T T
T F F T
F T T F
F F T T
Although the last two columns have three true and one false each, they occur for di¤ erent combinations
of the underlying truth values eg A ) B has a false value when A is true and B is false but under these
condtions B ) A is true : not the same and we would say [A ) B] 6 [B ) A]

4
We now start to investigate some very useful and thus important logical equivalences. Note that they
have names for easier referencing later on.
Idempotence :
A^A A ;A _ A A

we show the equivalence by means of a truth table :


A A A_A A^A
T T T T
F F F F
Now by comparing the relevant columns we can see the equivalences.
(note that we repeated A above in column 2 purely for ease of calculation of the truth table)

Double negation :
:(:A) A
proof :
A :A :(:A)
T F T
F T F
Thus by looking at the column 1 and 3 we can see A : (:A)

De Morgan’s laws :
:(A ^ B) :A _ :B ; :(A _ B) :A ^ :B
proof :
A B A ^ B :(A ^ B) :A :B :A _ :B A_B :(A _ B) :A ^ :B
T T T F F F F T F F
T F F T F T T T F F
F T F T T F T T F F
F F F T T T T F T T

If we compare columns 4 and 7 we see : :(A ^ B) :A _ :B


and if we look at columns 9 and 10 we see : :(A _ B) :A ^ :B

Note a pattern to the above equivalences. Mathematics is a study of patterns. It will also help with your
memorization of such.

Contra-positive :
A ) B :B ) :A

proof : do as an exercise.
This will be very useful when proofs are discussed.

Commutativity :
A_B B_A ;A ^ B B^A

Remark 6 note that ) not commutative (A ) B 6 B)A this has been shown before)

Associativity :
A _ (B _ C) (A _ B) _ C ; A ^ (B ^ C) (A ^ B) ^ C

Distributive :
A _ (B ^ C) (A _ B) ^ (A _ C) ; A ^ (B _ C) (A ^ B) _ (A ^ C)

Implication :
A ) B :A _ B

5
Note that this is a very useful equivalence.

We now introduce a new connective namely the biconditional and it has the symbol , : It is also called "
if and only if ". Please re-read the remark on only if and it will make a lot more sense with what follows.
Surely with , we would want the following : ) and (
We de…ne the biconditional as follows :

De…nition 9 [biconditional] : Let A and B be di¤ erent propositions. Then we de…ne A , B as follows
:
A B A,B
T T T
T F F
F T F
F F T

Remark 7 show that A , B [A ) B] ^ [B ) A]


This is useful when proving an if and only if theorem : see later in this module.

Remark 8 One would also ask "in the order of preference of connectives, where does the biconditional
lie?" and the answer is : last

We now continue with listing some of the important logical equivalences that need to be known. Please
look for patterns!
Excluded middle :
(A _ :A) Tt

Contradiction :
(A ^ :A) Cf

Absorbtion :
A ^ (A _ X) A ; A _ (A ^ X) A

Remark 9 note the pattern and why the word absorb.

Identity :
A ^ Tt A ; A _ Cf A

Remark 10 Note a tautology acts like an identity for the operation ^ whereas a contradiction plays the
role of such for _

Remark 11 note that to prove the above your truth table will only have two lines as A can be either true
or false but Tt is only true [by de…nition of what a tautology is]

Remark 12 What would happen if we switch the ^ with _??

Annihilation :
A _ Tt Tt [A is annihilated]
A ^ Cf Cf [A is annihilated]

We show now that there are often times when something can be done mathematically in more than one
way. We could use a truth table to show that : p _ :(:p ) q) q ) p Another way is now given
which will illustrate the reason why the logical equivalences mentioned before were given names for easy
referencing :

Example 4 Show : p _ :(:p ) q) q ) p without using a truth table

6
p _ :(:p ) q) p _ [:[:(:p) _ q]] implication
p _ [:(p _ q)] double negation
p _ [:p ^ :q] de morgan
(p _ :p) ^ (p _ :q) distributive
Tt ^ (p _ :q) excluded middle
p _ :q identity
:q _ p commutative
q)p implication

Example 5 Show (([p ) q] ^ :q) ) :p) Tt without using a truth table

(([p ) q] ^ :q) ) :p) (((:p _ q) ^ :q) ) :p) implication


(((:q ^ (:p _ q)) ) :p) ^ commutative
((:q ^ :p) _ (:q ^ q)) ) :p distributive
((:q ^ :p) _ Cf ) ) :p contradiction
(:q ^ :p) ) :p identity
:(q _ p) ) :p de morgan
:(:(q _ p)) _ :p implication
(q _ p) _ :p double negation
q _ (p _ :p) associative
q _ Tt excluded middle
Tt annihilation

Remark 13 note that we did only one operation per step in the above so that we could show exactly
why [each line has a single step with single reason]. Rather take a few more lines to do a problem but
understand exactly why each step is valid. This is essential especially at the introductory level to any
subject. Note also that any reader would be able to follow your reasoning. The above example could have
been done in more than one way and get to the same conclusion.

We are now ready to begin discussing what a proof really is. Some of this you did in MATA. Intuitively
a mathematical proof involves showing that if certain conditions are true then we can conclude another
proposition or combination of propositions is true. If we let A be the initial true proposition(s) and B
the resulting proposition(s) then we want to show that if A true then so is B true.

We thus de…ne a valid argument.

De…nition 10 [valid argument] : Let A and B be a collection of propositions


If all the propositions in A are true results in the propostions in B also being true , then we say if A then
B is a valid argument.

Remark 14 we often write A ) B for if Athen B, and we call A the hypothesis and B the conclusion.

Example 6 Show that if A _ B and :A then B is a valid argument


We need show that given A _ B true and :A true; then we can deduce that B is true.
One easy way to do this is by truth table. Note that in the complete truth table we will identify the line(s)
where the hypothesis are all true by an * and these lines are called critical lines. In these lines we will
then have to check that the conclusions are all true for then we will have a valid argument.
conclusion premise premise
A B :A A_B
T T F T
T F F T
F T T T *
F F T F
We note a single critical line and in this line the conclusion B is true : hence a valid argument

7
Example 7 Is the following argument valid or not ? If A _ B and A then B
premise conclusion premise
A B A_B
T T T *
T F T *
F T T
F F F
We have two critical lines - but we note in the second of these that the conclusion B is false : hence the
argument is not valid.

So a theorem is generally of the form A ) B [if A is true then we can deduce B is also true] and hence
we try to show a valid argument. But then surely we are just showing that A ) B Tt [can you see why
we can say such? if we have a Tautology then we must have A ) B is true thus if A is true so too must
B ie a valid argument and for a valid argument we would have A and B true hence A ) B always true]

Thus consider the next example :

Example 8 Show that if A ) B and A then B is a valid argument.


There are two possible ways to show/prove such.
(i) Show that [A ^ (A ) B)] ) B Tt
(ii) show by means of truth table and critical lines that under all conditions with A and A ) B being
true [critical lines] that you have B being true.

Do the above as an exercise.

Note now how we can use our previous knowledge to derive quicker methods of proof. You shall see that
[A ^ (A ) B)] ) B is called modus ponens as a rule of inference. Basically it is saying if you know that
[A ^ (A ) B)] then you can conclude B

Now what if you have : [:B ^ (A ) B)]? we show very quickly that we can conclude :A without truth
tables.

[:B ^ (A ) B)] [:B ^ (:B ) :A)] contrapositive


But then by the modus ponens rule we can conclude :A: This rule is called modus tollens. The names
of the some of the rules of inference [useful valid argument forms] are below and need be known for easy
reference. Four useful laws of inference we shall use are the following :-

modus ponens : if A^(A ) B) then B


modus tolens : if (A ) B) ^ :B then :A
simpli…cation : if A ^ B then A (or B)
addition : if A then A _ B (for any B)

We now introduce a very important tool for proof technique - the so called indirect technique. Say we
are wanting to show A ) B. There are times when A does not have much to work with and thus by
directly trying to arrive at B is di¢ cult. What we then do is make an indirect assumption viz :B and
then proceed with A and :B directly and head for an absurdity [for example a proposition that is both
true and false] for then what we assumed cannot be correct and B must follow. We show use of such a
technique in the next example, but …rst take note of why the indirect method works.

Say we are wanting to prove theorem P ) Q via the indirect method. Then we take P ^ :Q and head
for an absurdity. Surely then P ^ :Q must be false and hence :(P ^ :Q) thus true. But :(P ^ :Q)
:P _ Q P ) Q

8
Example 9 Show the transitive property : if A ) B and B ) C then A ) C
Given : A ) B and B ) C
Now assume : :(A ) C) the indirect assumption
but we have : :(A ) C) :(:A _ C) implication
:(:A) ^ :C De Morgan
A ^ :C double negation
But then we have B ) C and :C (:C comes from simpli…cation : see above) thus by modus tolens we
have :B
But by A (A comes from simpli…cation : see above) and A ) B and modus ponens we get B
Thus we have an absurdity : both B and :B
Thus what we assumed cannot be correct and A ) C follows.

Remark 15 Note we are moving away from truth tables and towards proofs with each line motivated :
that is what a mathematics proof is all about.

Remark 16 Note that if you prove : X ) Y then you have actually also proved another theorem : what
do you think it is? By the contrapositive equivalence you have also shown :Y ) :X

Remark 17 You shall …nd out that most often the most di¢ cult thing about a proof is the starting point.
Is it a direct proof method, or indirect proof technique or do we do the contrapositive. Experience will
help guide you. Please make sure that in all proofs tackled that each line can be reasoned : in this way
you are thinking correctly and the proofs will make sense.

We end o¤ with a simple word problem to show how a proof could be used.

Example 10 What valid conclusion can be made if the following is known.


If I study then I will pass. If I do not go to a movie then I will study. I failed.
Solution [from a logical perspective]
Let the following symbols be used for ease of referencing:
A : I study
B : I pass
C : I go to a movie
Then we are given :
A)B [If I study then I will pass]
:C ) A [If I do not go to a movie then I will study]
:B [I failed]
But then from logic we can see :
:C ) A and A ) B will result in :C ) B [transitive property shown above]
Then with :B and :C ) B and modus tolens we get :(:C)
But :(:C) C [double negation]
So we conclude that I went to a movie

Remark 18 Note that you could have equivalentally shown that


((A ) B) ^ (:C ) A) ^ :B) ) C was valid by either a truthtable and critical rows or showing that
((A ) B) ^ (:C ) A) ^ :B) ) C Tt but the above is the more natural mathematical method. The
joys of mathematics !

9
2.1 EXERCISE : logic
1. How many truth lines would be necessary to show all the di¤erent combinations of true or false for
the proposition : a _ (b _ :c) ) d

2. Draw up a truth table for :

(a) a _ (b _ :c)
(b) a ^ b _ :a hint : what would the order of preference be here?
(c) a ) (a _ b)

3. What is the truth value of a _ (b , :c) if a is false; b is false but c is true.


4. Use a truth table to show the following equivalences :

(a) commutativity of ,: A,B B,A


(b) absorbtion : P ^ (P _ X) P and P _ (P ^ X) P
(c) excluded middle : P _ :P Tt
(d) contradiction : P ^ :P Cf
(e) Identity : P ^ Tt P P _ Cf P
(f) Annihilation : P _ Tt Tt P ^ Cf Cf
(g) Biconditional : A , B (A ) B) ^ (B ) A)

5. Show by means of a truthtable and indenti…cation of the critical rows that the following are valid
arguments :

(a) modus ponens : if A and A ) B then B [ie (A ^ (A ) B)) ) B]


(b) modus tolens : if :B and A ) B then :A
(c) simpli…cation : if A ^ B then A (or B)
(d) addition : if A then A _ B

6. Prove each of the above without the use of a truthtable but by establishing a tautology.
[eg to show addition you need show : (A ) (A _ B)) Tt without a truthtable]

10
3 SET THEORY
One of our main aims with this continuation of set theory from MATA is how to prove sets equal.
This technique holds in many areas of mathematics and is thus useful. We recall …rst some necessary
de…nitions from MATA.

De…nition 11 (A \ B): A \ B = fx : x 2 A ^ x 2 Bg

Remark 19 A \ B is read A intersection B.

Remark 20 y 2 A \ B , y 2 A ^ y 2 B
y2
= A\B ,y 2 = A_y 2= B (recall :(P ^ Q) :P _ :Q)

De…nition 12 (A [ B): A [ B = fx : x 2 A _ x 2 Bg

Remark 21 A [ B is read A union B.

Remark 22 p 2 A [ B ) p 2 A _ p 2 B
p2
= A[B ,p2 = A^p2 =B

De…nition 13 (A B): A B = fy : y 2 A ^ y 2
= Bg

Remark 23 A B is read A less B.

Remark 24 x 2 A B ) x 2 A ^ x 2
=B
x2
=A B,x2 = A_x2B

De…nition 14 (A B): Let A; B be non empty sets. A B = f(x; y) : x 2 A; y 2 Bg

Remark 25 A B is read A cartesion B and consists of ordered pairs.

Remark 26 (x; y) 2 A B , x 2 A ^ y 2 B
(x; y) 2
= A B () x 2= A_y 2
=B

De…nition 15 (A0 ): Let U be the universal set (set from which all elements must belong).
A0 := U A = fx : x 2 U; x 2
= Ag

Remark 27 if U changes so does A0 .

Remark 28 A0 is read the complement of A.

Remark 29 x 2 A0 , x 2 U ^ x 2 =A
The above is generally shortened to x 2
= A as all elements must belong to the universal set U:
Thus: x 2 A0 , x 2 =A
x2= A0 , x 2 A

De…nition 16 (A B): A B , 8x 2 A; x 2 B

Remark 30 A B is read A is a subset of B.

Remark 31 A * B , 9x 2 A; x 2 = B:
(Recall: :(8x 2 A; P (x)) 9x 2 A; :P (x))

The one very important theorem you learnt in MATA was:

Theorem 1 Let A; B be sets. A = B , A B^B A.

11
Thus to prove two sets X and Y are equal you must show X Y and Y X. Recall how to show say
X Y : you select an arbitrary element from X and show it belongs to Y .

Theorem 2 A B; B C ) A C
Proof. Let x 2 A
Then x 2 B (A B)
then x 2 C (B C)
Hence A C

Theorem 3 A B = A \ B 0
Proof. Note we are going to prove A B A \ B 0 and A \ B 0 A B in one process. Make sure you
follow. If not; split your proof into the usual two proofs.

x2A B , x2A^x2 =B
, x 2 A ^ x 2 B0
, x 2 A \ B0

Theorem 4 A \ (B [ C) = (A \ B) [ (A \ C)
A [ (B \ C) = (A [ B) \ (A [ C)
[the distribution laws]
Proof. A \ (B [ C) = (A \ B) [ (B \ C)

let x 2 A \ (B [ C) , x 2 A ^ (x 2 B [ C)
, x 2 A ^ (x 2 B _ x 2 C)
, (x 2 A ^ x 2 B) _ (x 2 A ^ x 2 C) (what logic used!)
, (x 2 A \ B) _ (x 2 A \ C)
, x 2 (A \ B) [ (A \ C)
A [ (B \ C) = (A [ B) \ (A [ C): exercise

Theorem 5 B \ A = B , A0 \ B = ;
Proof. )
recall that an indirect method most often used when trying to prove a set empty; hence assume A0 \ B 6= ;
hence there exists an x 2 A0 \ B and so x 2 A0 ^ x 2 B
But we are given that B = B \ A so as we have x 2 B; we have x 2 B \ A and so x 2 B and x 2 A:But
if x 2 A we then have x 62 A0 and so we have reached an absurdity viz x 2 A0 ^ x 62 A0
Hence what we assumed is incorrect and the result A0 \ B = ; follows.
(
As we are needing to show B = B \ A we are actually needing to show that (i) B (B \ A) and (ii)
(B \ A) B
(i) : Let y 2 B: Then as B \ A0 = ; we must have that y 62 A0 ie y 2 A
But then as y 2 B ^ y 2 A we get y 2 B \ A and so we have shown B (B \ A)
(ii) : let p 2 B \ A then p 2 B ^ p 2 A: But then as p 2 B we get the desired result of B B \ A

Theorem 6 A (B \ C) = (A B) \ (A C)
Proof. Let (x; y) 2 A (B \ C) , x 2 A ^ [y 2 B \ C]
, x 2 A ^ [y 2 B ^ y 2 C]
, (x 2 A ^ y 2 B) ^ (x 2 A ^ y 2 C)
, [(x; y) 2 A B] ^ [(x; y) 2 A C]
, (x; y) 2 (A B) \ (A C)

We now move into the counting of elements in a set and the concept of a power set. We will see how the
concept of partitioning of a set can be used to solve a practical problem.

12
De…nition 17 (…nite set): A set A is said to be …nite if it has either 0 or a positive integer value of
di¤ erent elements in the set.
Remark 32 If a set is not …nite it is called in…nite.
Remark 33 If a set S is …nite then the number of di¤ erent elements in the set is the cardinality of the
set denoted by jSj.
Example 11 A = x : x2 = 1; x 2 R is …nite with jAj = 2
B = f2; 1; 2g is …nite with jBj = 2
C= x : x2 = 4; x 2 R is …nite with jCj = 0
D = fx : 1 x 2; x 2 Rg is not …nite (ie in…nite)
E = fx : x 2 N; 1 < x 100g is …nite with jCj = 99

We now de…ne the power set of a set.

De…nition 18 (P(X)): Let X be any set. Then the power set P(X) is the set of all subsets of X. ie
P(X) = fA : A Xg
Example 12 X = fa; bg
P(X) = f;; fa; bg ; fag ; fbgg
jP(X)j = 4
Remark 34 Remember ; X and X X for any set X.

We now establish jP(X)j for X a …nite set.


Theorem 7 Let X be a …nite set with jXj = n
Then jP(X)j = 2n
Proof. We must count the number of di¤ erent subsets. But subsets have a number of elements. There
are n Cr subsets having r elements from X (combination theory from MATA). Thus there are
n
C0 +n C1 +n C2 + ::: +n Cn subsets.
n
X n
X
binom ial
But consider 2n = (1 + 1)n = n
Cr 1n r 1r = n
Cr :
theorem
r=0 r=0
Thus we have established the theorem.

We now introduce the concept of the Partitioning of a set.


De…nition 19 (Partition): Let A be a set
X
= fCi : Ci 6= ;; Ci Ag is called a partition of A
if and only if the following holds:
(a) [PCi = A
Ci 2
P
(b) Ci \ Cj = ; for Ci ; Cj 2 ; Ci 6= Cj
P P
Remark 35 if is a partition of A, then Ci 2 is called a cell of A.
Remark 36 Pictorially one can see a partition of A as a jigsaw puzzle of A with the jigsaw pieces the
cells of A.
P
= fc1 ; c2 ; c3 ; c4 g
is a partition of A

13
Remark 37 A set A can have many di¤ erent partitions.

Example 13 A
P= fa; b; c; d; eg
P1 = ffag ; fb; cg fd; egg is a partition of A
P2 = ffag ; fb; cg ; fdgg is not a partition of A as e 2
= any cell
P3 = ffag ; fb; cg ; fa; d; egg not a partition of A as a belongs to 2 di¤ erent cells
4 = ffa; bg ; fc; eg ; fdgg is a partition of A.

Now one importance of partitioning Plies in the following.


Let S be a …nite set with partition = fC1 ; C2 ; :::; Cn g then jSj = jC1 j + jC2 j + ::: + jCn j

This enables us to now prove:

Theorem 8 Let A and B be …nite not empty sets.


Then jA [ Bj = jAj + jBj jA \ Bj
Proof. Consider the two cases: (i) A \ B = ;
(ii) A \ B 6= ;
(i) A [ B has partition fA; Bg
thus jA [ Bj = jAj + jBj
but jA \ Bj = 0
thus jA [ Bj = jAj + jBj jA \ Bj
(ii) A [ B has partition fA B; B A; A \ Bg
thus jA [ Bj = jA Bj + jB Aj + jA \ Bj
Now let jAj = x
jBj = y
jA \ Bj = r
then jA Bj = x r
jB Aj = y r
and so jA [ Bj = jA Bj + jB Aj + jA \ Bj
= (x r) + (y r) + r
=x+y r
= jAj + jBj jA \ Bj

We end o¤ this section on set theory by seeing how the partitioning of sets can be used.

Example 14 How many integer values are there between 1 and 100 (inclusive) which are divisible by 2
or 3.
Let A be set of numbers divisible by 2.
i.e.A = f2; 4; 6; :::; 100g = f2(1); 2(2); 2(3); :::; 2(50)g
ie jAj = 50
Let B be set of numbers divisible by 3.
i.e. B = f3; 6; 9; :::; 99g = f3(1); 3(2); :::; 3(33)g
ie jBj = 33
Thus we are looking for jA [ Bj
But jA [ Bj = jAj + jBj jA \ Bj
But A \ B is the set of integers divisible by 2 and 3 i.e. divisible by 6 i.e. A \ B = f6; 12; :::; 96g =
f6(1); 6(2); :::; 6(16)g
jA \ Bj = 16
Thus jA [ Bj = jAj + jBj jA \ Bj
= 50 + 33 16
= 67

14
Example 15 How many natural numbers are divisble by 3 or 5 between 51 and 176 inclusive ?
Let A = fnatural numbers divisible by 3 between 51 and 176 inclusiveg
Let B = fnatural numbers divisible by 5 between 51 and 176 inclusiveg
Then the numbers divisible by 3 and 5 will be those divisible by 15 ie
A \ B = fnatural numbers divisible by 15 between 51 and 176 inclusiveg
hence we get
A = f51; 54; :::; 174g = f3(17); 3(18); :::; 3(58)g
jAj = 58 17 + 1 = 42
B = f55; 60; :::; 175g = f5(11); 5(12); :::5(35)g
jBj = 35 11 + 1 = 25
A \ B = f60; 75; 90; :::; 165g = f15(4); 15(5); :::15(11)g
jA \ Bj = 11 4 + 1 = 8
hence the number of natural numbers divisible by 3 or 5 in range is
jA [ Bj = jAj + jBj jA \ Bj = 42 + 25 8 = 59

Note this concept will be returned to in the integer theory section. Can you think of a time when this
method will fail ? The answer and re…nement of such will met in the integer theory section.

15
3.1 Exercise: Set Theory
1. Prove the following:

(a) A \ B = ; ) A B0
0
(b) A (A0 \ B 0 )
(c) A0 B0 = B A
(d) A [ (B \ C) = (A [ B) \ (A [ C)
(e) (A B) \ (A C) = A (B [ C)
0 0 0
(f) (A \ B) = A [ B [De Morgan’s law]
0 0 0
(g) (A [ B) = A \ B [De Morgan’s law]

2. Prove (A B) C A (B C)
Find an example to show that A (B C) 6 (A B) C
3. Find the number of natural numbers divisible by 3 or 5 between 1 and 1000 (inclusive).
4. Find the number of positive integers between 10 and 500 (inclusive) that are divisible by 7 or 12

16
4 RELATIONS
Consider the set A = f1; 2; 3; 4; 5g
Now if we work with the relation < :
Is 2 < 1 true? No and we write 2 1.
Is 4 < 5 true? Yes and we can leave it as 4 < 5:
Thus we get cases where the statement a < b is true and some where false and we then write a b.
Similarly if we take another relation P de…ned by aP b , a + b > 4.
Then 1P 2 is false for 1 + 2 = 3 4 thus we write 1P/ 2
2P 3 is true for 2 + 3 = 5 > 4 thus we write 2P 3:

Thus we use the notation that if R is any relation between two elements a and b from a set then we write
aRb if the statement is true and aRb
/ if not true.

Consider now some more examples of relations on di¤erent sets.

1. set Z; R1 de…ned aR1 b , a b>2


2. set Z; R2 de…ned aR2 b , a = 2b

Then: 2R
/ 10 (for 2 0 = 2 2)
2R
/ 12 (for 2 2 = 0 2)
5R1 2 (for 5 2 = 3 > 2)
2R
/ 15 (for 2 5 = 3 2)
0R2 0 (for 0 = 2:0)
4R2 2 (for 4 = 2(2))
2R
/ 24 (for 2 6= 2(4))
Now certain properties of relations play an important role.

De…nition 20 (re‡exive): A relation R on set S is said to be re‡exive if 8a 2 S; aRa:

Remark 38 When is something not re‡exive?


:(8a 2 S; aRa) 9a 2 s; aRa /
Thus R is not re‡exive if you can …nd an element in the set which is not related to itself under R.

Example 16 A = f1; 2; 3; 4g R de…ned: aRb , a = b


Then R re‡exive for any a 2 A a = a and hence aRa holds for all a 2 A.

Example 17 B = f1; 2; 3; 4g Pi de…ned: aP1 b , a + b > 1


aP2 b , a + b > 2
Then P1 is re‡exive for aP1 a true for all a 2 B:
But P2 not re‡exive for 1P/ 2 1 as 1 + 1 2

Example 18 Z de…ned by a b , a b divisible by 5


, 9k 2 Z a b = 5k
(Note: divisible by 5 and the equivalent 9k 2 Z 3 5k)

Is re‡exive or not? We must either prove/show a a 8a 2 Z or give a counter example (ie an


example to show not true)

but let a 2 Z then a a = 0 = 5 (0)


thus a a and as a was an arbitrary we have 8a 2 Z ; a a:
Thus re‡exive.

17
Example 19 Z de…ned by: a b , ab > 1
Is re‡exive?
No for consider 0 2 Z but 0 0 = 0 1 thus 0 /0

De…nition 21 (symmetric): A relation R on set A is said to be symmetric if aRb ) bRa

Remark 39 note the above means that for all aRb true; then so must bRa be true. Thus not symmetric
means 9aRb true but bRa not true (i.e. 9aRb with bRa).
/

Example 20 A = f1; 2; 3; 4g R1 de…ned aR1 b , a + b > 2


R2 de…ned aR2 b , a b > 2
R1 is symmetric for if aR1 b then a + b > 2 but then b + a > 2 and hence bRa must also hold.
R2 not symmetric for 4R2 1 (as 4 1 = 3 > 2 but 1R / 24 (1 4 = 3 2)

Remark 40 note for symmetric we don’t have to have aRb true 8a; b 2 A. In the above example 1R
/ 11
(i.e. not re‡exive) but R1 is symmetric.

Example 21 Z de…ned a b , a b divisible by 5


symmetric for: let a b then 9k 2 Z 3 a b = 5k
but then b a = (a b) = 5( k)
thus b a divisible by 5 and b a true.

Example 22 N P de…ned aP b , ab > 1


Not symmetric.
Counter example: 4P 2 but 2P/ 4
Is P re‡exive? No! (can you think of a counter example?)

De…nition 22 (transitive): A relations R on set A is transitive if aRb; bRc ) aRc:

Remark 41 R not transitive? If you can …nd aRb; bRc but for which aRc
/

Example 23 A = f1; 2; 3; 4; 5g 1 de…ned a 1 b , a + b > 3


2 de…ned a 2 b , a = b
1 not transitive for: 1 1 3; 3 1 2 but 1 /1 2 (note there are other counter examples)
2 transitive: let a 2 b and b 2 c
then a 2 b ) a = b
b 2c ) b = c
but then a = b = c ) a = c and a 2 c follows

Example 24 Z R de…ned aRb , a b divisable by 5.


R transitive for: let aRb and bRc.
thus aRb ) 9k1 2 Z, a b = 5k1
bRc ) 9k2 2 Z, b c = 5k2
then a c = (a b) + (b c)
= 5k1 + 5k2
a c = 5(k1 + k2 ) ) aRc
2Z

Now certain relations have all three of the before mentioned properties (viz, re‡exive; symmetric; tran-
sitive) and play an important role in mathematics. We thus de…ne.

De…nition 23 (equivalence relation): A relation R on set A is called an equivalence relation if it is


re‡exive, symmetric and transitive.

18
Remark 42 When is a relation not an equivalence relation? Answer: when any one of the three
properties re‡exive, symmetric or transitive fails.

Remark 43 Can you …nd an example of an equivalence relation?


From the previous examples two such relations can be found.
(1) R de…ned aRb , a = b
(2) R de…ned on Z aRb , a b divisible by 5.

We now consider an example of an equivalence relation on a set which is itself an ordered pair.

Example 25 Let A = Z (Z f0g)


De…ne on A by (x; y) (a; b) , xb = ya
Show that is
(i) re‡ective
(ii) symmetric
(iii) transitive

Solution 9 (i) re‡ective:


Need show (x; y) (x; y) 8(x; y) 2 A = Z (Z f0g)
let (x; y) 2 A then xy = yx (Z commutative )
thus: (x; y) (x; y)
(ii) symmetric:
Need show (x; y) (a; b) ) (a; b) (x; y)
but if (x; y) (a; b) ) xb = ya
) ay = bx
) (a; b) (x; y)
(iii) transitive:
Need show (x; y) (a; b); (a; b) (w; r) ) (x; y) (w; r)
thus we need show xr = yw from given
but (x; y) (a; b) ) xb = y on (1)
(a; b) (w; r) ) ar = bw (2)
but from (1) xb = ya ) x = ya b (Note b 2 Z f0g hence can )
(2) ar = bw ) a = bw r (Note r 2 Z f0g )
then xr = ya b r
= yb bwr r
= yw
thus (x; y) (w; r) the needed result

We now investigate the equivalence relation further and see how it results in partitioning of the set it is
de…ned on

De…nition 24 (equivalence class): Let be an equivalence relation on A


The equivalence class of a 2 A is de…ned as follows
a = fx : x 2 A; a xg

Example 26 Consider R de…ned on Z by aRb , a b divisible by 5


We have seen that R is then an equivalence relation.
Find: 2; 3; 0; 4
2 := fx : x 2 Z; 2Rxg = fx : 2 x divisible by 5g
= fx : 9k 3 2 x = 5kg
= fx : x = 2 5k k 2 Zg
= f:::; 8; 3; 2; 7; :::g

19
3 = fx : x 2 Z; 3Rxg = fx : 3 5k k 2 Zg (check detail yourself )
= f:::; 8; 3; 2; 7; :::g
0 = fx : x 2 Z; 0Rxg = fx : x = 0 5k k 2 Zg (check detail yourself )
= f:::; 10; 5; 0; 5; 10; :::g

4 = fx : x 2 Z; 4Rxg = fx : x = 4 5k k 2 Zg (check detail yourself )


= f:::; 14; 9; 4; 1; 6; :::g

Remark 44 Looking at the classes above, note that 3 = 2 and otherwise the classes have no elements
in common. Does this always hold that if we have two equivalence classes that they are either the same
(equal) or disjoint (no elements in common)? The next theorems solves the problem but we …rst look at
an equivalence class for the equivalence relation (x; y) (a; b) , xb = ya de…ned on Z (Z f0g).

Example 27 Find (2; 1) for de…ned on Z (Z f0g) by (x; y) (a; b) , xb = ya.

Solution 10 (x; y) = f(a; b) : (x; y) (a; b)g


= f(a; b) : xb = yag
= a; ya x : a 2 Z; ya
x 2Z f0g
a a a
thus (2; 1) = a; 2 : a 2 Z; 2 2 Z f0g but we need 2 to be integer
= f(2a; a) a 2 Z f0gg
= f::: ( 4; 2) ; ( 2; 1) ; (2; 1) ; (4; 2) ; (6; 3) :::g

We now return to the theory of equivalence classes.

Theorem 11 Let ~ be an equivalence relation on A.


a b,a=b
Proof. ) (we must show a b and b a)
let x2a
a x (def a)
but a b (given)
thus b a ( symmetric)
but b a; a x ) b x ( transitive)
x2b (def b)
thus a b
Similarly b a (do yourself as exercise)
Thus a = b
( a 2 a as a a re‡exive
but a = b
) a2b
) b a (def b)
) a b ( symmetric)

Theorem 12 Let be an equivalence relation on A


a 6= b ) a \ b = ;
Proof. Recall the method to show a set is empty is the indirect method
thus: assume a \ b 6= ;
then 9x 2 a \ b
then a x; b x
but a x ) x a ( symmetric)

20
but then b x; x a ) b a ( transitive)
but then by previous theorem b = a : a contradiction to a 6= b (given)
thus assumption incorrect and theorem follows

So we know if is an equivalence relation, then the equivalence classes are either equal or disjoint,
furthermore a 2 a.
Thus we get that the equivalence classes of A form a partition for A (recall the de…nition of a partition
of A)

We end o¤ this section on relations by looking at an equivalence relation which has already been inves-
tigated, but generalizing it.

Recall on Z: R de…ned aRb , a b divisible by 5 was shown to be an equivalence relation. We now


generalize 5 to any positive integer value m.

De…nition 25 (divisible): Let a; d 2 Z. We say a is divisible by d (and denote d ja ) if and only if there
exists an integer k so that a = kd. (i.e. d ja , 9k 2 Z; a = kd):

De…nition 26 (modulo): Let m 2 N be …xed. Let a; b 2 Z. Then a is congruent to b mod m if and


only if a b is divisible by m.

Remark 45 We denote: a is congruent to b mod m by a b mod m.


thus a b mod m , m ja b
, 9k 2 Z; a b = km

Example 28 12 8 mod 2 for 2 j12 8


12 6 7 mod 2 for 2 - 12 7

Example 29 Find x 3 3 x mod 7


3 x mod 7 , 7 j3 x
, 9k 2 Z; 3 x = k7
, x = 3 k7 k 2 Z
, x 2 f:::; 11; 4; 3; 10; 17; 24; :::g

Remark 46 Look for a pattern in the above set values of x.

Theorem 13 Let m 2 N …xed.


Let R be de…ned in Z by: aRb , a b mod m
Then R is an equivalence relation on Z

21
Proof. (i) Re‡exive
Let a 2 Z then a a=0=0 m
) a a mod m (why: give reason)
) aRa

(ii) Symmetric
Let aRb
Thus a b mod m ) k 2 Z 3 a b = km
but b a = (a b) = ( k)m
) b a mod m (why: explain)
) bRa

(iii) Transitive
Let aRb; bRc (need show aRc ie a c mod m)
then 9k1 3 a b = k1 m (why!)
9k2 3 b c k2 m (why!)
then a c =a b+b c
= k1 m + k2 m
= (k1 + k2 )m
2Z
thus a c mod m ) aRc

Note that modulo n will prove useful when we end the module with an very brief introduction to cryp-
tography.

22
4.1 Exercise: Relations
1. Determine whether the following are true or false:

Z aRb , a + 2b > 3

(a) 2R2
(b) 2R1
(c) 1R10
(d) 10R 1
(e) R is re‡exive
(f) R is symmetric
(g) R is transitive

2. Prove or give counter example to the following statements concerning N with R de…ned on N by
aRb , 9k 2 Z,a b = 2k

(a) R is an equivalence relation


(b) 2 = 4
(c) 9x 2 1 \ 2

3. De…ne R on N by aRb , 9k 2 Z; a = 10k b

(a) Prove R an equivalence relation on N.


(b) Determine 1 and 170:

4. Let A = Z Z and de…ne P on A by (x; y)P (a; b) , x + b = y + a

(a) Prove P an equivalence relation on A:


(b) Determine (4; 3).

5. Let be an equivalence relation on A and a b. Prove b a:


6. Given: aj d; dj e. Prove aj e.
7. Given: aj b aj c. Prove:

(a) aj(b + c)
(b) ajbc

8. Find the smallest positive value of x satisfying x 17 mod 3.

9. Let x a mod m. Prove x2 a2 mod m:


10. Find all the distinct equivalence classes for congruence modulo 4. To which of these classes found
will 17 belong?

23
5 FUNCTIONS
Consider A = f1; 2; 3; 4g R de…ned on A by aRb , a+b 5. Then if we consider f(a; b) : aRb trueg
we get the following set of ordered pairs f(1; 4) ; (2; 3) ; (2; 4) ; (3; 2) ; (3; 3) ; (3; 4) ; (4; 1) ; (4; 2) ; (4; 3) ; (4; 4)g.
Thus we could consider the relation R to really be a set of ordered pairs on A A satisfying aRb.
We use this to now de…ne a relation. Note that we also generalize to A B (although A = B is one
possibility for B).

De…nition 27 (relation): Let A; B be non-empty sets. A relation R between sets A and B is de…ned
as: R = f(a; b) : a 2 A; b 2 B; aRb trueg
Remark 47 R A B
Remark 48 The domain of R (denoted dom R) = fa : a 2 A; 9b 2 B 3 (a; b) 2 Rg
The range of (denoted ran R ) = fb : b 2 B; 9a 2 A 3 (a; b) 2 Rg
i.e. Dom R is the set of all 1st co-ordinates of elements from R.
Ran R is the set of all 2nd co-ordinates of elements from R.

Remark 49 Note that both dom R and dom R are acceptable notations.
Example 30 R = f(1; a) ; (2; a) ; (1; b) ; (2; c)g is a relation between sets f1; 2g and fa; b; cg with
Dom R = f1; 2g Ran R = fa; b; cg
Example 31 Let x = fa; b; c; dg y = f1; 2; 3g
= f(a; 1) ; (b; 1)g
Then is a relation between x and y
dom = fa; bg
ran = f1g
Remark 50 for a relation R between A and B with R A B; the domain if R is a subset of A, but
need not be the whole of set A. Similarly for the range B R

We now introduce relations which are more speci…c and we call them functions.
De…nition 28 (function): Let A; B be non empty sets. A relation R A B is called a function from
A to B if and only if the following hold: (1) dom R = A
(2) 8a 2 A9!b 2 B 3 (a; b) 2 R
Remark 51 (2) in de…nition above is important. Every element from A is linked to a unique element
b 2 B. This element is called the image of a under R.
Remark 52 When is a relation R A B not a function from A to B? If either condition (1) or (2)
in the de…nition fail, then R will not be a function i.e. either 9a 2 A, a is not linked to any b under R
or 9 a which is mapped to more then one element from B.
Example 32 Let: A = f1; 2; 3; 4; 5g
B = f1; 4; 6; 8; 9g

1= f(1; 1) ; (2; 1) ; (3; 6) ; (3; 8) ; (4; 8)g


2 = f(1; 1) ; (2; 1) ; (3; 1) ; (4; 1) ; (5; 1)g
3 = f(1; 1) ; (1; 4); (2; 4) ; (3; 6) ; (4; 8) ; (5; 1)g
Which of the above are functions from A to B?
1 : No: 5 2 A and 5 not mapped to anything in B [or 3 2 A but 3 mapped to both 6 and 8 2 B]
2 : Is a function. Note ran 2 6= B:
3 : No: 1 mapped to both 1 and 4 in B

24
Remark 53 Let / A B be a function with (a; b1 ); (a; b2 ) 2/.
Then b1 = b2 (as function: also called a mapping)

Now consider a familiar function y = mx + c (straight line). How does this …t into our new way of
writing? Let f (x) = y or f : x ! mx + c (better still).
Then input x; output f (x) = mx + c.
Thus we really have (x; mx + c) 2 f R R. The beauty of mathematics!
Note how domf = R and 8x9!y(= mx + c) 3 (x; y) = (x; mx + c) 2 f .
Now returning to a function / from A into B.
There are times when Ran/= B. These functions receive a special name.

De…nition 29 (onto): a function f : A ! B is called onto , 8b 2 B9a 3 (a; b) 2 f

Remark 54 Note f : A ! B will mean f A B.

Remark 55 Another word often used for onto is surjective.

Example 33 A = f1; 2g B = f3; 4g


1 = f(1; 3); (2; 3)g
2 = f(1; 3); (1; 4)g
3 = f(1; 3); (2; 4)g
Of the above only 3 an onto function. Why? 1 : 4 2 B but nothing from A mapped to 4. 2 not a
function as 1 mapped to di¤ erent elements (or dom 2 =
6 A).

Now consider the following two functions. Can you …nd a major di¤erence between the two?
A = fa; b; cg B = fx; y; z; pg
1 = f(a; x); (b; y); (c; y)g
2 = f(a; p); (b; y); (c; x)g
We note in 1 that y 2 B is mapped to from both b and c 2 A. (Still a function note). Whereas in 2
all the range elements are mapped from di¤erent elements. Practically we get (which will help with the
next de…nition).

We can see 1 is what is called many-to-one whereas 2 is one-to-one (1 1). We now de…ne the
concept formally.

De…nition 30 (1-1): a function R A B is 1 1 , a1 6= a2 2 A ) R(a1 ) 6= R(a2 )

Remark 56 R(a1 ) is the image of a1 under R ie. (a1 ; R(a1 )) 2 R

Remark 57 R is not 1 1 if 9a1 6= a2 but R(a1 ) = R(a2 )

Remark 58 The contrapositive form of 1 1 is: R(a1 ) = R(a2 ) ) a1 = a2

25
Remark 59 This contrapositive form is often used to prove a function is 1-1.

Example 34 R = (x; y) : x; y 2 R; y = x2 is not 1 1


for 1 6= 1 but R( 1) = ( 1)2 = 1 = R(1)

Example 35 f := f(x; y) : x; y 2 R; y = 3x + 1g is 1-1


for:
let y1 = 3x1 + 1 and y2 = 3x2 + 1 with y1 = y2
3x1 + 1 = 3x2 + 1
3x1 = 3x2
x1 = x2
(Note: the use of the contrapositive form.)

Consider the following example. Think of what is really occurring:


2a 3
Example 36 /: Q f1) ! Q de…ned / (a) = a 1
Find Ran /
(note: Q f1g is domain for / (1) not de…ned!)

n o
To …nd Ran / we want all q 2 Q = xy : x; y 2 Z; y 6= 0 which are mapped onto ie. we …nd all q for
which 9a 2 Q f1g with / (a) = q:
Thus let q 3 9a with / (a) = q ) 2a 3
a 1 =q
(now solve for a to see what to exclude)
2a 3 = q(a 1)
2a aq = 3 q
a(2 q) = 3 q
a = 32 qq
But then q 6= 2 .
Hence: ran /= Q f2g
Note:
Say q = 34 (2 Q f2g) then what a will map onto q = 34 ?
3 3 9
3 3 9
a= 2
4
3 will work for / 2
4
3 =/ 4
5 =/ 5
4 4 4
2(95) 3
= 9
5 1
3
= 5
4
5
3
= 4

Example 37 Test /: R ! R; / (r) = r2


4r if (i) onto
(ii) 1 1
(i) Find range of /: p 2 R and r 3 / (r) = p
r2 4r = p
r2 4rp p = 0
r = 4 16+4p
2
but then 16 + 4p 0
p 4
Thus if p < 4 then there is no real value for r 3/ (r) = p.
ran /= [ 4; 1)
thus / not onto.

26
Let / (a) =/ (b)
a2 4a = b2 4b
a2 b2 4a + 4b = 0
(a b)(a + b) 4(a b) = 0
(a b) [a + b 4] = 0
thus a b=0 _ a+b 4=0
a=b _a=4 b
Thus if b = 1 then from a = 4 b = 3
we get / (1) = 12 4(1) = 3
/ (3) = 9 4(3) = 3
ie. / (1) =/ (3) but 1 6= 3
ie. / not 1 1

Can you think of another way to solve / (r) = r2 4r for onto and/or 1 1? Hint: what type of graph
is r2 4r?
Recall from MATA that we de…ned the composition of functions. We carry over the de…nition.

De…nition 31 (/ ): Let : A ! B, / B ! C be functions.


Then / : A ! C is de…ned by (/ )(a) =/ [ (a)]

Remark 60 / is a function for:


Let a 2 A then (a) unique ( a function) and (a) 2 B but then / ( (a)) unique as / a function.
Thus every a 2 A has a unique image under / .

Remark 61 if two functions are given; be careful in just forming compositions as they somethimes are
not de…ned. See next example.

Example 38 Let f : R ! R f (x) = x 4


g : R+ ! R g(x) = ln x (Remember only take log of positive # hence R+ = domg)
Are f g and g f both de…ned?
f g : R ! R (f g)(x) = f (g(x)) = f (ln x) = ln x 4
2R
g f : R ! R (g f ) (x) = g(f (x)) Beware! : g only de…ned on R+
g f not de…ned for say x = 2 then f (2) = 6 and g( 6) not de…ned

We now investigate composition wrt 1 1 and onto.

Theorem 14 : Let /: A ! B :B!C be function.


(i) If /; are onto then /: A ! C is onto.
(ii) If /; are 1 1 then /: A ! C is 1 1
Proof. (i) Let c 2 C
Then 9b 2 B 3 (b) = c : onto
but then 9a 2 A 3/ (a) = b :/ onto
then ( /)(a) = [/ (a)] = (b) = c thus / onto

27
(ii) Let ( /)(x1 ) = ( /)(x2 )
[x(x1 )] = [x(x2 )] def
/ (x1 ) =/ (x2 ) 1 1
x1 = x2 / 1 1
thus / 1 1

We now investigate the conditions necessary for the inverse of a function to exist.
(This is important for MATB102 when inverse trigonometric functions are discussed. )
Let R : A ! B be a function. Then we want R 1 : B ! A to be a function.
We begin by de…ning: (b; a) 2 R 1 , (a; b) 2 R a relation.
For R 1 to be a function we must have every element of B mapped, so we must have R an onto function.

1
And to ensure that every b gets mapped to a unique a 2 A under R we avoid the condition (b; a1 ); (b; a2 ) 2
R 1 by making R 1 1 (for then a1 = a2 ). so to summarized:
1 1
1 1
If R : A ! B then R : B ! A is a function de…ned (b; a) 2 R , (a; b) 2 R: This is important and
onto
useful for later work.

We end o¤ this section on functions by introducing the concept of restrictions which are useful in being
able to study inverse trigonometric functions (to be studied in MATB102).
Consider f :R!R de…ned f (x) = x2
Then f is not onto (ran f = [0; 1) : check yourself)
f not 1 1 (( 1; 1)(1; 1) 2 f )
1
so f not de…ned
1
However if we restrict f to: f : [0; 1) ! [0; 1) then f is 1 1 and onto thus f exists.
Note we have

We also note the following notation sometimes encountered f ([ 1; 1]) : What interval is the interval
[ 1; 1] mapped onto? Drawing f over this interval

Thus f ([ 1; 1]) = [0; 1] : Note that f over this interval is onto if we restrict f : [ 1; 1] ! [0; 1] but still
not (1 1):

28
Example 39 Suggest restrictions on the domain and codomain for the following to be invertible (ie. to
have an inverse)
/: x ! sin x /: R ! R

1
Then if we restrict / 2 ; 2 ! [ 1; 1] then / 1 1 and onto and thus / will exist.

29
5.1 Exercise: Functions
1. Given the following relations. Determine whether a function or not. If not give a reason. If a
function, determine with reason whether (i) onto and (ii) 1 1.

(a) A = f1; 2; 3g B = f3; 4g


f = f(1; 3); (2; 4)g
(b) f : N ! R f (x) = x
(c) /: R ! R / (y) = 10
(d) p : R ! R p(x) = ln x
+
(e) h : R ! R h(x) = ln x
(f) g : R ! R g(a) = sin a
(g) f : N ! R f (x) = x2
(h) f : R ! R f (x) = x2

1 x; x 1
2. Is /: x ! a function or not? Motivate.
1 + x; x 1
1 x+1
3. Given: f : R 2 ! R de…ned by f (x) = 2x 1 .

(a) Find Ran f and hence determine whether f is onto or not.


(b) Determine whether f is 1 1.

4. De…ne: /: Z+ ! Z+ / (n) = n + 1
: Z+ ! Z+ (x) = 2x

(a) Determine / and /.


(b) Determine (with reasons) whether each is 1 1 and onto.

5. Let /: R ! R de…ned /: x ! x2 2x:

(a) Determine: / ([0; 1])


1
(b) Suggest restrictions on the domain and range to make / 1 1 and onto (and hence / will
exist)
1
6. Let /: R ! R be the following functions: Suggest restrictions so that / will exist.

(a) / (x) = ex
(b) / (x) = cos x

30
6 INTRODUCTION TO FORMAL AXIOMATIC THEORY
We now introduce a fun section which will also allow you to see how much proof technique you have
learnt. When we start any new section of mathematics we begin with de…nitions. But within the
de…nition we often have already de…ned things and build on these. We must have an original starting
point though, which we just accept. These terms are called primitive terms - they will be what all else
is based on (cf to building a house where primitive terms are bricks (not concerned with what bricks
are); and we can de…ne say a wall in terms of the bricks).
In this section we take as primitive terms a set K with unde…ned terms a; b; c::: together with relation P .
The rules of the game or more mathematically correct the axioms (or postulates) will be the following:
axiom 1: a 6= b ) aP b _ bP a
axiom 2: aP b ) a 6= b
axiom 3: P transitive (ie. aP b; bP c ) aP c)
axiom 4: K has only 4 di¤erent elements
On only this we will now build a theory (hopefully abstract enough to see that really a game) and will
then show applications.

Theorem 15 aP b ) bP/ a
Proof. (note that nowhere in axioms is there a P/ so what proof technique springs to mind? Yes -
indirect.) Indirect assumption bP a:
but aP b (given)
thus bP b (axiom 3)
b 6= b (axiom 2)
But b 6= b is surely incorrect thus assumption not true and theorem follows.

Theorem 16 Let aP b and c 2 K


Then aP c or cP b:
Proof. As c 2 K arbitrary we have two options: (i) c = a
(ii) c 6= a
(i) if c = a and given aP b then cP b and theorem proved.

(ii) let c 6= a then by axiom 1 cP a _ aP c


if aP c then …nished
if cP a; but given aP b then by axiom 3 cP b and theorem follows.

Theorem 17 There exists an element in K not P related to any other element.

Proof. (Once again as nothing in axioms for P/ we use indirect proof technique)
Assume all elements are P related.
Let a 2 K then by above assumption 9b 3 aP b
Then by axiom 2: a 6= b

But b 2 K then by assumption 9c 3 bP c


by axiom 2: b 6= c
axiom 3 axiom 2
but aP b and bP c ) aP c ) a 6= c
hence a; b; c all di¤erent

but c 2 K and by assumption 9d with cP d


but by axiom 2: c 6= d
but aP c; cP d ) aP d ) a 6= d
bP c; cP d ) bP d ) b 6= d
Thus a; b; c; d all di¤erent.

But d 2 K thus by assumption 9e 3 dP e ) d 6= e

31
aP d; dP e ) aP e ) a 6= e
bP d; dP e ) bP e ) b 6= e
cP d; dP e ) cP e ) c 6= e
Thus a; b; c; d; e all di¤erent; but thus contradicts axiom 4.
Thus assumption incorrect and theorem follows.
Theorem 18 There exists only 1 element not P related.
Proof. From previous theorem there exists an element not P related.
We need prove now that only 1 exists.
(proof technique should be talking to you!)
Assume there exists more than one element not P related say x; y
axiom 1
then x 6= y ) xP y or yP x
but xP/ y and y P/ x (as x; y not P related)
Hence contradiction and theorem follows.

Before we introduce new de…nitions and theorems let us look at two possible applications. We need to
…nd situations which satisfy the 4 axioms.
(A) Let K = fgrandfather; father; son; grandsong
xP y to mean x is an ancestor of y
thus father P grandson but son P/ father
One can now see that all 4 axioms are met
Also interpret the theorems. The last theorem would state: "There is only 1
person who is not an ancestor of the others" [This is true for the grandson.]

(B) Take as your 4 elements 4 dots on a straight line


interpret aP b by a lies to the left of b.
The axioms are all satis…ed. Interpret the theorems

We now return to the tasks of bringing in more de…nitions (and you can interpret using the above
applications) and theorems.
De…nition 32 (aDb): aDb , bP a
De…nition 33 (aF b): aF b , aP b and there exists no c 2 K with aP c and cP b
De…nition 34 (aGb): aGb , 9x 2 K aF x and xF b
Theorem 19 aDb; bDc ) aDc
Proof. aDb ) bP a
bDc ) cP b
axiom 3
but then cP b; bP a ) cP a
) aDc
Theorem 20 aF c; bF c ) a = b
Proof. Assume a 6= b
Then aP b _ bP a (axiom 1)
if aP b: given bF c hence bP c
but then aP b; bP c ) aP c
but this contradicts aF c (why? explain)
so aP b cannot hold.
if bP a: given aF c thus aP c
then by axiom 3 bP c which contradicts bF c
thus bP a cannot hold.
Thus assumption cannot hold and theorem follows.

32
Theorem 21 aF b; bF c ) aF/ c

Proof. Assume aF c
previous
but bF c; aF c ) a = b
theorem
but then aF b ) aF a
) aP a
) a 6= a contradiction
So assumption false and theorem follows.

Theorem 22 aF c ) a 6= c
Proof. exercise.

Theorem 23 aGc; bGc ) a = b


Proof. exercise.

33
6.1 Exercise: Axiomatic theory
1. Using the axioms 1 - 4 as given in notes and de…nitions for dF y; xGy prove:

(a) aF c ) a 6= c
(b) aGc; bGc ) a = b

2. Let B = fa; b; c; :::g with two binary relations and de…ned on B


(B; ; ) satis…es the following axioms:
axiom 1: 8a; b 2 B a b=b a
axiom 2: 8a; b 2 B a b=b a
axiom 3: 9i 2 B 8a 2 B; a i = a
axiom 4: 9z 2 B 8a 2 B a z = a
axiom 5: 8a; b; c 2 B a (b c) = (a b) (a c)
axiom 6: 8a; b; c 2 B a (b c) = (a b) (a c)
axiom 7: 8a 2 A9a 2 B a a = i and a a = z
Prove the following:

(a) 8a 2 B a a=a
(b) 8a 2 B a a=a
(c) 8a 2 B a i=i
(d) 8a 2 B a z=z
(e) 8a; b 2 B a (a b) = a
(f) 8a; b 2 B a (a b) = a

34
7 INTEGERS
In this section we will not state all the axioms that the integers are built on, but will investigate a few
of the concepts for which we are familiar and see them from an axiomatic point of view. Consider the
familiar result 2 < 4. A question which should be asked is: what do we mean by x < y? This we now
answer but we …rst need the following:
One of the axioms for the integers state:
Z contains a subset Z+ (called positive integers) which satis…es the following conditions:
(a) Z+ closed under + (ie. 8a; b 2 Z+ ; a + b 2 Z+ )
+
(b) Z closed under (8a; b 2 Z+ ; a b 2 Z+ )
(c) 8p 2 Z one and only one of the following statements is true:
(i) p 2 Z+
(ii) p = 0
(iii) p 2 Z+

Remark 62 from (c) above we see that Z is partitional into 3 sections.

Z+ (= N) (positive integers)
f0g
Z (negative integers)

De…nition 35 (x < y): Let x; y 2 Z then: x < y , y x 2 Z+

We will now prove some of the familiar statements of order you know.

Theorem 24 Let x; y; z; w 2 Z
then (a) 0 < y , y 2 Z+
(b) x<y )x+z <y+z
(c) x < y; z < w ) x + z < y + w

Proof. (a) ) Let 0 < y then y 0 2 Z+


but y 0 = y hence y 2 Z+
+
(: Let y 2 Z then y = y 0 2 Z+
hence 0 < y
(b) We need show (y + z) (x + z) 2 Z+
but (y + z) (x + z) = y + z x z = y x
but y x 2 Z+ for x < y
thus proving the result
(c) We need show (w + y) (x + z) 2 Z+
but (w + y) (x + z) = w + y x z = (w z) + (y x)
but w z 2 Z+ (as z < w)
y x 2 Z+ (as x < y)
but then as Z+ closed under + we get (w z) + (y x) 2 Z+
the desired result.

We now look at the concepts of prime and composite. To do this though we …rst recall the concept of
divisible by:

De…nition 36 (b ja) : Let a; b 2 Z bj a , 9k 2 Z; a = bk

Remark 63 b is called the divisor of a if bj a


b is called a factor of a and a a multiple of b if bj a

35
Remark 64 We usually restrict b 2 Z+ when considering whether bj a (see division theorem later on)

Remark 65 We write c - d if c not a divisor of d (ie. 8k 2 Z d 6= ck)

Example 40 2 j 6 for 6 = 2(3)


2 j 6 for 6 = 2( 3)
4 - 6 for no k 2 Z for which 6 = k4

De…nition 37 (trivial factorization): Every a 2 Z can be written a = a 1 = ( a) ( 1).


This is called the trivial factorization of a.

De…nition 38 (prime number): Let p 2 Z+ ; p > 1


If p only has positive factors of p and 1 then p is called prime.

De…nition 39 (composite): A positive integer greater than one that is not prime is called is called
composite.

Remark 66 If a composite then a has two positive factors x; y so that a = xy and that 1 < x; y < a

Example 41 6 composite for 6 = 2 3


4 composite for 4 = 2 2 [note the positive factors can be the same]
13 prime for the only positive factors of 13 are 1 and 13.

Remark 67 1 is neither prime nor composite.

Theorem 25 (division algorithm): Let a; b 2 Z; b 2 Z+


Then there exist unique integers q; r satisfying
a = qb + r 0 r<b

Remark 68 We do not prove the above theorem but take note that q is called the quotient; b the divisor;
r the remainder.

Remark 69 If r = 0 then bj a; if r 6= 0 then b - a

Example 42 a = 102 b=3


102 = 34(3) + 0

a = 76 b = 12
76 = ( 7)(12) + 8

We now consider the concept of a greatest common divisor and see how to calculate such a value.

De…nition 40 (greatest common divisor): Let a; b 2 Z f0g


g 2 Z+ is called the greatest common divisor of a and b
(denoted g = gcd(a; b)) if and only if
(i) gj a and gj b
(ii) if cj a and cj b then c g

Remark 70 We accept the following:


gcd(0; a) = a 8a 2 Z f0g
gcd(0; 0) not de…ned
gcd(a; b) = gcd( a; b) = gcd(a; b) = gcd( a; b)

Now how to …nd the gcd(a; b)? The following algorithm of Euclid shows how. (we don’t prove the
theorem).

36
Theorem 26 If a = b(p) + r 0 r<b ; then : gcd(a; b) = gcd(b; r)

Remark 71 We shall not prove the above but will see how used in the next theorem and examples.

Theorem 27 (Euclid’s algorithm): Let a; b 2 Z+


Then there exist unique integers qi ; ri (1 i n + 1)
satisfying b > r1 > r2 > ::: > rn > rn+1 = 0 with
a = bq1 + r1
b = r1 q 2 + r2
r 1 = r2 q 3 + r 3
r n 2 = r n 1 q n + rn
rn 1 = rn qn+1 + rn+1 (= rn qb+1 )
Furthermore gcd(a; b) = rn (the last non-zero remainder)

We now show how the algorithm works.

Example 43 Find gcd(24; 16)


24 = 16(1) + 8
so using theorem 26 we get : gcd(24; 16) = gcd(16; 8)
But :
16 = 8(2) + 0
So by theorem 26 we get gcd(16; 8) = gcd(8; 0) and the latter is 8 by remark 68 [which ties into the last
non zero remainder]

Example 44 Find gcd(7; 33)


Start by dividing smaller number into the larger
33 = 7(4) + 5
7 = 5(1) + 2
5 = 2(2) + 1
2 = 1(2) + 0
Thus gcd(7; 33) = 1

Example 45 Find gcd( 108; 22)


We use remark gcd(a; b) = gcd( a; b)
Thus gcd( 108; 22) = gcd(108; 22)
108 = 22(4) + 20
22 = 20(1) + 2
20 = 2(10) + 0
gcd( 108; 22) = 2

De…nition 41 (coprime): Let a; b 2 Z: If gcd(a; b) = 1 then we say a and b are coprime (or relatively
prime).

Thus 7; 33 are coprime for gcd(7; 33) = 1 (see worked example 37).

The following theorem (especially with gcd(a; b) = 1) has useful applications. We won’t prove the
theorem.

Theorem 28 Let a; b 2 Z f0g with g = gcd(a; b)


Then 9x; y 2 Z 3g = ax + by
(ie. g can be written as a linear combination of a; b)

37
Remark 72 The theorem above is also known as Bezout’s lemma

Example 46 gcd(108; 22) = 2


2 = 22(5) + 108( 1)

Now the obvious question is how to …nd the x; y in the linear combination. Surely trial and error not
suitable. When …nding the gcd using Euclid note that quotient and remainder have a de…nite pattern.
Reverse this pattern and make the remainder the subject by formula to get result.

Example 47 108 = 22(4) + 20 ) 20 = 22(4) 108

22 = 20(1) + 2 ) 2 = 22 20(1)
2 = 2(1) + 0

thus 2 = 22 20
= 22 (108 4(22)
= 22(5) + (108( 1))

Example 48 Show gcd(14; 208) = 2 and hence write 2 as linear combination of 14 and 208.
208 = 14(14) + 12 ) 12 = 208 14(14)
14 = 12(1) + 2 ) 2 = 14 12
12 = 2(6) + 0
thus 2 = 14 12
= 14 (208 14(14))
2 = 15(14) + (208)( 1)

Remark 73 if gcd(a; b) = 1 then 1 can be written as linear combination of a and b for 9x; y 3 1 = ax+by
and hence any integer z can be written as a linear combination of a and b
z = z(1) = z(ax + by) = (zx)a + (zy)b .

Theorem 29 Let p prime; a; b 2 Z f0g


pj ab ) pj a _ pj b

Proof. Let pj ab but let p - a (we then show pj b must hold).


but p - a; p prime ) gcd(a; p) = 1
then 9s; t 2 Z 31 = as + pt (previous theorem)
Then b = b(1) = a(bs) + p(bt) = (ab)s + b(pt)::::::::::::::::1
but pj ab ) 9k 3 ab = kp::::::::::::::::::::::::::::::::2
Substituting 2 into 1: b = kps + bpt
= p(ks + bt)
2Z
thus pj b

Remark 74 The above can be generalized to: pj a1 a2 :::an ) pj ai for some i(1 i n)

Remark 75 pj an ) pj a (n 2 N)

Theorem 30 p 2 Z+ ; p prime
p
p is irrational.
p
Proof. Assume p2Q
p a
thus 9a; b 2 Z; gcd(a; b) = 1 with p= b
2
then p = ab2
pb2 = a2

38
but then pj a2 ) pj a (above remark)
thus 9k 3 a = kp
then a2 = k 2 p2 = pb2
thus b2 = k 2 p
thus pj b2
) pj b (above remark)
then p common factor between a; b which contradicts gcd(a; b) = 1 hence assumption false and theorem
follows.
Now recall the following type of example. Find the number of natural numbers divisible by 2 or 4 between
5 and 13. Now those divisible by 2 are {6;8;10;12} and those divisible by 4 are {8;12} : thus if we look at
the sets concerned the numbers divisible by 2 or 4 are {6;8;10;12}- ie four numbers. If we use as before
that jA [ Bj = jAj + jBj jA \ Bj with appropriate A and B and multiples of 8 [for 2 4] within the
range is {8} - we get jA [ Bj = 4 + 2 1 = 5 -not the correct answer of 4. Where have we gone wrong
? The problem lies in the counting of the overlap by looking at multiples of 8. We note that we really
look at lowest multiple of the two numbers and to …nd such we use the following theorem.

Theorem 31 Let a; b be natural numbers


Then : gcd(a; b) lcm(a; b) = a b where lcm(a; b) stands for the lowest common multiple of the two
numbers a and b:
ab
Remark 76 note that if the gcd(a; b) = 1 then lcm(a; b) = gcd(a;b) = ab and this has been the case
for all the previous examples.

Example 49 Find the number of natural numbers divisible by 2 or 4 between 5 and 13


Let A = fnatural numbers between 5 and 13 divisible by 2g = f6; 8; 10; 12g = f2(3); 2(4); :::2(6)g
jAj = 6 3 + 1 = 4
Let B = fnatural numbers between 5 and 13 divisible by 4g = f8; 12g = f4(2); 4(3)g
jBj = 3 2 + 1 = 2
A \ B = fnatural numbers between 5 and 13 divisible by 2 and 4g = fmultiples of lcm(2; 4) in rangeg
theorem24 8
Now gcd(2; 4) = gcd(2; 22 ) = 2 thus lcm(2; 4) = gcd(2;4) = 2 = 4
Thus A \ B = fmultiples of 4 between 5 and 13g = f8; 12g = f4(2); 4(3)g
jA \ Bj = 3 2 + 1 = 2
Thus jA [ Bj = jAj + jBj jA \ Bj = 4 + 2 2 = 4

Example 50 Find the number of natural numbers divisible by 15 or 18 between 16 and 312
Let A = fnatural numbers divisible by 15 between 16 and 312g
B = fnatural numbers divisible by 18 between 16 and 312g
Then A \ B = fnatural numbers divisible by lcm(15; 18) between 16 and 312g
But gcd(15; 18) = gcd(3 5; 2 32 ) = 3
15 18
Thus lcm(15; 18) = gcd(15;18) = 15318 = 90
Thus A = f30; 45; :::; 300g = f15(2); 15(3); :::15(20)g with jAj = 20 2 + 1 = 19
B = f18; 36; 54; :::; 306g = f18(1); 18(2); 18(3); :::; 18(17)g with jBj = 17 1 + 1 = 17
A \ B = f90; 180; 270g = f90(1); :::90(3)g with jA \ Bj = 3 1 + 1 = 3
And so jA [ Bj = jAj + jBj jA \ Bj = 19 + 17 3 = 33

We now further our knowledge on mathematical induction. Recall from MATA:


if we wish to show P (n) true 8n 2 N we must show:
(1) P (1) true (1 smallest element from N)
(2) P (k) ) P (k + 1)

This can be altered slightly. Say your wish to show P (n) true 8n n0 for some n0 2 Z …xed, then you
must show P (n0 ) true (n0 smallest value for which P (n) true) and P (k) ) P (k + 1).

39
Example 51 Prove n! > 2n 8n 2 N; n > 3
Let P (n) : n! > 2n
Smallest case n = 4
P (4) : 4! = 24
24 = 16
thus P (4) true (24 > 16)
Let P (r) be true. (ie. r! > 2r )
Now must show P (r + 1) true
(r + 1)! = (r + 1) r!
> (r + 1) 2r
= 2 2r (as r > 1 we get r + 1 > 1 + 1 = 2)
= 2r+1
thus P (r + 1) true
Hence P (n) true 8n 2 N; n 4

Example 52 Prove: 3j (7n 4n ) 8n 2 N


Let P (n) : 3j (7n 4n )
smallest case: n = 1
but 71 41 = 3 = 3(1)
thus 3j (7 4)
thus P (1) true
Let P (k) be true. Thus 3j (7k 4k ) (ie. 9x 3 3x = 7k 4k and hence 7k = 3x + 4k )
consider P (k + 1)
7k+1 4k+1 = 7k 7 4k 4
= (3x + 4k )(7) 4k 4
= 3 7x + 4k 7 4:4k
= 3 7x + 4k (7 4)
= 3 7x + 3 4k
= 3(7x + 4k )
| {z }
2Z
) 3j (7k+1 4k+1 )
Thus P (k + 1) true and theorem holds.

We end o¤ this module with a very brief introduction to cryptography. Sending a message that has been
encoded [encrypted] and then being able to decode [decrypt] has fascinated man for many years - even
during Julius Caesar’s time. Often letters were just shifted by a …xed number of places. We shall shortly
investigate a method which is a little more involved, but we will start with a simple shift. However we
need some theory [no proof of theorems] …rst.

Theorem 32 (Division theorem) : Let a; b be integers with b being positive. Then there exist unique
integers p; r so that
a = pb + r with 0 r < b

Remark 77 Note that the unique remainder r is what is important for later use. Also be aware that when
dividing by the positive value b there are only b values the remainder could come from viz 0; 1; 2; ::; (b 1)
For instance when you divide by 5 the only remainders you can have are the …ve values 0; 1; 2; 3; 4

Example 53 2 = 0(5) + 2
15 = 3(5) + 0
17 = 4(5) + 3

We introduce now the function mod and will see how it is linked to the mod(n) previously learnt.

40
De…nition 42 (mod function) : Let n be a positive integer value and a any integer.
Then a mod(n) = r where r is the unique remainder where by division theorem a = pb + r 0
r<n

Example 54 See above example to help


2 mod(5) = 2 15 mod(5) = 0 17 mod(5) = 3

Remark 78 note then when one works mod(n) the values we use will be from the set f0; 1; 2; :::; (n 1)g
ie the remainders allowed

Now recall that x y mod(n) if f nj(x y): Now it can be shown that the link between the mod(n)
function and modulo (n) in the following simple theorem : x y mod(n) if f x mod(n) = y mod(n)
Now what happens with modulo if we have an arbitrary integer c and x y mod(n): Can we add and
multiply ? Remove [cancel] ? The following theorems answer the question [and will be used soon]

Theorem 33 Let c be an integer


Then : x y mod(n) if f (x + c) (y + c) mod(n)
x y mod(n) ) xc yc mod(n)

Remark 79 Note the converse of the last part of the theorem does not in general hold. We have the
counter example 12 6 mod(2): But this is the same as 2(6) 2(3) mod(2): Note we cannot ’cancel the
20 s to get 6 3 mod(2) as we know that 6 6 3 mod(2) [why!!]. Now a question that should then begin
to form in your mind : when is it possible to ’cancel’ the c value ?

Theorem 34 let gcd(c; n) = 1 and cx cy mod(n) then x y mod(n)

Now let us bring in the last bit of theory before we get to the cryptography.

Theorem 35 Let gcd(a; n) = 1 then there exists an integer x so that ax b mod(n)

Remark 80 when one proves the above theorem it is found that x = br where r is the value from
Bezout
1 = ar + kn

Now let us start our investigation of introductory cryptography.


We shall denote a sent letter of the alphabet by S and what received by R

Did you note that when we did modulo(n) that there were n distinct values. So as there are 26 letters in
the alphabet we will use mod 26 and assign : A = 0; B = 1; :::Y = 24; Z = 25:

Example 55 For our …rst simple example let us shift all letters by say 5 places.
ie R = (S + 5) mod 26 but as we always working mod 26 we actually mean R mod 26 = (S + 5) mod 26 or
R (S + 5) mod 26
So if we sent say S = D we would get :
D=3
so R = (3 + 5) mod 26 = 8 mod 26 = 8 = I
Now what about if we received the letter R; what was sent? ie …nd S if we know R:
But : R (S + 5) mod 26
(S + 5) R mod 26 [this can be shown ie communtatvity for modulo n]
S (R 5) mod 26 (R + 21) mod 26 [what theory applied!: Note that when we work mod 26 we
restrict all values to 0; 1; 2; :::25]
thus : S = S mod 26 = (R + 21) mod 26
so if receive I then what sent ?
R=I=8
S = (R + 21) mod 26 = (8 + 21) mod 26 = 29 mod 26 = 3 = D

41
Now a more sophisticated encryption would be : f (S) = R (cS + e) mod 26 with its decryption
f 1 (R) = S (pR + q) mod 26 with 0 c; e; p; q < 26

Now one must be able to decrypt so this drives the process. So given R (cS + e) mod 26 ; when can we
make S the subject ?
Surely we then have (cS + e) R mod 26
cS (R e) mod 26 which we can equate to solving for x in ax b mod n which we know has solution
if gcd(a; n) = 1 and then with 1 = ar + ny we get x = br
Thus we can solve for S if gcd(c; 26) = 1 which only excludes c being 2 or 13 or multiples thereof
[c 2 f0; 1; 2; :::; 25g] and then we get
S = (R e)r which can be simpli…ed for modulo 26. We examine now by examples.

Example 56 Let f (S) = R (3S + 2) mod 26


Determine the decryption function f 1 (R) = S (cR + q) mod 26 with 0 c; q < 26
Hence : encode the letter E and check the decryption function works.
Solution :
we want S when given R (3S + 2) mod 26
Then we get : 3S (R 2) mod 26
But gcd(3; 26) = 1 = 9(3) + ( 1)26
Thus by previous theory we have x = S; a = 3; n = 26; b = (R 2) with :
S = x = br = (R 2)(9) = 9R 18
But (9R 18) mod 26 (9R + 8) mod 26
ie S = (9R + 8) mod 26
Now we show all works with the letter : E
E=4 (= S)
R = (3S + 2) mod 26 = (3(4) + 2) mod 26 = 14 mod 26 = 14
But 14 = O
Now the reverse : R = O = 14
Then S = (9R + 8) mod 26 = (9(14) + 8) mod 26 = 134 mod 26 = 4 = E

Example 57 Let the encryption code be : R = f (S) = (5S + 3) mod 26


Find f 1 (R) = S = (aR + b) mod 26
Then determine if C received what was sent ?
Solution :
R (5S + 3) mod 26
5S (R 3) mod 26
But gcd(5; 26) = 1 = 1(26) + ( 5)(5)
Then by previous theory we get |{z}
S = (R 3)( 5)
| {z }| {z }
x b r
S = ( 5)R + 15
But 5 mod 26 = 21 mod 26
Thus we get : S = f 1 (R) = ( 5R + 15) mod 26 = (21R + 15) mod 26
Thus if C received
R=C=2
S = (21(2) + 15) mod 26 = 57 mod 26 = 5 = F
(check : F = 5
Then R = (5S + 3) mod 26 = (5(5) + 3) mod 26 = 28 mod 26 = 2 = C)

42
7.1 Exercise: Integers
1. Prove: x < y; y < z ) x < z (x; y; z 2 Z)

2. Prove: dj a; dj b ) dj (a + b)
dj a; dj b ) dj (a b)
3. Let a; b; q; r 2 Z with a = bq + r
Furthermore let dj a and dj b
Prove: dj r
4. Find gcd(x; y) for the following and hence write the gcd(x; y) as a linear combination of x and y

(a) x = 1492; y = 1776


(b) x = 1234; y= 49
(c) x = 20; y = 20

5. Find the number of natural numbers divisible by a or b lying in the range given for the examples
below :

(a) a = 6; b = 27 between 14 and 401 [inclusive]


(b) a = 22; b = 55 between 619 and 2143 [inclusive]

6. Use induction to prove:

(a) 2n > n + 1 8n 2 N, n>1


2n
(b) 3j(2 1) 8n 2 N
n n
(c) (a b)ja b 8n 2 N

7. An encryption code is f (S) = (15S + 12) mod 26

(a) what letter is received if G sent ?


1
(b) …nd a decryption code ie f (R) = (aR + b) mod 26 0 a; b < 26
(c) what letter was sent if J is received.
1
8. Show that if R = g(S) = (9S + 13) mod 26 then S = g (R) = (3R + 13) mod 26

ooO-Ooo

43

You might also like