Lecture 5
Lecture 5
Lecture 5
Class Conducted by
Bibek Ropakheti
Associate Professor : Cosmos College of Management and Technology
Visiting Faculty : NCIT
July 2020
Chapter 1
Logic, Induction and Reasoning
Chapter Outline
• Proposition and Truth function • Proofs
• Propositional Logic • Informal Proofs
• Formal Proofs
• Expressing statements in Logic
Propositional Logic • Elementary Induction
• The predicate Logic • Complete Induction
• Validity • Consistency and Completeness of
the System
• Informal Deduction in Predicate
Logic
• Rules of Inference
• Methods of Tableaux
Last Class
• Using Quantifiers in System Specifications
• Informal Deduction in Predicate Logic
• Validity
• Rules of Inference
• Methods of Tableaux
Today’s Class
• Rules of Inference
• For Quantified statements
• Proofs
• Informal Proofs
• Formal Proofs
• Elementary Induction
• Complete Induction
• Consistency and Completeness of the System
Rules of Inference for Quantified Statements
Rules of Inference Name
∀x P(x) Universal Instantiation
∴ P(a)
P(a) for an arbitrary a Universal Generalization
∴ ∀x P(x)
∃x P(x) Existential Instantiation
∴ P(a) for some element a
P(a) for some element a Existential Generalization
∴∃x P(x)
Example
• Show that the premises
“A student in this class has not read the book” and “Everyone in this
class passed the mid term exam”, imply the conclusion
“Someone who passed the mid term exam has not read the book”
Solution
• Premises: • Let us start with identifying the
• “A student in this class has not predicates
read the book” • Predicates
• “Everyone in this class passed the
• C(x): x is the student in this class
mid term exam”
• B(x): x is the student who has read
• Conclusion the book
“Someone who passed the mid • P(x): x is the student who passed
term exam has not read the the mid term exam
book”
Solution (continues)
• Now let us write down the • Premises:
Premises in the form of • ∀x (C(x)àP(x))
statement • ∃x (C(x)∧¬B(x))
• Premises in language • Conclusion
• “A student in this class has not • “Someone who passed the mid
read the book” term exam has not read the book”
• “Everyone in this class passed the • ∃x (P(x)∧¬B(x))
mid term exam”
Solution (continues)
S. No. Step Reason
1 ∀x (C(x)àP(x)) Premises
2 ∃x (C(x)∧¬B(x)) Premises
3 C(a)àP(a) Universal Instantiation from 1
4 C(a)∧¬B(a) Existential Instantiation from 2
5 C(a) Simplification from 4
6 ¬B(a) Simplification from 4
7 P(a) Modus Ponens from 5 and 3
8 P(a) ∧ ¬B(a) Conjunction from 7 and 6
9 ∃x(P(x) ∧ ¬B(x)) Existential Generalization from 8
Exercise
• Pg 78
• Q. 10, 13, 14
Proofs
• A valid argument that establishes the truth of a mathematical
statement
• Uses the hypothesis of the theorem, axioms assumed true and
previously proven theorems in order to establish the truth of the
statement being proved
Formal and Informal Proofs
• In formal proofs, all steps are supplied, and the rules for each step in
the argument are given
• Formal proofs can be extremely long and hard to follow
• In practice, Informal proofs are preferred over Formal proofs
• More than one rule of inference can be used in each step in informal
proofs
• Steps can be missed in informal proofs
• Informal proofs are used to explain humans why theorems are true,
while Formal proofs are are used by computers in automated
reasoning systems
Some Terminology
• Theorem: Statement that can be shown to be true
• Propositions: Less important theorems
• Proof: Demonstration of the theorem
• Axioms: Statement that we assume to be true, generally previously
proven
• Lemma: Less important theorems used in proofs
• Corollary: Theorem that can be established directly from another
theorem
• Conjecture: Statement that is being proposed to be a true statement,
usually on the basis of partial evidence or intuition of an expert
Direct Proof
Theorems are often of the form
For all x1,x2,...,xn, if p(x1,x2,...,xn), then q(x1,x2,...,xn).
This universally quantified statement is true provided that the conditional proposition
if p(x1,x2,...,xn), then q(x1,x2,...,xn)
is true for all x1, x2, . . . , xn in the domain of discourse.
To prove the above statement, we assume that x1, x2, . . . , xn are arbitrary members of the domain
of discourse.
If p(x1, x2, . . . , xn) is false, by Definition PàQ, the given statement is vacuously true; thus, we need
only consider the case that p(x1, x2, . . . , xn) is true.
A direct proof assumes that p(x1, x2, . . . , xn) is true and then, using p(x1 , x2 , . . . , xn ) as well as
other axioms, definitions, previously derived theorems, and rules of inference, shows directly that
q(x1 , x2 , . . . , xn ) is true.
In simple words
• A direct proof of a conditional statement pàq is constructed when
the first step is the assumption that p is true; subsequent steps are
constructed using rules of inference, with the final step showing that
q must also be true
• Generally, the direct proofs of many results are quite straight forward,
with a fairly obvious sequence of steps leading from premises to the
conclusion
Example
• Definition: The integer n is even if • Let m and n be arbitrary integers, and
there exists an integer k such that suppose that m is odd and n is even.
n=2k, and n is odd if there exists an • We prove that m + n is odd.
integer k such that n=2k+1.
• By definition, since m is odd, there exists an
• Then, give the direct proof of the integer k1 such that m = 2k1 + 1.
theorem “For all integers m and n, if
m is odd and n is even, then m + n is • Also, by definition, since n is even, there
odd.” exists an integer k2 such that n = 2k2.
• Now the sum is,
m+n=(2k1 +1)+(2k2)=2(k1 +k2)+1.
• Proof:
• Thus, there exists an integer k (namely k = k1
+ k2 ) such that m + n = 2k + 1.
• Therefore, m+n is odd.
Indirect Proof (methods)
• Proof by Contraposition
• This method uses the fact that pàq ≡ ¬qà¬p (contrapositive of the
conditional statement)
• It tries to establish ¬qà¬p thus automatically proving pàq
Example
• Give a proof by contrapositive to prove that for all x ∈ R, if x2 is
irrational, then x is irrational.
• Solution:
• We begin by letting x be an arbitrary real number. We prove the
contrapositive of the given statement, which is
if x is not irrational, then x2 is not irrational
or, equivalently,
if x is rational, then x2 is rational.
• So, suppose that x is rational.
• Then x=p/q for some integers p and q.
• Now x2 =p2 /q2 .
• Since x2 is the quotient of integers, x2 is rational. The proof is complete.
Indirect Proof (methods)
• Proof by Contradiction
• If we want to prove that p is true
• For that if we can find a contradiction q such that ¬pàq
• Because q is false, but ¬pàq is true we can conclude
• ¬p is false, which means that p is true
Example
• Give a proof by contradiction of the following statement: For every
n∈Z, if n2 is even, then n is even.
• Solution:
• We assume the hypothesis n2 is even and that the conclusion is false n is odd.
• Since n is odd, there exists an integer k such that n = 2k + 1.
• Now, n2 =(2k+1)2 =4k2 +4k+1=2(2k2 +2k)+1.
• Thus n2 is odd, which contradicts the hypothesis n2 is even.
• The proof by contradiction is complete.
• We have proved that for every n ∈ Z, if n2 is even, then n is even.
Vacuous and Trivial Proofs
• We can prove that a conditional statement pàq is true when we
know that p is false, because pàq is always true when p is false
• So if we try to proof p is false and establish pàq, this proof is called
vacuous proof
Exercise
• Pg 91
• Q. 1, 2, 9, 11, 12, 17, 18
Mathematical Induction (Induction)
• We can show that P(n) is true for every positive integer n, where P(n)
is the statement that we can reach the nth point in a function
• It is a proof technique
• In general, mathematical induction can be used to prove the
statements that assert that P(n) is true for all positive integers n,
where P(n) is a propositional function
Induction
• A proof of mathematical induction has two parts:
• Basis step
• Inductive step
• In basis step, we show that P(1) or P at initial value of n is true
• In inductive step, we show that for all positive integers k, if P(k) is true
then P(k+1) is true
• Mathematically,
[P(1) ∧ {∀k (P(k)àP(k+1))}]à ∀n P(n)
• Where P(n) is a propositional function
Induction
• To complete the inductive step of a proof using the principle of
mathematical induction, we assume that P(k) is true for an arbitrary
positive integer k and show that under this assumption, P(k+1) must
also be true
• The assumption that P(k) is true is called the inductive hypothesis
• Once both the steps in a proof are completed using mathematical
induction, we have shown that P(n) is true for all positive integers,
that is, we have shown:
[P(1) ∧ {∀k (P(k)àP(k+1))}] à ∀n P(n)
Weak and Strong Induction
• The difference between weak induction and strong induction only
appears in induction hypothesis. In weak induction, we only assume
that particular statement holds at k-th step, while in strong induction,
we assume that the particular statement holds at all the steps from
the base case to k-th step.
• Inductive Step:
For Example For arbitrary k positive integers,
P(k): 1+2+…+k=k(K+1)/2 be true