1 The Foundations - Logic and Proofs

Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

1.

The Foundations- Logic and Proofs


------------------------------------------------------------------------------------------------
● Syllabus
Propositional logic, propositional Equivalences, Predicates and Quantifiers, Nested
Quantifiers, Rules of Interference, Introduction to proofs, Normal forms, proof methods and
strategy.
------------------------------------------------------------------------------------------------
2.1 Propositional logic
A Proposition is a declarative sentence that is either completely true or completely false but not
both.
Examples of propositions:
a) The Moon is made of green cheese.
b) Trenton is the capital of New Jersey.
c) Toronto is the capital of Canada.
d) 1 + 0 = 1
e) 0 + 0 = 2
Examples that are not propositions.
a) Sit down!
b) What time is it?
c) x + 1 = 2
d) x + y = z
𝑛
Note: Number of truth combinations when there are ‘n’ propositional variables - 2 .
Truth table: Table containing truth values for all positive truth combinations.

2.1.1 Logical Connectives:


Logical connectivity can be described as the operators that are used to connect one or more than
one propositions or predicate logic.

Name of Connective Connective Word Symbol

Negation Not ¬ or ∼ or ' or -

Conjunction And ∧

Disjunction Or ∨

Conditional If-then →

Bi-conditional If and only if ↔

The Foundations- Logic and Proofs | 1


i) Negation (∼): The truth table of negation is shown below:

p ∼p

F T

T F

Example: If p: I am a good student.


Then the negation of p will be: ∼p: I am not a good student.

ii) Conjunction (∧): When p and q both are true, then only conjunction of them will be true.

p q p∧q

F F F

F T F

T F F

T T T

iii) Disjunction (∨): When p and q both are false, then only disjunction of them will be false.

p q p∨q

F F F

F T T

T F T

T T T

2018301|Discrete Mathematics Lecture Notes|GP Muz.|2023| 2


iv) Implication (→): When p is true, and q is false, then the implication of them will be false.

p q p→q

F F T

F T T

T F F

T T T

Example:
p: you will get good marks q: you will get chocolate.
p → q: If you will get good marks then you will get chocolate.

Note:
● p → q may be read as
If p then q, p implies q, p only if q,q if p, q follows from p.

● In p → q; p is known as hypothesis q is known as conclusion.

v) Biconditional (↔): If there is a proposition that has the form "p if and only if q", then that type
of proposition will be known as a bi-implication or bi-conditional proposition. When both p and q
are true, or p and q both are false, then the bi-implication of them will be true.

p q p↔q

T T T

T F F

F T F

F F T

The Foundations- Logic and Proofs | 3


Example: Construct the truth table for (p → q) ∧ (¬p ↔ q).

Example: Show that (p → q) ∧ (q → p) is logically equivalent to p ↔ q.

2.1.2 Tautology, Contradiction, Contingency, Satisfiable


Tautology: A proposition which is always True.
Ex: ∼p ∨ p
Contradiction: A proposition which is always False.
Ex: ∼p ∧ p
Contingency: A proposition which is neither Tautology nor contradiction.
Ex: p → q
Satisfiable: A proposition which is True for atleast one truth combination.
Ex: p → q

Example: Determine the nature of following propositions among Tautology, Contradiction,


Contingency and Satisfiable- (p ∧ (p → q)) → ∼q.

Solution 1 (Using T.T.):

Clearly, the last column of the truth table contains both T and F.
Therefore, the given proposition is- Contingency, Satisfiable.
2018301|Discrete Mathematics Lecture Notes|GP Muz.|2023| 4
Solution 2 (Using Algebra Of Proposition):
We have-
(p ∧ (p → q)) → ∼q
= (p ∧ (∼p ∨ q)) → ∼q { ∵ p → q = ∼p ∨ q }
= ∼(p ∧ (∼p ∨ q)) ∨ ∼q { ∵ p → q = ∼p ∨ q }
= ∼((p ∧ ∼p) ∨ (p ∧ q)) ∨ ∼q { Using Distributive law }
= ∼(F ∨ (p ∧ q)) ∨ ∼q { Using Complement law }
= ∼(p ∧ q) ∨ ∼q { Using Identity law }
= ∼p ∨ ∼q ∨ ∼q { Using De Morgans law }
= ∼p ∨ ∼q
Clearly, the result is neither T nor F.
So, the given proposition is a contingency and satisfiable.

Solution 3 (Using Digital Electronics):


