You are on page 1of 32

PART I : LOGICS

INTRODUCTION

• Logic is the basis of all mathematical reasoning, and all automated reasoning.
• The rules of logic specify the meaning of mathematical statements.
• This rules help us understand and reason mathematic statements such as:
∃x ∈ D such that x = a + b, where x, a, b ∈ Z
Our objective is to be able to reduce the process of mathematical reasoning,
i.e., logic, to the manipulation of symbols using a set of rules.
STATEMENTS
• A statement (or proposition) is a declarative sentence that is true or false,
but not both.
• Let’s consider the following sentences.
i) One plus one equals two.
ii) One plus one equals three.
iii) He is a university student.
Every statement has a truth value, namely true (denoted by T) or false
(denoted by F). We often use p, q and r to denote statements,
ARGUMENT

• The main idea of deductive logic is the concept of argument form. An


argument is a sequence of statements aimed at demonstrating the truth of an
assertion (a “claim”). Consider the following two arguments.
• Some examples include:
• Argument 1. If x is a real number such that x < −2 or x > 2, then x2 > 4.
• Argument 2. If it is raining or I am sick, then I stay at home. Therefore, if I
do not stay at home, then it is not raining and I am not sick.
LOGICAL CONNECTIVES
NEGATION

• Let’s consider two statements p and q. If p takes the value T and q takes the value
F, and vice versa, then q is said to be the negation of p. And we write p = ~q
• The possible truth values of a statement are often given in a table, called a truth
table.
p q
• T F
F T

• Exercise: State the negation of each of the following statements.


a) 5 is an even integer. b) 0 is not an odd integer. c) It is cold.
CONJUNCTION
• Given two statements p and q, the conjunction of p and q is the statement “p and q”
and is denoted by p ∧ q.
• The conjunction p ∧ q is true only if both p and q are true; otherwise, p ∧ q is false. For
example, consider the statements
p q p∧q
T T T
T F F
F T F
F F F

• Write each of the following statements in symbolic form and determine their truth
value. (a) 1 < 2 and 2/3 is a rational number. (b) 3 is a prime number and 3 > 4.
DISJUNCTION
• Given two statements p and q, the disjunction of p and q is the statement “p or q” and
is denoted by p ∨ q.
• The disjunction p ∨ q is true if at least one of p and q is true; otherwise, p ∨ q is false.
Therefore, p ∨ q is true if exactly one of p and q is true or if both p and q are true.

p q p∨q
T T T
T F T
F T T
F F F

• Write each of the following statements in symbolic form and determine their truth
value. (a) 1 < 2 and 2/3 is a rational number. (b) 3 is a prime number and 3 > 4.
IMPLICATION
• Given two statements p and q, the implication of p and q is the statement “If p,
then q” and is denoted by p → q. We call p the hypothesis of the implication and
q the conclusion.
p q p→q
T T T
T F F
F T T
F F T

• Write each of the following sentences in terms of p, q and logical connectives, and
find the truth values of the given statements.
(a) If 1 is not an odd integer, then 1 ≮ 2. (b) If 1 is an odd integer, then 1 ≮ 2.
THE CONVERSE, INVERSE AND
CONTRAPOSITIVE OF AN IMPLICATION

• Definition. Let p and q be two statements.


The statement q → p is called the converse of the implication p → q.
The statement ∼ p →∼ q is called the inverse of the implication p → q.
The statement ∼ q →∼ p is called the contrapositive of the implication p → q.
COMPOUND STATEMENTS
• A compound statement (or statement form or formula) is a statement made up of one
or more statements with statement variables (such as p, q, and r) and at least one logical
connective (such as ∼, ∧, ∨ and →).
• For example, for given statements p and q, the conjunction p∧q is a compound statement.
For a slightly more complex example, consider the compound statement given by (( ∼ p)∨
∼ (q ∧ r)) ∨ (∼ (s ∧ (q ∨ (∼ t)))).
• In compound statements, we avoid the use of many parentheses when no confusion
arises. We often omit the outer pair of parentheses in a compound statement. For example,
we write ∼ p rather than (∼ p).
• In expressions using the logical connectives ∼, ∧, ∨ and →, we adopt the following
order of operation: ∼ performed first, ∧, ∨ performed second, → performed third.
COMPOUND STATEMENTS … CONTINUED
Example:
Construct the truth table for the compound statement (p → q) ∧ (q → p).

