LOGIc
LOGIc
FACULTY OF EDUCATION
The course covers one major theme, Mathematical Proofs. It aims at enabling students to
appreciate why mathematics proofs are important in mathematics learning and teaching. By the
end of the course, students should be able to carry out mathematical proofs using various
methods.
Course Content
REFERENCES
1. Hunter J, Monk D, Blackburn WT and Donald D (1983). Algebra and Number Systems.
Blackie Chambers, London.
2. Bull ACR (1986). Kenya Advanced Mathematics Project Option 2: Logic Circuits,
Algebraic Structures, 2nd edition. Jomo Kenyatta Foundation, Nairobi.
3. Bostock, L. & Chandler, S. (1983). Pure Mathematics 2. Stanley Thornes (Publishers)
Ltd. London,UK.
Introduction: Reviewing Logic
Logic is a systematic way of thinking that allows us to deduce new information from old
information. For example, suppose you are working with a certain circle, call it “Circle X,” and
you have the following two pieces of information.
You have no trouble putting these two facts together to get: Circle X has an area of 9π square
units.
In doing this you are using logic to combine existing information to produce new information. It
is important to realize that logic is a process of deducing information correctly, not just
deducing correct information. For example, suppose we were mistaken and Circle X actually
had a radius of 4 and not 3. Let’s look at our argument again.
The sentence “Circle X has radius equal to 3.” is now untrue, and so is our conclusion “Circle X
has an area of 9π square units.” But the logic is perfectly correct; the information was combined
correctly, even if some of it was false. This distinction between correct logic and correct
information is significant because it is often important to follow the consequences of an incorrect
assumption. Ideally, we want both our logic and our information to be correct, but the point is
that they are different things.
In proving theorems, we apply logic to information that is considered obviously true (such as
“Any two points determine exactly one line.”) or is already known to be true (e.g. the
Pythagorean Theorem). If our logic is correct, then anything we deduce from such information
will also be true (Or at least as true as the “obviously true” information we began with).
Statements
A statement is a sentence or a mathematical expression that is either definitely true or
definitely false.
A statement is a declarative sentence which is either true or false but not both
simultaneously.
Example 2.1 Here are some examples of statements. They are all true.
(i) If a circle has radius r, then its area is π r 2 square units.
(ii) Every even number is divisible by 2.
(iii) 2∈Z
(iv) √ 2∉Z
(v) N⊆ Z
(vi) The set {0, 1, 2} has three elements.
Example 2.2 Here are some additional statements. They are all false.
(i) All right triangles are isosceles.
(ii) 5 = 2
(iii) √ 2∉R
(iv) Z ⊆N
(v) {0, 1, 2}⋂ N =∅
Others include:
1. When will the lecture end?
2. Come here at once!
3. Knowledge and skills for service
4. Great!
5. x+3=7
6. Is it raining?
1.3 Notation
For example,
1. p: 6+4 = 10
2. q: 12 – 9 = 4
3. r: Mrs Sande is the best History teacher
ACTIVITY: State which of the following sentences are statements. Justify your answer.
In case of the statements, write down the truth value.
Negation of a Proposition
For example:
p : Mango is a fruit.
~p : Mango is not a fruit.
Statements Negations
a) Rome is in Italy. a) Rome is not in Italy.
b) 5 + 5 = 10 b) 5 + 5 ≠ 10
c) 3 is greater than 4. c) 3 is not greater than 4.
d) John is good in river rafting.
d) John is not good in river rafting.
e) π is an irrational number.
f) The square of a real number is e) π is not an irrational number.
positive. f) The square of a real number is not
g) Zero is not a complex number. positive.
h) Re (z) ≤ | z |. g) Zero is a complex number.
i) The sun sets in the East.
h) Re (z) > |z|.
j) It is not true that the mangoes are
inexpensive. i) The sun does not set in the East.
j) It is true that the mangoes are
inexpensive.
The negation can be shown on a Venn diagram or a truth table as shown below.
1. There are exactly five prime numbers x such that 2 < x < 20.
Solution set A= {3, 5, 7, 11, 13, 17, 19}, n (A) =7. Proposition is F.
Negation: There are NOT exactly five prime numbers x such that 2 < x < 20. (T).
2. There are exactly six integers satisfying – 1.2 < x < 5.
Solution set A= {-1, 0, 1, 2, 3, 4}, n (A) =6. Proposition is T.
Negation: There are NOT exactly six integers satisfying – 1.2 < x < 5. (F).
3. There is no real value of x for which x2 is negative. T.
Negation; x2 is negative for at least one real value of x.
4. All quadratic equations in one variable have two real roots. F.
Negation: At least one quadratic equation in one variable does not have real roots.
5. At least one make of cars does not have four tyres. (T).
Negation: All cars have four tyres (F).
ACTIVITY: NEGATE THE GIVEN PROPOSITIONS.
Simple statements
A statement is called simple if it cannot be broken down into two or more statements.
Examples
(i) 2 is an even number,
(ii) A square has all its sides equal,
Compound statements
A compound statement is the one which is made up two or more simple statements.
Example: 11 is both an odd and prime number” can be broken into two statements “11 is an
odd number” and “11 is a prime number” so it is a compound statement.
Note: The simple statements which constitutes a compound statement are called
component statements.
Example: Find the component statements of the following compound statements.
(i) Number 7 is prime and odd.
(ii) Chennai is in India and is the capital of Tamil Nadu.
(iii) The number 100 is divisible by 3, 11 and 5.
(iv) Two lines in a plane either intersect at one point or they are parallel.
We can form new statements from given statements by use of the words not, and, or, if p then q.
The words not, and, or, if p then q are called logical connectives or logical operators. We have
already seen the use of not. Let us see how the other logical connectives are used.
Examples
The conjunction of p and q is denoted by p∧q and may be true or false. When two propositions
are joined, their truth values can be combined in 22 possible ways. We show this in a truth table.
p Q p∧q
T T T
T F F
F T F
F F F
The truth of the compound statement p∧q depends on the truth of p and on the truth of q.
From the truth table we see that p∧q is true only when both p and q are true. P and q are called
the components of the compound statement p∧q. Thus, the conjunction is true only when both
p and q are true.
p Q p∨q
T T T
T F T
F T T
F F F
From the truth table we see that p∨q is true when at least ONE of the components p, q is true.
Negation of a conjunction
~ (p q) = ~ p ~ q
Negation of disjunction
Recall that a disjunction p q is consisting of two component statements p and q which are
such that either p or q or both exist. Therefore, the negation of the disjunction would mean the
negation of both p and q simultaneously.
The negation of a disjunction p q is the conjunction of the negation of p and the negation
8
of q. Equivalently, we write
~ (p q) = ~ p q
Negation of a negation
The negation of negation of a statement is the statement itself. Equivalently, we write
~ ( ~ p) = p
ACTIVITY
2. Use truth tables to show that (i) ( p∧q)’ and ~ p ∨ q (ii)(p∨q)’ and ~ p∧ q (iii)~ (~p) and p
are logically equivalent (are built up with the same component statements and have the same
truth values).
3. Let p: I want to go swimming today, q: I want to play tennis today. Write out the following
statements (i) ~q (ii) p∨q (iii) p∧q (iv) ~(p∧q) (v) p ∧~q (vi) ~p∨q (vii) (~p∧q)∨(p
∨ q¿
Recall that if p and q are any two statements, then the compound statement “if p then q”
formed by joining p and q by a connective ‘if then’ is called a conditional statement or an
implication and is written in symbolic form as p q or p q.
Remark The conditional statement p q can be expressed in several different ways. Some of
the common expressions are :
(a) if p, then q
(b) q if p
(c) p only if q
(d) p is sufficient for q
(e) q is necessary for p.
Observe that the conditional statement p q reflects the idea that whenever it is known
that p is true, it will have to follow that q is also true.
The proposition p⟹ q is a given a truth value according to the following truth table.
P Q p⟹
q
T T T
T F F
F T T
F F T
We say that p⟹ q is false when p is true and q is false, otherwise, p⟹ q is true. In the
conditional statement p⟹ q, p is called the hypothesis(a provisional explanation of something,
a theory to be proved or disproved, supposition), and q is called the conclusion. The implication/
conditional statement p⟹ q will clearly be untrue if a false conclusion is drawn from a true
hypothesis. The implication/ conditional statement p⟹ q is substantially the same as ~ (p∧ ~q),
i.e. they have the same truth table.
NOTE: Rather than memorizing the truth tables for the logical connectives we have seen so far,
it may be easier for some people to use the rules summarised in the table below.
EXAMPLES
1. X +1 = 0 ⟹X = 2
2. cos A + cos B = 1 ⟹cos (A + B) =1
3. log (x + y) = 3 ⟹log x + log y = 3
are all false since the conclusions do not follow from the hypotheses.
p : it is raining today
q:2+3>4
Solution: The required conditional statement is
“If it is raining today, then 2 + 3 > 4”
q:x+5<y+5
ACTIVITY
Note that the implication and its contrapositive are logically equivalent. Is it the same true for the
converse and inverse?
2. Use truth tables to show that the following are logically equivalent;
(i) p⟹ q and ~ p ∨ q
(ii) ~ (p⟹ q) and p∧ q
(iii) p⟹ (q∧r) and(p⟹ q)∧ (p⟹ r)
(iv) (p∨q)⟹ r and (p⟹ r)∧ (q⟹ r)
(v) p∧(q ∨ r) and ( p∧ q ¿ ∨ ( p∧r ¿
3. State the converse, inverse and contrapositive of the following conditional
statements:
i. If it rains then the match will be cancelled.
ii. If a function is differentiable then it is continuous.
iii. If surface area decreases then the pressure increases.
iv. If a sequence is bounded then it is convergent.
In a situation where both p⟹ q (the implication) and q⟹ p (the converse of p⟹ q) are true,
we write p⟺q. In this case, p is true if and only if q is true or “p iff q”. We say that a necessary
and sufficient condition for p to be true is that q is true. q being true is a necessary condition for
p to be true and q being true is a sufficient condition for p to be true. The truth table for the
biconditional is given below.
P Q p⟹ q⟹ (p⟹ q)∧ ( q⟹ p⟺
q p p) q
T T T T T T
T F F T F F
F T T F F F
F F T T T T
Example: If p: It is daytime, q: It is warm, give the compound statements in verbal form
denoted by q ↔ p.
Solution: It is warm if and only if it is daytime.
The negation of p⟹ q is ~ (p⟹ q). Note that the whole conditional statement is negated.
Negation: It is not true to say that if I love Maths then I teach it well.
Logical equivalence
Two propositions p and q are said to be logically equivalent if their truth tables are identical. If
S1 and S2 are logically equivalent statement patterns, we write S1 ≡ S2.
For example:
To prove:
i) p ∧ q ≡ ~ (p → ~q)
p q p ∧ q ~q (p → ~q) ~(p → ~q)
T T T F F T
T F F T T F
F T F F T F
F F F T T F
In the above truth table, all the entries in the columns of p ∧ q and ~(p → ~q) are identical.
∴ p ∧ q ≡ ~(p → ~q).
ii) ~(p ∨ q) ≡ ~p ∧ ~q
P q ~p ~q p ∨ q ~(p ∨ ~p ∧
q) ~q
T T F F T F F
T F F T T F F
F T T F T F F
F F T T F T T
iii) ~(p ∧ q) ≡ ~p ∨ ~q
p Q ~p ~q p∧ ~(p ∧ ~p ∨
q q) ~q
T T F F T F F
T F F T F T T
F T T F F T T
F F T T F T T
iv) p → q ≡ (~p) ∨ q
P q ~p p→ ~p ∨
q q
T T F T T
T F F F F
F T T T T
F F T T T
v) p ↔ q ≡ (p → q) ∧ (q → p)
p Q p→ q→ p↔ (p → q) ∧ (q →
q p q p)
T T T T T T
T F F T F F
F T T F F F
F F T T T T
1.7 TAUTOLOGIES AND CONTRADICTIONS
Tautology
A proposition which is always true is called a tautology. The statement pattern has truth
value always T, irrespective of the truth values of its component statements. The final entry
in the truth table will be a complete column of T’s. It is said to be logically true.(e.g.p or
not p).
p q p↔ q↔p (p ↔ q) ↔ (q ↔
q p)
T T T T T
T F F F T
F T F F T
F F T T T
Contradiction
A proposition whose final column is all F’s is called a contradiction and is said to be
logically false. (e.g. p and not p). The statement pattern has truth values always F,
irrespective of the truth values of its component statements.
For example, consider p ∧ ~ p
P ~p p∧~p
T F F
F T F
In the above truth table, all the entries in the last column are F.
∴ The given statement pattern is a contradiction.
It is important to be aware of the reasons that we study logic. There are three very significant
reasons.
1. The truth tables we studied tell us the exact meanings of the words such as “and,” “or”,
“not” and so on. For instance, whenever we use or read the “If..., then” construction in a
mathematical context, logic tells us exactly what it means.
2. The rules of inference provide a system in which we can produce new information
(statements) from known information.
3. Finally, logical rules such as De Morgan’s laws help us to correctly change certain
statements into (potentially more useful) statements with the same meaning. Thus logic
helps us understand the meanings of statements and it also produces new meaningful
statements. Logic is the glue that holds strings of statements together and pins down the
exact meaning of certain key phrases such as the “If..., then” or “For all” constructions.
Logic is the common language that all mathematicians use, so we must have a firm grip
on it in order to write and understand mathematics.