We have-
(p ∧ (p → q)) → ∼q
= (p.(p’ + q))’ + q’
= (p.p’ + p.q)’ + q’
= (p.q)’ + q’ { ∵ p.p’ = 0 }
= p’ + q’ + q’ { Using De Morgan’s law }
= p’ + q’
Clearly, the result is neither 0 nor 1.
So, the given proposition is a contingency and satisfiable.

2.1.3 Converse, Inverse and Contrapositive


Given implication: p →q; we can form new conditional statements .
Converse: q →p
Inverse: ¬ p → ¬ q
Contrapositive: ∼q → ∼p

Example: write the converse, inverse, and contrapositive of a given statement "If the weather is
sunny, then I will go to school."
Solution: p: The weather is sunny q: I will go to school
Converse Statement: If I will go to school, then the weather is sunny.
Inverse Statement: If the weather is not sunny, then I will not go to school.
Contrapositive Statement: If I will not go to school, then the weather is not sunny.

The Foundations- Logic and Proofs | 5


2.1.4 Precedence of Operators

1 means first priority or high precedence, 5 means least priority or low precedence.

2.2 Propositional Equivalences


Two propositions are equivalent if they have the same truth table.
Ex: p → q ≡ ∼p ∨ q

2.2.1 Few Important Equivalences

2018301|Discrete Mathematics Lecture Notes|GP Muz.|2023| 6


Equivalence on Biconditional

Law of Contrapositive: p → q ≡ ∼q → ∼p

2.3 Predicates and Quantifiers


2.3.1 Predicates
● A predicate contains variables whose values are to be taken from some universe of
discourse (Set).
● A propositional function / Open proposition / predicate is a sentence that contains one or
more variables.
● A predicate is neither true nor false.
● A predicate becomes a proposition when the variables are substituted with specific values.
● The domain of a predicate variable is the set of all values that may be substituted for the
variable.
● A predicate involving an ‘n’ variable is an n-place predicate.
● Use of quantifiers with proposition function is called Predicate calculus.
Ex-
1. L(x) : x + 2 < 7; U={x is natural number}
2. L(x,y) : x + y ≤ 6; U={x,y is natural number}
3. Loves(x,y) : x loves y.

2.3.2 Quantifiers
In predicate logic, predicates are used alongside quantifiers to express the extent to which a
predicate is true over a range of elements. Using quantifiers to create such propositions is called
quantification.
There are two types of quantifiers-
a. Universal Quantifier (∀) :
Let U be some domain of x; ∀x P(x) means “For all x, p(x) is True”
b. Existential Quantifier (∃) :
Let U be some domain of x; ∃x P(x) means “There exists an x such that p(x) is True”

Ex:
1. U = {1,2,3,4}; P(x) : x+4 ≤ 7
∀x P(x) = F
∃x P(x) = T
2. U = {1,2,3}; P(x) : x+4 ≤ 7
∀x P(x) = T
∃x P(x) = T

The Foundations- Logic and Proofs | 7


Standard Form Meaning

∀x P(x) All True

∃x P(x) Some True

¬∀x P(x) Not all True

¬∃x P(x) None True

∀x ¬P(x) All False

∃x ¬P(x) Some False

¬∀x ¬P(x) Not all False

¬∃x ¬P(x) None False

2.3.3 Equivalence using Quantifiers


1. ∀x P(x) = ¬∃x ¬P(x)
2. ∃x P(x) = ¬∀x ¬P(x)
3. ¬∀x P(x) = ∃x ¬P(x)
4. ¬∃x P(x) = ∀x ¬P(x)
Ex: Simplify ¬∃x ¬P(x).
Solution: ¬∃x ¬P(x) ≡ ¬ ¬ ∀𝑥 𝑃(𝑥) ≡ ∀𝑥 𝑃(𝑥)

2.4 Rules of Interference


Premises: p1, p2, p3, p4, ….., pn
Conclusion: q
If (p1∧ p2 ∧ p3 ∧ p4 ∧ …… ∧ pn) → q indicates a tautology, in this case, the argument will
be termed as valid otherwise, it will be termed invalid. The following expression is used to show
the argument:

First premises
Second premises
Third premises
Fourth premises
.
.
Nth premises
______________
∴ Conclusion

2018301|Discrete Mathematics Lecture Notes|GP Muz.|2023| 8


Example: Check the validity of given statement.
"If tomorrow is holiday, I will go to mall."
"If tomorrow is holiday".
∴ "I will go to mall."
Solution:
This argument belongs to a form that is described as follows:
P→Q
P
___________
∴Q

