0% found this document useful (0 votes)
18 views

Notes

Uploaded by

mynameisblove
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Notes

Uploaded by

mynameisblove
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

1 2

What is This Course About?


Topics in Logic and Complexity
Lecture 1 Complexity Theory is the study of what makes some algorithmic
problems inherently difficult to solve.

Anuj Dawar Difficult in the sense that there is no efficient algorithm.

Mathematical Logic is the study of formal mathematical reasoning.


MPhil Advanced Computer Science, Lent 2013 It gives a mathematical account of meta-mathematical
notions such as structure, language and proof.

In this course we will see how logic can be used to study complexity
theory. In particular, we will look at how complexity relates to
definability.

3 4

Computational Complexity Graph Properties

Complexity is usually defined in terms of running time or space For simplicity, we often focus on decision problems.
asymptotically required by an algorithm. E.g.
• Merge Sort runs in time O(n log n). As an example, consider the following three decision problems on
graphs.
• Any sorting algorithm that can sort an arbitrary list of n
numbers requires time Ω(n log n). 1. Given a graph G = (V, E) does it contain a triangle?
2. Given a directed graph G = (V, E) and two of its vertices
Complexity theory is concerned with the hardness of problems s, t ∈ V , does G contain a path from s to t?
rather than specific algorithms. 3. Given a graph G = (V, E) is it 3-colourable? That is,
We will mostly be concerned with broad classification of is there a function χ : V → {1, 2, 3} so that whenever
complexity: logarithmic vs. polynomial vs. exponential. (u, v) ∈ E, χ(u) 6= χ(v).
5 6

Graph Properties Logical Definability

1. Checking if G contains a triangle can be solved in polynomial In what kind of formal language can these decision problems be
time and logarithmic space. specified or defined?

2. Checking if G contains a path from s to t can be done in The graph G = (V, E) contains a triangle.
polynomial time.
Can it be done in logarithmic space?
∃x ∈ V ∃y ∈ V ∃z ∈ V (x 6= y∧y 6= z∧x 6= z∧E(x, y)∧E(x, z)∧E(y, z))
Unlikely. It is NL-complete.

3. Checking if G is 3-colourable can be done in exponential time The other two properties are provably not definable with only
and polynomial space. first-order quantification over vertices.
Can it be done in polynomial time?
Unlikely. It is NP-complete.

7 8

Second-Order Quantifiers Course Outline

3-Colourability and reachability can be defined with quantification This course is concerned with the questions of (1) how definability
over sets of vertices. relates to computational complexity and (2) how to analyse
definability.
∃R ⊆ V ∃B ⊆ V ∃G ⊆ V
∀x(Rx ∨ Bx ∨ Gx)∧ 1. Complexity Theory—a review of the major complexity classes
and their interrelationships (3L).
∀x(¬(Rx ∧ Bx) ∧ ¬(Bx ∧ Gx) ∧ ¬(Rx ∧ Gx))∧
∀x∀y(Exy → (¬(Rx ∧ Ry)∧ 2. First-order and second-order logic—their expressive power and
computational complexity (3L).
¬(Bx ∧ By)∧
¬(Gx ∧ Gy))) 3. Lower bounds on expressive power—the use of games and
locality (3L).
∀S ⊆ V (s ∈ S ∧ ∀x∀y((x ∈ S ∧ E(x, y)) → y ∈ S) → t ∈ S) 4. Fixed-point logics and descriptive complexity (3L).
5. Monadic Second-Order Logic and Automata (4L).
9 10

Useful Information Decision Problems and Algorithms

Some useful books:


Formally, a decision problem is a set of strings L ⊆ Σ∗ over a finite
• C.H. Papadimitriou. Computational Complexity. alphabet Σ.
Addison-Wesley. 1994.
The problem is decidable if there is an algorithm which given any
• S. Arora and B. Barak. Computational Complexity. CUP. input x ∈ Σ∗ will determine whether x ∈ L or not.
2009.
The notion of an algorithm is formally defined by a machine model:
• H.-D. Ebbinghaus and J. Flum. Finite Model Theory (2nd ed.)
A Turing Machine; Random Access Machine or even a Java
1999.
program.
• N. Immerman. Descriptive Complexity. Springer. 1999.
The choice of machine model doesn’t affect what is or is not
• L. Libkin. Elements of Finite Model Theory. Springer. 2004.
decidable.
• E. Grädel et al. Finite Model Theory and its Applications.
Similarly, we say a function f : Σ∗ → ∆∗ is computable if there is
Springer. 2007.
an algorithm which takes input x ∈ Σ∗ and gives output f (x).
Course website: http://www.cl.cam.ac.uk/teaching/1213/L15/

11 12

Turing Machines Configurations

For our purposes, a Turing Machine consists of: A complete description of the configuration of a machine can be
given if we know what state it is in, what are the contents of its
• K — a finite set of states;
tape, and what is the position of its head. This can be summed up
• Σ — a finite set of symbols, including ⊔. in a simple triple:
• s ∈ K — an initial state; Definition
• δ : (K × Σ) → (K ∪ {a, r}) × Σ × {L, R, S} A configuration is a triple (q, w, u), where q ∈ K and w, u ∈ Σ⋆

A transition function that specifies, for each state and symbol a


next state (or accept a or reject r), a symbol to overwrite the The intuition is that (q, w, u) represents a machine in state q with
current symbol, and a direction for the tape head to move (L – the string wu on its tape, and the head pointing at the last symbol
left, R – right, or S - stationary) in w.

The configuration of a machine completely determines the future


behaviour of the machine.
13 14

Computations Computations

Given a machine M = (K, Σ, s, δ) we say that a configuration The relation →⋆M is the reflexive and transitive closure of →M .
(q, w, u) yields in one step (q ′ , w′ , u′ ), written A sequence of configurations c1 , . . . , cn , where for each i,
ci →M ci+1 , is called a computation of M .
(q, w, u) →M (q ′ , w′ , u′ )
The language L(M ) ⊆ Σ⋆ accepted by the machine M is the set of
if strings
• w = va ;
{x | (s, ⊲, x) →⋆M (acc, w, u) for some w and u}

• δ(q, a) = (q , b, D); and
• either D = L and w′ = v u′ = bu
or D = S and w′ = vb and u′ = u
A machine M is said to halt on input x if for some w and u, either
or D = R and w′ = vbc and u′ = x, where u = cx. If u is
(s, ⊲, x) →⋆M (acc, w, u) or (s, ⊲, x) →⋆M (rej, w, u)
empty, then w′ = vb⊔ and u′ is empty.

15 16

Complexity Nondeterminism

