Predicate Logic
This chapter introduces predicate logic, a fundamental extension of propositional logic essential for formalizing statements with variables and quantifiers. Mastery of these concepts is crucial for advanced topics in discrete mathematics, artificial intelligence, and formal verification, and frequently tested in CMI examinations.
---
Chapter Contents
|
| Topic |
|---|-------| | 1 | Predicates and Quantifiers | | 2 | Negation of Quantified Statements |---
We begin with Predicates and Quantifiers.
Part 1: Predicates and Quantifiers
Predicate logic extends propositional logic by allowing us to represent properties of individuals and relationships between them, enabling a more granular analysis of statements relevant to computer science and mathematics. This unit provides the foundational concepts for constructing and interpreting quantified statements.
---
Core Concepts
1. Predicates (Atomic Formulas)
A predicate is a property or relation involving variables that becomes a proposition (true or false) when specific elements are assigned to these variables or when the variables are quantified.
A predicate is a statement containing variables, which becomes a proposition when values are substituted for the variables.
Worked Example:
Let be the predicate " is an even number" and be the predicate " is greater than ". We want to express specific propositions using these predicates.
Step 1: Express "5 is an even number".
>
Step 2: Express "10 is greater than 7".
>
Answer: and
:::question type="MCQ" question="Given the predicate meaning ' loves ', and the domain of discourse being all people. Which of the following correctly represents the statement 'Alice loves Bob'?" options=["","","",""] answer="" hint="Identify the specific individuals and their roles in the relation." solution="The predicate means ' loves '. To express 'Alice loves Bob', Alice takes the role of and Bob takes the role of . Therefore, the correct representation is ."
:::
---
2. Universal Quantifier ()
The universal quantifier, denoted by , is used to express that a predicate holds for all elements in a given domain of discourse.
Worked Example:
Translate the English sentence "All students are intelligent" into predicate logic. Let the domain of discourse be all people. Let be " is a student" and be " is intelligent".
Step 1: Identify the quantifier and the main assertion.
The sentence states that if someone is a student, then they are intelligent. This applies to all people.
Step 2: Formulate the logical expression.
>
Answer:
:::question type="MCQ" question="Let be ' is a cat' and be ' is a mammal'. The domain of discourse is all animals. Which expression correctly translates 'All cats are mammals'?" options=["","","",""] answer="" hint="The statement 'All A are B' is generally translated as . Consider the implication." solution="The statement 'All cats are mammals' means that for any animal, if it is a cat, then it must be a mammal. This is a universal statement requiring an implication.
correctly captures this meaning.
would mean 'Some cats are mammals'.
would mean 'Every animal is both a cat and a mammal', which is incorrect.
would mean 'There exists an animal such that if is a cat, then is a mammal', which is trivially true (e.g., pick a non-cat)."
:::
---
3. Existential Quantifier ()
The existential quantifier, denoted by , is used to express that a predicate holds for at least one element in a given domain of discourse.
Worked Example:
Translate the English sentence "Some birds can fly" into predicate logic. Let the domain of discourse be all animals. Let be " is a bird" and be " can fly".
Step 1: Identify the quantifier and the relationship.
The sentence states that there is at least one animal that is a bird and can fly.
Step 2: Formulate the logical expression.
>
Answer:
:::question type="MCQ" question="Let be ' is a prime number' and be ' is an even number'. The domain of discourse is integers. Which expression correctly translates 'There is an even prime number'?" options=["","","",""] answer="" hint="The statement implies the existence of a number that satisfies both properties simultaneously. Consider using conjunction." solution="The statement 'There is an even prime number' means that there exists at least one number that is both prime and even. This requires an existential quantifier and a conjunction.
correctly captures this meaning. (The number 2 is such a number).
would mean 'All prime numbers are even', which is false.
would mean 'All numbers are prime and even', which is false.
would mean 'There exists a number such that if is prime, then is even', which is trivially true (e.g., pick , which is not prime, so is false, making the implication true)."
:::
---
4. Free and Bound Variables
Variables in predicate logic can be either free or bound. A variable is bound if it falls within the scope of a quantifier; otherwise, it is free.
In a formula, an occurrence of a variable is bound if it is within the scope of a quantifier or . An occurrence is free if it is not bound by any quantifier.
Worked Example:
Identify the free and bound variables in the formula .
Step 1: Identify the quantifiers and their scopes.
The first quantifier is . Its scope is .
The second quantifier is . Its scope is .
Step 2: Determine which variables are bound by each quantifier.
- In , the variable is bound by . The variable is not bound by (the binds a different in a different part of the formula).
- In , the variable in is bound by .
- The variable is not bound by any quantifier.
- Bound variables: (bound by ), (bound by within ).
- Free variables: (in ), .
:::question type="MCQ" question="In the formula , which variables are free?" options=["","","",""] answer="" hint="Trace the scope of each quantifier. A variable is free if it is not within the scope of any quantifier binding it." solution="Let's analyze the formula :
Therefore, the variable in is free, and is free. The variables (in ) and (in ) are bound. The question asks for free variables.
Wait, I made a mistake in the analysis for the in . The variable in is not bound by any quantifier in this specific formula. The only affects . Therefore, in is free.
Corrected analysis:
- binds in .
- binds in .
- The in is not bound by any quantifier.
- The in is not bound by any quantifier.
So, the free variables are (from ) and .
Looking at the options, only '' includes both.
Let's re-evaluate the solution based on the options. The options seem to imply a single variable, or a combination. The option '' is available.
Let's re-check the question carefully: "which variables are free?"
In :
- in is bound by .
- in is not bound by any quantifier. It is free.
- in is bound by .
- in is not bound by any quantifier. It is free.
Thus, the free variables are and .
The correct option is "". I need to be careful with the solution explanation to reflect this accurately.
Let's refine the solution:
The formula is .
The free variables in the formula are (from ) and .
"
The correct answer is "". My reasoning was correct, just a momentary doubt.
"
Solution:
The formula is .
Thus, the free variables in the formula are and .
"
This is good.
---
Proceeding to Negation of Quantified Statements.
---
Part 2: Negation of Quantified Statements
This section covers the essential rules for negating statements involving universal () and existential () quantifiers, a fundamental skill in predicate logic for CMI examinations. We focus on direct application through worked examples.
---
Core Concepts
1. Negating Universal Statements
We define the negation of a universally quantified statement by transforming it into an existentially quantified statement where the predicate is negated.
Worked Example: Negate the statement: "All CMI students are proficient in discrete mathematics."
Step 1: Translate the statement into predicate logic.
Let be the domain of CMI students.
Let be the predicate " is proficient in discrete mathematics."
The statement is .
Step 2: Apply the negation rule.
>
Step 3: Translate the negated statement back into natural language.
The negation is "There exists a CMI student such that is not proficient in discrete mathematics."
Answer: There exists a CMI student who is not proficient in discrete mathematics.
:::question type="MCQ" question="Which of the following is the correct negation of the statement: 'Every integer is such that '?" options=["There exists an integer such that .","Every integer is such that .","There exists an integer such that .","Every integer is such that . "] answer="There exists an integer such that ." hint="Identify the quantifier and the predicate, then apply the negation rule." solution="Step 1: Identify the original statement's structure.
The statement is .
Here, is the predicate .
Step 2: Apply the rule for negating a universal quantifier.
Step 3: Negate the predicate .
The negation of is .
Step 4: Combine to form the negated statement.
This translates to: 'There exists an integer such that .'"
:::
---
2. Negating Existential Statements
We define the negation of an existentially quantified statement by transforming it into a universally quantified statement where the predicate is negated.
Worked Example: Negate the statement: "Some programming languages support multiple inheritance."
Step 1: Translate the statement into predicate logic.
Let be the domain of programming languages.
Let be the predicate " supports multiple inheritance."
The statement is .
Step 2: Apply the negation rule.
>
Step 3: Translate the negated statement back into natural language.
The negation is "For all programming languages , does not support multiple inheritance."
Answer: All programming languages do not support multiple inheritance (or, no programming language supports multiple inheritance).
:::question type="MCQ" question="What is the negation of the statement: 'There exists a real number such that '?" options=["For all real numbers , .","For all real numbers , .","There exists a real number such that .","There is no real number such that . "] answer="For all real numbers , ." hint="Recall the negation rules for existential quantifiers." solution="Step 1: The original statement is .
Let be the predicate .
Step 2: Apply the negation rule for existential quantifiers:
Step 3: Negate the predicate .
The negation of is .
Step 4: Combine to form the negated statement.
This translates to: 'For all real numbers , .'"
:::
---
3. Negating Multiply Quantified Statements
We apply the negation rules sequentially from left to right, moving the negation symbol past each quantifier and negating the predicate at the end.
Worked Example 1: Negate the statement: "For every natural number , there exists a natural number such that ." (Every natural number has a successor).
Step 1: Translate to predicate logic.
Let be the predicate .
The statement is .
Step 2: Apply the negation rule for the first quantifier ().
>
Step 3: Apply the negation rule for the second quantifier ().
>
Step 4: Negate the predicate .
The negation of is .
Step 5: Combine and translate back.
>
Answer: There exists a natural number such that for all natural numbers , . (This statement claims there is a largest natural number, which is false but correctly formed).
Worked Example 2: Negate the statement: "There exists a real number such that for every real number , ." (The set of real numbers is bounded).
Step 1: Translate to predicate logic.
Let be the predicate .
The statement is .
Step 2: Apply the negation rule for the first quantifier ().
>
Step 3: Apply the negation rule for the second quantifier ().
>
Step 4: Negate the predicate .
The negation of is .
Step 5: Combine and translate back.
>
Answer: For every real number , there exists a real number such that . (This statement claims that for any proposed bound, there's a real number larger than it, correctly reflecting that real numbers are unbounded).
:::question type="MCQ" question="Consider the statement: 'For every positive integer , there exists a positive integer such that .' Which of the following is its correct negation?" options=["There exists a positive integer such that for every positive integer , .","For every positive integer , for every positive integer , .","There exists a positive integer such that there exists a positive integer such that .","For every positive integer , there exists a positive integer such that ."] answer="There exists a positive integer such that for every positive integer , ." hint="Apply the negation rules for multiple quantifiers sequentially from left to right." solution="Step 1: Translate the original statement into predicate logic.
Let the domain be positive integers ().
The statement is .
Let be the predicate .
Step 2: Apply the negation operator to the entire statement.
Step 3: Move the negation past the first quantifier ().
Step 4: Move the negation past the second quantifier ().
Step 5: Negate the predicate .
The negation of is .
Step 6: Combine and translate back into natural language.
This translates to: 'There exists a positive integer such that for every positive integer , .'"
:::
---
Advanced Applications
We can apply these rules to more complex logical expressions involving multiple predicates and propositional connectives within the quantified scope.
Worked Example: Negate the statement: "For every student , if studies diligently, then will pass the exam."
Step 1: Translate to predicate logic.
Let be the domain of students.
Let be " studies diligently."
Let be " will pass the exam."
The statement is .
Step 2: Apply the negation rule for the universal quantifier.
>
Step 3: Apply the negation rule for implication.
Recall that .
Here, and .
>
Step 4: Translate back into natural language.
Answer: There exists a student such that studies diligently AND will not pass the exam.
:::question type="MSQ" question="Which of the following statements are logically equivalent to the negation of 'There exists a program such that for every input , terminates for AND produces the correct output for '?" options=["For every program , there exists an input such that does not terminate for OR does not produce the correct output for .","For every program , there exists an input such that does not terminate for AND does not produce the correct output for .","It is not the case that there exists a program such that for every input , terminates for AND produces the correct output for .","For every program , there exists an input such that does not terminate for OR produces the correct output for ."] answer="For every program , there exists an input such that does not terminate for OR does not produce the correct output for .,It is not the case that there exists a program such that for every input , terminates for AND produces the correct output for ." hint="Negate quantifiers and then apply De Morgan's laws for the conjunction." solution="Step 1: Translate the original statement into predicate logic.
Let be ' terminates for '.
Let be ' produces the correct output for '.
The statement is .
Step 2: Apply the negation operator.
Step 3: Move the negation past the first quantifier ().
Step 4: Move the negation past the second quantifier ().
Step 5: Apply De Morgan's Law to negate the conjunction.
Recall that .
Here, and .
Step 6: Translate back to natural language.
'For every program , there exists an input such that does not terminate for OR does not produce the correct output for .'
Option 1 matches this derived negation. Option 3 is simply the original statement prefixed with 'It is not the case that', which is always logically equivalent to its negation by definition."
:::
---
Problem-Solving Strategies
When negating a quantified statement, systematically move the negation symbol from left to right across each quantifier and logical connective:
- Quantifiers: and .
- Connectives:
- Predicates: Finally, negate the innermost predicate.
(De Morgan's)
(De Morgan's)
---
Common Mistakes
β Students often negate the quantifier but forget to negate the predicate.
Example: Negating 'All birds can fly' as 'Some birds can fly' (incorrect).
β
The correct approach is to negate both the quantifier AND the predicate.
Correct: 'There exists a bird that cannot fly.'
The negation of is , not .
β Misapplying De Morgan's laws within the predicate.
Example: Negating 'There exists such that ' as 'For all , '. (Incorrectly applies De Morgan's and changes OR to AND).
β
The correct approach is to apply De Morgan's laws:
Correct: 'For all , '.
---
Practice Questions
:::question type="MCQ" question="Which of the following is the correct negation of the statement: 'Every person has a unique best friend'?" options=["There exists a person who does not have a unique best friend.","There exists a person who has multiple best friends.","Every person has at least two best friends.","No person has a best friend."] answer="There exists a person who does not have a unique best friend." hint="First, formalize the original statement carefully, then apply the negation rules." solution="Step 1: Formalize the original statement.
Let mean ' is 's best friend'.
'Every person has a unique best friend ' can be written as:
Step 2: Apply negation.
Step 3: Move negation inwards.
Using :
Now negate :
Using :
So, the full negation is:
Step 4: Interpret the negation.
This means 'There exists a person such that for all , either is not 's best friend, OR there exists another person who is also 's best friend and is not (i.e., has multiple best friends), OR has no best friend at all (if no satisfies ).
This simplifies to: 'There exists a person who does not have a unique best friend.' This covers cases where a person has no best friend or multiple best friends."
:::
:::question type="NAT" question="Let be the predicate ' divides '. Consider the statement: 'For every integer , there exists an integer such that and '. If the domain is all non-zero integers, how many quantifiers change their type (from universal to existential or vice versa) when this statement is negated?" answer="2" hint="Apply the negation rules systematically." solution="Step 1: Formalize the original statement.
Let the domain be non-zero integers ().
The statement is .
Step 2: Apply negation to the statement.
Step 3: Move negation inwards.
Step 4: Quantifier changes:
The first quantifier changed from to . (1 change)
The second quantifier changed from to . (1 change)
Total changes = 2.
Step 5: Complete the negation (not required for the question, but useful for verification).
Negate the conjunction using De Morgan's:
In words: 'There exists a non-zero integer such that for every non-zero integer , does not divide or .'
The number of quantifiers that changed their type is 2."
:::
:::question type="MCQ" question="The negation of 'There is a computer science student who has taken every course in the curriculum' is:" options=["Every computer science student has not taken every course in the curriculum.","Every computer science student has taken at least one course not in the curriculum.","For every computer science student, there exists a course in the curriculum that they have not taken.","There is a computer science student who has not taken any course in the curriculum."] answer="For every computer science student, there exists a course in the curriculum that they have not taken." hint="Identify the quantifiers and predicates, then apply the negation rules sequentially." solution="Step 1: Formalize the original statement.
Let be the set of computer science students.
Let be the set of courses in the curriculum.
Let be the predicate ' has taken '.
The statement is .
Step 2: Apply negation.
Step 3: Move negation past the first quantifier ().
Step 4: Move negation past the second quantifier ().
Step 5: Translate back into natural language.
'For every computer science student , there exists a course in the curriculum that has not taken.'
This matches the third option."
:::
:::question type="MSQ" question="Let be a binary relation on a set . Consider the statement: 'For every , there exists such that and '. Which of the following are equivalent to the negation of this statement?" options=["There exists such that for every , or .","There exists such that for every , if then .","For every , for every , or .","There exists such that for every , it is not true that ."] answer="There exists such that for every , or .,There exists such that for every , if then .,There exists such that for every , it is not true that ." hint="Apply negation rules for quantifiers and then De Morgan's laws for the conjunction. Remember that ." solution="Step 1: Formalize the original statement.
Let be and be .
The statement is .
Step 2: Apply negation.
Step 3: Move negation inwards.
Step 4: Apply De Morgan's Law to negate the conjunction.
Step 5: Translate back and check options.
is .
is .
So the negation is: 'There exists such that for every , or .' This matches Option 1.
Let's check other options:
Option 2: 'There exists such that for every , if then .'
Recall that . So, 'if then ' is equivalent to ' or '.
Thus, Option 2 is equivalent to Option 1 and is also correct.
Option 3: 'For every , for every , or .'
This statement starts with , which is incorrect as our negation starts with . So, Option 3 is incorrect.
Option 4: 'There exists such that for every , it is not true that .'
This is literally the step before applying De Morgan's. Thus, this is also equivalent to the negation and is correct.
Therefore, Options 1, 2, and 4 are correct."
:::
---
Summary
|
| Concept | Expression |
|---|-----------------------------|----------------------------------------------------| | 1 | Negation of Universal | | | 2 | Negation of Existential | | | 3 | Negation of | | | 4 | Negation of | | | 5 | Negation of Implication | | | 6 | De Morgan's Law 1 | | | 7 | De Morgan's Law 2 | |---
What's Next?
This topic connects to:
- Proof Techniques: Understanding negation is crucial for proofs by contradiction and contrapositive, where negating statements correctly is the first step.
- Set Theory: Quantified statements are often used to define properties of sets (e.g., injectivity, surjectivity), and their negations describe when these properties do not hold.
- Formal Verification: In computer science, specifying system properties often involves quantified statements, and negating them helps identify counterexamples or violations.
Chapter Summary
Predicates: Generalize propositions by introducing variables, allowing for open statements whose truth value depends on the assignment of values to variables from a specified domain.
Quantifiers: Universal () and Existential () quantifiers bind variables in predicates, transforming them into propositions with definite truth values.
Domain of Discourse: Crucial for interpreting quantified statements, as it defines the set of all possible values for the variables, directly impacting the truth value.
Negation Rules: Fundamental for logical manipulation: and . These rules extend to nested quantifiers by applying them iteratively.
Nested Quantifiers: Used to express complex relationships involving multiple variables, requiring careful attention to their order and scope for correct interpretation.
Logical Equivalence: Understanding when two quantified statements are logically equivalent is vital for simplifying expressions, performing proofs, and verifying arguments.
Chapter Review Questions
:::question type="MCQ" question="Which of the following is logically equivalent to the negation of the statement ?" options=["", "", "", ""] answer="" hint="Apply De Morgan's laws for quantifiers and propositional logic equivalences step-by-step." solution="Let the given statement be .
We need to find .
Therefore, the equivalent statement is ."}
:::
:::question type="NAT" question="Let the domain of discourse be the set of integers . Consider the predicate defined as ''. How many elements in satisfy the predicate ?" answer="7" hint="List the integers in the domain whose square is less than 10." solution="We need to find integers in such that .
Let's test values:
* (satisfies)
* (satisfies)
* (satisfies)
* (satisfies)
* (does not satisfy)
* (does not satisfy)
The integers satisfying are .
There are 7 such elements."}
:::
:::question type="MCQ" question="Let be 'x is a student', be 'y is a course', and be 'x is taking y'. Which of the following predicate logic statements correctly translates the English sentence: 'Every student is taking at least one course'?" options=["", "", "", ""] answer="" hint="Break down the sentence: 'Every student...' suggests a universal quantifier over students. '...is taking at least one course' suggests an existential quantifier over courses, connected with 'taking'." solution="Let's analyze the English sentence: 'Every student is taking at least one course'.
'Every student': This implies a universal quantifier over students. So, . The implication is used because we are talking about if x is a student, then* something follows.
'...is taking at least one course': For each student, there exists some course they are taking. So, . Here, we use conjunction because the student must be taking a course (C(y)) AND that specific course* (T(x,y)).
Combining these, we get .
Let's look at why other options are incorrect:
: This means 'For every x, there exists a y such that x is a student AND y is a course AND x is taking y'. This falsely implies that everything* in the domain is a student, or that if x is a student, then it is necessarily taking a course AND for every x and y, x is a student and y is a course. The implication for 'every student' is lost.
: This translates to 'There exists a course y such that for every x, if x is a student and y is a course, then x is taking y'. This means there is one specific course that all students* are taking, which is not what the original sentence says.
* : This means 'For every x, x is a student AND there exists a y such that if y is a course, then x is taking y'. The initial conjunction means that every element in the domain must be a student, which is incorrect. Also, for the existential part is not the correct formulation for 'taking at least one course'."}
:::
What's Next?
Having mastered predicate logic, you've established a robust foundation for advanced logical reasoning. This chapter's concepts directly underpin the formal proofs and deductive systems explored in subsequent chapters on Proof Techniques and Set Theory. A strong grasp here will also significantly aid in understanding Boolean Algebra and its applications in digital logic and computer science, where precise logical statements are paramount.