Lably
Skip to content

Second-order logic

Form of logic that allows quantification over predicates

  • 17 min read
  • 9 chapters

Related on Lably

Through Logic, Mathematics and Propositional logic

First-order logic quantifies only variables that range over individuals (elements of the domain of discourse); second-order logic, in addition, quantifies over relations. For example, the second-order sentence ∀P∀x(Px∨¬Px) says that for every formula P, and every individual x, either Px is true or not(Px) is true (this is the law of excluded middle). Second-order logic also includes quantification over sets, functions, and other variables (see section below). Both first-order and second-order logic use the idea of a domain of discourse (often called simply the "domain" or the "universe"). The domain is a set over which individual elements may be quantified.

Examples

First-order logic can quantify over individuals, but not over properties. That is, we can take an atomic sentence like Cube(b) and obtain a quantified sentence by replacing the name with a variable and attaching a quantifier:

∃xCube(x)

However, we cannot do the same with the predicate. That is, the following expression:

∃PP(b)

is not a sentence of first-order logic, but this is a legitimate sentence of second-order logic. Here, P is a predicate variable and is semantically a set of individuals.

As a result, second-order logic has greater expressive power than first-order logic. For example, there is no way in first-order logic to identify the set of all cubes and tetrahedrons. But the existence of this set can be asserted in second-order logic as:

∃P∀x(Px↔(Cube(x)∨Tet(x))).

We can then assert properties of this set. For instance, the following says that the set of all cubes and tetrahedrons does not contain any dodecahedrons:

∀P(∀x(Px↔(Cube(x)∨Tet(x)))→¬∃x(Px∧Dodec(x))).

Second-order quantification is especially useful because it gives the ability to express reachability properties. For example, if Parent(x, y) denotes that x is a parent of y, then first-order logic cannot express the property that x is an ancestor of y. In second-order logic we can express this by saying that every set of people containing y and closed under the Parent relation contains x:

∀P((Py∧∀a∀b((Pb∧Parent(a,b))→Pa))→Px).

It is notable that while we have variables for predicates in second-order logic, we don't have variables for properties of predicates. We cannot say, for example, that there is a property Shape(P) that is true for the predicates P Cube, Tet, and Dodec. This would require third-order logic.

Definition of equality

Objects are defined to be equal when they share all properties. In second-order logic, this can be expressed regardless of the type of objects we study and without the need to add any special treatment for equality to the logic as follows:

∀a∀b(a=b↔(∀P(P(a)↔P(b))))

Mathematical induction

In first-order logic, the induction axiom of Peano arithmetic is actually stated as a schema for generating an infinite collection of first-order axioms. But in second-order logic, it can be expressed concisely as a single axiom:

∀P((P(0)∧∀n(P(n)→P(n+1)))→∀nP(n))

Sign in to keep reading

8 more chapters are free with a Lably account.

More in Foundations