Second-order logic

Syntax and Semantics

Reading preferences

Optional display controls need JavaScript. All reading content and navigation work without it.

Source file content/second-order-logic/syntax-and-semantics/syntax-and-semantics.tex

Editorial

Basic syntax and semantics for SOL covered so far. As a chapter it's too short. Substitution for second-order variables has to be covered to be able to talk about derivation systems for SOL, and there's some subtle issues there.

Source file content/second-order-logic/syntax-and-semantics/introduction.tex

Introduction

In first-order logic, we combine the non-logical symbols of a given language, i.e., its constant symbols, function symbols, and predicate symbols, with the logical symbols to express things about first-order structures. This is done using the notion of satisfaction, which relates a structure M\Struct{M}source, together with a variable assignment sssource, and a formula A!Asource: M,sA\Sat{M}{!A}[s]source holds iff what A!Asource expresses when its constant symbols, function symbols, and predicate symbols are interpreted as M\Struct{M}source says, and its free variables are interpreted as sssource says, is true. The interpretation of the identity predicate =\eqsource is built into the definition of M,sA\Sat{M}{!A}[s]source, as is the interpretation of \lforallsource and \lexistssource. The former is always interpreted as the identity relation on the domain |M|\Domain{M}source of the structure, and the quantifiers are always interpreted as ranging over the entire domain. But, crucially, quantification is only allowed over elements of the domain, and so only object variables are allowed to follow a quantifier.

In second-order logic, both the language and the definition of satisfaction are extended to include free and bound function and predicate variables, and quantification over them. These variables are related to function symbols and predicate symbols the same way that object variables are related to constant symbols. They play the same role in the formation of terms and formulas of second-order logic, and quantification over them is handled in a similar way. In the standard semantics, the second-order quantifiers range over all possible objects of the right type (nnsource-place functions from |M|\Domain{M}source to |M|\Domain{M}source for function variables, nnsource-place relations for predicate variables). For instance, while v0(P01(v0)¬P01(v0))\lforall[\Obj{v_0}][(\Obj{P^1_0}(\Obj{v_0}) \lor \lnot \Obj{P^1_0}(\Obj{v_0}))]source is a formula in both first- and second-order logic, in the latter we can also consider V01v0(V01(v0)¬V01(v0))\lforall[\Obj{V^1_0}][\lforall[\Obj{v_0}][(\Obj{V^1_0}(\Obj{v_0}) \lor \lnot \Obj{V^1_0}(\Obj{v_0}))]]source and V01v0(V01(v0)¬V01(v0))\lexists[\Obj{V^1_0}][\lforall[\Obj{v_0}][(\Obj{V^1_0}(\Obj{v_0}) \lor \lnot \Obj{V^1_0}(\Obj{v_0}))]]source. Since these contain no free variables, they are sentences of second-order logic. Here, V01\Obj{V^1_0}source is a second-order 11source-place predicate variable. The allowable interpretations of V01\Obj{V^1_0}source are the same that we can assign to a 11source-place predicate symbol like P01\Obj{P^1_0}source, i.e., subsets of |M|\Domain{M}source. Quantification over them then amounts to saying that v0(V01(v0)¬V01(v0))\lforall[\Obj{v_0}][(\Obj{V^1_0}(\Obj v_0) \lor \lnot \Obj{V^1_0}(v_0))]source holds for all ways of assigning a subset of |M|\Domain{M}source as the value of V01\Obj{V^1_0}source, or for at least one. Since every set either contains or fails to contain a given object, both are true in any structure.

Source file content/second-order-logic/syntax-and-semantics/terms-formulas.tex

Terms and formula

Like in first-order logic, expressions of second-order logic are built up from a basic vocabulary containing variables, constant symbols, predicate symbols and sometimes function symbols. From them, together with logical connectives, quantifiers, and punctuation symbols such as parentheses and commas, terms and formulas are formed. The difference is that in addition to variables for objects, second-order logic also contains variables for relations and functions, and allows quantification over them. So the logical symbols of second-order logic are those of first-order logic, plus:

  1. A denumerables set of second-order relation variables of every arity nnsource: V0n\Obj V_0^nsource, V1n\Obj V_1^nsource, V2n\Obj V_2^nsource, dots

  2. A denumerables set of second-order function variables: u0n\Obj u_0^nsource, u1n\Obj u_1^nsource, u2n\Obj u_2^nsource, dots