p q p→q q→p (p → q) ∧ (q → p)
T T T T T
T F F T F
F T T F F
F F T T T
BICONDITIONAL

• Given two statements p and q, the conjunction of the implication p → q and its converse q →
p is called the biconditional of p and q which is equivalent to: (p → q) ∧ (q → p)
• This is denoted by p ↔ q. The biconditional p ↔ q is often stated as “p if and only if q.” or “p
is equivalent to q”.
• As already mentioned, the implication q → p can be expressed in words as “p is necessary for
q”, while p → q can be expressed as “p is sufficient for q”. Therefore, p ↔ q can be expressed
in words as “p is necessary for q and p is sufficient for q”. Another way to say this is “p is
necessary and sufficient for q”
TAUTOLOGIES AND CONTRADICTIONS
• A compound statement S is called a tautology if the truth value of S is true for
any assignment of truth values to the statement variables occurring in S.
p ~p p v ~p
T T T
T F T
F T T
F F T

• A compound statement S is called a contradiction if the truth value of S is false


for any assignment of truth values to the statement variables occurring in S.
p ~p p ∧ ~p
F T F
T F F
LOGICAL EQUIVALENCES
• Two statements R and S are logically equivalent if they have the same truth values for all
combinations of truth values of the statement variables occurring in R and S. We denote the logical
equivalence of R and S by R ≡ S.
• For example: p → q ≡ (∼ p) ∨ q
Let p, q and Laws
Commutative r be statements. Then the following logical equivalences hold
p∧q≡q∧p De Morgan’s Laws
Universal Bound Laws
p∨q≡q∨p ∼(p ∨ q) ≡ (∼p) ∧ (∼q)
p∨T≡T
∼(p ∧ q) ≡ (∼p) ∨ (∼q)
p∧F≡F
Associate Laws
(p ∧ q) ∧ r ≡ p ∧ (q ∧ r) Idempotent Laws
Identity Laws
(p ∨ q) ∨ r ≡ p ∨ (q ∨ r) p∧p≡p
(i) p ∨ F ≡ p
p∨p≡p
(ii) p ∧ T ≡ p
Distributive
. Laws
p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ Negation Laws
Double Negation Law
r) p ∨ (∼p) ≡ T
∼(∼p) ≡ p
p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ p ∧ (∼p) ≡ F
r)
LOGICAL EQUIVALENCES … CONTINUED

Example: Proof that (p ∧ ~q) ∨ (p ∧ q) is equivalent to p


Solution:
PROOF
(p ∧ ~q) ∨ (p ∧ q) ≡ p ∧ (~q ∨ q) by distributive laws
≡p∧T by the negation laws
≡p by the identity laws QED.
QUANTIFIED STATEMENTS
PROPOSITIONAL STATEMENT

• A predicate or propositional function is a sentence that contains a finite


number of variables and becomes a statement when specific values are
substituted for the variables. The domain of a predicate variable is the set of all
values that may be substituted in place of the variables.
• For example: P(x):x is an even integer” is a predicate. And if we defined D, the
domain of definition of x i.e x ∈ D, then “for each x ∈ D, P(x)” is true or false,
but not both
• Another example of a predicate: “P(x): x+3 is an odd integer” with domain D =
N
UNIVERSAL QUANTIFIER

• Let P(x) be a predicate with domain D. A universal statement is a statement of the


form: ∀x ∈ D, P(x).
• It is false if P(x) is false for at least one x ∈ D; otherwise, it is true.

• Example: Let P(x) be the predicate “P(x): x2 ≥ x.” Determine whether the following
universal statements are true or false.
• Solution: for x = ½, x2 = ¼ which is less than x hence the universal statement is false.

• The negation of a universal statement of the form ∃x ∈ D such that ∼P(x).


i.e. ∼(∀x ∈ D, P(x)) ≡ ∃x ∈ D such that ∼P(x).
EXISTENTIAL QUANTIFIER
• Let P(x) be a predicate with domain D. An existential statement is a statement of the
form ∃x ∈ D such that P(x).
• It is true if P(x) is true for at least one x ∈ D; otherwise, it is false.

• Example: Let P(x) be the predicate “P(x): x2 < x.” Determine whether the following
existential statements are true or false.
• Solution: for x = ½, x2 = ¼ which is less than x hence the existential statement is true.