For any function f : IN → IN, we say that a language L is in If, in the definition of a Turing machine, we relax the condition on
TIME(f (n)) if there is a machine M = (K, Σ, s, δ), such that: δ being a function and instead allow an arbitrary relation, we
obtain a nondeterministic Turing machine.
• L = L(M ); and
• The running time of M is O(f (n)). δ ⊆ (K × Σ) × (K ∪ {a, r} × Σ × {R, L, S}).

Similarly, we define SPACE(f (n)) to be the languages accepted by a


The yields relation →M is also no longer functional.
machine which uses O(f (n)) tape cells on inputs of length n.
In defining space complexity, we assume a machine M , which has a We still define the language accepted by M by:
read-only input tape, and a separate work tape. We only count
cells on the work tape towards the complexity. L(M ) = {x | (s, ⊲, x) →⋆M (acc, w, u) for some w and u}

though, for some x, there may be computations leading to


accepting as well as rejecting states.
17 18

Nondeterministic Complexity Computation Trees

For any function f : IN → IN, we say that a language L is in


NTIME(f (n)) if there is a nondeterministic machine With a nondeterministic machine, each configuration gives rise to a
M = (K, Σ, s, δ), such that: tree of successive configurations.
• L = L(M ); and (s, ⊲, x)

• The running time of M is O(f (n)). (q0 , u0 , w0 )(q1 , u1 , w1 )(q2 , u2 , w2 )

The last statement means that for each x ∈ L(M ), there is a (q00 , u00 , w00 ) (rej, u2 , w2 )
computation of M that accepts x and whose length is bounded by
(q10 , u10 , w10 ) (q11 , u11 , w11 )
O(f (|x|)). . .
. .
. .

Similarly, we define NSPACE(f (n)) to be the languages accepted by (acc, . . .)

a nondeterminstic machine which uses O(f (n)) tape cells on inputs


of length n.
As before, in reckoning space complexity, we only count work space.

19 20

Complexity Classes Polynomial Bounds

A complexity class is a collection of languages determined by three By making the bounds broad enough, we can make our definitions
things: fairly independent of the model of computation.
• A model of computation (such as a deterministic Turing The collection of languages recognised in polynomial time is
machine, or a nondeterministic TM, or a parallel Random the same whether we consider Turing machines, register
Access Machine). machines, or any other deterministic model of computation.
• A resource (such as time, space or number of processors). The collection of languages recognised in linear time, on
the other hand, is different on a one-tape and a two-tape
• A set of bounds. This is a set of functions that are used to
Turing machine.
bound the amount of resource we can use.
We can say that being recognisable in polynomial time is a
property of the language, while being recognisable in linear time is
sensitive to the model of computation.
21 22

Reading List for this Part


Topics in Logic and Complexity
1. Papadimitriou. Chapters 1 and 2. Part 2
2. Arora and Barak. Chapter 1.
3. Grädel et al. Chapter 1 (Weinstein). Anuj Dawar

MPhil Advanced Computer Science, Lent 2013

23 24

Polynomial Time Computation Nondeterministic Polynomial Time