Just as we use xxsource, yysource, zzsource as meta-variables for first-order variables vi\Obj v_isource, we'll use XXsource, YYsource, ZZsource, etc., as metavariables for Vin\Obj V_i^nsource and uusource, vvsource, etc., as meta-variables for uin\Obj u_i^nsource.

Explain

The non-logical symbols of a second-order language are specified the same way a first-order language is: by listing its constant symbols, function symbols, and predicate symbols.

In first-order logic, the identity predicate =\eqsource is usually included. In first-order logic, the non-logical symbols of a language L\Lang{L}source are crucial to allow us to express anything interesting. There are of course sentences that use no non-logical symbols, but with only =\eqsource it is hard to say anything interesting. In second-order logic, since we have an unlimited supply of relation and function variables, we can say anything we can say in a first-order language even without a special supply of non-logical symbols.

Definition of second order terms

[Second-order Terms] The set of second-order terms of L\Lang Lsource, Trm2(L)\TrmSOL[L]source, is defined by adding to the definition of first order terms the clause

  1. If uusource is an nnsource-place function variable and t1t_1source, dots, tnt_nsource are terms, then u(t1,,tn)\Atom{u}{t_1, \ldots, t_n}source is a term.

Explain

So, a second-order term looks just like a first-order term, except that where a first-order term contains a function symbol fin\Obj{f^n_i}source, a second-order term may contain a function variable uin\Obj{u^n_i}source in its place.

Definition of second order formulas

[Second-order formula] The set of second-order formulas Frm2(L)\FrmSOL[L]source of the language L\Lang Lsource is defined by adding to the definition of first order formulas the clauses

  1. If XXsource is an nnsource-place predicate variable and t1t_1source, dots, tnt_nsource are second-order terms of L\Lang Lsource, then X(t1,,tn)\Atom{X}{t_1,\ldots, t_n}source is an atomic formula.

    tagitemprvAllIf A!Asource is a formula and uusource is a function variable, then uA\lforall[u][!A]source is a formula.

    tagitemprvAllIf A!Asource is a formula and XXsource is a predicate variable, then XA\lforall[X][!A]source is a formula.

    tagitemprvExIf A!Asource is a formula and uusource is a function variable, then uA\lexists[u][!A]source is a formula.

    tagitemprvExIf A!Asource is a formula and XXsource is a predicate variable, then XA\lexists[X][!A]source is a formula.

Source file content/second-order-logic/syntax-and-semantics/satisfaction.tex

Satisfaction

Explain

To define the satisfaction relation M,sA\Sat{M}{!A}[s]source for second-order formulas, we have to extend the definitions to cover second-order variables. The notion of a structure is the same for second-order logic as it is for first-order logic. There is only a difference for variable assignments sssource: these now must not just provide values for the first-order variables, but also for the second-order variables.

Second order variable assignments

[Variable Assignment] A variable assignment sssource for a structure M\Struct{M}source is a function which maps each

  1. object variable vi\Obj{v_i}source to an element of |M|\Domain Msource, i.e., s(vi)|M|s(\Obj{v_i}) \in \Domain{M}source

  2. nnsource-place relation variable Vin\Obj{V_i^n}source to an nnsource-place relation on |M|\Domain{M}source, i.e., s(Vin)|M|ns(\Obj{V_i^n}) \subseteq \Domain{M}^nsource;

  3. nnsource-place function variable uin\Obj{u_i^n}source to an nnsource-place function from |M|\Domain{M}source to |M|\Domain{M}source, i.e., s(uin):|M|n|M|s(\Obj{u_i^n})\colon \Domain{M}^n \to \Domain{M}source;

Explain

A structure assigns a value to each constant symbol and function symbol, and a second-order variable assignment assigns objects and functions to each object and function variable. Together, they let us assign a value to every term.

