Second-order logic

Metatheory of Second-order Logic

Reading preferences

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

Source file content/second-order-logic/metatheory/metatheory.tex

Source file content/second-order-logic/metatheory/introduction.tex

Introduction

First-order logic has a number of nice properties. We know it is not decidable, but at least it is axiomatizable. That is, there are proof systems for first-order logic which are sound and complete, i.e., they give rise to a derivability relation \Provessource with the property that for any set of sentences Γ\Gammasource and sentence A!Asource, ΓA\Gamma \Entails !Asource iff ΓA\Gamma \Proves !Asource. This means in particular that the validities of first-order logic are computably enumerable. There is a computable function f:Sent(L)f\colon \Nat \to \Sent[L]source such that the values of ffsource are all and only the valid sentences of L\Lang{L}source. This is so because derivations can be enumerated, and those that derive a single sentence are then mapped to that sentence. Second-order logic is more expressive than first-order logic, and so it is in general more complicated to capture its validities. In fact, we'll show that second-order logic is not only undecidable, but its validities are not even computably enumerable. This means there can be no sound and complete proof system for second-order logic (although sound, but incomplete proof systems are available and in fact are important objects of research).

First-order logic also has two more properties: it is compact (if every finite subset of a set Γ\Gammasource of sentences is satisfiable, Γ\Gammasource itself is satisfiable) and the Löwenheim--Skolem Theorem holds for it (if Γ\Gammasource has an infinite model it has a denumerable model). Both of these results fail for second-order logic. Again, the reason is that second-order logic can express facts about the size of domains that first-order logic cannot.

Source file content/second-order-logic/metatheory/second-order-arithmetic.tex

Second-order Arithmetic

Recall that the theory PA\Th{PA}source of Peano arithmetic includes the eight axioms of Q\Th{Q}source,