[ ∞
[
k
P= TIME(n ) NP = NTIME(nk )
k=1 k=1
The class of languages decidable in polynomial time.
That is, NP is the class of languages accepted by a
The complexity class P plays an important role in complexity
nondeterministic machine running in polynomial time.
theory.
Since a deterministic machine is just a nondeterministic machine in
• It is robust, as explained.
which the transition relation is functional, P ⊆ NP.
• It serves as our formal definition of what is feasibly computable
25 26

Succinct Certificates Equivalence of Definitions

The complexity class NP can be characterised as the collection of If L = {x | ∃y R(x, y)} we can define a nondeterministic machine
languages of the form: M that accepts L.

The machine first uses nondeterministic branching to guess a value


L = {x | ∃y R(x, y)} for y, and then checks whether R(x, y) holds.

Where R is a relation on strings satisfying two key conditions In the other direction, suppose we are given a nondeterministic
machine M which runs in time p(n).
1. R is decidable in polynomial time.
Suppose that for each (q, σ) ∈ K × Σ (i.e. each state, symbol pair)
2. R is polynomially balanced. That is, there is a polynomial p there are at most k elements in δ(q, σ).
such that if R(x, y) and the length of x is n, then the length of
y is no more than p(n).

27 28

Equivalence of Definitions Space Complexity Classes

For y a string over the alphabet {1, . . . , k}, we define the relation L = SPACE(log n)
R(x, y) by: The class of languages decidable in logarithmic space.
• |y| ≤ p(|x|); and NL = NSPACE(log n)
The class of languages decidable by a nondeterministic machine in
• the computation of M on input x which, at step i takes the
logarithmic space.
“y[i]th transition” is an accepting computation. S∞
PSPACE = k=1 SPACE(nk )
The class of languages decidable in polynomial space.
Then, L(M ) = {x | ∃y R(x, y)} S∞
NPSPACE = k=1 NSPACE(nk )
29 30

Inclusions between Classes NP ⊆ PSPACE

We have the following inclusions: To simulate a nondeterministic machine M running in time t(n) by
a deterministic one, it suffices to carry out a depth-first search of
L ⊆ NL ⊆ P ⊆ NP ⊆ PSPACE ⊆ NPSPACE ⊆ EXP the computation tree.
We keep a counter to cut off branches that exceed t(n) steps.
S∞ nk
where EXP = k=1 TIME(2 ) The space required is:

Of these, the following are direct from the definitions: • a counter to count up to t(n); and
• a stack of configurations, each of size at most O(t(n)).
L ⊆ NL The depth of the stack is at most t(n).
P ⊆ NP Thus, if t is a polynomial, the total space required is polynomial.
PSPACE ⊆ NPSPACE

31 32

NL ⊆ P Reachability in the Configuration Graph

Given a nondeterministic machine M that works with work space M accepts x if, and only if, some accepting configuration is
bounded by s(n) and an input x of length n, there is some constant reachable from the starting configuration in the configuration graph
c such that of M, x.

the total number of possible configurations of M within


space bounds s(n) is bounded by n · cs(n) . Using an O(n2 ) algorithm for Reachability, we get that M can be
simulated by a deterministic machine operating in time

Define the configuration graph of M, x to be the graph whose nodes c′ (ncs(n) )2 ∼ c′ c2(log n+s(n)) ∼ d(log n+s(n))
are the possible configurations, and there is an edge from i to j if,
for some constant d.
and only if, i →M j.

When s(n) = O(log n), this is polynomial and so NL ⊆ P.


When s(n) is polynomial this is exponential in n and so
NPSPACE ⊆ EXP.
33 34

Nondeterministic Space Classes Reachability in O((log n)2 )

If Reachability were solvable by a deterministic machine with O((log n)2 ) space Reachability algorithm:
logarithmic space, then
L = NL. Path(a, b, i)
if i = 1 and (a, b) is not an edge reject
else if (a, b) is an edge or a = b accept
In fact, Reachability is solvable by a deterministic machine with else, for each node x, check:
space O((log n)2 ). 1. is there a path a − x of length i/2; and
This implies 2. is there a path x − b of length i/2?
NSPACE(s(n)) ⊆ SPACE((s(n)2 )).
if such an x is found, then accept, else reject.

In particular PSPACE = NPSPACE. The maximum depth of recursion is log n, and the number of bits
of information kept at each stage is 3 log n.

35 36

Inclusions between Classes Complement Classes

This leaves us with the following: If we interchange accepting and rejecting states in a deterministic
machine that accepts the language L, we get one that accepts L.
L ⊆ NL ⊆ P ⊆ NP ⊆ PSPACE ⊆ EXP If a language L ∈ P, then also L ∈ P.

Hierarchy Theorems proved by diagonalization can show that: Complexity classes defined in terms of nondeterministic machine
models are not necessarily closed under complementation of
languages.
L 6= PSPACE NL 6= NPSPACE P 6= EXP

Define,
For other inclusions above, it remains an open question whether co-NP – the languages whose complements are in NP.
they are strict.
co-NL – the languages whose complements are in NL.
37 38

Relationships Reductions

P ⊆ NP ∩ co-NP and any of the situations is consistent with our Given two languages L1 ⊆ Σ⋆1 , and L2 ⊆ Σ⋆2 ,
present state of knowledge:
• P = NP = co-NP a reduction of L1 to L2 is a computable function

• P = NP ∩ co-NP 6= NP 6= co-NP
f : Σ⋆1 → Σ⋆2
• P 6= NP ∩ co-NP = NP = co-NP
such that for every string x ∈ Σ⋆1 ,
• P 6= NP ∩ co-NP 6= NP 6= co-NP

f (x) ∈ L2 if, and only if, x ∈ L1


It follows from the fact that PSPACE = NPSPACE that NPSPACE is
closed under complementation.

Also, Immerman and Szelepcsényi showed that NL = co-NL.

39 40

Resource Bounded Reductions Reductions 2

If f is computable by a polynomial time algorithm, we say that L1 If L1 ≤ L2 we understand that L1 is no more difficult to solve than
is polynomial time reducible to L2 . L2 .

L1 ≤P L2 That is to say, for any of the complexity classes C we consider,


If L1 ≤ L2 and L2 ∈ C, then L1 ∈ C

If f is also computable in SPACE(log n), we write We can get an algorithm to decide L1 by first computing f , and
then using the C-algorithm for L2 .
L1 ≤L L2 Provided that C is closed under such reductions.
41 42

Completeness Complete Problems

The usefulness of reductions is that they allow us to establish the Examples of complete problems for various complexity classes.
relative complexity of problems, even when we cannot prove
NL
absolute lower bounds.
Reachability
P
Cook (1972) first showed that there are problems in NP that are
Game, Circuit Value Problem
maximally difficult.
NP Satisfiability of Boolean Formulas, Graph 3-Colourability,
For any complexity class C, a language L is said to be C-hard if for Hamiltonian Cycle
every language A ∈ C, A ≤ L. co-NP
Validity of Boolean Formulas, Non 3-colourability
A language L is C-complete if it is in C and it is C-hard.
PSPACE
Geography, The game of HEX

43 44

Reading List for this Part


Topics in Logic and Complexity
1. Papadimitriou. Chapters 7, 8 and 16. Part 3
2. Arora and Barak. Chapters 2 and 4.
3. Immerman Chapter 2. Anuj Dawar

MPhil Advanced Computer Science, Lent 2013


45 46

P-complete Problems Circuit Value Problem

Game A Circuit is a directed acyclic graph G = (V, E) where each node


has in-degree 0, 1 or 2 and there is exactly one vertex t with no
Input: A directed graph G = (V, E) with a partition
outgoing edges, along with a labelling which assigns:
V = V1 ∪ V2 of the vertices and two distinguished vertices
s, t ∈ V . • to each node of indegree 0 a value of 0 or 1
Decide: whether Player 1 can force a token from s to t in • to each node of indegree 1 a label ¬
the game where when the token is on v ∈ V1 , Player 1
• to each node of indegree 2 a label ∧ or ∨
moves it along an edge leaving v and when it is on v ∈ V2 ,
Player 2 moves it along an edge leaving v. The problem CVP is, given a circuit, decide if the target node t
evaluates to 1.

47 48

NP-complete Problems co-NP-complete Problems

SAT VAL
Input: A Boolean formula φ Input: A Boolean formula φ
Decide: if there is an assignment of truth values to the Decide: if every assignment of truth values to the variables
variables of φ that makes φ true. of φ makes φ true.

Hamiltonicity Non-3-colourability
Input: A graph G = (V, E) Input: A graph G = (V, E)
Decide: if there is a cycle in G that visits every vertex Decide: if there is no function χ : V → {1, 2, 3} such that
exactly once. the two endpoints of every edge are differently coloured.
49 50

PSPACE-complete Problems Descriptive Complexity

Descriptive Complexity provides an alternative perspective on


Geography is very much like Game but now players are not allowed
Computational Complexity.
to visit a vertex that has been previously visitied.
Computational Complexity
HEX is a game played by two players on a graph G = (V, E) with a
• Measure use of resources (space, time, etc.) on a machine
source and target s, t ∈ V .
model of computation;
The two players take turns selecting vertices from V —neither
• Complexity of a language—i.e. a set of strings.
player can choose a vertex that has been previously selected.
Player 1 wins if, at any point, the vertices she has selected include Descriptive Complexity
a path from s to t. Player 2 wins if all vertices have been selected • Complexity of a class of structures—e.g. a collection of graphs.
and no such path is formed. • Measure the complexity of describing the collection in a formal
The problem is to decide which player has a winning strategy. logic, using resources such as variables, quantifiers,
higher-order operators, etc.
There is a fascinating interplay between the views.

51 52

Signature and Structure Structure

In general a signature (or vocabulary) σ is a finite sequence of A structure A over the signature σ is a tuple:
relation, function and constant symbols:
A = (A, R1A , . . . , Rm
A
, f1A , . . . , fnA , cA A
1 , . . . , cn ),
σ = (R1 , . . . , Rm , f1 , . . . , fn , c1 , . . . , cp )
where,
where, associated with each relation and function symbol is an
• A is a non-empty set, the universe of the strucure A,
arity.
• each RiA is a relation over A of the appropriate arity.
• each fiA is a function over A of the appropriate arity.
• each cA
i is an element of A.
53 54

First-order Logic Queries

A formula φ with free variables among x1 , . . . , xn defines a map Q


Formulas of first-order logic are formed from the signature σ and
from structures to relations:
an infinite collection X of variables as follows.
Q(A) = {a | A |= φ[a]}.
terms – c, x, f (t1 , . . . , ta )

Formulas are defined by induction: Any such map Q which associates to every structure A a (n-ary)
relation on A, and is isomorphism invariant, is called a (n-ary)
• atomic formulas – R(t1 , . . . , ta ), t1 = t2
query.
• Boolean operations – φ ∧ ψ, φ ∨ ψ, ¬φ
Q is isomorphism invariant if, whenever f : A → B is an
• first-order quantifiers – ∃xφ, ∀xφ isomorphism between A and B, it is also an isomorphism between
(A, Q(A)) and (B, Q(B)).

If n = 0, we can regard the query as a map from structures to


{0, 1}—a Boolean query.

55 56

Graphs Complexity

For example, take the signature (E), where E is a binary relation For a first-order sentence φ, we ask what is the computational
symbol. complexity of the problem:

Finite structures (V, E) of this signature are directed graphs. Input: a structure A
Decide: if A |= φ
Moreover, the class of such finite structures satisfying the sentence
In other words, how complex can the collection of finite models of φ
∀x¬Exx ∧ ∀x∀y(Exy → Eyx)
be?
can be identified with the class of (loop-free, undirected) graphs.
In order to talk of the complexity of a class of finite structures, we
need to fix some way of representing finite structures as strings.
57 58

Representing Structures as Strings Naı̈ve Algorithm

The straightforward algorithm proceeds recursively on the


We use an alphabet Σ = {0, 1, #, −}.
structure of φ:
For a structure A = (A, R1 , . . . , Rm , f1 , . . . , fl ), fix a linear order <
• Atomic formulas by direct lookup.
on A = {a1 , . . . , an }.
• Boolean connectives are easy.
Ri (of arity k) is encoded by a string [Ri ]< of 0s and 1s of length
• If φ ≡ ∃x ψ then for each a ∈ A check whether
nk .
(A, c 7→ a) |= ψ[c/x],
fi is encoded by a string [fi ]< of 0s, 1s and −s of length nk log n.
where c is a new constant symbol.

[A]< = |1 ·{z
· · 1} #[R1 ]< # · · · #[Rm ]< #[f1 ]< # · · · #[fl ]< This runs in time O(lnm ) and O(m log n) space, where m is the
n nesting depth of quantifiers in φ.

The exact string obtained depends on the choice of order. Mod(φ) = {A | A |= φ}


is in logarithmic space and polynomial time.

59 60

Reading List for this Part


Topics in Logic and Complexity
1. Papadimitriou. Chapter 8. Part 4
2. Libkin Chapter 2.
3. Grädel et al. Sections 2.1–2.4 (Kolaitis). Anuj Dawar

MPhil Advanced Computer Science, Lent 2013


61 62

Complexity of First-Order Logic QBF

The following problem: We define quantified Boolean formulas inductively as follows, from
FO satisfaction a set X of propositional variables.

Input: a structure A and a first-order sentence φ • A propositional constant T or F is a formula


Decide: if A |= φ • A propositional variable X ∈ X is a formula
is PSPACE-complete. • If φ and ψ are formulas then so are: ¬φ, φ ∧ ψ and φ ∨ ψ
• If φ is a formula and X is a variable then ∃X φ and ∀X φ are
It follows from the O(lnm ) and O(m log n) space algorithm that the formulas.
problem is in PSPACE.
Say that an occurrence of a variable X is free in a formula φ if it is
How do we prove completeness?
not within the scope of a quantifier of the form ∃X or ∀X.

63 64

QBF Complexity of QBF

Given a quantified Boolean formula φ and an assignment of truth Note that a Boolean formula φ without quantifiers and with
values to its free variables, we can ask whether φ evaluates to true variables X1 , . . . , Xn is satisfiable if, and only if, the formula
or false.
∃X1 · · · ∃Xn φ is true.
In particular, if φ has no free variables, then it is equivalent to
either true or false. Similarly, φ is valid if, and only if, the formula

∀X1 · · · ∀Xn φ is true.


QBF is the following decision problem:
Input: a quantified Boolean formula φ with no free
Thus, SAT ≤L QBF and VAL ≤L QBF and so QBF is NP-hard and
variables.
co-NP-hard.
Decide: whether φ evaluates to true.
In fact, QBF is PSPACE-complete.
65 66

QBF is in PSPACE PSPACE-completeness

To see that QBF is in PSPACE, consider the algorithm that To prove that QBF is PSPACE-complete, we want to show:
maintains a 1-bit register X for each Boolean variable appearing in
Given a machine M with a polynomial space bound and an
the input formula φ and evaluates φ in the natural fashion.
input x, we can define a quantified Boolean formula φMx
which evaluates to true if, and only if, M accepts x.
The crucial cases are:
Moreover, φMx can be computed from x in polynomial time
• If φ is ∃X ψ then return T if either (X ← T ; evaluate ψ) or (or even logarithmic space).
(X ← F ; evaluate ψ) returns T.
• If φ is ∀X ψ then return T if both (X ← T ; evaluate ψ) and The number of distinct configurations of M on input x is bounded
k
(X ← F ; evaluate ψ) return T. by 2n for some k (n = |x|).
Each configuration can be represented by nk bits.

67 68

Constructing φM
x
Reducing QBF to FO satisfaction

We use tuples A, B of nk Boolean variables each to encode We have seen that FO satisfaction is in PSPACE.
configurations of M . To show that it is PSPACE-complete, it suffices to show that
Inductively, we define a formula ψi (A, B) which is true if the QBF ≤L FO sat.
configuration coded by B is reachable from that coded by A in at
most 2i steps. The reduction maps a quantified Boolean formula φ to a pair
(A, φ∗ ) where A is a structure with two elements: 0 and 1
ψ0 (A, B) ≡ “A = B′′ ∨ “A →M B′′ interpreting two constants f and t respectively.
ψi+1 (A, B) ≡ ∃Z∀X∀Y [(X = A ∧ Y = Z) ∨ (X = Z ∧ Y = B)
⇒ ψi (X, Y)] φ∗ is obtained from φ by a simple inductive definition.
φ ≡ ψnk (A, B) ∧ “A = start′′ ∧ “B = accept′′
69 70

Expressive Power of FO Second-Order Logic

For any fixed sentence φ of first-order logic, the class of structures We extend first-order logic by a set of relational variables.
Mod(φ) is in L.
For each m ∈ N there is an infinite collection of variables
V m = {V1m , V2m , . . .} of arity m.
There are computationally easy properties that are not definable in
first-order logic. Second-order logic extends first-order logic by allowing second-order
quantifiers
• There is no sentence φ of first-order logic such that A |= φ if,
∃X φ for X ∈ V m
and only if, |A| is even.
A structure A satisfies ∃X φ if there is an m-ary relation R on the
• There is no formula φ(E, x, y) that defines the transitive
universe of A such that (A, X → R) satisfies φ.
closure of a binary relation E.

We will see proofs of these facts later on.

71 72

Existential Second-Order Logic Examples

ESO—existential second-order logic consists of those formulas of Evennness


second-order logic of the form: This formula is true in a structure if, and only if, the size of the
domain is even.
∃X1 · · · ∃Xk φ
∃B∃S ∀x∃yB(x, y) ∧ ∀x∀y∀zB(x, y) ∧ B(x, z) → y = z
where φ is a first-order formula.
∀x∀y∀zB(x, z) ∧ B(y, z) → x = y
∀x∀yS(x) ∧ B(x, y) → ¬S(y)
∀x∀y¬S(x) ∧ B(x, y) → S(y)
73 74

Examples Examples

Transitive Closure 3-Colourability


This formula is true of a pair of elements a, b in a structure if, and The following formula is true in a graph (V, E) if, and only if, it is
only if, there is an E-path from a to b. 3-colourable.
∃P ∀x∀y P (x, y) → E(x, y) ∃R∃B∃G ∀x(Rx ∨ Bx ∨ Gx)∧
∃xP (a, x) ∧ ∃xP (x, b) ∧ ¬∃xP (x, a) ∧ ¬∃xP (b, x) ∀x( ¬(Rx ∧ Bx) ∧ ¬(Bx ∧ Gx) ∧ ¬(Rx ∧ Gx))∧
∀x∀y(P (x, y) → ∀z(P (x, z) → y = z)) ∀x∀y(Exy → ( ¬(Rx ∧ Ry)∧
∀x∀y(P (x, y) → ∀z(P (z, y) → x = z)) ¬(Bx ∧ By)∧
∀x((x 6= a ∧ ∃yP (x, y)) → ∃zP (z, x)) ¬(Gx ∧ Gy)))
∀x((x 6= b ∧ ∃yP (y, x)) → ∃zP (x, z))

75 76

Reading List for this Part


Topics in Logic and Complexity
1. Papadimitriou. Chapter 5. Section 19.1. Part 5
2. Grädel et al. Section 3.1
Anuj Dawar

MPhil Advanced Computer Science, Lent 2013


77 78

Fagin’s Theorem Fagin’s Theorem

Theorem (Fagin) Given a machine M and an integer k, there is an ESO sentence φ


A class C of finite structures is definable by a sentence of existential such that A |= φ if, and only if, M accepts [A]< , for some order <
second-order logic if, and only if, it is decidable by a in nk steps.
nondeterminisitic machine running in polynomial time.
We construct a first-order formula φM,k such that
ESO = NP
(A, <, X) |= φM,k ⇔ X codes an accepting computation of M

One direction is easy: Given A and ∃P1 . . . ∃Pm φ. of length at most nk on input [A]<

a nondeterministic machine can guess an interpretation for


So, A |= ∃ < ∃X φM,k if, and only if, there is some order < on A so
P1 , . . . , Pm and then verify φ.
that M accepts [A]< in time nk .

79 80

Order Ordering Tuples

The formula φM,k is built up as the conjunction of a number of If x = x1 , . . . , xk and y = y1 , . . . , yk are k-tuples of variables, we
W
formulas. The first of these simply says that < is a linear order use x = y as shorthand for the formula i<k xi = yi and x < y as
shorthand for the formula
∀x(¬x < x)∧ _ _ 
∀x∀y(x < y → ¬y < x)∧ ( xj = yj ) ∧ xi < yi
i<k j<i
∀x∀y(x < y ∨ y < x ∨ x = y)
∀x∀y∀z(x < y ∧ y < z → x < z) We also write y = x + 1 for the following formula:

x < y ∧ ∀z x < z → (y = z ∨ y < z)
We can use a linear order on the elements of A to define a
lexicographic order on k-tuples.
81 82

Constructing the Formula

Let M = (K, Σ, s, δ). Intuitively, these relations are intended to capture the following:
The tuple X of second-order variables appearing in φM,k contains • Sq (x) – the state of the machine at time x is q.
the following:
• Tσ (x, y) – at time x, the symbol at position y of the tape is σ.

Sq a k-ary relation symbol for each q ∈ K • H(x, y) – at time x, the tape head is pointing at tape cell y.
Tσ a 2k-ary relation symbol for each σ ∈ Σ
H a 2k-ary relation symbol
We now have to see how to write the formula φM,k , so that it
enforces these meanings.

83 84

Initial state is s and the head is initially at the beginning of the Initial Tape Contents
tape.

∀x (∀y x ≤ y) → Ss (x) ∧ H(x, x) The initial contents of the tape are [A]< .
The head is never in two places at once
 ∀x x ≤ n → T1 (1, x)∧
∀x∀y H(x, y) → (∀z(y 6= z) → (¬H(x, z))) x ≤ na → (T1 (1, x + n + 1) ↔ R1 (x|a ))
The machine is never in two states at once ...
^ ^
∀x (Sq (x) → (¬Sq′ (x))) where,
^
q q ′ 6=q x < na : xi = 0
i≤(k−a)
Each tape cell contains only one symbol
^ ^
∀x∀y (Tσ (x, y) → (¬Tσ′ (x, y)))
σ σ ′ 6=σ
85 86

The tape does not change except under the head


^
∀x∀y∀z(y 6= z → ( (H(x, y) ∧ Tσ (x, z) → Tσ (x + 1, z)))
σ where ∆ is the set of all triples (q ′ , σ ′ , D) such that
((q, σ), (q ′ , σ ′ , D)) ∈ δ and
Each step is according to δ.

 j if D = S
^^ 

∀x∀y (H(x, y) ∧ Sq (x) ∧ Tσ (x, y)) ′
σ q j = j − 1 if D = L
_ 

→ (H(x + 1, y′ ) ∧ Sq′ (x + 1) ∧ Tσ′ (x + 1, y)) 
j + 1 if D = R

Finally, some accepting state is reached

∃x Sacc (x)

87 88

NP co-NP

Recall that a languge L is in NP if, and only if, USO—universal second-order logic consists of those formulas of
second-order logic of the form:
L = {x | ∃yR(x, y)}
∀X1 · · · ∀Xk φ
where R is polynomial-time decidable and polynomially-balanced.
where φ is a first-order formula.
Fagin’s theorem tells us that polynomial-time decidability can, in
some sense, be replaced by first-order definability. A corollary of Fagin’s theorem is that a class C of finite structures
is definable by a sentence of existential second-order logic if, and
only if, it is decidable by a nondeterminisitic machine running in
polynomial time.
USO = co-NP
89 90

Second-Order Alternation Hierarchy Polynomial Hierarchy

We can define further classes by allowing other second-order We have, for each n:
quantifier prefixes.
Σ1n ∪ Π1n ⊆ Σ1n+1 ∩ Π1n+1
Σ11 = ESO
Π11 = USO
The classes together form the polynomial hierarchy or PH.
Σ1n+1 is the collection of properties definable by a sentence of the
form: ∃X1 · · · ∃Xk φ where φ is a Π1n formula.
NP ⊆ PH ⊆ PSPACE
Π1n+1 is the collection of properties definable by a sentence of the
P = NP if, and only if, P = PH
form: ∀X1 · · · ∀Xk φ where φ is a Σ1n formula.

Note: every formula of second-order logic is Σ1n and Π1n for some n.

91 92

Reading List for this Part


Topics in Logic and Complexity
1. Arora and Barak Chapter 5. Part 6
2. Grädel et al. Section 3.2
3. Libkin. Chapter 9. Anuj Dawar

4. Ebbinghaus and Flum. Chapter 7.

MPhil Advanced Computer Science, Lent 2013


93 94

Expressive Power of First-Order Logic Quantifier Rank

We noted that there are computationally easy properties that are The quantifier rank of a formula φ, written qr(φ) is defined
not definable in first-order logic. inductively as follows:
• There is no sentence φ of first-order logic such that A |= φ if, 1. if φ is atomic then qr(φ) = 0,
and only if, |A| is even.
2. if φ = ¬ψ then qr(φ) = qr(ψ),
• There is no sentence φ that defines exactly the connected
3. if φ = ψ1 ∨ ψ2 or φ = ψ1 ∧ ψ2 then
graphs.
qr(φ) = max(qr(ψ1 ), qr(ψ2 )).
How do we prove these facts?
4. if φ = ∃xψ or φ = ∀xψ then qr(φ) = qr(ψ) + 1

Our next aim is to develop the tools that enable such proofs. More informally, qr(φ) is the maximum depth of nesting of
quantifiers inside φ.

95 96

Formulas of Bounded Quantifier Rank Formulas of Bounded Quantifier Rank

Note: For the rest of this lecture, we assume that our signature If qr(φ) = 0 then φ is a Boolean combination of atomic formulas. If
consists only of relation and constant symbols. That is, there are it is has m variables, it is equivalent to a formula using the
no function symbols of non-zero arity. variables x1 , . . . , xm . There are finitely many formulas, up to logical
equivalence.
With this proviso, it is easily proved that in a finite vocabulary, for
Suppose qr(φ) = q + 1 and the free variables of φ are among
each q, there are (up to logical equivalence) only finitely many
x1 , . . . , xm . Then φ is a Boolean combination of formulas of the
sentences φ with qr(φ) ≤ q.
form
∃xm+1 ψ
To be precise, we prove by induction on q that for all m, there are
where ψ is a formula with qr(ψ) = q and free variables
only finitely many formulas of quantifier rank q with at most m
x1 , . . . , xm , xm+1 .
free variables.
By induction hypothesis, there are only finitely many such
formulas, and therefore finitely many Boolean combinations.
97 98

Equivalence Relation Partial Isomorphisms

For two structures A and B, we say A ≡q B if for any sentence φ A map f is a partial isomorphism between structures A and B, if
with qr(φ) ≤ q,
• the domain of f = {a1 , . . . , al } ⊆ A, including the
A |= φ if, and only if, B |= φ. interpretation of all constants;
• the range of f = {b1 , . . . , bl } ⊆ B, including the interpretation
of all constants; and
More generally, if a and b are m-tuples of elements from A and B
respectively, then we write (A, a) ≡q (B, b) if for any formula φ • f is an isomorphism between its domain and range.
with m free variables qr(φ) ≤ q, Note that if f is a partial isomorphism taking a tuple a to a tuple
A |= φ[a] if, and only if, B |= φ[b]. b, then for any quantifier-free formula θ

A |= θ[a] if, and only if, B |= θ[b].

99 100

Ehrenfeucht-Fraı̈ssé Games Equivalence and Games

The q-round Ehrenfeucht game on structures A and B proceeds as Write A ∼q B to denote the fact that Duplicator has a winning
follows: strategy in the q-round Ehrenfeucht game on A and B.
• There are two players called Spoiler and Duplicator. The relation ∼q is, in fact, an equivalence relation.

• At the ith round, Spoiler chooses one of the structures (say B)


and one of the elements of that structure (say bi ). Theorem (Fraı̈ssé 1954; Ehrenfeucht 1961)
A ∼q B if, and only if, A ≡q B
• Duplicator must respond with an element of the other
structure (say ai ).
While one direction A ∼q B ⇒ A ≡q B is true for an arbitrary
• If, after q rounds, the map ai 7→ bi is a partial isomorphism, vocabulary, the other direction assumes that the vocabulary is
then Duplicator has won the game, otherwise Spoiler has won. finite and has no function symbols.
101 102

Proof Proof

To prove A ∼q B ⇒ A ≡q B, it suffices to show that if there is a We prove by induction on q the stronger statement that if φ is a
sentence φ with qr(φ) ≤ q such that formula with qr(φ) ≤ q and a = (a1 , . . . , am ) and b = (b1 , . . . , bm )
are tuples of elements from A and B respectively such that
A |= φ and B 6|= φ
A |= φ[a] and B 6|= φ[b]
then Spoiler has a winning strategy in the q-round Ehrenfeucht
game on A and B. then Spoiler has a winning strategy in the q-round Ehrenfeucht
game which starts from a position in which a1 , . . . , am and
Assume that φ is in negation normal form, i.e. all negations are in front b1 , . . . , bm have already been selected.
of atomic formulas.

103 104

Proof Using Games

When q = 0, φ is a quantifier-free formula. Thus, if To show that a class of structures S is not definable in FO, we find,
for every q, a pair of structures Aq and Bq such that
A |= φ[a] and B 6|= φ[b]
• Aq ∈ S, Bq ∈ S; and
there is an atomic formula θ that distinguishes the two tuples and
therefore the map taking a to b is not a partial isomorphism. • Duplicator wins a q-round game on Aq and Bq .

When q = p + 1, there is a subformula θ of φ of the form ∃xψ or


This shows that S is not closed under the relation ≡q for any q.
∀xψ such that qr(ψ) ≤ p and
Fact:
A |= θ[a] and B 6|= θ[b]
S is definable by a first order sentence if, and only if, S is
If θ = ∃xψ, Spoiler chooses a witness for x in A. closed under the relation ≡q for some q.
If θ = ∀xψ, B |= ∃x¬ψ and Spoiler chooses a witness for x in B.
The direction from right to left requires a finite, function-free
vocabulary.
105 106

Evenness Linear Orders

Let A be a structure in the empty vocabulary with q elements and B Let Ln denote the structure in one binary relation ≤ which is a
be a structure with q + 1 elements. linear order of n elements. Then L6 6≡3 L7 but L7 ≡3 L8 .
Then, it is easy to see that A ∼q B.
In general, for m, n ≥ 2p − 1,
It follows that there is no first-order sentence that defines the Lm ≡p Ln
structures with an even number of elements.
Duplicator’s strategy is to maintain the following condition after r
rounds of the game:
If S ⊆ N is a set such that
for 1 ≤ i < j ≤ r,
{A | |A| ∈ S}
• either length(ai , aj ) = length(bi , bj )
is definable by a first-order sentence then S is finite or co-finite.
• or length(ai , aj ), length(bi , bj ) ≥ 2p−r − 1
Evenness is not first order definable, even on linear orders.

107 108

Reading List for this Part


Topics in Logic and Complexity
1. Ebbinghaus and Flum. Chapter 2. Part 7
2. Libkin. Chapter 3.
3. Grädel et al. Section 2.3. Anuj Dawar

MPhil Advanced Computer Science, Lent 2013


109 110

Connectivity Proof

Consider the signature (E, <). Suppose there was such a formula γ.

Consider structures G = (V, E, <) in which E is a graph relation Let γ ′ be the formula obtained by replacing every occurrence of
and < is a linear order. E(x, y) in γ by the following formula

There is no first order sentence γ in this signature such that y = x + 2∨


G |= γ if, and only if, (V, E) is connected. (x = max ∧y = min +1)∨
(y = min ∧x = max −1).

Then, ¬γ ′ defines evenness on linear orders!

111 112

Proof Reduction

The above is, in fact, a first-order definable reduction from the


problem of evenness of linear orders to the problem of connectivity
of ordered graphs.

It follows from the above that there is no first order formula that
can express the transitive closure query on graphs.
Any such formula would also work on ordered graphs.

We obtain two disjoint cycles on linear orders of even length, and a


single cycle on linear orders of odd length.
113 114

Gaifman Graphs and Neighbourhoods Hanf Locality Theorem

On a structure A, define the binary relation: We say A and B are Hanf equivalent with radius r (A ≃r B) if, for
every a ∈ A the two sets
E(a1 , a2 ) if, and only if, there is some relation R and some
tuple a containing both a1 and a2 with R(a). {a′ ∈ a | NbdA ∼ A ′
{b ∈ B | NbdA ∼ B
r (a) = Nbdr (a )} and r (a) = Nbdr (b)}

The graph GA = (A, E) is called the Gaifman graph of A. have the same cardinality
and, similarly for every b ∈ B.
dist(a, b) — the distance between a and b in the graph (A, E).

Theorem (Hanf )
NbdA
r (a) — the substructure of A given by the set: For every vocabulary σ and every p there is r ≤ 3p such that for
any σ-structures A and B: if A ≃r B then A ≡p B.
{b | dist(a, b) ≤ r}
In other words, if r ≥ 3p , the equivalence relation ≃r is a
refinement of ≡p .

115 116

Hanf Locality Uses of Hanf locality

Duplicator’s strategy is to maintain the following condition: The Hanf locality theorem immediately yields, as special cases, the
After k moves, if a1 , . . . , ak and b1 , . . . , bk have been selected, then proofs of undefinability of:
[

[ • connectivity;
NbdA 3p−k (ai ) = NbdB3p−k (bi )
i i • 2-colourability
• acyclicity
If Spoiler plays on a within distance 2 · 3p−k−1 of a previously
chosen point, play according to the isomorphism, otherwise, find b • planarity
such that
Nbd3p−k−1 (a) ∼
= Nbd3p−k−1 (b) A simple illustration can suffice.
p−k−1
and b is not within distance 2 · 3 of a previously chosen point.
Such a b is guaranteed by ≃r .
117 118

Connectivity Acyclicity

To illustrate the undefinability of connectivity and 2-colourability, A figure illustrating that acyclicity is not first-order definable.
consider on the one hand the graph consisting of a single cycle of
length 4r + 6 and, on the other hand, a graph consisting of two
disjoint cycles of length 2r + 3.

119 120

Planarity Monadic Second Order Logic

A figure illustrating that planarity is not first-order definable. MSO consists of those second order formulas in which all relational
variables are unary.

That is, we allow quantification over sets of elements, but


not other relations.

Any MSO formula can be put in prenex normal form with


second-order quantifiers preceding first order ones.

Mon.Σ11 — MSO formulas with only existential second-order


quantifiers in prenex normal form.

Mon.Π11 — MSO formulas with only universal second-order


quantifiers in prenex normal form.
121 122

Undefinability in MSO Connectivity

The method of games and locality can also be used to show Recall that connectivity of graphs can be defined by a Mon.Π11
inexpressibility results in MSO. sentence.

In particular, ∀S(∃x Sx ∧ (∀x∀y (Sx ∧ Exy) → Sy)) → ∀x Sx


There is a Mon.Σ11 query that is not definable in Mon.Π11
(Fagin 1974)
and by a Σ11 sentence (simply because it is in NP).

Note: A similar result without the monadic restriction would imply


We now aim to show that connectivity is not definable by a Mon.Σ11
that NP 6= co-NP and therefore that P 6= NP.
sentence.

123 124

MSO Game MSO Game

The m-round monadic Ehrenfeucht game on structures A and B • If, after m rounds, the map
proceeds as follows:
ai 7→ bi
• At the ith round, Spoiler chooses one of the structures (say B)
and plays either a point move or a set move. is a partial isomorphism between

In a point move, he chooses one of the elements of the (A, R1 , . . . , Rq ) and (B, S1 , . . . , Sq )
chosen structure (say bi ) – Duplicator must respond with
then Duplicator has won the game, otherwise Spoiler has won.
an element of the other structure (say ai ).
In a set move, he chooses a subset of the universe of the
chosen structure (say Si ) – Duplicator must respond
with a subset of the other structure (say Ri ).
125 126

MSO Game Existential Game

If we define the quantifier rank of an MSO formula by adding the The m, p-move existential game on (A,B):
following inductive rule to those for a formula of FO:
• First Spoiler makes m set moves on A, and Duplicator replies
if φ = ∃Sψ or φ = ∀Sψ then qr(φ) = qr(ψ) + 1 on B.
then, we have • This is followed by an Ehrenfeucht game with p point moves.
Duplicator has a winning strategy in the m-round monadic
Ehrenfeucht game on structures A and B if, and only if, for If Duplicator has a winning strategy, then for every Mon.Σ11
every sentence φ of MSO with qr(φ) ≤ m sentence:
φ ≡ ∃R1 . . . ∃Rm ψ
A |= φ if, and only if, B |= φ
with qr(ψ) = p,
if A |= φ then B |= φ

127 128

Variation Application

To show that a Boolean query Q is not Mon.Σ11 definable, find for Write Cn for the graph that is a simple cycle of length n.
each m and p
• A ∈ Q; and For n sufficiently large, and any colouring of Cn , we can find an
n′ < n and a colouring of
• B 6∈ P ; such that
Cn′ ⊕ Cn−n′ the disjoint union of two cycles—one of length
• Duplicator wins the m, p move game on (A, B).
n′ , the other of length n − n′
Or,
So that the graphs Cn and Cn′ ⊕ Cn−n′ are ≃r equivalent.
• Duplicator chooses A.
m

• Spoiler colours A (with 2m colours). Taking n > (2r + 1)2 +2


suffices.

• Duplicator chooses B and colours it.


• They play a p-round Ehrenfeucht game.
129 130

Reading List for this Part


Topics in Logic and Complexity
1. Ebbinghaus and Flum. Section 2.4. Part 8
2. Libkin. Chapter 4.
3. Grädel et al. Section 2.3 and 2.5 Anuj Dawar

MPhil Advanced Computer Science, Lent 2013

131 132

Expressive Power of Logics Inductive Definitions

We have seen that the expressive power of first-order logic, in terms LFP is a logic that formalises inductive definitions.
of computational complexity is weak.
Unlike in second-order logic, we cannot quantify over
Second-order logic allows us to express all properties in the arbitrary relations, but we can build new relations
polynomial hierarchy. inductively.

Are there interesting logics intermediate between these two? Inductive definitions are pervasive in mathematics and computer
science.
We have seen one—monadic second-order logic.
The syntax and semantics of various formal languages are typically
We now examine another—LFP—the logic of least fixed points.
defined inductively.
viz. the definitions of the syntax and semantics of
first-order logic seen earlier.
133 134

Transitive Closure Monotone Operators

The transitive closure of a binary relation E is the smallest relation In order to introduce LFP, we briefly look at the theory of
T satisfying: monotone operators, in our restricted context.
• E ⊆ T ; and
We write Pow(A) for the powerset of A.
• if (x, y) ∈ T and (y, z) ∈ E then (x, z) ∈ T .
An operator in A is a function

This constitutes an inductive definition of T and, as we have F : Pow(A) → Pow(A).


already seen, there is no first-order formula that can define T in
F is monotone if
terms of E.
if S ⊆ T, then F (S) ⊆ F (T ).

135 136

Least and Greatest Fixed Points Least and Greatest Fixed Points

A fixed point of F is any set S ⊆ A such that F (S) = S. For any monotone operator F , define the collection of its pre-fixed
points as:
S is the least fixed point of F , if for all fixed points T of F , S ⊆ T . Pre = {S ⊆ A | F (S) ⊆ S}.
Note: A ∈ Pre.
S is the greatest fixed point of F , if for all fixed points T of F ,
T ⊆ S. Taking
\
L= Pre,
we can show that L is a fixed point of F .
137 138

Fixed Points Least and Greatest Fixed Points

For any set S ∈ Pre, L is a fixed point of F .


L⊆S by definition of L. Every fixed point P of F is in Pre, and therefore L ⊆ P .
F (L) ⊆ F (S) by monotonicity of F .
Thus, L is the least fixed point of F
F (L) ⊆ S by definition of Pre.
F (L) ⊆ L by definition of L. Similarly, the greatest fixed point is given by:
F (F (L)) ⊆ F (L) by monotonicity of F [
G = {S ⊆ A | S ⊆ F (S)}.
F (L) ∈ Pre by definition of Pre.
L ⊆ F (L) by definition of L.

139 140

Iteration Iteration

Let A be a finite set and F be a monotone operator on A. Proof by induction.


Define for i ∈ N:
∅ = F 0 ⊆ F 1.
F0 = ∅
F i+1 = F (F i ).
If F i ⊆ F i+1 then, by monotonicity

F (F i ) ⊆ F (F i+1 )
For each i, F i ⊆ F i+1 (proved by induction).
and so F i+1 ⊆ F i+2 .
141 142

Fixed-Point by Iteration Defined Operators

If A has n elements, then Suppose φ contains a relation symbol R (of arity k) not interpreted
in the structure A and let x be a tuple of k free variables of φ.
F n = F n+1 = F m for all m>n
For any relation P ⊆ Ak , φ defines a new relation:
Thus, F n is a fixed point of F .
FP = {a | (A, P ) |= φ[a]}.
Let P be any fixed point of F . We can show induction on i, that
Fi ⊆ P.
F0 = ∅ ⊆ P The operator Fφ : Pow(Ak ) → Pow(Ak ) defined by φ is given by the
map
If F i ⊆ P then
P 7→ FP .
F i+1 = F (F i ) ⊆ F (P ) = P.
Or, Fφ,b if we fix parameters b.

Thus F n is the least fixed point of F .

143 144

Positive Formulas Reading List for this Part

Definition 1. Ebbinghaus and Flum. Section 8.1.


A formula φ is positive in the relation symbol R, if every occurence
2. Libkin. Sections 10.1 and 10.2.
of R in φ is within the scope of an even number of negation signs.
3. Grädel et al. Section 3.3.
Lemma
For any structure A not interpreting the symbol R, any formula φ
which is positive in R, and any tuple b of elements of A, the
operator Fφ,b : Pow(Ak ) → Pow(Ak ) is monotone.

You might also like