• The negation of an existential statement is of the form ∀x ∈ D, ∼P(x).


i.e. ∼(∃x ∈ D such that P(x)) ≡ ∀x ∈ D, ∼P(x)
PART II : PROOFS
INTRODUCTION
• In this chapter, we discuss the topic of mathematical proofs. Our goal is to introduce the
student to several important proof techniques for verifying mathematical statements.

• A true mathematical statement is called a result. Interesting or significant mathematical


results are called theorems (or propositions)

• A corollary is a mathematical result that can be deduced from or is a consequence of some


earlier result.

• A lemma is a mathematical result that is useful in proving another (more interesting) result.
A lemma can be thought of as a “helping result” to prove some other result.
SOME DEFINITIONS
• An integer n is even if and only if n = 2k for some integer k. An integer n is odd if and only if n = 2k + 1 for some
integer k.
• An integer n is prime if and only if n > 1 and for all positive integers r and s, if n = r·s, then r = 1 or s = 1. i.e.
has only 2 factors: 1 and n. e.g. 2,3, 5, 7
• An integer n is composite if and only if n = r · s for some positive integers r and s with r ≠ 1 and s ≠1. i.e. n is
not prime e.g. 4,6,8,9,10
• Two integers m and n are said to be of the same parity if m and n are both even or are both odd, while m and n
are said to be of the opposite parity if one of m and n is even and the other is odd. e.g. 2 and 4, 3 and 7 are of
same parity while 1 and 2 are of opposite parity.
• Two integers are consecutive if one is one more than the other. So if one integer is n, the next consecutive integer
is n + 1. eg 10, 11, 12 are consecutive.
• Let n, k and d be integers with d ≠ 0. Then n is said to be divisible by d if n = d · k. Alternatively, we say that n is
a multiple of d, or d is a factor of n, or d is a divisor of n, or d divides n. e.g. 27 = 9x3, we can say:27 is a
multiple of 9, 9 is a factor of 27, 9 is a divisor of 27 or 9 divides 27.
TRIVIAL PROOFS
• Trivial proof. Let P(x) and Q(x) be statements with domain D. If Q(x) is true for all
every x ∈ D, then the universal statement ∀x ∈ D, P(x) → Q(x) is true (regardless of the
truth value of P(x)).
• Recall from the Truth Table for “→”, that if Q(x) is a true statement, then so too is the
implication P(x) → Q(x). Such a proof we call a trivial proof.

• Example: Proof that, for x ∈ R, if x > −5, then x2 + 2 > 0.


Proof. Consider the statements P(x):x > −5 and Q(x):x2 + 2 > 0.
Since x2 ≥ 0 for every x ∈ R, it follows that x2 + 2 ≥ 0 + 2 > 0 for every x ∈ R.
Hence, Q(x) is true for every x ∈ R. Thus, P(x) → Q(x) is true for every x ∈ R,
i.e., for x ∈ R, if x > −5, then x2 + 2 > 0. QED
DIRECT PROOFS
• Direct proof. Let P(x) and Q(x) be statements with domain D. If P(x) → Q(x) is true for all x ∈
D for which P(x) is true, then the universal statement ∀x ∈ D, P(x) → Q(x) is true.
• Thus to give a direct proof of the above universal statement, we assume P(x) is true for some
particular but arbitrary element x ∈ D, and then show that Q(x) is true for this element x. This
is called direct proof.
• Example: Proof that If n is an even integer, then 3n + 5 is an odd integer.
Proof. If we let “P(n):n is even” and “Q(n):3n + 5 is odd”, then we need to show that the
universal statement ∀n ∈ Z, P(n) → Q(n)
To do this, we assume P(n) is true for n ∈ Z and show that Q(n) is true for this element n.
Since P(n) is true, n = 2k for some integer k, we can write
3n + 5 = 3(2k) + 5 = 6k + 5 = 2(3k + 2) + 1 = 2m + 1, where m = 3k + 2 hence Q(n) is odd QED.
PROOF BY CONTRAPOSITIVE

