2.
0 Predicate Logic
A predicate is a statement that contains a variable, such that for any specific value
of the variable the statement is a proposition.
Usually, the allowed values for the variable will come from a specific set, sometimes
called the universe of the variable which will be either explicitly mentioned or clear
from context.
A predicate is denoted in a similar way as function. A predicate P(x) can be
considered as a function 𝑃: 𝑈 → {0, 1} where U is a universe of the variable x. 1
represent true and 0 represent false.
2.1 Quantifiers
Predicate statements have their true-value dependent on variables. Predicates are
often abbreviated by capital letters followed by a list of arguments, the variables that
appear in the predicate. For example
𝑄(𝑥) = x+2=x 2 .
Since the true values depend on the variable, there is need to bind the variable using
quantifiers. The quantifiers states whether the claim we are making applies to all
values of the variable (universal quantification) or whether it may only apply to some
(existential quantification)
2.1.1 Universal Quantifier
The universal quantifier ∀ (pronounced “for all”) says that a statement is true for all
values of a variable within some universe of allowed values
Example
If x is positive then 𝑥 + 1 is positive can be written as
∀𝑥; 𝑥 > 0 → 𝑥 + 1 > 0
2.1.2 Existential Quantifier
The existential quantifier ∃ (pronounced “there exists”) says that a statement must
be true for at least one value of the variable
Example
∃𝑥 ∈ 𝑧: 𝑥 = 𝑥 2
3.0 Introduction to Proofs
A proof is a valid argument that establishes the truth of a mathematical statement. A
proof can use the hypotheses of the theorem, if any, axioms assumed to be true, and
previously proven theorems.
The methods of proof discussed in this course are important not only because they
are used to prove mathematical theorems but also their many applications to
Computer Science. These applications include verifying that computer programs are
correct, establishing that operating systems are secure, making inferences in artificial
intelligence etc.
3.1 Basic Terms
Theorem – A statement that can be shown to be true.
Axioms – statements that are assumed in the current context always to be true
Lemma – is a less important theorem used in proof of other results.
Proof – is a valid argument that establishes the truth of a theorem.
3.2 Core of theorem statements
The core of any mathematical theorem is to assert the existence of a property for all
elements in a given domain. Domain such as integer or real.
Example
The theorem: if 𝑥 > 𝑦 where x and y are positive real numbers then 𝑥 2 > 𝑦 2
Here, the statement implies that for any two positive values in a domain say real,
that are related in such a way that element x is greater than element y, then the
squares of both elements in that domain maintain the relation property of both.
The validity of the above theorem can only be ascertained through proving. Proves
of mathematical theorems are not easy to change.
Therefore, the basic approaches or strategies of different proof methods need to be
understood. Approximate axioms, definitions of terms, existing validated results and
rule of inference to establishing the proof are required.
3.3 Direct Proofs
A direct proof of a conditional statement 𝑝 → 𝑞 is constructed with an assumption
that p is true. Next, axioms, definitions, known established theorem are used to show
that q is true. Only if this is achieved can the theorem be said to be proven to be true.
The case where p is true and q is false should not occur. If it does then the statement
propounded is not a theorem.
3.3.1 Direct Proofs Technique
Direct proofs follow these common steps:
(a) Provided a chain of clear statements, each logically following from
established theorems, axioms, and definitions
(b) Prove using the chains of arguments to establish that statement q is true
(c) Conclude the proof
3.4 Proofs by Contradiction
The idea here is to prove that a statement p is true by finding a contradiction q such
that ¬𝑝 → 𝑞 is true. Next proceed to prove that q is false while ¬𝑝 → 𝑞 is true. We
presupposes that is ¬𝑝 false and hence p is true.
3.4.1 Proofs by contradiction techniques
(a) State the method of proof
(b) State the assumption that should lead to the contradiction. That is, the
statement (or proposition of the theorem) does not hold.
(c) Proceed with a chain of clear statements, each logically following from the
previous ones combined with our shared knowledge base. The final statement
in the chain of argument should be a contradiction to itself
(d) Conclude the proof
3.5 Proof by Mathematical Induction
The basic procedure involved in the principle of mathematical induction is as
follows:
(a) First show if what is to be proved is true for 𝑛 = 1
(b) If it is true for 𝑛 = 1, then assume it is true for 𝑛 = 𝑘
(c) Show if it is true for 𝑛 = 𝑘 + 1 based on your assumption in (b)
If (a) – (b) are found to be true, then it can be said to be universally true and the
proof is complete.
Example
Prove that the sum of square of first n integers is
𝑛
𝑛(𝑛 + 1)(2𝑛 + 1)
∑ 𝑟2 =
6
𝑟=1
Proof
Let 𝑛 = 1, that is
1
1(1 + 1)(2 + 1) 1 ∙ 2 ∙ 3
∑ 𝑟2 = = =1
6 6
𝑟=1
It is true for 𝑛 = 1
Assume true for 𝑛 = 𝑘, that is
𝑘
𝑘(𝑘 + 1)(2𝑘 + 1)
∑ 𝑟2 =
6
𝑟=1
Show for 𝑛 = 𝑘 + 1
𝑘+1 𝑘
𝑘(𝑘 + 1)(2𝑘 + 1)
∴ ∑ 𝑟 2 = ∑ 𝑟 2 + (𝑘 + 1)2 = + (𝑘 + 1)2
6
𝑟=1 𝑟=1
𝑘(𝑘 + 1)(2𝑘 + 1) + 6(𝑘 + 1)2
=
6
(𝑘 + 1)[𝑘(2𝑘 + 1) + 6(𝑘 + 1)]
=
6
(𝑘 + 1)(2𝑘 2 + 𝑘 + 6𝑘 + 6)
=
6
(𝑘 + 1)(2𝑘 2 + 7𝑘 + 6)
=
6
(𝑘 + 1)(2𝑘 2 + 3𝑘 + 4𝑘 + 6)
=
6
(𝑘 + 1)(𝑘(2𝑘 + 3) + 2(2𝑘 + 3))
=
6
(𝑘 + 1)(𝑘 + 2)(2𝑘 + 3)
=
6
Observe that
𝑛
(𝑘 + 1)(𝑘 + 2)(2(𝑘 + 1) + 1) (𝑘 + 1)(𝑘 + 2)(2𝑘 + 3)
∑ 𝑟 2 == ==
6 6
𝑟=1
Therefore, it is true for 𝑛 = 𝑘 + 1, whenever it is true for 𝑛 = 𝑘.
Exercise
1. Prove that the sum of n integers is given as
𝑛
𝑛(𝑛 + 1)
∑𝑟 = .
2
𝑟=1