Finite Model Theory: First-Order Logic on the Class of Finite Models
Total Page:16
File Type:pdf, Size:1020Kb
1 Finite Model Theory: First-Order Logic on the Class of Finite Models Anuj Dawar University of Cambridge Modnet Tutorial, La Roche, 21 April 2008 Anuj Dawar February 2008 2 Finite Model Theory In the 1980s, the term finite model theory came to be used to describe the study of the expressive power of logics (from first-order to second-order logic and in between), on the class of all finite structures. The motivation for the study is that problems in computer science (especially in complexity theory and database theory) are naturally expressed as questions about the expressive power of logics. And, the structures involved in computation are finite. Anuj Dawar February 2008 3 Model Theoretic Questions The kind of questions we are interested in are about the expressive power of logics. Given a formula ϕ, its class of models is the collection of finite relational structures A in which it is true. Mod(ϕ)= {A | A |= ϕ} What classes of structures are definable in a given logic L? How do syntactic restrictions on ϕ relate to semantic restrictions on Mod(ϕ)? How does the computational complexity of Mod(ϕ) relate to the syntactic complexity of ϕ? Anuj Dawar February 2008 4 Descriptive Complexity A class of finite structures is definable in existential second-order logic if, and only if, it is decidable in NP. (Fagin) A closs of ordered finite structures is definable in least fixed-point logic if, and only if, it is decidable in P. (Immerman; Vardi) Open Question: Is there a logic that captures P without order? Can model-theoretic methods cast light on questions of computational complexity? Anuj Dawar February 2008 5 Compactness The Compactness Theorem fails if we restrict ourselves to finite structures. Let λn be the first order sentence. λ = ∃x ... ∃x (x 6= x ) n 1 n ^ i j 1≤i<j≤n Then Λ= {λn | n ∈ ω} is a set of sentences such that: • every finite subset of Λ has a finite model • Λ does not have a finite model. Anuj Dawar February 2008 6 Completeness Abstract Completeness Theorem The set of valid first order sentences is recursively enumerable. Define the following sets: Val = {ϕ | ϕ is valid on finite structures} Sat = {ϕ | ϕ is satisfiable in a finite structure} then, clearly Sat is recursively enumerable, and Val is r.e. if, and only if, Sat is decidable. Theorem (Trakhtenbrot 1950) The set of finitely satisfiable sentences is not decidable. Anuj Dawar February 2008 7 Trakhtenbrot’s Theorem The proof is by a reduction from the Halting problem. Given a Turing machine M , we construct a first order sentence ϕM such that A |= ϕM if, and only if, • there is a discrete linear order on the universe of A with minimal and maximal elements • each element of A (along with appropriate relations) encodes a configuration of the machine M • the minimal element encodes the starting configuration of M on empty input • for each element a of A the configuration encoded by its successor is the configuration obtained by M in one step starting from the configuration in a • the configuration encoded by the maximal element of A is a halting configuration. Anuj Dawar February 2008 8 Preservation Theorems Preservation theorems for first-order logic provide a correspondence between syntactic and semantic restrictions. A sentence ϕ is equivalent to an existential sentence if, and only if, the models of ϕ are closed under extensions. Łos-Tarski´ A sentence ϕ is equivalent to one that is positive in the relation symbol R if, and only if, it is monotone in the relation R. Lyndon. Anuj Dawar February 2008 9 Proving Preservation In each of the cases, it is trivial to see that the syntactic restriction implies the semantic restriction. The other direction, of expressive completeness, is usually proved using compactness. For example, if ϕ is closed under extensions: Take Φ to be the existential consequences of ϕ and show Φ |= ϕ by: A |= Φ ∪ {ϕ} A∗ ∩ B |= Φ ∪ {¬ϕ} B∗ Anuj Dawar February 2008 10 Relativised Preservation We are interested in relativisations of expressive completeness to classes of structures C: If ϕ satisfies the semantic condition restricted to C, it is equivalent (on C) to a sentence in the restricted syntactic form. If C satisfies compactness, then the preservation property necessarily holds in C. Restricting the class C in this statement weakens both the hypothesis and the conclusion. Both Łos-Tarski´ and Lyndon are known to fail when C is the class of all finite structures. Anuj Dawar February 2008 11 Preservation under Extensions in the Finite (Tait 1959) showed that there is a ϕ preserved under extensions on finite structures, but not equivalent to an existential sentence. • Either ≤ is not a linear order; • or R(x, z) for some x, y, z with x<y<z; • or R contains a cycle. For any existential sentence whose finite models include all of the above, we can find a model that does not satisfy these conditions. Anuj Dawar February 2008 12 Tools for Finite Model Theory Besides compactness, completeness and preservation theorems, there are also examples showing that the finitary analogues of Craig Interpolation Theorem and the Beth Definability Theorem fail. It seems that the class of finite structures is not well-behaved for the study of definability. What tools and methods are available to study the expressive power of logic in the finite? • Ehrenfeucht-Fra¨‘isse´ Games; • Locality Theorems. • Complexity Anuj Dawar February 2008 13 Elementary Equivalence On finite structures, the elementary equivalence relation is trivial: A ≡ B if, and only if, A =∼ B Given a structure A with n elements, we construct a sentence ϕA = ∃x1 ... ∃xnψ ∧∀y y = xi _ 1≤i≤n where, ψ(x1,...,xn) is the conjunction of all atomic and negated atomic formulas that hold in A. Anuj Dawar February 2008 14 Theories vs. Sentences First order logic can make all the distinctions that are there to be made between finite structures. Any isomorphism closed class of finite structures S can be defined by a first-order theory: {¬ϕA | A 6∈ S}. To understand the limits on the expressive power of first-order sentences, we need to consider coarser equivalence relations than ≡. Anuj Dawar February 2008 15 Quantifier Rank The quantifier rank of a formula ϕ, written qr(ϕ) is defined inductively as follows: 1. if ϕ is atomic then qr(ϕ) = 0, 2. if ϕ = ¬ψ then qr(ϕ)= qr(ψ), 3. if ϕ = ψ1 ∨ ψ2 or ϕ = ψ1 ∧ ψ2 then qr(ϕ) = max(qr(ψ1), qr(ψ2)). 4. if ϕ = ∃xψ or ϕ = ∀xψ then qr(ϕ) = qr(ψ) + 1 Note: For the rest of this lecture, we assume that our signature consists only of relation and constant symbols. With this proviso, it is easily proved that in a finite vocabulary, for each q, there are (up to logical equivalence) only finitely many sentences ϕ with qr(ϕ) ≤ q. Anuj Dawar February 2008 16 Finitary Elementary Equivalence For two structures A and B, we say A ≡p B if for any sentence ϕ with qr(ϕ) ≤ p, A |= ϕ if, and only if, B |= ϕ. Key fact: a class of structures S is definable by a first order sentence if, and only if, S is closed under the relation ≡p for some p. The equivalence relations ≡p can be characterised in terms of sequences of partial isomorphisms (Fra¨ısse´ 1954) or two player games. (Ehrenfeucht 1961) Anuj Dawar February 2008 17 Ehrenfeucht-Fra¨ısse´ Game The p-round Ehrenfeucht game on structures A and B proceeds as follows: • There are two players called Spoiler and Duplicator. • At the ith round, Spoiler chooses one of the structures (say B) and one of the elements of that structure (say bi). • Duplicator must respond with an element of the other structure (say ai). • If, after p rounds, the map ai 7→ bi is a partial isomorphism, then Duplicator has won the game, otherwise Spoiler has won. Theorem (Fra¨ısse´ 1954; Ehrenfeucht 1961) Duplicator has a strategy for winning the p-round Ehrenfeucht game on A and B if, and only if, A ≡p B. Anuj Dawar February 2008 18 Using Games To show that a class of structures S is not definable in FO, we find, for every p,a pair of structures Ap and Bp such that • Ap ∈ S, Bp ∈ S; and • Duplicator wins a p round game on Ap and Bp. Example: Cn—a cycle of length n. Duplicator wins the p round game on C2p and C2p+1. • 2-Colourability is not definable in FO. • Even cardinality is not definable in FO. Anuj Dawar February 2008 19 Linear Orders Example: Ln—a linear order of length n. for m, n ≥ 2p − 1, Lm ≡p Ln Duplicator’s strategy is to maintain the following condition after r rounds of the game: for 1 ≤ i<j ≤ r, • either length(ai, aj )= length(bi,bj) p−r • or length(ai, aj), length(bi,bj) ≥ 2 − 1. Evenness is not first order definable, even on linear orders. The only first order definable sets of linear orders are the finite or co-finite ones. Anuj Dawar February 2008 20 Connectivity Consider the signature (E,<). and structures G =(V,E,<) in which E is a graph relation (i.e., an irreflexive, symmetric relation) and < is a linear order. There is no first order sentence γ in this signature such that G |= γ if, and only if, (V, E) is connected. Note: The compactness-based argument that connectivity is undefinable leaves open the possibility that there is a sentence whose finite models are exactly the connected graphs.