Professional Documents
Culture Documents
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
• 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
• 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
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
• 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.
• 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.
• 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.
• 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.
• 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.
• 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.