• Let P(x) and Q(x) be statements with domain D. A proof by contrapositive of the statement ∀x ∈ D,
P(x) → Q(x) is the statement ∀x ∈ D,∼Q(x) → ∼P(x)
• that is, we assume that ∼Q(x) is true for some particular but arbitrary element x ∈ D, and then show that
∼P(x) is true for this element x.
• Example: Let n ∈ Z. If n2 + 5 is odd, then n is even.
• Proof. Let P(n) be the statement “n2 + 5 is odd” and let Q(n) be the statement “n is even”. Then we need
to show that the universal statement ∀n ∈ Z, P(n) → Q(n).
By contrapositive, show that ∼Q(n) → ∼P(n). i.e. Assume ~Q(n) is true and proof that ~P(n) is true.
~P(n): “n2 + 5 is even” and ~Q(n) : “n is odd”
n is odd implies n = 2k + 1 for k an integer, therefore n2 + 5 = (2k + 1) 2 + 1 = 4k 2 + 4k +2 = 2(2k 2 +2k+1)
= 2p where p = 2k 2 + 2k + 1 an integer.
Hence ∼Q(n) → ∼P(n) is true which means P(n) → Q(n). QED
PROOF BY CASES
• Let P(x) be a statement. If x possesses certain properties, and if we can verify that P(x) is true
regardless of which of these properties x has, then P(x) is true. In other words, we proof that
for all the possible properties of x, P(x) is true. Such a proof is called a proof by cases.
• Let m,n ∈ Z. If m and n are of the same parity, then m + n is even.
• Proof. We use a proof by cases, depending on whether m and n are both even or both odd.
• Case 1. m and n are both even. Then, m = 2k and n = 2p for some integers k and `. Thus, m +
n = 2k + 2` = 2(k + p). Since k + p ∈ Z, the integer m + n is even.
• Case 2. m and n are both odd. Then, m = 2k + 1 and n = 2p + 1 for some integers k and `.
Thus, m + n = (2k + 1) + (2p + 1) = 2(k + p + 1). Since k + p + 1 ∈ Z, the integer m + n is
even. 2 QED
PROOF BY CONTRADICTION
• Let P be a statement. If we assume that ∼P is a true statement (or, equivalently, that P is false) and, from this
assumption, we are able to deduce a contradiction, then we can conclude that the statement P is true.

• Example: The sum of a rational number and an irrational number is irrational.


Proof. Assume, to the contrary, that there exists a rational number r and an irrational number s whose sum is a
rational number.
Thus, by definition of rational numbers, r = a/b and r + s = c/d for some integers a,b,c and d with b ≠0 and d ≠
0.
Hence, s = c/d – r = c/d – a/b = (bc – ad)/bd = f/g where f,g are intergers with f = bc – cd and g = bd
Hence s ∈ Q which is a contradiction because s is not rational.
Hence our assumption that there exists a rational number and an irrational number whose sum is a rational
number is false. Thus, the sum of a rational number and an irrational number is irrational. QED
DISPROOF BY COUNTER-EXAMPLE

• Let P(x) be a statement with domain D. A disproof by counterexample of the


statement ∀x ∈ D, P(x) is to find an element x ∈ D such that P(x) is false. Such an
element x is called a counterexample of the statement.
• In order word, look for a value of x for which the statement is false.
• Example: Let P(x) be ∀x ∈ R, “P(x): x2 ≥ x.” Proof that P(x) is not true.
• PROOF: for x = ½, x2 = ¼ which is less than x hence P(x) is fals for ∀x ∈ R. QED
PROOF BY MATHEMATICAL INDUCTION

• Let n0 ∈ Z and let P(n) be a statement that is defined for integers n such that P(n0) is true; and if P(k) is true,
where k ∈ Z and k ≥ n0, then P(k + 1) is true.

• Then the statement P(n) is true for all integers n ≥ n0 by induction

• To summarize, a proof of a mathematical statement by the principle of mathematical induction involves the
following steps.
i) Prove that P(n0) is true.

ii) Inductive hypothesis: Let k be an arbitrary (but fixed) integer such that k ≥ n0, and assume that P(k) is
true.
iii) Inductive step: Prove that P(k + 1) is true.
PROOF BY INDUCTION … CONT.

• Example: Proof that, For every integer n ≥ 1,


• For n = 1, P(1) = 12 = 1(1+1)(2*1 + 1)/6 = 6/6 =1. Hence P(n) is true for n = 1.
• Assume statement is true for n = k i.e.
• Proof that the statement is true for n = k+1
12 + 22 + ··· + (k + 1)2 = (12 + 22 + ··· + k2) + (k + 1)2
END !!!

You might also like