Class note on Propositional and predicate Logic
Class note on Propositional and predicate Logic
PROPOSITIONAL
AND
PREDICATE LOGIC
∃ ∀
Predicate �(�)
�(�, �) Logic
∀�∃�(�(�, �) ∀�∀�(�(�, �)
Propositional logic Predicate logic
∃ ∀
�(�, �)
Predicate �(�)
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.
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 �).
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.
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.
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: ⊨ �
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
Note that Γ is any set of formulas, so it can contain a single formula β or even no
formula at all.
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
B. Monotonicity
Theorem1.2:
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.
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:
Contradiction
Quantifiers indicates how many objects satisfy the sentence.
(∀�)�(�) ≡ (∃�)�(�).
(∃�)�(�) ≡ (∀�)�(�)
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 “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.
Solution: