MATB101notes 2025
MATB101notes 2025
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 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
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 :
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.
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.
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
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
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
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 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
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]
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 :
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
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.
Remark 14 we often write A ) B for if Athen B, and we call A the hypothesis and B the conclusion.
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]
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.
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.
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
(a) a _ (b _ :c)
(b) a ^ b _ :a hint : what would the order of preference be here?
(c) a ) (a _ b)
5. Show by means of a truthtable and indenti…cation of the critical rows that the following are valid
arguments :
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 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 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 24 x 2 A B ) x 2 A ^ x 2
=B
x2
=A B,x2 = A_x2B
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 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 31 A * B , 9x 2 A; x 2 = B:
(Recall: :(8x 2 A; P (x)) 9x 2 A; :P (x))
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
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.
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.
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.
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.
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
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).
/
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.
Remark 41 R not transitive? If you can …nd aRb; bRc but for which aRc
/
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.
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.
We now consider an example of an equivalence relation on a set which is itself an ordered pair.
We now investigate the equivalence relation further and see how it results in partitioning of the set it is
de…ned on
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
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).
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.
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):
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) aj(b + c)
(b) ajbc
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
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.
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.
25
Remark 59 This contrapositive form is often used to prove a function is 1-1.
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
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.
Remark 61 if two functions are given; be careful in just forming compositions as they somethimes are
not de…ned. See next example.
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.
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 .
4. De…ne: /: Z+ ! Z+ / (n) = n + 1
: Z+ ! Z+ (x) = 2x
(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.
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
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.]
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.
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
(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+
Z+ (= N) (positive integers)
f0g
Z (negative integers)
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
We now look at the concepts of prime and composite. To do this though we …rst recall the concept of
divisible by:
35
Remark 64 We usually restrict b 2 Z+ when considering whether bj a (see division theorem later on)
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
Remark 68 We do not prove the above theorem but take note that q is called the quotient; b the divisor;
r the remainder.
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.
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.
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.
37
Remark 72 The theorem above is also known as Bezout’s lemma
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.
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 .
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.
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
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
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
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]
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 ?
Now let us bring in the last bit of theory before we get to the cryptography.
Remark 80 when one proves the above theorem it is found that x = br where r is the value from
Bezout
1 = ar + kn
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.
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
5. Find the number of natural numbers divisible by a or b lying in the range given for the examples
below :
ooO-Ooo
43