P Q P→Q (P → Q)∧P [(P → Q)∧P] → Q

F F T T∧F = F F→F=T

F T T T∧F = F F→T=T

T F F F∧T = F F→F=T

T T T T∧T = T T→T=T

[(P → Q)∧P] → Q is Tautology. Hence, The above form is valid.

2.5 Normal forms


The problem of finding whether a given statement is tautology or contradiction or satisfiable in a
finite number of steps is called the Decision Problem. For Decision Problem, construction of truth
table may not be practical always. We consider an alternate procedure known as the reduction to
normal forms.

There are two such forms:


1. Disjunctive Normal Form (DNF): A formula which consists of a sum of elementary
products is called a disjunctive normal form of given formula.
Example :
(P ∧ ~ Q) ∨ (Q ∧ R) ∨ (~ P ∧ Q ∧~ R)

2. Conjunctive Normal Form (CNF): A formula which consists of a product of elementary


sums is called a conjunctive normal form of given formula.
Example :
(P~ ∨ Q) ∧ (Q ∨ R) ∧ (~ P ∨ Q ∨ ~ R)

The Foundations- Logic and Proofs | 9


2.6 Introduction to Proofs
Mathematical proof is an argument we give logically to validate a mathematical statement. In
order to validate a statement.

2.6.1 Proof methods and strategy


i) Direct Proof:
The simplest (from a logic perspective) style of proof is a direct proof.
The general format to prove P → Q is this:
Assume P. Explain, explain, …, explain. Therefore Q.
2
Example: Prove: For all integers n, if n is even, then 𝑛 is even.

ii) Proof by cases:


In this method, we evaluate every case of the statement to conclude its truthiness.
Example: For every integer x, the integer x(x + 1) is even.
Proof:
If x is even, hence, x = 2k for some number k. now the statement becomes:
2k(2k + 1)
which is divisible by 2, hence it is even.

If x is odd, hence x = 2k + 1 for some number k, now the statement becomes:


(2k+1)(2k+1+1) = (2k + 1) 2(k + 1)
which is again divisible by 2 and hence in both cases we proved that x(x+1) is even.

iii) Proof by contradiction:


We assume the negation of the given statement and then proceed to conclude the proof.
Example: Prove that sqrt(2) is irrational

2018301|Discrete Mathematics Lecture Notes|GP Muz.|2023| 10


iv) Proof by contrapositive:
Recall that an implication P → Q is logically equivalent to its contrapositive ¬Q → ¬P. There are
plenty of examples of statements which are hard to prove directly, but whose contrapositive can
easily be proved directly.
2
Example: If 𝑛 is odd then n is odd.

------------------------------------------------------------------------------------------------

The Foundations- Logic and Proofs |


11
Practice Questions

1. Here we will write the converse, inverse, and contrapositive of some statements, which are
shown below:
a. If the weather is sunny, then I will go to school.
b. If 3y - 2 = 10, then x = 1.
c. If there is rainy weather, then I will go outside to enjoy it.
d. You will get good marks only if you study hard.
e. I will go to the market if my cousins come.
f. I go to college whenever my friends come.
g. I will give you a party only if I buy a good dress.
h. If I become famous, then I will earn a lot of money.
2. Determine the nature of following propositions among Tautology, Contradiction and
Contingency-
a. p ∧ ∼p
b. (p ∧ (p → q)) → ∼q
c. [ (p → q) ∧ (q → r) ] ∧ ( p ∧ ∼r)
d. ∼(p → q) ∨ (∼p ∨ (p ∧ q))
e. (p ↔ r) → (∼q → (p ∧ r))
3. With and without truth tables show that ¬(p∨ (¬p ∧ q)) ≡ ¬(p∨ q).
4. With and without truth tables show that (¬ p → q) ≡ p∨ q.
5. With and without truth tables show that ¬ (¬ p ∨ (p∨ q)) → q is a tautology.
6. With and without truth tables show that an implication and it’s contrapositive are logically
equivalent.
7. Show that the two statements (p ∧ q) → r and (p → r) ∧ (q → r) are not logically
equivalent.
8. Show that the following argument is not valid
p∨r
p∨q
______
∴q∨r
9. Explain any two proof methods that you like most.

------------------------------------------------------------------------------------------------

2018301|Discrete Mathematics Lecture Notes|GP Muz.|2023| 12

You might also like