We have previously discussed propositional logic, such as “Zakaria is a student”, which is a statement that is either true or false. In programming and advanced mathematics, we need logic that can handle variables, like “x is a prime number”. We can’t say whether it is true or false until we put in a value for x.
1. Predicates
Predicate (Propositional Function): a statement containing variables that becomes a true or false proposition once the variables are assigned values. It is written as P(x).
The Subject and the Predicate
- The Subject (x): the variable acting as a placeholder.
- The Predicate (P): the property, action, or characteristic assigned to the subject.
Example: Let P(x) be “x² > 0”.
Domain of Discourse
The Domain of Discourse is the exact set of values that x can take for the predicate.
For example, if your domain is “all positive integers”, then x can be 1, 2, 3, … but it cannot be −5, 0.5, or a “laptop”.
Note: if a maths textbook does not define the domain, it is assumed to be all real numbers (any number on the number line).
Unary Predicates (One Variable)
Let P(x) be the statement: “x is an even number.”
- Plug in 4: P(4) becomes “4 is an even number” → True
- Plug in 7: P(7) becomes “7 is an even number” → False
N-ary Predicates (Multiple Variables)
Predicates can have more than one variable. A predicate with two variables is a binary predicate, for example:
Let Q(x, y) be “x + y = 10”.
- Q(3, 7): “3 + 7 = 10”
- 10 = 10, so LHS = RHS → True
2. Quantifiers
In language, a quantifier is a word placed before a noun to show amount or quantity, such as “some” or “many” (many cookies, some water).
In discrete maths, we are concerned with two special quantifiers:
| Quantifier | Symbol | Meaning |
|---|---|---|
| Universal | ∀ (an upside-down “A”) | “For all” / “for every”. The property is true for every value in the domain. |
| Existential | ∃ (a backwards “E”) | “There exists”. The property is true for at least one value in the domain. |
The Existential Quantifier in Detail
Logical notation: ∃x P(x)
The rule: this statement is True if you can find at least one element in the domain of discourse where P(x) is true. It is only False if you test the entire domain and zero elements work.
Example
- Domain: all real numbers
- Predicate: let P(x) be “x² = 9”
- Symbolic form: ∃x P(x)
- English translation: “There exists a number x such that x² = 9.”
- Truth value: True, since x = 3 satisfies P(3).
3. De Morgan’s Laws for Quantifiers (Negation)
Negating a quantified statement flips the quantifier (∀ becomes ∃ and vice versa) and negates the inner predicate.
Negating a Universal Quantifier
¬(∀x P(x)) ≡ ∃x ¬P(x)
English intuition: “Not everyone likes pizza” means “There is at least one person who does not like pizza.”
Negating an Existential Quantifier
¬(∃x P(x)) ≡ ∀x ¬P(x)
English intuition: “There does not exist a flying pig” means “Every pig does not fly” (no pig can fly).
Quick Summary
| Statement | True when | False when |
|---|---|---|
| ∀x P(x) | P(x) is true for every x in the domain | There is at least one x where P(x) is false |
| ∃x P(x) | There is at least one x where P(x) is true | P(x) is false for every x in the domain |