xx0xy(x=yx=y)x(x=0yx=y)x(x+0)=xxy(x+y)=(x+y)x(x×0)=0xy(x×y)=((x×y)+x)xy(x<yz(z+x)=y)plus all sentences of the form(A(0)x(A(x)A(x)))xA(x).& \lforall[x][\eq/[x'][\Obj 0]]\\ & \lforall[x][\lforall[y][(\eq[x'][y'] \lif \eq[x][y])]]\\ & \lforall[x][(\eq[x][\Obj 0] \lor \lexists[y][\eq[x][y']])]\\ & \lforall[x][\eq[(x + \Obj 0)][x]]\\ & \lforall[x][\lforall[y][\eq[(x + y')][(x + y)']]]\\ & \lforall[x][\eq[(x \times \Obj 0)][\Obj 0]]\\ & \lforall[x][\lforall[y][\eq[(x \times y')][((x \times y) + x)]]]\\ & \lforall[x][\lforall[y][(x < y \liff \lexists[z][\eq[(z' + x)][y]])]]\\ \intertext{plus all sentences of the form} & (!A(\Obj 0) \land \lforall[x][(!A(x) \lif !A(x'))]) \lif \lforall[x][!A(x)].source

The latter is a “schema,” i.e., a pattern that generates infinitely many sentences of the language of arithmetic, one for each formula A(x)!A(x)source. We call this schema the (first-order) axiom schema of induction. In second-order Peano arithmetic PA2\Th{PA^2}source, induction can be stated as a single sentence. PA2\Th{PA^2}source consists of the first eight axioms above plus the (second-order) induction axiom:

X((X(0)x(X(x)X(x)))xX(x)).\lforall[X][((X(\Obj 0) \land \lforall[x][(X(x) \lif X(x'))]) \lif \lforall[x][X(x)])].source

It says that if a subset XXsource of the domain contains 0M\Assign{\Obj{0}}{M}source and with any x|M|x \in \Domain{M}source also contains M(x)\Assign{\prime}{M}(x)source (i.e., it is “closed under successor”) it contains everything in the domain (i.e., X=|M|)X = \Domain{M})source.

The induction axiom guarantees that any structure satisfying it contains only those elements of |M|\Domain{M}source the axioms require to be there, i.e., the values of n¯\num{n}source for nn \in \Natsource. A model of PA2\Th{PA^2}source contains no non-standard numbers.

Every element of a second order arithmetic model is named by a numeral

If MPA2\Sat{M}{\Th{PA^2}}source then |M|={ValM(n¯):n}\Domain{M} = \Setabs{\Value{\num{n}}{M}}{n \in \Nat}source.

Proof

Let N={ValM(n¯):n}N = \Setabs{\Value{\num{n}}{M}}{n \in \Nat}source, and suppose MPA2\Sat{M}{\Th{PA^2}}source. Of course, for any nn \in \Natsource, ValM(n¯)|M|\Value{\num{n}}{M} \in \Domain{M}source, so N|M|N \subseteq \Domain{M}source.

Now for inclusion in the other direction. Consider a variable assignment sssource with s(X)=Ns(X) = Nsource. By assumption,

MX((X(0)x(X(x)X(x)))xX(x)), thusM,s(X(0)x(X(x)X(x)))xX(x).\Sat{M}{\lforall[X][((X(\Obj 0) \land \lforall[x][(X(x) \lif X(x'))]) \lif \lforall[x][X(x)])]}, & \text{ thus}\\ \Sat{M}{(X(\Obj 0) \land \lforall[x][(X(x) \lif X(x'))]) \lif \lforall[x][X(x)]}[s]. &source

Consider the antecedent of this conditional. ValM(0)N\Value{\Obj{0}}{M} \in Nsource, and so M,sX(0)\Sat{M}{X(\Obj{0})}[s]source. The second conjunct, x(X(x)X(x))\lforall[x][(X(x) \lif X(x'))]source is also satisfied. For suppose xNx \in Nsource. By definition of NNsource, x=ValM(n¯)x = \Value{\num{n}}{M}source for some nnsource. That gives M(x)=ValM(n+1¯)N\Assign{\prime}{M}(x) = \Value{\num{n+1}}{M} \in Nsource. So, M(x)N\Assign{\prime}{M}(x) \in Nsource.

We have that M,sX(0)x(X(x)X(x))\Sat{M}{X(\Obj 0) \land \lforall[x][(X(x) \lif X(x'))]}[s]source. Consequently, M,sxX(x)\Sat{M}{\lforall[x][X(x)]}[s]source. But that means that for every x|M|x \in \Domain{M}source we have xs(X)=Nx \in s(X) = Nsource. So, |M|N\Domain{M} \subseteq Nsource.

Categoricity of second order Peano arithmetic

Any two models of PA2\Th{PA^2}source are isomorphic.

Proof

By the theorem that second order arithmetic models contain only numeral values, the domain of any model of PA2\Th{PA^2}source is exhausted by ValM(n¯)\Value{\num{n}}{M}source. Any such model is also a model of Q\Th{Q}source. By the proposition about standard models of Q, any such model is standard, i.e., isomorphic to N\Struct{N}source.

Above we defined PA2\Th{PA^2}source as the theory that contains the first eight arithmetical axioms plus the second-order induction axiom. In fact, thanks to the expressive power of second-order logic, only the first two of the arithmetical axioms plus induction are needed for second-order Peano arithmetic.

Definability of arithmetic from successor and second order induction

Let PA2\Th{PA^{2\dagger}}source be the second-order theory containing the first two arithmetical axioms (the successor axioms) and the second-order induction axiom. Then \lesource, ++source, and ×\timessource are definable in PA2\Th{PA^{2\dagger}}source.

Proof

To show that \lesource is definable, we have to find a formula A(x,y)!A_\le(x, y)source such that NA(n¯,m¯)\Sat{N}{!A_\le(\num n, \num m)}source iff nmn \le msource. Consider the formula

B(x,Y)Y(x)y(Y(y)Y(y))!B(x, Y) \ident Y(x) \land \lforall[y][(Y(y) \lif Y(y'))]source

Clearly, B(n¯,Y)!B(\num n, Y)source is satisfied by a set YY \subseteq \Natsource iff {m:nm}Y\Setabs{m}{n \le m} \subseteq Ysource, so we can take A(x,y)Y(B(x,Y)Y(y))!A_\le(x, y) \ident \lforall[Y][(!B(x, Y) \lif Y(y))]source.

To see that addition is definable observe that k+l=mk+l=msource iff there is a function uusource such that u(0)=ku(0)=ksource, u(n)=u(n)u(n')=u(n)'source for all nnsource, and m=u(l)m = u(l)source. We can use this equivalence to define addition in PA2\Th{PA^{2\dagger}}source by the following formula:

A+(x,y,z)u(u(0)=xwu(x)=u(x)u(y)=z)!A_+(x,y,z) \ident \lexists[u][(u(\Obj 0)=x \land \lforall[w][u(x')=u (x)'] \land u(y)=z)]source

It should be clear that NA+(k¯,l¯,m¯)\Sat{N}{!A_+(\num k, \num l, \num m)}source iff k+l=mk+l=msource.

Exercise completing the definability proof

Complete the proof of the proposition defining arithmetic from successor and second order induction.

Source file content/second-order-logic/metatheory/undecidability-and-axiomatizability.tex

Second-order Logic is not Axiomatizable

Undecidability of second order logic

Second-order logic is undecidable.

Proof

A first-order sentence is valid in first-order logic iff it is valid in second-order logic, and first-order logic is undecidable.

No sound and complete effective second order proof system

There is no sound and complete derivation system for second-order logic.

Proof

Let A!Asource be a sentence in the language of arithmetic. NA\Sat{N}{!A}source iff PA2A\Th{PA^2} \Entails !Asource. Let P!Psource be the conjunction of the nine axioms of PA2\Th{PA^2}source. PA2A\Th{PA^2} \Entails !Asource iff PA\Entails !P \lif !Asource, i.e., MPA\Sat{M}{!P \lif !A}source. Now consider the sentence zuuuL(PA)\lforall[z][\lforall[u][\lforall[u'][\lforall[u''][\lforall[L][(!P' \lif !A')]]]]]source resulting by replacing 0\Obj{0}source by zzsource, \primesource by the one-place function variable uusource, ++source and ×\timessource by the two-place function-variables uu'source and uu''source, respectively, and <<source by the two-place relation variable LLsource and universally quantifying. It is a valid sentence of pure second-order logic iff the original sentence was valid iff PA2A\Th{PA^2} \Entails !Asource iff NA\Sat{N}{!A}source. Thus if there were a sound and complete proof system for second-order logic, we could use it to define a computable enumeration f:Sent(LA)f\colon \Nat \to \Sent[L_A]source of the sentences true in N\Struct{N}source. This function would be representable in Q\Th{Q}source by some first-order formula Bf(x,y)!B_f(x, y)source. Then the formula xBf(x,y)\lexists[x][!B_f(x, y)]source would define the set of true first-order sentences of N\Struct{N}source, contradicting Tarski's Theorem.

Source file content/second-order-logic/metatheory/compactness.tex

Second-order Logic is not Compact

Explain

Call a set of sentences Γ\Gammasource finitely satisfiable if every one of its finite subsets is satisfiable. First-order logic has the property that if a set of sentences Γ\Gammasource is finitely satisfiable, it is satisfiable. This property is called compactness. It has an equivalent version involving entailment: if ΓA\Gamma \Entails !Asource, then already Γ0A\Gamma_0 \Entails !Asource for some finite subset Γ0Γ\Gamma_0 \subseteq \Gammasource. In this version it is an immediate corollary of the completeness theorem: for if ΓA\Gamma \Entails !Asource, by completeness ΓA\Gamma \Proves !Asource. But a derivation can only make use of finitely many sentences of Γ\Gammasource.

Compactness is not true for second-order logic. There are sets of second-order sentences that are finitely satisfiable but not satisfiable, and that entail some A!Asource without a finite subset entailing A!Asource.

Failure of compactness for second order logic

Second-order logic is not compact.

Proof

Recall that

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

is satisfied in a structure iff its domain is infinite. Let An!A^{\ge n}source be a sentence that asserts that the domain has at least nnsource elements, e.g.,

Anx1xn(x1x2x1x3xn1xn).!A^{\ge n} \ident \lexists[x_1][\dots\lexists[x_n][(\eq/[x_1][x_2] \land \eq/[x_1][x_3] \land \dots \land \eq/[x_{n-1}][x_n])]].source

Consider the set of sentences

Γ={¬Inf,A1,A2,A3,}.\Gamma = \{\lnot \fn{Inf}, !A^{\ge 1}, !A^{\ge 2}, !A^{\ge 3}, \dots\}.source

It is finitely satisfiable, since for any finite subset Γ0Γ\Gamma_0 \subseteq \Gammasource there is some kksource so that AkΓ!A^{\ge k} \in \Gammasource but no AnΓ!A^{\ge n} \in \Gammasource for n>kn>ksource. If |M|\Domain{M}source has kksource elements, MΓ0\Sat{M}{\Gamma_0}source. But, Γ\Gammasource is not satisfiable: if M¬Inf\Sat{M}{\lnot \fn{Inf}}source, |M|\Domain{M}source must be finite, say, of size kksource. Then MAk+1\Sat/{M}{!A^{\ge k+1}}source.

Exercise on noncompact entailment

Give an example of a set Γ\Gammasource and a sentence A!Asource so that ΓA\Gamma \Entails !Asource but for every finite subset Γ0Γ\Gamma_0 \subseteq \Gammasource, Γ0/A\Gamma_0 \Entails/ !Asource.

Source file content/second-order-logic/metatheory/loewenheim-skolem.tex

The Löwenheim--Skolem Theorem Fails for Second-order Logic

Explain

The (Downward) Löwenheim--Skolem Theorem states that every set of sentences with an infinite model has an enumerable model. It, too, is a consequence of the completeness theorem: the proof of completeness generates a model for any consistent set of sentences, and that model is enumerable. There is also an Upward Löwenheim--Skolem Theorem, which guarantees that if a set of sentences has a denumerable model it also has a non-enumerable model. Both theorems fail in second-order logic.

Failure of downward Loewenheim Skolem in second order logic

The Löwenheim--Skolem Theorem fails for second-order logic: There are sentences with infinite models but no enumerable models.

Proof

Recall that

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

is true in a structure M\Struct{M}source iff |M|\Domain{M}source is enumerable, so ¬Count\lnot\fn{Count}source is true in M\Struct{M}source iff |M|\Domain{M}source is non-enumerable. There are such structures---take any non-enumerable set as the domain, e.g., ()\Pow{\Nat}source or \Realsource. So ¬Count\lnot \fn{Count}source has infinite models but no enumerable models.

Failure of upward Loewenheim Skolem in second order logic

There are sentences with denumerable but no non-enumerable models.

Proof

CountInf\fn{Count} \land \fn{Inf}source is true in \Natsource but not in any structure M\Struct{M}source with |M|\Domain{M}source non-enumerable.

Source disclosures