Introduction
Propositional logic treats "every prime greater than 2 is odd" as one indivisible proposition. It cannot see the structure inside: the objects (numbers), the properties (prime, odd) and the word "every". First-order logic (predicate logic) adds exactly these: variables that range over a domain, predicates that describe properties and relations of objects, and the quantifiers "for all" and "there exists".
First-order logic is the language of mathematical definitions (limits, asymptotic notation, injectivity), of database queries (tuple relational calculus is a fragment of it), and of program specifications. The working skills are translation between English and formulas, the effect of quantifier order, negation of quantified statements, and deciding which formulas are valid.
Prerequisites
- Propositional Logic: connectives, equivalences, validity.
- Sets: domains, membership, subsets.
Core concepts
Predicates, domain, and quantifiers
- The domain of discourse (universe) is the non-empty set of objects variables can take. The truth of a quantified statement depends on .
- A predicate or becomes a proposition once its variables are given values in . Example: : "" over the integers; is true.
- Universal quantifier: is true if is true for every .
- Existential quantifier: is true if is true for at least one .
- Uniqueness: abbreviates .
Over a finite domain :
This is the bridge between first-order and propositional reasoning, and a reliable way to test a claim on a small domain.
Domain convention. Domains are always non-empty here (the standard convention). Under it, is valid; over an empty domain it would fail.
Free and bound variables, scope
In , the variable is bound by , whose scope is the parenthesised formula; is free. A formula with no free variables is a sentence and has a truth value once the domain and the meaning of the predicates (an interpretation) are fixed.
Precedence: quantifiers bind more tightly than all connectives, so means , and the second is free. Write the parentheses explicitly when the scope should extend.
Restricted quantifiers: the two standard patterns
| English | Formula | Wrong version (and why) |
|---|---|---|
| Every student is enrolled | : says everything is a student | |
| Some student is enrolled | : true if any non-student exists |
Rule: goes with ; goes with .
Negating quantifiers (De Morgan for quantifiers)
Negation moves inward, flipping each quantifier it passes and finally negating the matrix:
For restricted forms: ("some student is not enrolled"), and ("no student is enrolled").
Order of quantifiers
Quantifiers of the same kind commute: and . Quantifiers of different kinds generally do not:
- with : "" over the integers: "every integer has a larger integer". True; may depend on .
- : "some integer is larger than every integer". False (take ).
The valid direction is
and the converse is not valid. A single witness that works for all certainly provides a for each , but not the other way round.

Distribution of quantifiers over connectives
| Statement | Status |
|---|---|
| Equivalence | |
| Equivalence | |
| One direction only | |
| One direction only | |
| One direction only | |
| One direction only |
Counterexample for the converse of row 3: domain , true only at 1, true only at 2. Every element satisfies , but neither nor holds everywhere.
When does not occur free in :
The last two need care: moving a quantifier out of the antecedent of an implication flips it. ( relies on the domain being non-empty.)
Validity, satisfiability and interpretations
A sentence is valid if it is true in every interpretation (every non-empty domain and every meaning of the predicates), satisfiable if true in at least one, and unsatisfiable if true in none. To show a sentence is not valid, give one interpretation that makes it false. To show it is valid, argue for an arbitrary interpretation.
Unlike propositional logic, validity in first-order logic cannot in general be decided by any algorithm (Church and Turing). On short problems, small counter-models are the practical tool.
Rules of inference with quantifiers
| Rule | From | Infer | Condition |
|---|---|---|---|
| Universal instantiation | any | ||
| Universal generalisation | arbitrary, with no special assumption | ||
| Existential instantiation | a new name not used before | ||
| Existential generalisation | some |
Universal modus ponens: from and , infer . Example: "All primes greater than 2 are odd; 7 is a prime greater than 2; so 7 is odd."
Worked examples
Example 1: translation
Domain: people. : " loves ".
| English | Formula |
|---|---|
| Everybody loves somebody | |
| There is somebody whom everybody loves | |
| Nobody loves everybody | |
| Everybody loves exactly one person |
Example 2: negation
Let be the domain of , with an accumulation point of . Negate “for every there is such that for all , ”:
This is precisely "the limit of at is not " (see Limits). The implication becomes a conjunction, as .
Example 3: test a claimed equivalence on a small domain
Claim: .
Domain , true exactly when . Left side: for choose , for choose : true. Right side: fails at , fails at : false. The claim is false. Over the possible relations on , the left side is true for 9 of them and the right side for 7, and every relation that makes the right side true also makes the left side true.
Example 4: which is valid?
Is valid?
Try to falsify. Need true and false, so is false everywhere; and need true. Domain , true, false, false everywhere: at , is . Antecedent true, consequent false: not valid. Compare with the valid sentence .
Important properties and observations
- The truth of a quantified sentence depends on the domain: is true over the integers and false over the natural numbers (with , if includes 0, or otherwise).
- , never the reverse in general.
- distributes over ; distributes over . The other two combinations hold in one direction only.
- Moving a quantifier out of the antecedent of flips it.
- is valid only because domains are non-empty.
- Renaming a bound variable preserves meaning only with capture-avoiding substitution. A safe rule is to choose a completely fresh variable , absent both free and bound from , and replace just the occurrences bound by the displayed : . More generally, must be free for in and absent from its free variables; alpha-rename conflicting inner binders first.
GATE examination perspective
- Translation MCQs and MSQs. Check that each option keeps the restricted-quantifier rule ( with , with ).
- Negation. Push inward one quantifier at a time; convert to .
- "Which of the following is valid?" Build a two-element counter-model. For implications, make the antecedent true and the consequent false.
- Quantifier swap trap. and differ; only holds.
- Database link. Relational calculus queries with "for all" (division-style queries) are usually written as .
Summary
Sources
- K. H. Rosen, Discrete Mathematics and Its Applications, 7th ed., McGraw-Hill, 2012: Sections 1.4 (Predicates and Quantifiers), 1.5 (Nested Quantifiers) and 1.6 (Rules of Inference).