Value of a function variable application

[value of a Term] If ttsource is a term of the language L\Lang Lsource, M\Struct Msource is a structure for L\Lang Lsource, and sssource is a variable assignment for M\Struct Msource, the value ValsM(t)\Value{t}{M}[s]source is defined as for first-order terms, plus the following clause:

Case: tu(t1,,tn)t \ident \Atom{u}{t_1, \ldots, t_n}source

ValsM(t)=s(u)(ValsM(t1),,ValsM(tn)).\Value{\indfrm}{M}[s] = s(u)(\Value{t_1}{M}[s], \ldots, \Value{t_n}{M}[s]).source

Variants of variable assignments

[xxsource-Variant] If sssource is a variable assignment for a structure M\Struct Msource, then any variable assignment ss'source for M\Struct Msource which differs from sssource at most in what it assigns to xxsource is called an xxsource-variant of sssource. If ss'source is an xxsource-variant of sssource we write sxs\varAssign{s'}{s}{x}source. (Similarly for second-order variables XXsource or uusource.)

Changing the value of one variable in an assignment

If sssource is a variable assignment for a structure M\Struct Msource and m|M|m \in \Domain{M}source, then the assignment s[m/x]\Subst{s}{m}{x}source is the variable assignment defined by

s[m/y]={mif yxs(y)otherwise,\Subst{s}{m}{y} = \begin{cases} m & \text{if } y \ident x\\ s(y) & \text{otherwise}, \end{cases}source

If XXsource is an nnsource-place relation variable and M|M|nM \subseteq \Domain{M}^nsource, then s[M/X]\Subst{s}{M}{X}source is the variable assignment defined by

s[M/y]={Mif yXs(y)otherwise.\Subst{s}{M}{y} = \begin{cases} M & \text{if } y \ident X\\ s(y) & \text{otherwise}. \end{cases}source

If uusource is an nnsource-place function variable and f:|M|n|M|f\colon \Domain{M}^n \to \Domain{M}source, then s[f/u]\Subst{s}{f}{u}source is the variable assignment defined by

s[f/y]={fif yus(y)otherwise.\Subst{s}{f}{y} = \begin{cases} f & \text{if } y \ident u\\ s(y) & \text{otherwise}. \end{cases}source

In each case, yysource may be any first- or second-order variable.

Satisfaction clauses for second order logic

[Satisfaction] For second-order formulas A!Asource, the definition of satisfaction is like the definition of first order satisfaction with the addition of:

  1. Case: AXn(t1,,tn)!A \ident \Atom{X^n}{t_1, \dots, t_n}source

    M,sA\Sat{M}{\indfrm}[s]source iff ValsM(t1),,ValsM(tn)s(Xn)\langle \Value{t_1}{M}[s], \dots, \Value{t_n}{M}[s] \rangle \in s(X^n)source. tagitemprvAll

    Case: AXB!A \ident \lforall[X][!B]source

    M,sA\Sat{M}{\indfrm}[s]source iff for every M|M|nM \subseteq \Domain{M}^nsource, M,s[M/X]B\Sat{M}{!B}[\Subst{s}{M}{X}]source.

    tagitemprvEx

    Case: AXB!A \ident \lexists[X][!B]source

    M,sA\Sat{M}{\indfrm}[s]source iff for at least one M|M|nM \subseteq \Domain{M}^nsource so that M,s[M/X]B\Sat{M}{!B}[\Subst{s}{M}{X}]source.

    tagitemprvAll

    Case: AuB!A \ident \lforall[u][!B]source

    M,sA\Sat{M}{\indfrm}[s]source iff for every f:|M|n|M|f\colon \Domain{M}^n \to \Domain{M}source, M,s[f/u]B\Sat{M}{!B}[\Subst{s}{f}{u}]source.

    tagitemprvEx

    Case: AuB!A \ident \lexists[u][!B]source

    M,sA\Sat{M}{\indfrm}[s]source iff for at least one f:|M|n|M|f\colon \Domain{M}^n \to \Domain{M}source so that M,s[f/u]B\Sat{M}{!B}[\Subst{s}{f}{u}]source.

Example of complementary unary relations

Consider the formula z(X(z)¬Y(z))\lforall[z][(\Atom{X}{z} \liff \lnot \Atom{Y}{z})]source. It contains no second-order quantifiers, but does contain the second-order variables XXsource and YYsource (here understood to be one-place). The corresponding first-order sentence z(P(z)¬R(z))\lforall[z][(\Atom{P}{z} \liff \lnot \Atom{R}{z})]source says that whatever falls under the interpretation of PPsource does not fall under the interpretation of RRsource and vice versa. In a structure, the interpretation of a predicate symbol PPsource is given by the interpretation PM\Assign{P}{M}source. But for second-order variables like XXsource and YYsource, the interpretation is provided, not by the structure itself, but by a variable assignment. Since the second-order formula is not a sentence (it includes free variables XXsource and YYsource), it is only satisfied relative to a structure M\Struct{M}source together with a variable assignment sssource.

M,sz(X(z)¬Y(z))\Sat{M}{\lforall[z][(\Atom{X}{z} \liff \lnot \Atom{Y}{z})]}[s]source whenever the elements of s(X)s(X)source are not elements of s(Y)s(Y)source, and vice versa, i.e., iff s(Y)=|M|s(X)s(Y) = \Domain{M} \setminus s(X)source. For instance, take |M|={1,2,3}\Domain{M} = \{1, 2, 3\}source. Since no predicate symbols, function symbols, or constant symbols are involved, the domain of M\Struct{M}source is all that is relevant. Now for s1(X)={1,2}s_1(X) = \{1, 2\}source and s1(Y)={3}s_1(Y) = \{3\}source, we have M,s1z(X(z)¬Y(z))\Sat{M}{\lforall[z][(\Atom{X}{z} \liff \lnot \Atom{Y}{z})]}[s_1]source.

By contrast, if we have s2(X)={1,2}s_2(X) = \{1, 2\}source and s2(Y)={2,3}s_2(Y) = \{2, 3\}source, M,s2z(X(z)¬Y(z))\Sat/{M}{\lforall[z][(\Atom{X}{z} \liff \lnot \Atom{Y}{z})]}[s_2]source. That's because M,s2[2/z]X(z)\Sat{M}{\Atom{X}{z}}[\Subst{s_2}{2}{z}]source (since 2s2[2/z](X)2 \in \Subst{s_2}{2}{z}(X)source) but M,s2[2/z]¬Y(z)\Sat/{M}{\lnot \Atom{Y}{z}}[\Subst{s_2}{2}{z}]source (since also 2s2[2/z](Y)2 \in \Subst{s_2}{2}{z}(Y)source).

Existence of a nonempty complement

M,sY(yY(y)z(X(z)¬Y(z)))\Sat{M}{\lexists[Y][(\lexists[y][\Atom{Y}{y}] \land \lforall[z][(\Atom{X}{z} \liff \lnot \Atom{Y}{z})])]}[s]source if there is an N|M|N \subseteq \Domain{M}source such that M,s[N/Y](yY(y)z(X(z)¬Y(z)))\Sat{M}{(\lexists[y][\Atom{Y}{y}] \land \lforall[z][(\Atom{X}{z} \liff \lnot \Atom{Y}{z})])}[\Subst{s}{N}{Y}]source. And that is the case for any NN \neq \emptysetsource (so that M,s[N/Y]yY(y)\Sat{M}{\lexists[y][\Atom{Y}{y}]}[\Subst{s}{N}{Y}]source) and, as in the previous example, N=|M|s(X)N = \Domain{M} \setminus s(X)source. In other words, M,sY(yY(y)z(X(z)¬Y(z)))\Sat{M}{\lexists[Y][(\lexists[y][\Atom{Y}{y}] \land \lforall[z][(\Atom{X}{z} \liff \lnot \Atom{Y}{z})])]}[s]source iff |M|s(X)\Domain{M} \setminus s(X)source is non-empty, i.e., s(X)|M|s(X) \neq \Domain{M}source. So, the formula is satisfied, e.g., if |M|={1,2,3}\Domain{M} = \{1, 2, 3\}source and s(X)={1,2}s(X) = \{1, 2\}source, but not if s(X)={1,2,3}=|M|s(X) = \{1, 2, 3\} = \Domain{M}source.

Since the formula is not satisfied whenever s(X)=|M|s(X) = \Domain{M}source, the sentence

XY(yY(y)z(X(z)¬Y(z)))\lforall[X][\lexists[Y][(\lexists[y][\Atom{Y}{y}] \land \lforall[z][(\Atom{X}{z} \liff \lnot \Atom{Y}{z})])]]source

is never satisfied: For any structure M\Struct{M}source, the assignment s(X)=|M|s(X) = \Domain{M}source will make the sentence false. On the other hand, the sentence

XY(yY(y)z(X(z)¬Y(z)))\lexists[X][\lexists[Y][(\lexists[y][\Atom{Y}{y}] \land \lforall[z][(\Atom{X}{z} \liff \lnot \Atom{Y}{z})])]]source

is satisfied relative to any assignment sssource, since we can always find M|M|M \subseteq \Domain{M}source but M|M|M \neq \Domain{M}source (e.g., M=M = \emptysetsource).

Defining negation with a universally false second order sentence

The second-order sentence XyX(y)\lforall[X][\lforall[y][X(y)]]source says that every 11source-place relation, i.e., every property, holds of every object. That is clearly never true, since in every M\Struct{M}source, for a variable assignment sssource with s(X)=s(X) = \emptysetsource, and s(y)=a|M|s(y) = a \in \Domain{M}source we have M,sX(y)\Sat/{M}{X(y)}[s]source. This means that AXyX(y)!A \lif \lforall[X][\lforall[y][X(y)]]source is equivalent in second-order logic to ¬A\lnot !Asource, that is: MAXyX(y)\Sat{M}{!A \lif \lforall[X][\lforall[y][X(y)]]}source iff M¬A\Sat{M}{\lnot !A}source. In other words, in second-order logic we can define ¬\lnotsource using \lforallsource and \lifsource.

Exercise defining conjunction and disjunction

Show that in second-order logic \lforallsource and \lifsource can define the other connectives:

  1. Prove that in second-order logic AB!A \land !Bsource is equivalent to X(A(BxX(x))xX(x))\lforall[X][(!A \lif (!B \lif \lforall[x][X(x)])\lif \lforall[x][X(x)])]source.

  2. Find a second-order formula using only \lforallsource and \lifsource equivalent to AB!A \lor !Bsource.

Source file content/second-order-logic/syntax-and-semantics/semantic-notions.tex

Semantic Notions

Explain

The central logical notions of validity, entailment, and satisfiability are defined the same way for second-order logic as they are for first-order logic, except that the underlying satisfaction relation is now that for second-order formulas. A second-order sentence, of course, is a formula in which all variables, including predicate and function variables, are bound.

Second order validity

[Validity] A sentence A!Asource is valid, A\Entails !Asource, iff MA\Sat{M}{!A}source for every structure M\Struct Msource.

Second order entailment

[Entailment] A set of sentences Γ\Gammasource entails a sentence A!Asource, ΓA\Gamma \Entails !Asource, iff for every structure M\Struct Msource with MΓ\Sat{M}{\Gamma}source, MA\Sat{M}{!A}source.

Second order satisfiability

[Satisfiability] A set of sentences Γ\Gammasource is satisfiable if MΓ\Sat{M}{\Gamma}source for some structure M\Struct Msource. If Γ\Gammasource is not satisfiable it is called unsatisfiable.

Source file content/second-order-logic/syntax-and-semantics/expressive-power.tex

Expressive Power

Explain

Quantification over second-order variables is responsible for an immense increase in the expressive power of the language over that of first-order logic. Second-order existential quantification lets us say that functions or relations with certain properties exist. In first-order logic, the only way to do that is to specify a non-logical symbol (i.e., a function symbol or predicate symbol) for this purpose. Second-order universal quantification lets us say that all subsets of, relations on, or functions from the domain to the domain have a property. In first-order logic, we can only say that the subsets, relations, or functions assigned to one of the non-logical symbols of the language have a property. And when we say that subsets, relations, functions exist that have a property, or that all of them have it, we can use second-order quantification in specifying this property as well. This lets us define relations not definable in first-order logic, and express properties of the domain not expressible in first-order logic.

Definability of a binary relation

If M\Struct{M}source is a structure for a language L\Lang{L}source, a relation R|M|2R \subseteq \Domain{M}^2source is definable in L\Lang{L}source if there is some formula AR(x,y)!A_R(x, y)source with only the variables xxsource and yysource free, such that R(a,b)R(a, b)source holds (i.e., a,bR\tuple{a,b} \in Rsource) iff M,sAR(x,y)\Sat{M}{!A_R(x, y)}[s]source for s(x)=as(x) = asource and s(y)=bs(y) = bsource.

Defining identity without the equality symbol

In first-order logic we can define the identity relation Id|M|\Id{\Domain{M}}source (i.e., {a,a:a|M|}\Setabs{\tuple{a,a}}{a \in \Domain{M}}source) by the formula x=y\eq[x][y]source. In second-order logic, we can define this relation without =\eqsource. For if aasource and bbsource are the same element of |M|\Domain{M}source, then they are elements of the same subsets of |M|\Domain{M}source (since sets are determined by their elements). Conversely, if aasource and bbsource are different, then they are not elements of the same subsets: e.g., a{a}a \in \{a\}source but b{a}b \notin \{a\}source if aba \neq bsource. So “being elements of the same subsets of |M|\Domain{M}source” is a relation that holds of aasource and bbsource iff a=ba = bsource. It is a relation that can be expressed in second-order logic, since we can quantify over all subsets of |M|\Domain{M}source. Hence, the following formula defines Id|M|\Id{\Domain{M}}source:

X(X(x)X(y))\lforall[X][(X(x) \liff X(y))]source

Exercise defining identity with a one way conditional

Show that X(X(x)X(y))\lforall[X][(X(x) \lif X(y))]source (note: \lifsource not \liffsource!) defines Id|M|\Id{\Domain{M}}source.

Second order definition of transitive closure

If RRsource is a two-place predicate symbol, RM\Assign{R}{M}source is a two-place relation on |M|\Domain{M}source. Perhaps somewhat confusingly, we'll use RRsource as the predicate symbol for RRsource and for the relation RM\Assign{R}{M}source itself. The transitive closure R*R^*source of RRsource is the relation that holds between aasource and bbsource iff for some c1c_1source, dots, ckc_ksource, R(a,c1)R(a,c_1)source, R(c1,c2)R(c_1, c_2)source, dots, R(ck,b)R(c_k,b)source holds. This includes the case if k=0k = 0source, i.e., if R(a,b)R(a,b)source holds, so does R*(a,b)R^*(a,b)source. This means that RR*R \subseteq R^*source. In fact, R*R^*source is the smallest relation that includes RRsource and that is transitive. We can say in second-order logic that XXsource is a transitive relation that includes RRsource:

BR(X)xy(R(x,y)X(x,y))xyz((X(x,y)X(y,z))X(x,z)).!B_R(X) \ident \lforall[x][\lforall[y][(R(x,y) \lif X(x, y))]] \land {}\\ \lforall[x][\lforall[y][\lforall[z][((X(x,y) \land X(y,z)) \lif X(x, z))]]].source

The first conjunct says that RXR \subseteq Xsource and the second that XXsource is transitive.

To say that XXsource is the smallest such relation is to say that it is itself included in every relation that includes RRsource and is transitive. So we can define the transitive closure of RRsource by the formula

R*(X)BR(X)Y(BR(Y)xy(X(x,y)Y(x,y))).R^*(X) \ident !B_R(X) \land \lforall[Y][(!B_R(Y) \lif \lforall[x][\lforall[y][(X(x, y) \lif Y(x,y))]])].source

We have M,sR*(X)\Sat{M}{R^*(X)}[s]source iff s(X)=R*s(X) = R^*source. The transitive closure of RRsource cannot be expressed in first-order logic.

Source file content/second-order-logic/syntax-and-semantics/inf-count.tex

Describing Infinite and enumerable domain

A set MMsource is (Dedekind) infinite iff there is an injective function f:MMf\colon M \to Msource which is not surjective, i.e., with ran(f)M\ran{f} \neq Msource. In first-order logic, we can consider a one-place function symbol ffsource and say that the function fM\Assign{f}{M}source assigned to it in a structure M\Struct{M}source is injective and ran(f)|M|\ran{f} \neq \Domain{M}source:

xy(f(x)=f(y)x=y)yxyf(x).\lforall[x][\lforall[y][(\eq[f(x)][f(y)] \to \eq[x][y])]] \land \lexists[y][\lforall[x][\eq/[y][f(x)]]].source

If M\Struct{M}source satisfies this sentence, fM:|M||M|\Assign{f}{M}: \Domain{M} \to \Domain{M}source is injective, and so |M|\Domain{M}source must be infinite. If |M|\Domain{M}source is infinite, and hence such a function exists, we can let fM\Assign{f}{M}source be that function and M\Struct{M}source will satisfy the sentence. However, this requires that our language contains the non-logical symbol ffsource which we use for this purpose. In second-order logic, we can simply say that such a function exists. This no-longer requires ffsource, and we obtain the sentence in pure second-order logic

Infu(xy(u(x)=u(y)x=y)yxyu(x)).\fn{Inf} \ident \lexists[u][(\lforall[x][\lforall[y][(\eq[u(x)][u(y)] \lif \eq[x][y])]] \land \lexists[y][\lforall[x][\eq/[y][u(x)]]])].source

MInf\Sat{M}{\fn{Inf}}source iff |M|\Domain{M}source is infinite. We can then define Fin¬Inf\fn{Fin} \ident \lnot \fn{Inf}source; MFin\Sat{M}{\fn{Fin}}source iff |M|\Domain{M}source is finite. No single sentence of pure first-order logic can express that the domain is infinite although an infinite set of them can. There is no set of sentences of pure first-order logic that is satisfied in a structure iff its domain is finite.

Inf characterizes infinite domains

MInf\Sat{M}{\fn{Inf}}source iff |M|\Domain{M}source is infinite.

Proof

MInf\Sat{M}{\fn{Inf}}source iff M,sxy(u(x)=u(y)x=y)yxyu(x)\Sat{M}{\lforall[x][\lforall[y][(\eq[u(x)][u(y)] \lif \eq[x][y])]] \land \lexists[y][\lforall[x][\eq/[y][u(x)]]]}[s]source for some sssource. If it does, s(u)s(u)source is an injective function, and some y|M|y \in \Domain{M}source is not in the range of s(u)s(u)source. Conversely, if there is an injective f:|M||M|f\colon \Domain{M} \to \Domain{M}source with ran(f)|M|\ran{f} \neq \Domain{M}source, then s(u)=fs(u) = fsource is such a variable assignment.

A set MMsource is enumerable if there is an enumeration

m0,m1,m2,m_0, m_1, m_2, \dotssource

of its elements (without repetitions but possibly finite). Such an enumeration exists iff there is an element zMz \in Msource and a function f:MMf\colon M \to Msource such that zzsource, f(z)f(z)source, f(f(z))f(f(z))source, dots, are all the elements of MMsource. For if the enumeration exists, z=m0z = m_0source and f(mk)=mk+1f(m_k) = m_{k+1}source (or f(mk)=mkf(m_k) = m_ksource if mkm_ksource is the last element of the enumeration) are the requisite element and function. On the other hand, if such a zzsource and ffsource exist, then zzsource, f(z)f(z)source, f(f(z))f(f(z))source, dots, is an enumeration of MMsource, and MMsource is enumerable. We can express the existence of zzsource and ffsource in second-order logic to produce a sentence true in a structure iff the structure is enumerable:

CountzuX((X(z)x(X(x)X(u(x))))xX(x))\fn{Count} \ident \lexists[z][\lexists[u][\lforall[X][((X(z) \land \lforall[x][(X(x) \lif X(u(x)))]) \lif \lforall[x][X(x)])]]]source

Count characterizes enumerable domains

MCount\Sat{M}{\fn{Count}}source iff |M|\Domain{M}source is enumerable.

Proof

Suppose |M|\Domain{M}source is enumerable, and let m0m_0source, m1m_1source, dots, be an enumeration. By removing repetitions we can guarantee that no mkm_ksource appears twice. Define f(mk)=mk+1f(m_k) = m_{k+1}source and let s(z)=m0s(z) = m_0source and s(u)=fs(u) = fsource. We show that

M,sX((X(z)x(X(x)X(u(x))))xX(x))\Sat{M}{\lforall[X][((X(z) \land \lforall[x][(X(x) \lif X(u(x)))]) \lif \lforall[x][X(x)])]}[s]source

Suppose M|M|M \subseteq \Domain{M}source is arbitrary. Suppose further that M,s[M/X](X(z)x(X(x)X(u(x))))\Sat{M}{(X(z) \land \lforall[x][(X(x) \lif X(u(x)))])}[\Subst{s}{M}{X}]source. Then s[M/X](z)M\Subst{s}{M}{X}(z) \in Msource and whenever xMx \in Msource, also (s[M/X](u))(x)M(\Subst{s}{M}{X}(u))(x) \in Msource. In other words, since s[M/X]Xs\varAssign{\Subst{s}{M}{X}}{s}{X}source, m0Mm_0 \in Msource and if xMx \in Msource then f(x)Mf(x) \in Msource, so m0Mm_0 \in Msource, m1=f(m0)Mm_1 = f(m_0) \in Msource, m2=f(f(m0))Mm_2 = f(f(m_0)) \in Msource, etc. Thus, M=|M|M = \Domain{M}source, and so M,s[M/X]xX(x)\Sat{M}{\lforall[x][X(x)]}[\Subst{s}{M}{X}]source. Since M|M|M \subseteq \Domain{M}source was arbitrary, we are done: MCount\Sat{M}{\fn{Count}}source.

Now assume that MCount\Sat{M}{\fn{Count}}source, i.e.,

M,sX((X(z)x(X(x)X(u(x))))xX(x))\Sat{M}{\lforall[X][((X(z) \land \lforall[x][(X(x) \lif X(u(x)))]) \lif \lforall[x][X(x)])]}[s]source

for some sssource. Let m=s(z)m = s(z)source and f=s(u)f = s(u)source and consider M={m,f(m),f(f(m)),}M = \{m, f(m), f(f(m)), \dots\}source. MMsource so defined is clearly enumerable. Then

M,s[M/X](X(z)x(X(x)X(u(x))))xX(x)\Sat{M}{(X(z) \land \lforall[x][(X(x) \lif X(u(x)))]) \lif \lforall[x][X(x)]}[\Subst{s}{M}{X}]source

by assumption. Also, M,s[M/X]X(z)\Sat{M}{X(z)}[\Subst{s}{M}{X}]source since Mm=s[M/X](z)M \ni m = \Subst{s}{M}{X}(z)source, and also M,s[M/X]x(X(x)X(u(x)))\Sat{M}{\lforall[x][(X(x) \lif X(u(x)))]}[\Subst{s}{M}{X}]source since whenever xMx \in Msource also f(x)Mf(x) \in Msource. So, since both antecedent and conditional are satisfied, the consequent must also be: M,s[M/X]xX(x)\Sat{M}{\lforall[x][X(x)]}[\Subst{s}{M}{X}]source. But that means that M=|M|M = \Domain{M}source, and so |M|\Domain{M}source is enumerable since MMsource is, by definition.

Exercise directly describing denumerable domains

The sentence InfCount\fn{Inf} \land \fn{Count}source is true in all and only denumerable domains. Adjust the definition of Count\fn{Count}source so that it becomes a different sentence that directly expresses that the domain is denumerable, and prove that it does.

Source disclosures