Mathematical Logic and Set Theory Overview
Mathematical Logic and Set Theory Overview
• Propositional Logic
• Applications of Propositional Logic
• Propositional Equivalences
• Predicates and Quantifiers
• Nested Quantifiers
• Rules of Inference
• Introduction to Proofs
• Proof Methods and Strategy Sets
• Combination of sets
• Venn Diagrams
• Finite and Infinite sets, Uncountably infinite sets,
• Principle of inclusion and exclusion, multisets .
Proposition
• Proposition: It is basic building block of logic.
Definition: A statement or proposition is a declarative sentence that is either
True (T) or False (F), but not both.
Example:
1. It is raining
2. 1 + 1 = 2
3. Do you study everyday?
4. 5 – x = 4
5. Listen to me.
Proposition
• Proposition: letters are used to denote propositions. Some conventional
letters are p,q,r,s,….
Example:
1. p: It is raining
2. q: 1 + 1 = 2
3. r: Do you study everyday?
4. s: 5 – x = 4
5. a: Listen to me.
Producing new Proposition
• Producing new proposition: new propositions can be produced from
those we already have.
• These methods were discussed by English mathematician George Boole
in 1854 in his book of Thelaw of thought
• New propositions are called compound propositions
• Compound propositions are formed from existing propositions using
logical operators.
Truth Table
• Truth Table: Truth table displays the relationship between the truth
values of propositions.
• It determine truth values of propositions constructed from simpler
propositions
Negation of Proposition
• Negation of Proposition: if 𝑝 is the statement, the negation of 𝒑 is the
statement not 𝒑 , denoted by ~𝒑.
• Sometimes ¬𝒑 , 𝒑
• ~𝒑: “it is not the case that 𝑝”
Example:
𝒑: “it is Friday” ~𝒑: “it is not Friday”
This proposition is true on rainy Fridays and is false on any day that is not
Friday and on Fridays when it does not rain.
Disjunction of Proposition
• Disjunction of Proposition: if 𝑝 and 𝑞 are statements, the disjunction of
𝒑 or 𝒒 is the compound statement 𝒑 or 𝒒 , denoted by 𝒑 ∨ 𝒒.
Example:
𝒑: “Today is Friday” and 𝒒: “It is raining today”
Truth table for disjunction of Proposition
𝒑 𝒒 𝒑 ∨𝒒
T T T
T F T
F T T
F F F
This proposition is true on any day that is either Friday or Rainy day. It is only
false on days that are not Friday when it is also does not rain.
Implication of Proposition
• Implication of Proposition: if 𝑝 and 𝑞 are statements, the compound
statement "𝒑 then 𝒒" , denoted by 𝒑 → 𝒒, is called conditional
statement or implication.
• The statement 𝒑 is called antecedent or hypothesis and 𝒒 is called
consequent or conclusion.
• A useful of way to remember that an implication is true when its
hypothesis is false is to think of a contrast or an obligation.
• If condition specified by such statement is false, no obligation is in
force.
Implication of Proposition
• Because implication arise in many places in mathematical reasoning, a wide
variety of terminology is used to express 𝑝 → 𝑞.
• Some of common ways of expressing the implication are:
o “if 𝑝, then 𝑞”
o “𝑝, implies 𝑞”
o “if 𝑝, 𝑞”
o “𝑝 only if 𝑞”
o “𝑝 is sufficient for 𝑞”
o “𝑞 if 𝑝”
o “𝑞 whenver 𝑝”
o “𝑞 is necessary for 𝑝”
Implication of Proposition
Example:
𝒑: “Today is Friday” and 𝒒: “It is raining today”
This proposition is true on any day that is either Friday or Rainy day. It is
only false on days that are not Friday when it is also does not rain.
Implication of Proposition
Example:
𝒑: “2+2=4” and 𝒒: “x:=x+1”
if ‘x=0’ before this statement encountered?
Solution:
Since 2+2=4 is true, the assignment statement x:=x+1 is executed.
Hence x has the value 0+1=1 after this statement is encountered
Related Implication of Propositions
• There are some related implications that can be formed from 𝒑 → 𝒒
Solution:
The converse is “if I have a test today, then today isThursday”
A B C D E
𝒑 𝒒 𝑝 ∧𝑞 ¬𝑝 (𝑝 ∧ 𝑞) ∨ ¬𝑝
T T T F T
T F F F F
F T F T T
F F F T T
More examples on Compound Proposition
Example 1: (𝑝 → 𝑞) ↔ (¬𝑞 → ¬𝑝
)
Example 2: 𝑝 → (¬𝑞 ∨ 𝑟)
Example 3: (𝑝 → 𝑞) ∨ (¬𝑝 → 𝑟
) Example 4:(𝑝 → 𝑞) ∧ (¬𝑝 →
𝑟) Example 5:(𝑝 → 𝑞) ↔ (𝑞
→ 𝑝)
Syllabus
• Propositional Logic
• Applications of Propositional Logic
• Propositional Equivalences
• Predicates and Quantifiers
• Nested Quantifiers
• Rules of Inference
• Introduction to Proofs
• Proof Methods and Strategy Sets
• Combination of sets
• Venn Diagrams
• Finite and Infinite sets, Uncountably infinite sets,
• Principle of inclusion and exclusion, multisets .
Applications of Propositional Logic
• Translating English Sentences
• System Specifications
• Boolean Searches
• Logic Puzzles
• Logic Circuits
Translating English Sentences
• Why it is required
• Toremove ambiguity
• Manipulate expressions ( easy in logical sentences)
• Able to solve puzzles
• Example: Youare not allowed to drive vehicle if your age is less than 18
years or you have no age proof.
Translating English Sentences
• Example:
Youare not allowed to drive vehicle if your age is less than 18 years or
you have no age proof
Step-1: Find the connectives which are connecting two propositions
together
Step-2: Rename the propositions
Let: q: “you are allowed to drive vehicle”
r: “ your age is less than 18”
s: “you have age proof”
Translating English Sentences
• Example:
Youare not allowed to drive vehicle if your age is less than 18 years or
you have no age proof.
Step-1: Find the connectives which are connecting two propositions
together
Step-2: Rename the propositions
Let: q: “you are allowed to drive vehicle”
r: “ your age is less than 18”
s: “you have age proof”
(𝑟 ∨ ¬𝑠) → 𝑞
System Specifications
• Translating sentences in natural language(such as English) into logical
expressions is required for hardware and software system.
• Example: Express the specification
• The automated reply cannot be sent when the file system is full.
Consistent System Specifications
• A list of propositions is consistent if it is possible to assign truth values
to the proposition variables, so that each proposition is true.
Consistent System Specifications
• Example: Are these propositions consistent
[Link] diagnostic message is stored in the buffer or it is retransmitted.
[Link] diagnostic message is not stored in the buffer
[Link] diagnostic message is stored in the buffer, then it is retransmitted
If p-diagnostic message is stored in the buffer
q-diagnostic message is retransmitted
Consistent System Specifications
• Solution: Are these propositions consistent
[Link] diagnostic message is stored in the buffer or it is retransmitted (
𝑝 ∨ 𝑞).
2. The diagnostic message is not stored in the buffer (¬𝑝)
[Link] diagnostic message is stored in the buffer, then it is retransmitted
(p → 𝑞)
If p-diagnostic message is stored in the buffer
q-diagnostic message is retransmitted
When p is false and q is true, all statements are true
So, the specification is consistent.
Consistent System Specifications
• Solution: Are these propositions consistent
[Link] diagnostic message is stored in the buffer or it is retransmitted (
𝑝 ∨ 𝑞).
2. The diagnostic message is not stored in the buffer (¬𝑝)
[Link] diagnostic message is stored in the buffer, then it is retransmitted
(p → 𝑞)
4. The diagnostic message is not transmitted
If p-diagnostic message is stored in the buffer
q-diagnostic message is retransmitted
• Propositional Logic
• Applications of Propositional Logic
• Propositional Equivalences
• Predicates and Quantifiers
• Nested Quantifiers
• Rules of Inference
• Introduction to Proofs
• Proof Methods and Strategy Sets
• Combination of sets
• Venn Diagrams
• Finite and Infinite sets, Uncountably infinite sets,
• Principle of inclusion and exclusion, multisets .
Tautology, Contradiction and Contingency
• Tautology: A compound proposition is always true, no matter what the
truth values of propositions that occur in it, is called tautology.
• Contradiction: A compound proposition is always false, is called
contradiction.
• Contingency : A compound proposition is that is neither a tautology nor a
contradiction is called contingency.
Tautology, Contradiction and Contingency
Example: Tautology and Contradiction of (𝑝 ∨ ¬𝑝) and (𝑝 ∧ ¬𝑝)
Tautology Contradiction
𝒑 ¬𝑝 (𝑝 ∨¬𝑝) (𝑝 ∧ ¬𝑝)
T F T F
F T T F
Logical Equivalence
• Logical Equivalent: Compound propositions that have the same
truth values in all possible cases are called Logical Equivalent.
Example: The proposition 𝑝 and 𝑞 are called logically equivalent if
(𝑝 ↔ 𝑞) is tautology.
𝒑 𝒒 𝒑 ↔𝒒
T T T
T F F
F T F
F F T
Logical Equivalence
• Logical Equivalent: one way to determine whether two propositions are
equivalent is to use truth table.
Example: Show that ¬ 𝑝 ∨ 𝑞 and (¬𝑝 ∧ ¬𝑞) are logically
equivalent.
A B C D E F G
𝒑 𝒒 𝑝 ∨𝑞 ¬ 𝑝 ∨𝑞 ¬𝑝 ¬𝑞 (¬𝑝 ∧ ¬𝑞)
T T T F F F F
T F T F F T F
F T T F T F F
F F F T T T T
Logical Equivalence
A B C D E
𝒑 𝒒 ¬𝑝 (¬𝑝 ∨ 𝑞) (𝑝 → 𝑞)
T T F T T
T F F F F
F T T T T
F F T T T
More examples on Equivalence
Example 1: (𝑝 ∨ 𝑞 ∧ 𝑟 𝑎𝑛𝑑 (𝑝 ∨ 𝑞) ∧ (𝑝 ∨ 𝑟)
Example 2: 𝑝 → 𝑞 𝑎𝑛𝑑 (¬𝑞 → ¬𝑝)
Example 3: 𝑝 ∨ 𝑞 𝑎𝑛𝑑 (𝑞 ∨𝑝)
Example 4: 𝑝 → 𝑞 𝑎𝑛𝑑 (¬𝑝 ∨𝑞)
Example 5: ¬𝑝 ∨ (¬𝑝 ∧ 𝑞 )𝑎𝑛𝑑 (¬𝑝 ∧¬𝑞)
Example 6: show that 𝑎𝑛𝑑 (𝑝 ∧ 𝑞) ↔ 𝑝 ∨ 𝑞 is tautology
Syllabus
• Propositional Logic
• Applications of Propositional Logic
• Propositional Equivalences
• Predicates and Quantifiers
• Nested Quantifiers
• Rules of Inference
• Introduction to Proofs
• Proof Methods and Strategy Sets
• Combination of sets
• Venn Diagrams
• Finite and Infinite sets, Uncountably infinite sets,
• Principle of inclusion and exclusion, multisets .
Predicates
• Predicates: Sometimes because of involving variables such as “x>3”,
“x=y=5” can not predict truth value of statement suchas true or false.
• The statement “x is greater than 3” has two parts.
• The first part is variable ‘x’ subject of statement
• Second part is ‘is greater than 3’predicate (property of subject)
• Notation: 𝑷(𝒙)
where, Pdenote predicate ‘is greater than 3’
x is a variable
• Once value is assigned to ‘x’, the statement 𝑃 (𝑥) becomes a
proposition and has a truth value.
Predicates
• Example: Let 𝑃 (𝑥) denote statement “x>5”, what are truth values of P(1)
and P(10).
• P(1) : 1 > 5 False
• P(10) : 10 > 5 True
• Example: Let 𝑃(𝑥, y) denote statement “x=y+5”, what are truth values of
P(6,1) and P(10,5).
• P(6,1) : 6= 5+1 True
• P(10,5) : 10 =5+ 5 True
• Example: Let 𝑃(𝑥, y, z) denote statement “x+y=z”, what are truth values of
P(1,2,3).
• P(1,2,3) : 1 +2=3 True
Predicates
• Statement of form P(x1, x2, x3… xn) is the value of proposition function
Pat the n-tuple (x1, x2, x3… xn) and Pis called as predicate.
• Propositional Logic
• Applications of Propositional Logic
• Propositional Equivalences
• Predicates and Quantifiers
• Nested Quantifiers
• Rules of Inference
• Introduction to Proofs
• Proof Methods and Strategy Sets
• Combination of sets
• Venn Diagrams
• Finite and Infinite sets, Uncountably infinite sets,
• Principle of inclusion and exclusion, multisets .
Nested Quantifier
• When quantifier is used on the variable 𝑥 or when we assign a value
to this variable, the occurrence of variable is bound.
• An occurrence of a variable is not bound by quantifiers or set to
particular value is said to be free.
• All variables that occur in propositional function must be bound to turn
into proposition.
• This can be done using combination of universal quantifiers, existential
quantifiers and value assignment.
• In such case, order of quantifiers is important.
Nested Quantifier
• Question: let 𝑃(𝑥, y) be the statement “x+y=y+x”. What is truth value
of quantification ∀x∀𝑦𝑃(𝑥, y) ?
• Answer: for all real numbers 𝑥 and y, it is true that “x+y=y+x”. Hence
truth value is TRUE
Nested Quantifier
• Question: let 𝑃(𝑥, y) be the statement “x+y=0”. What is truth value of
quantification ∃y∀x𝑃(𝑥, y) and ∀x∃𝑦𝑃(𝑥, y) ?
• Propositional Logic
• Applications of Propositional Logic
• Propositional Equivalences
• Predicates and Quantifiers
• Nested Quantifiers
• Rules of Inference
• Introduction to Proofs
• Proof Methods and Strategy Sets
• Combination of sets
• Venn Diagrams
• Finite and Infinite sets, Uncountably infinite sets,
• Principle of inclusion and exclusion, multisets .
Rules of Inferences
• An argument in propositional logic is sequence of propositions.
• All but the final propositions in the argument are called premises and
final proposition is called conclusion.
• An argument is valid if the truth of all premises implies that the
conclusion is true.
Rules of Inferences
• Example:
• “if you have a current password, then you can log onto network”
𝑃: “if you have a current password”
Therefore
𝑄: “you can log onto network”
𝑃 →𝑄 (𝑃 ∧ P → 𝑄 ) → 𝑄 Modus Ponens
𝑃
-
𝑄
Rules of Inferences
𝑃 → ( P → 𝑄 ∧ Q → 𝑅) → P → 𝑅 Hypothetical Syllogism
𝑄 Q
→𝑅
-
𝑃 →𝑅
Rules of Inferences
𝑃 →𝑄 ( P ∧𝑄 ) → 𝑃 Simplification
-
𝑃
Rules of Inferences
𝑃 ( P) ∧ ( 𝑄 ) → (P ∧ 𝑄 ) Conjunction
𝑄
-
P ∧𝑄
Rules of Inferences
• Example:
• State which rule of inference is the basis of the following argument.
“it is freezing and raining. Therefore, it is freezing ”
• Example:
• State which rule of inference is the basis of the following
argument.
“if it rains today, then we will not have barbecue today. If we do
not have a barbecue today, then we will have a barbecue
tomorrow. Therefore, if it rains today, then we will have a barbecue
tomorrow”
Rules of Inferences : Example
“ Raja works hard”, “If Raja works hard, then he is a dull boy” and “If Raja is
a dull boy then he will not get the job”
We need to conclude that “Raja will not get the job”
• Solution:
• H-Raja works hard
• D-Raja is a dull boy
• J-Raja will get the job
[Link] work hard –H
[Link] Raja works hard, then he is a dull boy : H→D
[Link] Raja is a dull boy then he will not get the job: D → ¬J
There are three premises and one conclusion. Solve any two premises at a
time.
Rules of Inferences : Example
• If we solve first two (H and H → D), we will get D ( By using Modus
Pones rule)
• Then we can solve D and third premise (D → ¬ J), we will get ~J ( By
using Modus Pones rule)
• ¬ J – “Raja will not get the job”
Rules of Inferences : Exercise
• “ If it does not rain or it is not foggy, then sailing race will be held and
life saving demo will go on”
• “If the sailing race is held, then the trophy will be awarded”
•“The trophy was not awarded”
Conclusion: It rained
Rules of Inferences : Exercise
Show that the premises
• “It is not sunny this afternoon and it is colder than yesterday,”
• “We will go swimming only if it is sunny,”
• “If we do not go swimming, then we will take a canoe trip,” and
• “If we take a canoe trip, then we will be home by sunset”
conclusion “We will be home by sunset”
Rules of Inferences : Exercise
• Show that the premises
• “If you send me an e-mail message, then I will finish writing the
program,”
• “If you do not send me an e-mail message, then I will go to sleep
early,” and
• “If I go to sleep early, then I will wake up feeling refreshed”
• conclusion “If I do not finish writing the program, then I will wake up
feeling refreshed.”
Syllabus
• Propositional Logic
• Applications of Propositional Logic
• Propositional Equivalences
• Predicates and Quantifiers
• Nested Quantifiers
• Rules of Inference
• Introduction to Proofs
• Proof Methods and Strategy Sets
• Combination of sets
• Venn Diagrams
• Finite and Infinite sets, Uncountably infinite sets,
• Principle of inclusion and exclusion, multisets .
Introduction to Proofs
Solve it mathematically
• n=2x--------n is even
• n2 = 4 x2 = 2(2 x2) =2a------- n2 is even
(¬Q → ¬P)
Hence P → Q (By logical equivalence)
Proof by Contrapositive
Method : Exercise
• Example: If x,y belongs to integers such that x, y is odd then x and y
are odd
• Example: Prove that, P- if 3n+2 is odd, Q-n is odd, by method of
contrapositive
Proof by Contradiction
Method
• p→ q
• We assume that q is false. (¬q is true)
• Contradiction: This can happen only when ¬q is false---implies q must
be true.
Proof by Contradiction
Method
• Example:
• p:3n+2 is odd, q: n is odd
• p->q
• Assume q is false----(¬q) ----n is even
• (3n+2)=3(2k)+2=6k+2=2(3k+1)=2a-----(3n+2) is even