First-Order Predicate Calculus
While propositional logic serves as the foundation for logical reasoning, it is insufficient for describing the internal structure of mathematical statements. Propositional logic treats sentences as atomic units, whereas First-Order Logic (FOL), or Predicate Calculus, allows us to analyze the relationships between objects, their properties, and the scope of those assertions. FOL is the standard language of modern mathematics and set theory.
The Formal Alphabet of First-Order Logic
A first-order language is defined by its signature, which consists of:
- Variables: Symbols like that range over a domain.
- Constants: Specific names for objects in the domain, e.g., or .
- Functions: Symbols that map objects to other objects, e.g., or .
- Predicates (Relations): Symbols that represent properties or relationships, e.g., or .
- Logical Connectives: .
- Quantifiers: (Universal) and (Existential).
Well-Formed Formulas (WFFs)
The syntax of FOL is defined by recursive rules.
- Terms are variables, constants, or functions applied to terms.
- Atomic Formulas are predicates applied to terms, e.g., .
- Formulas are built from atomic formulas using connectives and quantifiers.
A Sentence is a formula with no free variables. For example, is a sentence in the language of arithmetic, whereas is a formula with two free variables.
Semantics: Interpretations and Structures
The “truth” of a first-order formula depends on its Interpretation (or Model). An interpretation consists of:
- A Domain (Universe) : A non-empty set of objects.
- Mapping Functions: Each constant is assigned an element . Each -ary function is assigned a mapping .
- Mapping Relations: Each -ary predicate is assigned a subset .
A formula is satisfied by an interpretation if it evaluates to true under that specific mapping. If a sentence is true in every possible interpretation, it is called Valid (the FOL analogue of a tautology).
Quantificational Inference Rules
Deduction in FOL requires specific rules for handling quantifiers:
- Universal Instantiation (UI): If is true, then is true for any constant in the domain.
- Universal Generalization (UG): If is proven for an arbitrary (with no assumptions on ), then is true.
- Existential Generalization (EG): If is true for some constant , then is true.
- Existential Instantiation (EI): If is true, we can “name” that element , provided is a new constant not appearing elsewhere in the proof.
The Power of Identity
Most mathematical systems include the Identity Predicate (). The axioms for identity are:
- Reflexivity: .
- Substitution: .
These axioms allow us to define the “Uniqueness Quantifier” ():
Limitations and Higher-Order Logic
First-order logic is powerful because of the Completeness Theorem (proven by Kurt Gödel): any formula that is logically valid (true in all models) is provable in the formal system. However, it has limitations, such as the Löwenheim-Skolem Theorem, which states that if a first-order theory has an infinite model, it has models of every infinite cardinality. This means FOL cannot uniquely “pin down” the structure of the real numbers . To describe properties like “every non-empty set of reals bounded above has a least upper bound,” we would need Second-Order Logic, where we can quantify over sets of elements.
Modeling Predicate Logic in Code
In computational logic, we often use Unification and Resolution to handle predicates. We can represent a simple knowledge base and query it.
type Entity = string;
type Predicate = (e: Entity) => boolean;
const Domain: Entity[] = ["Socrates", "Plato", "Aristotle", "Man"];
const isMan: Predicate = (e) => ["Socrates", "Plato", "Aristotle"].includes(e);
const isMortal: Predicate = (e) => isMan(e); // Axiom: ∀x (Man(x) ⇒ Mortal(x))
// Universal Check: ∀x (Man(x) ⇒ Mortal(x))
const checkUniversal = () => {
return Domain.every(x => !isMan(x) || isMortal(x));
};
// Existential Check: ∃x (Man(x) ∧ Mortal(x))
const checkExistential = () => {
return Domain.some(x => isMan(x) && isMortal(x));
};
console.log(`Universal validity: ${checkUniversal()}`);
console.log(`Existential validity: ${checkExistential()}`);
Exercise
Which of the following is the correct negation of the statement ∀x ∃y P(x, y)?
While this code snippet is a trivial discrete simulation, it illustrates how predicates function as boolean-valued functions over a domain of discourse. In pure mathematics, the domains are often uncountable, requiring symbolic proof rather than exhaustive checking.