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 source, together with a variable assignment source, and a formula source: source holds iff what source expresses when its constant symbols, function symbols, and predicate symbols are interpreted as source says, and its free variables are interpreted as source says, is true. The interpretation of the identity predicate source is built into the definition of source, as is the interpretation of source and source. The former is always interpreted as the identity relation on the domain 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 (source-place functions from source to source for function variables, source-place relations for predicate variables). For instance, while source is a formula in both first- and second-order logic, in the latter we can also consider source and source. Since these contain no free variables, they are sentences of second-order logic. Here, source is a second-order source-place predicate variable. The allowable interpretations of source are the same that we can assign to a source-place predicate symbol like source, i.e., subsets of source. Quantification over them then amounts to saying that source holds for all ways of assigning a subset of source as the value of 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:
A denumerables set of second-order relation variables of every arity source: source, source, source, dots
A denumerables set of second-order function variables: source, source, source, dots
Just as we use source, source, source as meta-variables for first-order variables source, we'll use source, source, source, etc., as metavariables for source and source, source, etc., as meta-variables for source.
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 source is usually included. In first-order logic, the non-logical symbols of a language source are crucial to allow us to express anything interesting. There are of course sentences that use no non-logical symbols, but with only source 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 source, source, is defined by adding to the definition of first order terms the clause
Explain
So, a second-order term looks just like a first-order term, except that where a first-order term contains a function symbol source, a second-order term may contain a function variable source in its place.
Definition of second order formulas
[Second-order formula] The set of second-order formulas source of the language source is defined by adding to the definition of first order formulas the clauses
If source is an source-place predicate variable and source, dots, source are second-order terms of source, then source is an atomic formula.
tagitemprvAllIf source is a formula and source is a function variable, then source is a formula.
tagitemprvAllIf source is a formula and source is a predicate variable, then source is a formula.
tagitemprvExIf source is a formula and source is a function variable, then source is a formula.
tagitemprvExIf source is a formula and source is a predicate variable, then source is a formula.
Source file content/second-order-logic/syntax-and-semantics/satisfaction.tex
Satisfaction
Explain
To define the satisfaction relation 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 source: 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 source for a structure source is a function which maps each
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 source is a term of the language source, source is a structure for source, and source is a variable assignment for source, the value source is defined as for first-order terms, plus the following clause:
Variants of variable assignments
[source-Variant] If source is a variable assignment for a structure source, then any variable assignment source for source which differs from source at most in what it assigns to source is called an source-variant of source. If source is an source-variant of source we write source. (Similarly for second-order variables source or source.)
Changing the value of one variable in an assignment
If source is a variable assignment for a structure source and source, then the assignment source is the variable assignment defined by
If source is an source-place relation variable and source, then source is the variable assignment defined by
If source is an source-place function variable and source, then source is the variable assignment defined by
In each case, source may be any first- or second-order variable.
Satisfaction clauses for second order logic
[Satisfaction] For second-order formulas source, the definition of satisfaction is like the definition of first order satisfaction with the addition of:
Example of complementary unary relations
Consider the formula source. It contains no second-order quantifiers, but does contain the second-order variables source and source (here understood to be one-place). The corresponding first-order sentence source says that whatever falls under the interpretation of source does not fall under the interpretation of source and vice versa. In a structure, the interpretation of a predicate symbol source is given by the interpretation source. But for second-order variables like source and source, 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 source and source), it is only satisfied relative to a structure source together with a variable assignment source.
source whenever the elements of source are not elements of source, and vice versa, i.e., iff source. For instance, take source. Since no predicate symbols, function symbols, or constant symbols are involved, the domain of source is all that is relevant. Now for source and source, we have source.
By contrast, if we have source and source, source. That's because source (since source) but source (since also source).
Existence of a nonempty complement
source if there is an source such that source. And that is the case for any source (so that source) and, as in the previous example, source. In other words, source iff source is non-empty, i.e., source. So, the formula is satisfied, e.g., if source and source, but not if source.
Since the formula is not satisfied whenever source, the sentence
is never satisfied: For any structure source, the assignment source will make the sentence false. On the other hand, the sentence
is satisfied relative to any assignment source, since we can always find source but source (e.g., source).
Defining negation with a universally false second order sentence
The second-order sentence source says that every source-place relation, i.e., every property, holds of every object. That is clearly never true, since in every source, for a variable assignment source with source, and source we have source. This means that source is equivalent in second-order logic to source, that is: source iff source. In other words, in second-order logic we can define source using source and source.
Exercise defining conjunction and disjunction
Show that in second-order logic source and source can define the other connectives:
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 source is valid, source, iff source for every structure source.
Second order entailment
[Entailment] A set of sentences source entails a sentence source, source, iff for every structure source with source, source.
Second order satisfiability
[Satisfiability] A set of sentences source is satisfiable if source for some structure source. If source 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 source is a structure for a language source, a relation source is definable in source if there is some formula source with only the variables source and source free, such that source holds (i.e., source) iff source for source and source.
Defining identity without the equality symbol
In first-order logic we can define the identity relation source (i.e., source) by the formula source. In second-order logic, we can define this relation without source. For if source and source are the same element of source, then they are elements of the same subsets of source (since sets are determined by their elements). Conversely, if source and source are different, then they are not elements of the same subsets: e.g., source but source if source. So “being elements of the same subsets of source” is a relation that holds of source and source iff source. It is a relation that can be expressed in second-order logic, since we can quantify over all subsets of source. Hence, the following formula defines source:
Exercise defining identity with a one way conditional
Second order definition of transitive closure
If source is a two-place predicate symbol, source is a two-place relation on source. Perhaps somewhat confusingly, we'll use source as the predicate symbol for source and for the relation source itself. The transitive closure source of source is the relation that holds between source and source iff for some source, dots, source, source, source, dots, source holds. This includes the case if source, i.e., if source holds, so does source. This means that source. In fact, source is the smallest relation that includes source and that is transitive. We can say in second-order logic that source is a transitive relation that includes source:
The first conjunct says that source and the second that source is transitive.
To say that source is the smallest such relation is to say that it is itself included in every relation that includes source and is transitive. So we can define the transitive closure of source by the formula
We have source iff source. The transitive closure of source 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 source is (Dedekind) infinite iff there is an injective function source which is not surjective, i.e., with source. In first-order logic, we can consider a one-place function symbol source and say that the function source assigned to it in a structure source is injective and source:
If source satisfies this sentence, source is injective, and so source must be infinite. If source is infinite, and hence such a function exists, we can let source be that function and source will satisfy the sentence. However, this requires that our language contains the non-logical symbol source which we use for this purpose. In second-order logic, we can simply say that such a function exists. This no-longer requires source, and we obtain the sentence in pure second-order logic
source iff source is infinite. We can then define source; source iff 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
Proof
source iff source for some source. If it does, source is an injective function, and some source is not in the range of source. Conversely, if there is an injective source with source, then source is such a variable assignment.
A set source is enumerable if there is an enumeration
of its elements (without repetitions but possibly finite). Such an enumeration exists iff there is an element source and a function source such that source, source, source, dots, are all the elements of source. For if the enumeration exists, source and source (or source if source is the last element of the enumeration) are the requisite element and function. On the other hand, if such a source and source exist, then source, source, source, dots, is an enumeration of source, and source is enumerable. We can express the existence of source and source in second-order logic to produce a sentence true in a structure iff the structure is enumerable:
Count characterizes enumerable domains
Proof
Suppose source is enumerable, and let source, source, dots, be an enumeration. By removing repetitions we can guarantee that no source appears twice. Define source and let source and source. We show that
Suppose source is arbitrary. Suppose further that source. Then source and whenever source, also source. In other words, since source, source and if source then source, so source, source, source, etc. Thus, source, and so source. Since source was arbitrary, we are done: source.
Now assume that source, i.e.,
for some source. Let source and source and consider source. source so defined is clearly enumerable. Then
by assumption. Also, source since source, and also source since whenever source also source. So, since both antecedent and conditional are satisfied, the consequent must also be: source. But that means that source, and so source is enumerable since source is, by definition.
Exercise directly describing denumerable domains
The sentence source is true in all and only denumerable domains. Adjust the definition of source so that it becomes a different sentence that directly expresses that the domain is denumerable, and prove that it does.
Source disclosures
- TR039-SAR-001: Source notation caveat. This display places y in the assignment replacement slot and omits evaluation at y. The surrounding definition changes x and then tests a variable y. The original display is preserved, not silently corrected. source
- TR039-SAR-002: Source notation caveat. This relation assignment display again places y in the replacement slot and omits evaluation at y, although the surrounding prose changes capital X. The original notation is preserved. source
- TR039-SAR-003: Source notation caveat. This function assignment display again places y in the replacement slot and omits evaluation at y, although the surrounding prose changes u. The original notation is preserved. source
- TR039-SAR-004: Source grouping caveat. The source leaves a chain of two outer conditionals without parentheses selecting their association. Its exercise asks for equivalence to conjunction. The exact displayed grouping is preserved, and the exercise is not solved here. source
- TR039-SAR-005: Source proof caveat. For a finite enumeration, the displayed successor prescription has no next element at its last position. The preceding prose explicitly gives the convention that the function fixes the last element; the proof does not repeat that convention. Its wording is preserved. source