In our last lesson, we built the foundation of logical reasoning by translating statements into symbolic form using propositions and connectives. We saw that a proposition must be definitively true or false. However, this left us unable to handle statements like "x is an even number," whose truth depends on the value of the variable x.
This lesson builds directly on that foundation by introducing the tools to handle such statements. We will explore quantifiers, the logical concepts corresponding to phrases like "for all" and "there exists." By the end of this lesson, you will be able to determine the truth value of these more complex, quantified statements and, crucially for proofs and debugging, you will be able to write their precise negations.
From Open Sentences to Quantified Statements
A statement with a variable, like , is often called a predicate or an open sentence. It's "open" because its truth value is not fixed until we specify the value of x. Quantifiers are the tools that "close" the sentence, turning it into a full-fledged proposition.
There are two fundamental quantifiers:
- The Universal Quantifier (), which means "for all" or "for every." The statement asserts that is true for every possible value of
xin our domain of consideration. - The Existential Quantifier (), which means "there exists" or "for some." The statement asserts that there is at least one value of
xin our domain for which is true.
This first video provides a clear introduction to open sentences and shows how these two quantifiers transform them into statements with definite truth values.
Quantified statements (Screencast 2.4.1)
Please watch the segments that define open sentences and then introduce the existential and universal quantifiers.
Start by watching the explanation of an open sentence. Next, see how the existential quantifier (there exists, ∃) turns an open sentence into a statement. Finally, watch the introduction of the universal quantifier (for all, ∀).
The Importance of the Domain
When we say "for all x" or "there exists an x," we implicitly assume x comes from a specific collection of possible values. This collection is called the domain or universe of discourse. The truth of a quantified statement can change dramatically depending on its domain.
For instance, consider the statement "There exists an x such that ."
- If the domain is the set of real numbers (), the statement is true (since is a solution).
- If the domain is the set of integers (), the statement is false (since is not an integer).
The following reading explains the role of the domain and how to determine the truth value of quantified statements.
These sections define the domain and show with clear examples how it affects a statement's truth value. It also introduces the formal terms "predicate" and "truth set."
Focus on the definition of a domain. Then, work through the examples under Domain and Statements to see how changing the domain from integers (\mathbb{Z}) to real numbers (\mathbb{R}) alters the outcome. Finally, read the definitions of a predicate and its truth set.
Determining Truth Values: Examples and Counterexamples
Now that we have the concepts of quantifiers and domains, how do we systematically determine if a statement is true or false? The strategy depends on the quantifier.
- To show a universal statement is true, you must show is true for every single element in the domain. This often requires a formal proof, which we will cover in the next module.
- To show a universal statement is false, you only need to find one single element in the domain for which is false. This element is called a counterexample.
- To show an existential statement is true, you only need to find one single element in the domain for which is true. This element is called an example or a witness.
- To show an existential statement is false, you must show is false for every single element in the domain.
The following screencast walks through this logic with several good examples.
Quantified statements (Screencast 2.4.1)
This part of the video demonstrates how to find examples and counterexamples to determine the truth of quantified statements.
Watch the examples from the beginning of this section. Notice how for universal statements that are false, a single counterexample is sufficient (like x = 5), while for existential statements that are true, a single example is all that's needed (like x = 9).
Let's apply this to a cybersecurity context. Imagine D is the set of user accounts on a network server.
- The statement
∀x ∈ D, HasMFA(x)means "All users have multi-factor authentication enabled." To prove this false, a security auditor just needs to find one counterexample: a single account without MFA. - The statement
∃x ∈ D, IsAdmin(x) ∧ LastLogin(x) > 365 daysmeans "There is an administrator account that hasn't been used in over a year." To prove this is true, an auditor would search for just one such dormant, high-privilege account.
Negating Quantified Statements
Being able to negate a quantified statement is a critical skill. It's essential for a proof technique called "proof by contradiction," and it helps clarify what it means for a security policy or a program specification to fail.
The rules for negation are elegant and can be seen as an extension of De Morgan's laws:
-
The negation of a universal statement is an existential statement.
¬() is equivalent to
In words: "It is not the case that all x satisfy P" is the same as "There exists an x that does not satisfy P." -
The negation of an existential statement is a universal statement.
¬() is equivalent to
In words: "There does not exist an x that satisfies P" is the same as "For all x, they do not satisfy P."
The next video gives a fantastic intuition for why these rules work and provides a simple trick for applying them.
PREDICATE LOGIC and QUANTIFIER NEGATION - DISCRETE MATHEMATICS
This video explains the rules for negating quantifiers and demonstrates the process.
Watch the section on negating quantifiers. The key idea is thinking of ∀ as a giant AND operation and ∃ as a giant OR. This connects the negation rules directly back to De Morgan's laws from our previous lesson. Then, watch the final example where a more complex statement is negated step-by-step.
To solidify this, here is a textual summary of the rules.
This section from the Runestone Academy text provides a concise summary and examples of quantifier negation.
Read the short subsection on negation. Pay special attention to the summary in Table 3.8.7, as it lays out the two fundamental equivalences you need to remember.
A Note on Multiple Quantifiers
Statements can involve multiple variables and quantifiers. When quantifiers are of the same type (e.g., all ∀ or all ∃), their order doesn't matter.
However, when you mix quantifiers, order is critical. The statement ∀x ∃y, P(x,y) is very different from ∃y ∀x, P(x,y).
Let the domain be integers and P(x,y) be the predicate x < y.
∀x ∃y, x < y: "For every integerx, there exists an integerythat is greater thanx." This is true. (For anyx, we can choosey = x + 1).∃y ∀x, x < y: "There exists an integerythat is greater than every integerx." This is false. (There is no "largest integer").
When you read these, it's helpful to "peel the onion" from the outside in, as the next reading suggests.
This section explains the crucial difference in meaning when the order of mixed quantifiers is changed.
Start at the subsection on multiple quantifiers. Focus on the paragraph that begins "When existential and universal quantifiers are mixed" and the "Tips on Reading" that follow it. This section explains how to decipher these complex statements.
Conclusion
In this lesson, we have extended our logical vocabulary to include quantified statements. This allows us to reason about properties that apply to entire domains of objects, which is fundamental to both mathematics and computer science.
Here are the main takeaways:
- Quantifiers ( for "for all," for "there exists") turn predicates (open sentences) into propositions with definite truth values.
- The domain of discourse is the set of values a variable can take, and it is essential for determining a statement's truth.
- A universal statement () is proven false with a single counterexample. An existential statement () is proven true with a single example.
- Negating quantifiers involves flipping the quantifier and negating the predicate inside: ¬∀ becomes ∃¬, and ¬∃ becomes ∀¬.
- For mixed quantifiers, order matters.
We have spent the first two lessons building the language of logic. In the next lesson, we will turn our attention to the objects these logical statements describe: sets. You have already seen domains like the set of integers or real numbers . We will now study sets formally, learning how to combine and manipulate them with operations like union, intersection, and difference.