7.3 First-Order Validity, Semantic Tableaux & Prenex Normal Form
π‘ Core Intuition: The 3-Second Mental Modelβ
π³ The Everyday Analogy: Compiling High-Level Code to Assemblyβ
Think of advanced first-order logic like compiler parsing and intermediate code generation:
- First-Order Validity (Universal Truth across All Universes): In propositional logic, a tautology is true across a finite table of rows. In predicate logic, a valid formula must be true across every conceivable universeβwhether the universe has 1 element, 5 elements, or an infinite continuum of numbers!
- Prenex Normal Form (Hoisting Quantifiers): Just as JavaScript hoists variable declarations
var x, yto the top of a function scope, Prenex Normal Form (PNF) pulls all quantifiers () out to the very front of the formula (), leaving a clean, flat, quantifier-free logic circuit (the Matrix) behind. - The 4 Quantifier Inference Rules:
- Universal Instantiation (UI): If a law applies to all citizens, it applies to Bob.
- Universal Generalization (UG): If you proved a theorem for an arbitrary generic triangle without special assumptions, it holds for all triangles!
- Existential Instantiation (EI): If a crime witness exists, name them "Witness X" (a fresh name not already used in court).
- Existential Generalization (EG): If Bob solved the bug, then someone solved the bug!
π» Bridging to Computer Science: SMT Solvers, Skolemization & Undecidabilityβ
In computer systems:
- Skolemization in SMT Solvers (Z3, CVC5): Before automated theorem provers can check first-order assertions, they convert formulas to PNF and replace existential variables with Skolem functions.
- GΓΆdel vs Church-Turing: GΓΆdel proved that first-order logic is Complete (every valid formula can be proven in finite steps). But Alonzo Church and Alan Turing proved it is Undecidableβno algorithm can exist that halts and decides whether an arbitrary first-order formula is valid (Entscheidungsproblem)!
πTable of Contents
- ποΈ Interpretations, Validity & Satisfiability
- π The Master 10-Case Quantifier Distribution Matrix
- πͺ Null Quantification Laws (Variable x Free of A)
- π¦ Prenex Normal Form (PNF) Conversion
- βοΈ The Four Quantifier Rules of Inference
- π Step-by-Step Worked Examples
- π― Exam & Interview Pitfall Check
ποΈ Interpretations, Validity & Satisfiabilityβ
In propositional logic, an evaluation is simply an assignment of True or False to atomic letters. In First-Order Logic (FOL), an evaluation requires an entire mathematical universe called an Interpretation.
An Interpretation for a first-order language consists of:
- A non-empty set called the Domain (or Universe).
- An assignment that maps:
- Each constant symbol to a concrete element in .
- Each -ary function symbol to a mapping .
- Each -ary predicate symbol to a relation .
Classifications:
- Valid (Universal Tautology): A formula is valid if it evaluates to True in every possible interpretation over every possible domain .
- Satisfiable: A formula is satisfiable if there exists at least one interpretation under which evaluates to True.
- Unsatisfiable (Contradiction): A formula is unsatisfiable if it evaluates to False in every interpretation.
π The Master 10-Case Quantifier Distribution Matrixβ
A classic question in competitive examinations (GATE) tests whether quantifiers distribute across , , and :
- Full Equivalences ():
- Universal over Conjunction: .
- Existential over Disjunction: .
- One-Way Semi-Distributive Implications ():
- Existential over Conjunction is one-way: .
- Universal over Disjunction is one-way: .
- Universal over Implication is one-way: .
Master 10-Case Quantifier Distribution Reference Tableβ
| Index | Premise Form | Consequent Form | Validity Status | Mathematical Justification / Counterexample Valuation |
|---|---|---|---|---|
| 1 | Valid () | Full Distributivity: Witness for or suffices for both sides | ||
| 2 | Valid () | Converse of Case 1 is strictly valid | ||
| 3 | Valid () | If single element satisfies both, separate witnesses trivially exist | ||
| 4 | INVALID | Counterexample: Over , = even, = odd (Separate witnesses exist, but no number is both!) | ||
| 5 | Valid () | If all are (or all are ), then every element is | ||
| 6 | INVALID | Counterexample: Over , every integer is even or odd, but not all are even nor all odd! | ||
| 7 | Valid () | Full Distributivity: Conjunction holds for all iff each holds for all | ||
| 8 | Valid () | Converse of Case 7 is strictly valid | ||
| 9 | Valid () | If holds everywhere, then all forces all | ||
| 10 | INVALID | Counterexample: Let be False (antecedent vacuously True), but for some element |
πͺ Null Quantification Laws (Variable x Free of A)β
Let be a formula in which variable does NOT occur as a free variable:
- Conjunction & Disjunction (Zero Quantifier Shift):
- Implication with Quantifier in Consequent (No Flip):
- Implication with Quantifier in Antecedent (QUANTIFIER FLIPS!):
Algebraic Proof of the Antecedent Flip:
By Quantifier De Morgan: :
π¦ Prenex Normal Form (PNF) Conversionβ
A first-order formula is in Prenex Normal Form (PNF) if it is structured as:
where:
- Each is a quantifier (the Prefix).
- is a completely quantifier-free propositional logic formula (the Matrix).
The 4-Step Prenex Normal Form (PNF) Conversion Algorithm
Standardized procedure to hoist all quantifiers to the leftmost prefix
Eliminate Conditionals & Biconditionals
Replace a β b with Β¬a β¨ b and a β b with (Β¬a β¨ b) β§ (Β¬b β¨ a).
Push Negations Inward (NNF)
Apply De Morgan's laws: Β¬βx P(x) β‘ βx Β¬P(x) and Β¬βx P(x) β‘ βx Β¬P(x).
Standardize Variables Apart (Alpha-Conversion)
Rename dummy variables so every quantifier binds a unique variable name (e.g., βx P(x) β¨ βx Q(x) βΉ βx P(x) β¨ βy Q(y)).
Hoist Quantifiers to the Prefix
Apply Null Quantification laws to pull all quantifiers to the left of the expression.
βοΈ The Four Quantifier Rules of Inferenceβ
To extend propositional natural deduction to First-Order Logic, we introduce four formal quantifier rules:
The 4 Quantifier Inference Rules
Formal derivation rules bridging quantified formulas and individual instances
Universal Instantiation (UI)
βx P(x) β’ P(c)- From βx P(x), deduce P(c) for ANY arbitrary element or constant c in the domain.
- Zero restrictions: if a property holds for all elements, it holds for c.
- Example: 'All humans are mortal' βΉ 'Socrates is mortal'.
Universal Generalization (UG)
P(c) β’ βx P(x)- From P(c), deduce βx P(x), provided c is an ARBITRARY, generic element.
- Restriction: c must NOT appear in any prior un-discharged premises or hypotheses!
- Standard method of mathematical proof: 'Let c be an arbitrary integer...'.
Existential Instantiation (EI)
βx P(x) β’ P(c)- From βx P(x), deduce P(c) for a BRAND NEW constant symbol c.
- Strict Restriction: c must be a FRESH constant that has NEVER appeared anywhere earlier in the proof!
- Intuition: Name the unknown witness c; do not assume c is someone already known.
Existential Generalization (EG)
P(c) β’ βx P(x)- From P(c) for a known specific element c, deduce βx P(x).
- Zero restrictions: if c has the property, then at least one such element exists.
- Example: '7 is prime' βΉ 'There exists a prime number'.
π Step-by-Step Worked Examplesβ
Example 1: Converting a First-Order Formula to Prenex Normal Formβ
Problem Statement: Convert the formula into Prenex Normal Form (PNF).
Step-by-Step Solution:
-
Step 1: Eliminate the implication ()
- Apply :
-
Step 2: Push negations inward using Quantifier De Morgan
- Negate :
- The expression becomes:
-
Step 3: Standardize variables apart
- The quantified variables are and . They are already distinct! No renaming needed.
-
Step 4: Hoist quantifiers using Null Quantification
- Variable does not appear in , and variable does not appear in .
- Hoist :
- Hoist :
- Prefix: . Matrix: .
Key Takeaway: An implication with in the antecedent converts into an existential prefix () in PNF due to the negation of the antecedent!
Example 2: Formal Deductive Proof in First-Order Logicβ
Problem Statement: Prove the classic syllogism using first-order inference rules:
- "All men are mortal":
- "Socrates is a man":
- Prove: "Socrates is mortal":
Step-by-Step Solution:
| Step | Formal Expression | Rule of Inference Applied |
|---|---|---|
| 1 | Premise 1 | |
| 2 | Premise 2 | |
| 3 | Universal Instantiation (UI) on Step 1 with | |
| 4 | Modus Ponens on Steps 2 and 3 |
The conclusion is derived cleanly in 4 formal steps.
Example 3: Disproving an Invalid Quantifier Implicationβ
Problem Statement: Prove that is INVALID by constructing a formal interpretation counterexample.
Step-by-Step Solution:
- Choose Domain: Let .
- Assign Predicates:
- Let and .
- Let and .
- Evaluate the Antecedent: :
- .
- Since the hypothesis is False, the antecedent is vacuously True ()!
- Evaluate the Consequent: :
- For : (False!).
- Thus, is False!
- Conclusion:
- Under this interpretation, while .
- Therefore, the implication is INVALID!
π― Exam & Interview Pitfall Checkβ
Question 1: Is First-Order Logic decidable? Key Focus Points: No! By Church's Theorem and Turing's Undecidability Theorem (1936), First-Order Logic is semi-decidable (recursively enumerable), but NOT decidable. If a formula is valid, a resolution refutation will eventually find a proof in finite time. But if a formula is invalid, an automated prover may loop forever without halting!
Question 2: Why does Existential Instantiation (EI) require a fresh, unused constant symbol? Key Focus Points: If is known, using an existing constant (say, ) assumes that the witness is an already-known entity. For example, if you know "Someone committed the robbery" () and you instantiate it with "Alice" without evidence, you have falsely accused Alice! A fresh symbol (e.g., ) guarantees that no prior assumptions pollute the witness.
Trap 1: Forgetting that Why it fails: When pulling a quantifier out of the antecedent of an implication, students often leave it as . Because , the negation flips to ! Pulling quantifiers across the left side of ALWAYS inverts the quantifier!
Trap 2: Renaming variables carelessly during PNF conversion Why it fails: In , hoisting without renaming produces , where the inner illegally shadows the outer . You must always standardize variables apart first: .