0% found this document useful (0 votes)
24 views

Class note on Propositional and predicate Logic

The document provides an overview of propositional and predicate logic, detailing the concepts of propositions, logical connectives, and truth values. It explains the structure of logical arguments, validity, and the formation of compound propositions, along with examples and truth tables. Additionally, it discusses the independence of validity from the truth of premises and introduces the concept of logical consequence.

Uploaded by

Wakuma Masresha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Class note on Propositional and predicate Logic

The document provides an overview of propositional and predicate logic, detailing the concepts of propositions, logical connectives, and truth values. It explains the structure of logical arguments, validity, and the formation of compound propositions, along with examples and truth tables. Additionally, it discusses the independence of validity from the truth of premises and introduces the concept of logical consequence.

Uploaded by

Wakuma Masresha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 58

CHAPTER ONE

PROPOSITIONAL
AND
PREDICATE LOGIC

∃ ∀
Predicate �(�)
�(�, �) Logic

∀�∃�(�(�, �) ∀�∀�(�(�, �)
Propositional logic Predicate logic
∃ ∀

�(�, �)
Predicate �(�)
Logic

∀�∃�(�(�, �) ∀�∀�(�(�, �)

It deals with propositions. It deals with open propositions.


• Logical connectives • Logical quantifiers
• Truth value and truth table • Predicate (properties)
• Arguments • variables (object)
MATHEMATICAL LOGIC

1. 2.

Conjuction
Disjuction
Implication Bi-implication
Negation
What is logic?
§ The science of reasoning, Which Studies about organizing evidence in a
systematic ways
1.1. Propositional Logic(Statement calculus)
Ø The area of logic which deals with propositions.
Ø It studies the logical relationships between propositions and combining
propositions via logical connectives.
Definition:
A proposition (or statement) is a sentence wich can be said to be either True or False
but not both. A statement is any collection of symbols which is either true or false,
but not both. The truth or falsity of astatementis called its truth value.

Examples: a. 2 is an even number. b. A triangle has three sides.


c. The sun rises from West.
The followings are not proposition.
4. May God bless you! 7. I hope you win the race.
5. Give me that book. 8. A Nice job! well done!
6. What is your name? 9. Open the door!

Remark!
q Sentences that are used to express feelings, Imperative,
Orders/commands, opinions.
q A word True or False assigned to a proposition is called
a truth value.
q Every proposition has a truth value, namely true
(denoted by �) or false (denoted by �).

Note: Letters such as �, �, �, � etc. are usually used to denote


propositions.
1.1.2. Logical connectives

Words such as: “Not”, “And”, “Or”, “If .., then”, “If and only if”
Logical connectives
q A Proposition formed either by modifying or joining Proposition/s using
the above connectives.
Logical
connectives

Conjuction Implication
Negation Bi-Implication
Disjuction
q Conjunction
When two propositions are joined with the connective “and,”
the proposition formed is a logical conjunction. “and” is
denoted by “∧ ”.
written: � ∧ � , read as “ � and � ”
p , q are called the components of the conjunction.
Rule: � ∧ � is T if and only if � is T and � is T, otherwise F.

q Disjunction
When two propositions are joined with the connective “or,”
the proposition formed is called a logical disjunction. “or” is
denoted by “ ∨ ”.
written: � ∨ � read as “� or �” or “� disjunction �.”
Rule: � ∨ � is F if and only if both � and � are F, otherwise T.
q Implication
When two propositions are joined with the connective
“implies,” or “If … then” the proposition formed is called a
logical implication. “implies” is denoted by “ ⟹”.
written: � ⟹ � read as “� implies �.” or “if �, then �.”
Rule:
� ⟹ � is false if and only if � is true and � is false.

v The following have the same meaning with If P, then Q

P implies Q P is sufficient condition for Q


P Only if Q Q is necessary condition for P
Q if P Q, provided that P
q Bi-implication
When two propositions are joined with the connective “bi-
implies,” or “If and only if ” the proposition formed is
called a logical bi-implication or a logical equivalence.
ü denoted by “ ⟺ ”.
ü written: � ⟺ �.
Rule:
� ⟺ � is F if and only if � and � have different truth values.

q Negation
Given any proposition �, we can form the
proposition using word “not” , denoted by “”.
“”� called the negation of �
The truth value of � is � if � is � and � if � is �.
Compound (Complex) propositions
Definition: The proposition formed by joining two or more propositions
by connective(s) is called a compound statement.
Example: Consider the following propositions:
Let �: 3 is an odd number. �: 27 is a prime number.
Then write the following in English!
Ø � ∧ �: 3 is an odd number and 27 is a prime number.
Ø � ∨ �: 3 is an odd number or 27 is a prime number.
Ø � ⟹ �: If 3 is an odd number, then 27 is a prime number.
Ø � ⟺ �: 3 is an odd number iff 27 is a prime number.
Ø �: 3 is not odd (even) number.
Composite sentence is Compound statement as a declarative sentence in which one
or more connectives appear. while Prime sentence is the constituent of composite
sentence which either contain no connectives or, by choice, are regarded as
“indivisible”.
Example 1: Consider the following declarative sentence
If it is not foggy tonight, then either John must stay home or must take a taxi.

From the above we have three prime components of sentences


p: It is foggy.
q: John must stay home.
r: John must take a taxi.
Symbolically, equivalent to ¬� ⟹ (� ∨ �)
Truth Table
The compilation of all possible combination of proposition in a
tabular format is called a truth table.
v In general, a truth table involving “�” propositions(Prime
proposition �1 , �2 ,…, �� ) there are 2� possible combinations of
truth values.

For example: Suppose that a compound proposition is symbolized by


(� ∨ �) ⟹ (� ⟺ s)
If the truth values of �, �, �, and � are �, �, �, and �, respectively,
Then the truth value of � ∨ � is �, that of s is F , that of � ⟺ s is �.
So the truth value of (� ∨ �) ⟹ (� ⟺ s) is �.
But to see the all possible truth values we need to construct a truth table.
Example: Construct Truth table for the following proposition.
a. (p ∨ �) ⟹ � ��� b. (� ⟹ �) ⟺ �
Solution:
a. Composed of three propositions, 23 = 8 �������� �����������
The assignments are as p q r � p ∨ � (p ∨ �) ⟹ �
follows:
T T T F T F
• Assign 4T 4F to p T T F T T T
TTTTFFFF T F T F T F
• Assign 2T 2F 2T 2F to q T F F T T T
TTFFTTFF
F T T F T F
• Assign 1T 1F up to the last
F T F T T T
row consecutively to r
TFTFTFTF F F T F F T
F F F T F T 15
Exercise
Remark: When dealing with compound propositions, we shall adopt
the following convention on the use of parenthesis.

§ Whenever the Logical connectives present, we shall assume that


first “”, then “∨” or “∧” is assigned equal strength, and then
“⟹”, lastly “⟺” is then applied.

For example:
� ∧ � ⟹ � means (� ∧ �) ⟹ �
� ∨ � ⟺ � means (� ∨ �) ⟺ �
� ⟹ � means (�) ⟹ (�)
� ⟹ � ⟺ � means ((�) ⟹ �) ⟺ �
Tautology and contradiction
o g y
to l
Ta u

i o n
ad ict
tr
Co n

1.3. Validity
Truth in every valuation is called validity. A valid formula represents a logical
truth, that is, a sentence that is true in virtue of its logical form. More specifically,
a logical truth expressible in a propositional language is called tautology.
: A compound proposition � is valid if all value it returns in truth table is true
(Tautology).
Written as: ⊨ �

Example: � ⟹ �, � ∨ ¬�, (� ⟹ �) ⟺ (¬� ∨ �)


Construct truth table for � ∨ ¬�

Now it is a tautology, hence it is valid and written as:


⊨ � ∨ ¬�
The validity of Argument

: An argument form �1 , �2 , �3 , …, �� ├ � is said to be valid if � is true


whenever all the premises �1 , �2 , �3 , …, �� are true.
: In other hand The argument form �1 , �2 , �3 , …, �� ├ � is valid iff the statement
(�1 ∧ �2 ∧ �3 ∧ … ∧ �� ) ⟹ � is a tautology.
A valid argument is written as
{ �1 , �2 , �3 , …, �� } ⊨ � or �� , �� , �� , …, �� ⊨ �

Example: i. Show that � ⟹ �, � ⊨ �

ii. Investigate the validity of the following argument:

p  q,  q   p p  q,  q  r  p
Solution: ii. p  q,  q   p p  q,  q  r  p

� � �⟹� � � � � �⟹� � ⟹ �
� �
� � � � � � � � � � �
� � � � � � � � � � �
� � � � � � � � � � �
� � � � � � � � � � �
� � � � � �
� � � � � �
� � � � � �
The premises � ⟹ � and � are true
� � � � � �
simultaneously in row 4 only. Since in this case
� is also true, the argument is valid. The 1st, 2nd, 5th, 6th and 7th rows are those in which all
the premises take value �.
∴ � ⟹ � , � ⊨ �
In the 5th, 6th and 7th rows however the conclusion
takes value �. Hence, the argument form is invalid.
Premises and Validity of argument
Does validity of argument is independent of the truth of its premises? yes.
Let � - be the sets of premises sentences and
� - the conclusion

Then we can write the argument as: Γ/�


The truth of the sentences in Γ is neither necessary nor sufficient for the validity
of argument Γ/α.
That is,
• Γ/α can be valid even if some of (or all) the sentences in Γ are false, and
• Γ/α can be invalid even if the sentences in Γ are all true.
Consider the following
i: Valid argument with False premise!
Example 1:
(1) Either the earth is a star or it is a planet [T]
(2) The earth is not a planet [F]
(3) Therefore the earth is a star. [F]
It has a false premise, namely, (2): But the inference from (1) and (2) to (3) is
correct. (It is a valid argument. )

Example 2: All cups are green. (False)


Socrates is a cup. (False)
Therefore, Socrates is green. (False)
All premises are False, but the Inference is correct. (It is a valid argument. )
ii: Invalid arguments with true premises.
For example: Consider the following argument
If you are a hero, then you wear a Rolex. �⟹�
You wear a Rolex. q
∴�
Therefore, you are a hero.
From the above Truth table the premises are true (1st and 3rd rows) but the
conclusion is false in 3rd row. ∴ The argument is invalid.
REMARK!
q Validity does not require the truth of the premises, instead it merely necessitates
that conclusion follows from the premises without violating the correctness of
the logical form.
v We conclude that validity and true premises are entirely independent
properties of arguments.
There are valid arguments with true premises (called sound argument).
In valid argument the conclusion is true when ever the premises are True. That
means there is no interpretation in which all premises are true and conclusion is
False.
Example: Either the earth is a star or it is a planet. [T]
The earth is not a star. [T]
Therefore the earth is a planet. [T]

Example: All men are mortal. (True)


Socrates is a man. (True)
Therefore, Socrates is mortal. (True)
From above argument there is no interpretation in which the premises are true
and conclusion is False.
1.4 Consequence and Rules of Inference
Logical consequence (also entailment) describes the relationship between statements that
hold true when one statement logically follows from one or more statements.
A valid logical argument is one in which the conclusion is entailed by the premises,
because the conclusion is the consequence of the premises.
Consider the following argument
All men are mortal
Premises
Socrates is a man
Therefore, Socrates is mortal. Conclusion/Consequence

Let Γ - be any set of formulas of the premises and � - be the conclusion


Then the symbol:
Γ⊨ � , read as ~ “ α is a logical consequence of Γ ”
Definition: Γ⊨ � iff there is no interpretation in which the formulas in Γ are true and α
is false.
Definition: � ⊭ � if there exist an interpretation that verifies Γ but falsifies α.

Note that Γ is any set of formulas, so it can contain a single formula β or even no
formula at all.

In the first case we say that α is a logical consequence of β, and write: β ⊨ α.


Example: �∧�⊨�

The 2nd case in which Γ = ∅ and α is true in all interpretations and write: ⊨ �.
Example: ⊨ ¬� ∨ �
Example 1: � ⟹ �, � ⊨ � (� is logical consequence of {� ⟹ �, �})
since there is no interpretation in which � ⟹ � and p are true but q is false.
here for all the premises are true:
which means � ⟹ � is True and p is true
(1) p ≡ ���� Premise
(2) � ⟹ � ≡ True Premise
(3) q ≡ True Conclusion
From the above logical interpretation q must be True. (i.e. the conclusion)
Example 2: � ⟹ �, � ⊭ �
This to assert the existence of an interpretation that verifies {p ⟹ q, r} but
falsifies q.
If p and q are false and r is true,
Both premises � ⟹ � and r are true but q is false.
Properties of Logical consequence

Logical consequence exhibits the following properties:


reflexivity, monotonicity, and cut (transtivity).
A. Reflexivity
Theorem1.1:

B. Monotonicity
Theorem1.2:

From the above Theorems we conclude that:-


Ø no addition of premises to a valid argument can affect its validity.
C. Transitivity
Theorem 1.3:

Theorem 1.3 says that if two valid arguments are chained, then a third argument
formed by the premises of the first two and the conclusion of the second is valid.

Note that reflexivity and monotonicity imply that any argument whose
premises include the conclusion is valid.
Suppose that α ∈ Γ, by theorem 1.1, α entails α.
Since {α} ⊆ Γ, by theorem 1.2 Γ also entails α.
Rules of inference
In logic, a consequence is the result of applying a rule of inference to a set of
premises.
Rule of inference: A logical schema or way of drawing a conclusion
from a set of premises.
Consequence: The result of applying a rule of inference to a set of premises

Rules of Inference: Rules of inference are logical tools used to derive conclusions
from premises. They form the foundation of logical reasoning, allowing us to build
arguments, prove theorems, and solve problems in mathematics, computer science,
and philosophy. Understanding these rules is crucial for constructing valid
arguments and ensuring that conclusions follow logically from given information.
Basic Rules of Inference
1. Modus Ponens 2. Modus Tollens
(Law of Detachment) (Law of Contrapositive)
If a conditional statement is true, and If a conditional statement is true, and its
its antecedent is true, then its consequent is false, then its antecedent
consequent must also be true. must also be false.
Form: If � ⟹ � and �, �ℎ�� � Form: If � ⟹ � and ¬� , �ℎ�� ¬�
.
�⟹� �⟹�
� ¬�
∴� ∴ ¬�

Example: Example:
Premise: If it rains, the ground will be wet. Premise: If it rains, the ground will be wet.
Premise: It is raining. Premise: The ground is not wet.
Conclusion: The ground is wet Conclusion: It is not raining.
3. Hypothetical Syllogism 4. Disjunctive Syllogism
If two conditional statements are true, If a disjunction (an “or” statement)
where the consequent of the first is the is true, and one of the disjuncts (the
antecedent of the second, then a third parts of the “or” statement) is false,
conditional statement combining the then the other disjunct must be true.
antecedent of the first and the consequent
of the second is also true. Form:
Form: �� � ∨ � ��� ¬�, �ℎ�� �.
�� � ⟹ � ��� � ⟹ �, �ℎ�� � ⟹ �. �∨�
�⟹� ¬�
�⟹� ∴�
∴�⟹� Example:
Example: Premise: It is either raining or sunny.
Premise: If it rains, the ground will be wet. Premise: It is not raining.
Premise: If the ground is wet, the plants will grow. Conclusion: It is sunny.
Conclusion: If it rains, the plants will grow.
5. Conjunction 6. Simplification(Detachment)
If two statements are true, then their If a conjunction (an “and” statement) is
conjunction (an “and” statement) is true, then each of its conjuncts is also
also true. true.
Form: If p and q, then p ∧ q. Form:
If p ∧ q, then p. If p ∧ q, then q
�⟹q
p �∧�
∴� ∧� ∴ �, �

Example: Example:
Premise: It is raining. Premise: It is raining and windy.
Premise: It is windy. Conclusion: It is raining.
Conclusion: It is raining and windy.
7. Addition
If a statement is true, then the disjunction
(an “or” statement) of that statement with
any other statement is also true.
Form:
�� �, �ℎ�� � ∨ q

∴�∨q

Example:
Premise: It is raining.
Conclusion: It is raining or sunny.
Example: Given premises write a valid conclusion or their consequence.
A: If today is Monday, then I will go to cinema.
Hint:
I didn’t went to cinema �⟹�
__ Cons: Therefore,Today is not Monday. ¬�
∴ ¬�
B: All men are mortal
Socrates is a man Hint:
__ Cons: Therefore Socrates is mortal �⟹�
�⟹�
C: If you like apples, you will like this pie. ∴�⟹�
If you like this pie, then you will like the bakery.

The consequences are:


Therefore, if you do not like the bakery, you do not like apples.
Therefore, If you like apples, then you will like the bakery.
1.6. Symbolizing Everyday Language and Predicate Calculus

We developed propositional logic to model basic proof and truth. However, the
sentences of mathematics involve ideas that cannot be fully represented in
propositional logic. These sentences are able to characterize objects, such as
numbers or geometric figures, by describing properties of the objects. Since
propositional logic is not well suited to handle these ideas, we extend propositional
logic to a predicate logic.
the rules of logic specify the meaning of mathematical statements. these rules help
us to understand and reason with statements such as:-

In English means “there exists and integer that is not sum of two squares”
Predicate and quantifiers
Definition : An open statement (also called a predicate) is a sentence that
contains one or more variables and whose truth value depends on the values
assigned for the variables.
We represent an open statement by a capital letter followed by the variable(s)
in parenthesis, e.g. �(�), �(�, �), �(�, �, �), etc.

Example 1.11: Here are some open propositions:


a. �(�) : � is the day before Sunday.
b. �(�) : � is a city in Africa.
c. �(�) : � is greater than 9 .
d. �(�, �): � + 4 = �
Definition : Let U be the universal set. An open proposition �(�) is a tautology
if and only if �(�) is always true for all values of � ∈ �.

Example:

We observe the following three possiblities


Tautology

Contradiction
Quantifiers indicates how many objects satisfy the sentence.

"for every � " “For some �”


"for all � " “there exist �”,
"for each � " “For Atleast one �”.
q Symbolized by “ ∀� ” q Symbolized by “ ∃� ”

If �(�) is open proposition with universal U. The followings are quantified


proposition and read as follows:
∀��(�) ~read as ~ “ Every � ∈ � with the property � ”

∃��(�) ~ read as ~ “ There exist � ∈ � ���� ��� �������� � ”


v Unique Existential: P(x) is true for one and only one x in the
universe, ∃!xP(x)
Remarks:
i. To show that (∀�)�(�) is �, it is sufficient to find at least one
� ∈ � such that �(�) is �. Such an element � ∈ � is called a
counter example.
ii. (∃�)�(�) is � if we cannot find any � ∈ � having the property �.

Example: Write the following statements using quantifiers.


a. For each real number � > 0, �2 + � − 6 = 0.
Solution: (∀� > 0)(�2 + � − 6 = 0).
b. There is a real number � > 0 such that �2 + � − 6 = 0.
Solution: (∃� > 0)(�2 + � − 6 = 0).
c. The square of any real number is nonnegative.
Solution: (∀� ∈ ℝ)(�2 ≥ 0).

Exercise: Find the truth value for the following if � ∈ ℝ:


1. (∀�)(�2 + 1 ≥ 0) T
2) 1
2. (∀�)(� < � = F , b/c � = is a counterexample
2
3. (∃�)(� < �2 ) = T , since −1 ∈ ℝ such that −1 < 1.
Note:
q The negation of (∀�)�(�) is (∃�)�(�).
q The negation of (∃�)�(�) is (∀�)�(�).

(∀�)�(�) ≡ (∃�)�(�).
(∃�)�(�) ≡ (∀�)�(�)

Example: Let � = ℝ.
1. (∃�)(� < �2 ) ≡ (∀�)(� < �2 )
≡ (∀�)(� ≥ �2 ).
2. (∀�)(4� + 1 = 0) ≡ (∃�)(4� + 1 = 0)
≡ (∃�)(4� + 1 ≠ 0).
v Compound proposition in predicate logic
Examples: Let ℚ(�) : � is a rational number.
ℝ(�) : � is real number.

• (∀�)(ℚ(�) ⟹ ℝ(�)): ��� ��������� ��� �����.

q The negation of (∀�)(ℚ(�) ⟹ ℝ(�)) is (∃�)(ℚ(�) ∧ ℝ(�))


(∃�)(ℚ(�) ∧ ℝ(�)): Some rationals are not reals:

• (∀�)(ℚ(�) ⟹ ℝ(�)): No rationals are reals.

q The negation of (∀�)(ℚ(�) ⟹ ℝ(�)) is (∃�)(ℚ(�) ∧ ℝ(�))


(∃�)(ℚ(�) ∧ ℝ(�)): Some rationals are reals.
Example: Write the negation of the followings:
A: All men in this group are named Bob B: Some of us have headaches
Solution: A: Let U= the group of men and
B(x): x is named Bob M(x): x is man
A : All men in this group are named Bob ≡ ∀�(�(�) ⟹ �(�)
¬A ≡ ¬[∀�(�(�) ⟹ �(�)] ≡ ∃�(�(�) ∧ ¬�(�))
Therefore the negation of A are the statements:-
¬[∀�(�(�) ⟹ �(�)] : Not all men in this group are named Bob.
∃�(�(�) ∧ ¬�(�)) : Some men in this group are not named Bob
B: Let U= Our Collection, and �(�): � ��� � ���������
B: Some of us have headaches ≡ ∃��(�)
Therefore negations of B are the statements:-
¬[∃��(�)] : None of us has headaches
∀�(¬�(�)) : All of us do not have headaches
12/6/2024 Logic and set theory 49
From the above Example:

q The negation of “All men in this group are named Bob” are
the statements
: Some men in this group are not named Bob,
: Not all men in this group are named Bob.

q The negations of “Some of us have headaches” are the


statements
: None of us has headaches,
: All of us do not have headaches

12/6/2024 Logic and set theory 50


EXERCISE

12/6/2024 Logic and set theory 51


v Example: Let � = The set of integers and
�(�): � is a prime number
�(�): � is an even number
�(�): � is an odd number
Then determine the truth value of the followings!
�. (∃�)[�(�) ⟹ �(�)] is �;
since there is an �, say 2, such that �(2) ⟹ �(2) is �.
�. (∀�)[�(�) ⟹ �(�)] is �.
As a counterexample take 7. Then �(7) is � and �(7) is �. Hence �(7) ⟹ �(7).
c. (∀�)[�(�) ∧ �(�)] is �.
d. (∀�)[(�(�) ∧ �(�)) ⟹ �(�)] is �.
Nested Quantifiers
The following are the simplest forms of combinations:
1. (∀�)(∀�)�(�, �)
“for all � and for all � the relation �(�, �) holds”;
2. (∃�)(∃�)�(�, �)
“there is an � and there is a � for which �(�, �) holds”;
3. (∀�)(∃�)�(�, �)
“for each � there is a � such that �(�, �) holds”;
4. (∃�)(∀�)�(�, �)
“there is an � which stands to every � in the relation �(�, �).”
Example: Let � = The set of integers.
�(�, �): � + � = 5.
Determine the truth value of the followings!

�. (∃�) (∃�) �(�, �) = T, for x = 4 and y = 1


b. (∃�) (∀�) �(�, �) = F, there is an integer �0 such that for every �, �0 + � =
5.
c. (∀�) (∃�) �(�, �) = T
For every integer �, there is an integer � such that � + � = 5
Let � = �, then � = 5 − � will always be an integer
d. (∀�) (∀�) �(�, �) = F
For every integer � and �, � + � = 5. False
1.7. Consequence and Predicate Logic
A logical argument containing quantifiers is called a categorical syllogism.
Using rules of inference proof that:

Solution:

You might also like