<<

1

THE LOGIC IN COMPUTER SCIENCE COLUMN

by

2

Yuri GUREVICH

Electrical Engineering and Computer Science

UniversityofMichigan, Ann Arb or, MI 48109-2122, USA

[email protected]

Zero-One Laws

Quisani: I heard you talking on nite mo del theory the other day.Itisinteresting

indeed that all those famous theorems ab out rst-order logic fail in the case when

only nite structures are allowed. I can understand that for those, likeyou, educated

in the tradition of it seems very imp ortantto ndoutwhichof

the classical theorems can b e rescued. But nite structures are to o imp ortant all by

themselves. There's got to b e deep nite mo del theory that has nothing to do with

in nite structures.

Author: \Nothing to do" sounds a little extremist to me. Sometimes in nite ob jects

are go o d approximations of nite ob jects.

Q: I do not understand this. Usually, nite ob jects approximate in nite ones.

A: It may happ en that the in nite case is cleaner and easier to deal with. For example,

a long nite sum may b e replaced with a simpler integral. Returning to your question,

there is indeed meaningful, inherently nite, mo del theory. One exciting issue is zero-

one laws. Consider, say, undirected graphs and let  be a propertyofsuch graphs. For

example,  may b e connectivity. What fraction of n-vertex graphs have the prop erty

 ? It turns out that, for many natural prop erties  , this fraction converges to 0 or

1asn grows to in nity. If the fraction converges to 1, the prop erty is called

sure. In that sense, almost all graphs are connected, hamiltonian, not 3-colorable,

rigid, etc. [BH, Co2, and references there].

1

\CurrentTrends in Theoretical Computer Science", Eds. G. Rozenb erg and A. Salomaa, World

Scienti c, Series in Computer Science, Volume 40, 1993

2

Partially supp orted by NSF grant CCR 89-04728 and ONR grant N00014-91-J-11861. 1

Q: What is exactly the fraction of n-vertex graphs with prop erty  ? What do es it

mean that a graph is rigid?

A: A graph G is called rigid if the identity map is the only automorphism of G

(i.e. the only isomorphism from G to G). Now, ab out that fraction. There are two

di erent de nitions in the literature:

Lab eled Case: l ( )isthenumber L ( )of  graphs on f1;:::;ng divided by

n n

n(n1)=2

2 , the total numb er of graphs on f1;:::;ng. In other words, l ( )=

n

L ( )=L ( ) where  is the trivial prop ertythatevery graph has.

n n

Unlab eled Case: u ( ) is the U ( ) of isomorphism typ es of n-vertex 

n n

graphs divided by the total number U ( )ofisomorphismtyp es of n-vertex

n

graphs.

Of course, the prop erty  in question is supp osed to b e preserved by isomorphisms.

Somewhat lo osely, p eople say that  ob eys the lab eled (resp. unlab eled) zero-one law

if l ( ) (resp. u ( )) converges to 0 or 1. Let me saythattwonumerical sequences

n n

and are asymptotical ly equivalent if they converge to the same numb er or else

n n

they b oth diverge. I will use the sign  to denote asymptotic equivalence. Notice

that the asymptotic equivalence  is weaker than the asymptotic equality

n n

 ; the latter means that the fraction = converges to 1. For example, 1=n

n n n n

2

is asymptotically equivalent but not asymptotically equal to 1=n . It turns out that

l ( )  u ( ). The reason for the asymptotic equivalence is that almost all graphs

n n

are rigid.

Q: In what sense are most graphs rigid?

A: Rigidity,which I will denote by , ob eys either of the two zero-one laws: l () 

n

u () ! 1. Notice that each rigid n-vertex graph has exactly n! distinct lab elings, so

n

that L ( ^ )=U ( ^ )  n!. The desired asymptotic equivalence l ( )  u ( )

n n n n

follows easily.Doyou see how to deriveit?

Q: I think I do. Since l () ! 1,

n

L ( ) L ( ^ )+L ( ^:) L ( ^ ) L ( ^ )

n n n n n

=   :

L ( ) L ( ) L ( ) L ()

n n n n

U ( ) U ( ^ ) U ( ^ ) L ( ^ )

n n n n

Similarly,  b ecause u () ! 1. But = .

n

U ( ) U () U () L ()

n n n n

A: Very go o d.

Q: Let me verify for myself that rigid graph has n! distinct lab elings.

There are n! one-to-one functions f from the universe V of an n-vertex graph

G onto f1;:::;ng. Eachsuch f gives a graph G on f1;:::;ng,sothatf is an

f

1

isomorphism from G onto G .IfG = G then h  f is an automorphism of G.

f f h

Thus, all n! graphs G are distinct if G is rigid. Hence L ()=U ().

f n n 2

I think we are getting somewhere. If G is not rigid and  is a nontrivial automor-

phism of G, then each graph G equals G .Thus, a nonrigid n-vertex graph has at

f h

most n!=2 distinct lab elings, so that L (:)  U (:)  n!=2

n n n

U () U ()  n! L ()

n n n

u ()= = < = l ()

n n

U ()+U (:) U ()  n!+U (:)  n! L ()+L (:)

n n n n n n

and therefore l () ! 1ifu () ! 1. However, I do not see why the latter is true.

n n

A: There is a go o d reason for the diculty.Until now, weworked in great generality.

We could sp eak as well ab out directed graphs or groups, etc. But nowwe need

information sp eci c to graphs. The following simple formula of Polya [HP, Section

9.1] is worth rememb ering:

L ( )

n

: U ( ) 

n

n!

By Polya's formula,

U ()+U (:)=2 U ()n!+ U (:)n!=2 L ()+L (:) L ( )

n n n n n n n

=  = ! 1:

U ( ) U ( )n! U ( )n! U ( )n!

n n n n

U ()+U (:) U (:)=2 U ()+U (:)=2

n n n n n

Thus, 1 u (:)=2= = ! 1and

n

U ( ) U ( ) U ( )

n n n

therefore u (:) ! 0.

n

It is often easier to deal with lab eled graphs. The fraction l ( ) can b e seen as

n

the probabilityof  in the sample space of graphs with universe f1;:::;ng and the

uniform probability distribution.

Q: Similarly, the fraction u ( )canbeinterpreted as the probabilityof  in an

n

appropriate sample space.

A: True, but the sample space of lab eled graphs is easier to deal with. In the case

of lab eled graphs, for example, the probabilityofanevent\fi; j g is an edge" is 1/2

whenever i 6= j .Further, anytwosuchevents are pairwise indep endent. The sample

space can b e viewed as the of outcomes of the following exp eriment: for each pair

fi; j g of distinct elements of f1;:::;ng, toss a fair coin to decide whether the pair is

an edge.

Q: How do es logic come in?

A: It turns out that every rst-order prop erty  satis es the zero-one law [GKLT,

and indep endently Fa1].

Q: Wow!

A: Wemaysay that rst-order logic ob eys the zero-one law.

Q: Do you mean the lab eled or unlab eled law? Mayb e you are talking ab out prop er-

ties of graphs only.Weknow that l ( )  u ( )forany graph prop erty  preserved

n n

by isomorphisms. 3

A: I am talking ab out rst-order logic with equality and unary,binary, ternary, etc.

predicate symb ols, but without function symb ols or individual constants.

Q: Sure. If c is an individual constant then the probability of a sentence P (c) is 1/2

in the case of lab eled structures.

A: Right. It turns out that l ( )  u ( )forevery prop erty  of structures of

n n

a given signature  . Let me say this more carefully. First of all, I consider only

nite signatures. Given a nite collection  of predicate symb ols of sp eci ed arities,

consider a class K of nite structures of signature  . A prop erty  of K structures

can b e viewed as a function on K that assigns true or false to each structure A in K .

We will consider only those prop erties which are preserved under isomorphisms.

Q: You got me worried. Do you mean that K is a class and not necessarily a set?

A: No, no. I do not intend to involve us in set theory. We are only interested in

isomorphism typ es of structures and their lab elings. Generalize the de nitions of l

n

and u from graphs to structures in K and consider the case when K is the class of

n

all  structures. For every prop erty  of  structures, l ( )  u ( ).

n n

Q: It is clear that l ( )  u ( ) if unlab eled  -structures are rigid.

n n

Are they?

A: Not if  comprises only unary predicates. But the case of unary predicates is

easily analyzable directly and wemay ignore it. If  contains at least one predicate

of arity > 1 then the unlab eled zero-one law for the rigidityof  structures follows

from the unlab eled zero-one law for graph rigidity.

Q: How do es it follow?

A: For simplicity, I supp ose that  contains a binary predicate P .Given a  structure

A, construct a graph G on the universe of A such that any pair fa; bg of distinct

elements of A is an edge if and only if either b oth P (a; b)and P (b; a) are true in A

or else b oth P (a; b) and P (b; a) are false in A.Every automorphism of A is also an

automorphism of G. Hence all pre-images A of a rigid graph G are rigid. Further,

a rigid n-vertex graph has more pre-images than a nonrigid one. It follows that the

fraction of rigid n-element  -structures is larger than the fraction of rigid n-vertex

graphs.

Q: What if  contains only predicates of arity  3?

A: May I leave this as an exercise? By the way, historical references related to rigidity

may b e found in [Co2].

Q: Fair enough. I would love to see a pro of of a zero-one law for rst-order logic.

A: Wemay forget ab out the unlab eled law and concentrate on the lab eled one. The

original pro of of Glebsky et al. is somewhat involved. A nice sketch of the pro of is

in [Co2]. 4

Q: Did you know the four coauthors?

A: Yes. Kogan, Liogonky and Talanovwere students of Glebsky at Gorky (now

NijnyNovgoro d) University in Russia. I visited Gorky to participate, as an ocial

\opp onent", in the ceremony of the public \defense" by Liogonky of his Ph.D. thesis

[Li] where he proved the unlab eled law for rst-order logic.

Fagin rediscovered the zero-one law for rst-order logic in [Fa1]. His pro of is very

instructive. Imagine the following in nite exp eriment: For eachpair fi; j g of distinct

p ositive p ositiveintegers, toss a fair coin to decide if fi; j g is an edge. Outcomes of

the exp eriment are graphs on p ositiveintegers. What do you think is the probability

that two outcomes are isomorphic?

Q: Iwould say zero, but I feel a trap. Would you give me a hint?

A: Try to build an isomorphism piecemeal. Supp ose that f is a partial isomorphism

from one outcome graph to another such that the domain of f is nite. Let i be an

integer outside the domain of f . Can f b e extended to i?

Q: For every j outside the range of f , the probability p that the extension of f by

k

f (i)=j is a partial isomorphism equals 2 where k is the cardinality of the domain

m

of f . The probabilitythatatleastoneofm such j 's is appropriate is (1 (1 p) ),

which tends to 1 as m grows. Thus, the probabilitythat f can b e extended to include

i into its domain is 1. I see it now. Start with the empty partial isomorphism and

keep extending it to include the smallest integer outside the domain, the smallest

integer outside the range, the smallest integer outside the domain, etc. I presume

that the union of countably manyevents of probability zero has probabilityzeroin

our sample space.

A: Yes, it is easy to check that the probability is countably additive.

Q: Then the intersection of countably manyevents of probability 1 has probability1.

Hence, with probability 1, the back-and-forth construction results in an isomorphism

between two random outcomes. This is amazing.

A: I think so to o. The prevalent outcome (if we identify isomorphic graphs) is called

the in nite .Canyou de ne an in nite random directedgraph ?

Q: Yes. Mo dify the exp eriment to toss a coin for every ordered pair (i; j ) of p ositive

integers which are not necessarily distinct. The same back-and-forth argumentshows

that, with probability1,two outcomes are isomorphic.

A: Right. We can de ne the in nite random structure of an arbitrary ( nite) sig-

nature  in a similar way. For every predicate symbol P in  and for every tuple

(i ;:::;i ) of (not necessarily distinct) p ositiveintegers, toss a fair coin to decide

1 r

whether P (i ;:::;i ) is true. Here r is of course the arityof P . With probability1,

1 r

two outcomes of the in nite exp eriment are isomorphic.

Q: How is this related to the zero-one law for rst-order logic?

A: For each p ositiveinteger k , consider an extension axiom 5

1 0

^

A @

^ 9u :::9u u 6= u

1 k i j

1i

1 20

^ ^

A 4@

! 8u :::8u 9v u 6= u

1 k i j

1i

k

0 0 1 1 3

! !

k

^ ^ ^

@ @ A A 5

u 6= v ^ ^ :

i

i=1

2X 2A X

k

which I will denote " . Here A comprises all atomic formulas = P (w ;:::;w )

k k 1 r

such that P 2  and v 2fw ;:::;w gfu ;:::;u ;vg.For example, if  comprises

1 r 1 k

one binary predicate P then

A = fP (v; v);P(u ;v);:::;P(u ;v);P(v; u );:::;P(v; u )g:

k 1 k 1 k

The axiom " says that there exist at least k distinct elements and every k -element

k

substructure can b e extended by one additional elementinevery p ossible way. Notice

that each " implies " . It is easy to see that the in nite random  -structure satis es

k +1 k

all extension axioms and that every twocountably in nite  -structures satisfying all

extension axioms are isomorphic.

Further, using a couple of classical theorems ab out rst-order logic, one can infer

that, for every rst-order sentence ,either or : follows from some extension

axiom. Indeed, supp ose bycontradiction that neither of the two formulas is implied

byany extension axiom and therefore byany nite set of extension axioms. By the

Compactness Theorem, there is a graph G satisfying  and all extension axioms

1

and there is a graph G satisfying : and all extension axioms. Obviously, the two

2

graphs are in nite. By the Lowenheim-Skolem Theorem, every in nite structure has

a countable substructure with the same rst-order prop erties. Thus, wemay assume

without loss of generality that the two graphs are countable. But then G and G

1 2

are isomorphic which is imp ossible.

All these facts were known b efore Fagin's pap er. Tomake this long story shorter,

let me refer again to Compton's comprehensivesurvey [Co2] for the history of the

sub ject. But Fagin connected all this with nite structures. Every extension axiom

is almost sure. Hence either  or : is almost sure.

Q: And the almost sure theory of nite structures is exactly the theory of the in -

nite random structure. A nice illustration of the thesis that an in nite ob ject may

approximate nite ones. But was it necessary to use in nite graphs?

A: No. One can prove directly that every rst-order sentence is decided bysome

extension axiom. One way is to use Ehrenfeucht games. You can check easily that

if two graphs G and G satisfy " , then Player I I has a winning strategy in the

1 2 k

k -step Ehrenfeucht game (G ;G )andthus, by Ehrenfeucht's Theorem [Eh], no

k 1 2 6

prenex (with quanti ers up front) rst-order sentence with k quanti ers distinguishes

between G and G .

1 2

Q: So what?

A: Oh, consider an arbitrary rst-order sentence . A standard algorithm transforms

0

 into a logically equivalent prenex rst-order sentence  .Letk be the number of

0 0

quanti ers in  . By the argumentabove,  do es not distinguish b etween anytwo

mo dels of " . Hence  do es not distinguish b etween anytwomodelsof" . Either all

k k

mo dels of " satisfy , or else all mo dels of " satisfy :. In the rst case,  is almost

k k

surely true, and in the second case,  is almost surely false.

Q: Would you remind me what exactly Ehrenfeucht games are?

A: That is not necessary. Let me explain to you how to prove the zero-one law for

rst-order logic by quanti er elimination. This even more direct metho d is due to

Etienne Grandjean [Gr]. By induction on (the logical depth of the) rst-order formula

(u), we will prove that there exists k suchthat (u) is equivalent to some quanti er-

free formula (u  ) on structures satisfying " . Hereu  is a tuple of free variables. If 

k

has no free variables, then  is true or false.Thus every sentence  is almost surely

true or almost surely false.

The atomic case is trivial and the case when  is a boolean combination of

prop er subformulas is obvious. It remains to consider the case (u ;:::;u )=

1 r

(9v ) (u ;:::;u ;v). By induction hyp othesis, there exists j such that is equiv-

1 r

alenttoaquanti er-free formula on structures satisfying " .Letk =max(j; r ). We

j

check that  is equivalent to a quanti er-free formula on structures satisfying " .

k

Since k  j ,wemay assume without loss of generalitythat itself is quanti er-free.

Since (9v )( _ ) is logically equivalentto[(9v ) ] _ [(9v ) ], wemay supp ose that

is a conjunction of atomic formulas and negated atomic formulas. Moreover, wemay

supp ose that, for every pair (u ;u ) with 1  p

p q

u = u or the conjunct u 6= u , and that contains conjuncts u 6= v;:::;u 6= v .If

p q p q 1 r

is not satis able at all, cho ose  to b e logically false. Otherwise, the desired (u  )

is obtained from (u;v)by deleting all (negated or non-negated) atomic formulas

that mention v . Obviously (u) logically implies (u  ). It is easy to see that the

implication (u  ) ! (u) follows from " and therefore from " .

r k

Q: It lo oks like the desired k is less than largest numb er of free variables in subformulas

of . One can actually compute the desired  and, in the case  has no free variables,

decide whether it is almost surely true or almost surely false. Did someb o dy lo ok into

the complexity of this decision problem?

A: Grandjean did. The decision problem is PSPACE complete [Gr].

Q: So it may b e hard to tell whether a given rst-order sentence is almost sure.

A: To put things into prop er p ersp ective, let me quote two facts. The problem

whether a given sentence in the rst-order language of equality (without any other 7

predicate symb ols) is true in every nite structure (and therefore logically true) is

PSPACE complete [St]. The problem whether a given rst-order sentence is true in

every nite structure is undecidable [Tr].

Q: It p opp ed up in my mind that the zero-one law for rst-order graph prop erties

do es not follow from the zero-one law for rst-order logic b ecause the prop erties of

symmetry and irre exivity,whichcharacterize undirected graphs, are almost surely

false.

A: That is true, but the same pro ofs establish the zero-one law for graph prop erties.

Q: It is interesting that that the zero-one lawsurvives the restriction to graphs. I

wonder if this is a sp ecial case of a general phenomenon. Mayb e, the restricting

axioms should b e universal like the axioms of re exivity and symmetry.

A: Here is a trivial counterexample. Consider the class of structures with two unary

predicates P and Q satisfying the axiom 8u8v [(P (u) ^ P (v )) ! u = v ]. The sentence

 =(9u)(P (u) ^ Q(u)) is neither almost surely true nor almost surely false.

However, sometimes the zero-one law survives. Andreas Blass and

proved the zero-one law for simplicial complexes proved by [BH]. Kevin Compton

proved the zero-one law for partial orders [Co1]. He used a theorem of Kleitman and

Rothschild according to whicha typical random partial order of size n has, somewhat

surprisingly,nochains of length more than 3. Such partial orders can b e seen as

graphs with three layers of vertices where each edge connects a vertex of the middle

layer with a vertex of the lower or the upp er level. The appropriate in nite random

partial order also has this form, and Compton's pro of pro ceeds along the lines of

Fagin's pro of. Kolaitis, Promel and Rothschild proved that, for each l  2, the class

of K -free graphs ob eys the zero-one law [KPR]. Here K is the complete graph on

l+1 l+1

l +1 vertices; a graph is called K -free if it do es not haveany subgraph isomorphic

l+1

to K .

l+1

Q: Your counterexample is not very satisfactory b ecause l () converges to 1/2. The

n

formula  satis es the \convergence law", whichisweaker than the zero-one law but

still very meaningful.

A: You maywant to lo ok at some pap ers of Jim Lynch. He proves, for example,

the convergence law for the rst-order logic of unary functions [Ly2]. But here is

another counterexample for your hyp othesis [Bl]. Use universal axioms to say that

P is a linear order, and if Q(u; v ; w ) holds then v is the successor of u with resp ect

to P and R(u) $:R(v ). Let K b e the class of ( nite) structures satisfying the

0

universal axioms. The relation Q (u; v )= 9wQ(u; v ; w ) is a partial successor relation

appropriate to linear order P on K structures.

Q: Whydoyou need w ?

A: Howdoyou assert, using only universal axioms, that every element, except for

the last one, has a successor? The additional argumentallow us to assert a statistical 8

0

version of this statement. Almost surely, Q is the complete successor relation. Hence,

almost surely, R marks either all even or all o dd elements in the linear order. Write

a sentence  saying that the rst (with resp ect to P )element satis es R if and only

if the last (with resp ect to P )element do es. It is easy to see that l () ! 0and

2n

l () ! 1. Thus  violates the convergence law.

2n+1

By the way, some weaker but nontrivial forms of the convergence lawmaysurvive

even if the parity of the universe is expressible. For example, enricheachuniverse

f1;:::;ng with the successor relation S (x; y ) ! y = x + 1 and mo dular addition

P (x; y ; z ) ! x + y = z mo d n. It easy to see that the sentence 8u9vP (v; v; u) holds

if and only if n is o dd. Nevertheless, for every rst-order sentence  in this language,

there exists a p ositiveinteger m such that, for each i< m, the fraction of enriched

structures of cardinality i + km that satisfy  converges when k grows to in nity

[Ly1]. However, our second counterexample can b e mo di ed to violate the weak form

of the convergence law.

Q: I susp ect that the zero-one law for rst-order logic inspired attempts to generalize

it.

A: Yes, a whole new area of research has b een created. You maywant to read a nicely

written comprehensive survey of the area by Kevin Compton [Co2]. One generaliza-

tion of the (lab eled) zero-one law for rst-order logic is related to the probability

distribution on the set of graphs with universe f1;:::;ng.Above, we tossed a fair

coin to determine whether a pair fi; j g of distinct vertices is an edge. Alter the ex-

perimentby using a biased coin, so that the probability that a pair fi; j g of distinct

vertices is an edge is some p ositivenumber p<1. It is easy to see that all the results

survive. The situation changes drastically if p is allowed to vary as n grows [SS, Sp,

Ly3].

Q: Iwonder if attempts were made to nd logics with a zero-one lawwhich are more

expressive than rst-order logic and which express prop erties like connectivityand

hamiltonicity.

A: Yes, you b et. It is easy to see that second-order logic violates the zero-one law

and the convergence law. You can write a formula saying that the cardinality of the

universe is even. Matt Kaufmann and Saharon Shelah proved that the convergence

law fails miserably in the case of monadic second-order logic [KS]. Kaufmann went

on to show that even existential monadic second-order logic violates the convergence

law [Ka].

Apparently, the rst p ositive result in this direction has b een proved byTalanov,

who established the zero-one law for rst-order logic extended with a transitive closure

op erator [Ta]. His logic is able to express graph connectivity. Unfortunately, his pap er

was published in an obscure place and went unnoticed. Blass, Gurevich and Kozen

proved the zero-one law for xed-p oint logic [BGK], which is more expressive(cf.

[TK]). Recently Kolaitis and Vardi proved the zero-one law for the in nitary logic

!

L whichiseven more expressive.

1;! 9

Q: In what sense is that last logic in nitary?

!

A: Formulas can b e in nitely long. Actually, the syntax of L is very easy to de-

1;!

scrib e. Formulas are built from atomic formulas by means of connectives :; ^; _ and

quanti ers 8 and 9.Thenovelty, in comparison to rst-order logic, is that you are

allowed to form the conjunction and disjunction of an arbitrary set of formulas pro-

vided that the total numb er of predicate symb ols and the total numb er of individual

variables in these formulas is nite. The semantics is obvious.

Q: It's a joke. Formulas are supp osed to b e writable on a sheet of pap er.

!

allow succinct presentations, and certainly A: Be broader-minded. Fragments of L

1;!

there is nothing wrong in proving a zero-one law for in nite formulas.

Q: I do not see what do in nite conjunctions and disjunctions buy you if you keep

the numb er of individual variables b ounded.

A: The trick is to reuse variables. Here is an example in the language of graphs with

edge relation E . Consider the rst-order formulas

 (u; v )=E (u; v );  (u; v )= (9w )[E (u; w ) ^ (9u)(u = w ^  (u; v ))]:

1 n+1 n

Each of them has (the same) two free variables, and only three variables altogether.

Of course, the meaning of  is that there exists a path of length n from u to v .Thus,

n

the in nite formula

1

_

8u8v 

n

n=1

expresses connectivity.

The quanti er elimination pro of of the zero-one law for rst-order logic can b e

!

mo di ed to establish the zero-one lawforL [KV4]. Would you like to try? It

1;!

should b e instructive.

Q: Sure. By induction on a formula ,we prove that that there is k such that  is

equivalent to some quanti er-free formula  (with the same predicate symbols) on

mo dels of " . I can require that  is nite, but this do es not matter. An in nitary

k

quanti er-free formula with nite many predicate symb ols and individual variables is

logically equivalent to a nite quanti er-free formula.

_ ^ ^

Since  !: : ,we need only to consider one new case  = 

i i i

i2I i2I i2I

in the induction step. Without loss of generality, all formulas  have the same free

i

variables. By induction hyp othesis, for each i, there exists k such that  is equivalent

i i

to a quanti er-free formula  on mo dels of " .Now I am in trouble. If there is a

i k

i

nite b ound k for all k then  is equivalent to the conjunction of formulas  on

i i

mo dels of " .How do I ensure the existence of sucha bound?

k

A: You did not take full advantage of the restriction on the number of variables.

Strengthen the induction claim by requiring that the desired k do es not exceed the

number of variables (all variables, b ound and free) in . 10

Q: OK, let me give another try. The basis of induction is trivial, the case of negation

is obvious, and the treatment of the existential quanti er ab ove seems to b e ne. In

the case of in nite conjunction, I can continue the argumentabove. By the induction

hyp othesis, each k is b ounded bythenumber of variables in  and therefore by the

i i

number of variables in .Thisgives the desired b ound and nishes the argument.

Nice.

By the way, I rememb er seeing another Kolaitis-Vardi pap er on zero-one laws.

It was somehow related to that classi cation of pre x classes that you were talking

ab out a year ago [Gu2].

A: Oh, yes. This is also an interesting story. You maywant to read the survey

[KV2] of Kolaitis and Vardi. They notice that every universal second-order sentence

(8P )(P ) satis ed by the in nite random structure (of the appropriate signature)

follows from some extension axiom and thus is almost sure. Here  is rst-order.

Q: That seems quite mysterious.

A: The pro of is simple. The crucial observation is that an extension axiom is con-

sistent with (9P ):(P ) if and only if it is consistent with the rst-order formula :.

This observation allows us to use the usual theorems ab out rst-order logic. Supp ose

that every extension axiom is consistentwith:. By the compactness theorem, : is

consistent with the whole collection of extension axioms; let A b e a mo del of all these

sentences. By the Lowenheim-Skolem Theorem, A has a countable substructure B

satisfying all these sentences. Since B satis es all extension axioms, it is the in nite

random structure with an additional relation P . Since B satis es :, the in nite

random structure fails to satisfy (8P )(P ). That's it. Instead of (8P )(P ), we could

  

sp eak ab out (8P )(P ) where P is a tuple of predicate symb ols.

Q: This do es not prove the zero-one law for universal second-order sentences, do es

it? It leaves the p ossibility that some existential second-order sentence holds on the

in nite random structure but is not almost sure. Do es this really happ en?

A: What do you think? This question is not dicult.

Q: Then there has to b e a counterexample, I feel. Right. I got it. There exists an

order without a last element on the in nite graph, but of course there is no such thing

on any nite graph.

A: Go o d. Kolaitis and Vardi investigated fragments E () of existential second-order

logic. Here  is a pre x typ e and E () is the collection of existential second-order

 

sentences (9P )(P ) where  is a prenex rst-order sentence with pre x of typ e .

 

They proved for example that E (9 8 ) ob eys the zero-one law. That particular pro of

is easy and I can explain it.

Q: I am listening.

 

A: Let (P )= (9u :::9u )(8v)(P; u ;:::;u ; v)whereisquanti er-free, and

1 m 1 m



 

supp ose that the existential second-order formula  =(9P )(P ) holds on the in -

nite random structure S of the appropriate signature, namely the signature  that 11



comprises free predicate symb ols of  .Wewillshow that, on nite (and countable)



structures,  follows from the extension axiom " (in signature  ). For simplicity,I

m



supp ose that P is just one predicate variable P .

Fix a particular value P of P and particular elements a ;:::;a of S such that

0 1 m

S j=(8v)(P ;a ;:::;a ; v). Let A b e the substructure with elements a ;:::;a .

0 1 m 0 m

0 

Notice that every substructure A of S containing A satis es  (with P equal to the

0

restriction of P to A and with u = a ;:::;u = a ). NowletB b e an arbitrary

0 1 1 m m

nite mo del of " .Obviously, B has a substructure isomorphic to A. In other words,

m

there exists a partial isomorphism f from B to S whose range is A.SinceS satis es all

extension axioms, f can b e extended to an isomorphism from B onto a substructure

0  0

A of S that contains A.Since holds on A , it holds on B as well.

Q: You told me that pre x typ es, ordered by inclusion, form a well partially ordered

+

set [Gu2]. I would like to see how this applies to the situation at hand. Let F (resp.

F ) b e the collection of fragments E () that ob ey (resp. violate) the zero-one law.

Because of the well partial ordering, the collection of minimal memb ers of F is nite

and every member of F includes some minimal member.

+

A: We can saymoreabout F and F . Notice that the union of fragments satisfying

the zero-one law satis es the zero-one law. It follows that every minimal member of

F has the form E (fsg)wheres is a particular pre x. Further, do you remember

sp ecial pre x typ es?

Q: Yes. A typ e is sp ecial if it contains all pre xes or is represented by a string in

 

the 4-letter alphab et f8; 9; 8 ; 9 g. I rememb er also that the union of any ascending

chainofspecialtyp es is sp ecial.

A: Right. In particular, let  b e the collection of pre xes s such that E (fsg) ob eys

+

the zero-one law. Obviously, E () is the greatest elementof F . It is easy to see

that  is the union a nite collection of sp ecial typ es  , namely the maximal sp ecial

i

0 0

subtyp es of . Let me say that a fragment E ( ) is sp ecial if the pre x typ e  is

+

sp ecial. Then the fragments E ( ) are the maximal sp ecial members of F .

i

+

Q: Are the maximal sp ecial memb ers of F known? Are the minimal memb ers of

F known?

+    

A: The maximal sp ecial members of F are E (9 8 )and E (9 89 ), and the minimal

2

memb ers of F are E (898)and E (8 9). The two zero-one laws and the failure of the

zero-one lawfor E (898)were proved by Kolaitis and Vardi; the pro ofs are found in

2

their survey [KV2]. Pacholski and Szwast proved that E (8 9) violates the zero-one

law [PS1, PS2]; they used a technique develop ed by Goldfarb in order to prove the

2

undecidability of the satis ability problem for 8 9 sentences with equality [Go].

Q: At the b eginning of this conversation, you told me that the zero-one phenomenon

is common in combinatorics. Do you see zero-one laws for various logics as sort of

an \explanation" of the combinatorial phenomenon? If yes, how successful was the

explanation? 12

A: I do not think that either of the discoveries [GKLT, Fa1] was driven by the enthu-

siasm to \explain" the combinatorial phenomenon, but the pap er [BH] of Blass and

Harary pro jects this contagious enthusiasm. This enthusiasm drove us to generalize

the zero-one law to xed-p oint logic and, I b elieve, it was an imp ortantmotivation

for Kolaitis and Vardi.

The success of the explanation is partial. Blass and Harary list numerous natural

prop erties of graphs expressible in rst-order logic and thus ob eying the zero-one

law. For example, almost surely, the diameter of a graph is 2. However, it is easier

to check directly that all those prop erties ob ey the zero-one law. More interesting

graph prop erties, like connectivity, 3-colorability, hamiltonicityorrigidity, are not

expressible in rst-order logic.

Q: But almost sure connectivityfollows from the almost sure prop erty that the

diameter equals 2, which is rst-order.

A: That is true. Also, the negation of 3-colorability follows from the almost sure

rst-order prop erty that there exists a complete 4-vertex subgraph. Still, neither

connectivity nor 3-colorability is expressible in rst-order logic. Connectivity is ex-

pressible in Talanov's logic though, and 3-colorability(aswell as any k -colorability

2  

with k  2) is expressible by a sentence in E (8 )  E (9 8 ) [KV2]. But none of

the zero-one laws ab ove \explains" hamiltonicity or rigidity: Blass and Harary prove

that neither hamiltonicity nor rigidityfollow from any extension axiom [BH].

Q: Howcanyou prove that?

A: Here is a sketch of the pro of that graph rigidity do es not followfrom" . Picka

k

graph G with vertices l; l +1;:::;l 1;l randomly sub ject to the constraint that

the function f (i)=i b e an automorphism of G. It is not to o dicult to check that

with high probability G satis es " provided l is suciently large. Thus there exists

k

a nonrigid graph that satis es " .

k

Blass and Harary p ose a problem to nd \a natural class of prop erties, broader

than the class of rst-order prop erties", that includes \prop erties like hamiltonicity

and rigidity" and ob eys the zero-one law. This problem is still wide op en.

Q: On the other hand, there are probably manyinteresting prop erties expressible in

!

xed-p oint logic or L that combinatorialists did not consider.

1;!

A: That is true. Many problems complete for p olynomial time are expressible in

xed-p oint logic. Many problems complete for p olynomial space are expressible in

!

partial xed-p oint logic, which is sandwiched b etween xed-p oint logic and L from

1;!

the p oint of view of expressivepower [KV2].

Q: What is the relevance of zero-one laws to computer science? Let me play devil's

advo cate. Was there any direct application of zero-one laws to computer science?

A: In a similar vein you can claim that mo dern group theory or is ir-

relevanttophysics. It is conceivable that even if all pure mathematical researchwere 13

stopp ed, physics would develop without imp ediments for a while. But eventually

physics would su er greatly. Inadditiontobeinguseddirectlyinphysics, mathemat-

ical education creates an atmosphere of rigor necessary to raise go o d physicists.

Q: This may justify theoretical computer science at large, but mayb e zero-one laws

do not b elong there.

A: Actually,I was thinking ab out an analogy for logic vs. computer science rather

than for theoretical computer science vs. applied computer science.

Q: I do not doubt the relevance of zero-one laws to logic. But whyisthiskindof

logic relevant to computer science? Do you think it is relevant?

A: Yes, I do. By the way, relevance is not by itself a zero-one notion. It can b e

quanti ed. I do not knowany direct applications of zero-one laws to, say, complexity

theory, but such applications are certainly p ossible esp ecially in the context of prob-

abilistic algorithms that usually run fast or the average case analysis of deterministic

algorithms [Va]. The case of decreasing edge probability [SS, Sp, Ly3] maybeespe-

cially relevant b ecause that probabilistic mo del is very p opular in complexity theory.

Even the uniform distribution is not irrelevant. If you have to deal with a database

ab out whichyou do not knowanything, you mayaswell supp ose that it is drawn

randomly.

Q: No, this do es not sound convincing. Natural databases satisfy all kind of dep en-

dencies.

A: Mayb e, it is worth checking whether the zero-one law (I am assuming that database

queries are rst-order and I am talking ab out the zero-one law for rst-order logic)

survives the imp osition of dep endencies.

It is imp ortant, however, to see zero-one laws in the context of nite mo del theory.

Logic changed many mathematical elds; set theory is a go o d example. Its in uence

in computer science is even greater. The development of nite mo del theory re ects

the desire to take the new applications seriously.

Q: You mean, it would b e exp ensivetomaintain an in nite database?

A: Exactly. Well, I sp oke enough of the imp ortance of nite mo del theory [Gu1].

Zero-one laws are integral part of inherently- nite mo del theory and are very imp or-

tant in this context. Am I succeeding in my propaganda?

Q: Let me think ab out it.

Acknowledgment. Many thanks to Andreas Blass for very b ene cial and en-

joyable discussions and to Ron Fagin, Warren Goldfarb, Jim Lynch, Leszek Pacholski

and for very helpful comments. 14

References:

Bl Andreas Blass, private communication.

BGK Andreas Blass, Yuri Gurevich and Dexter Kozen, \A Zero-One Law for Logic

with a Fixed-Point Op erator", Information and Control 67 (1985), 70{90.

BH Andreas Blass and Frank Harary, \Prop erties of Almost All Graphs and Com-

plexes", J. Graph Theory 3 (1979), 225{240.

Co1 Kevin J. Compton, \The Computational Complexity of Asymptotic Problems

I: Partial Orders", Information and Computation 78:2 (1988), 108{123.

Co2 Kevin J. Compton, \0{1 Laws in Logic and Combinatorics", Pro c. NATO

Advanced Study Institute on Algorithms and Order (I. Rival, ed.), Reidel, Dor-

drecht, 1988, 353{383.

Eh Andrzej Ehrenfeucht, \An Application of Games to the Completeness Problem

for Formalized Theories", Fund. Math. 49 (1961), 129{141.

Fa1 Ronald Fagin, \Probabilities on Finite Mo dels", J. Symb olic Logic 41:1 (1976),

50{58. (Notices of AMS, Oct. 1972.)

Fa2 Ronald Fagin, \Finite-Mo del Theory: A Personal Persp ective", Springer Lec-

ture Notes in Computer Science 470 (1990), 3{24. To app ear in Theoretical

Computer Science.

GKLT Y. V. Glebsky, D. I. Kogan, M. I. Liogonky and V. A. Talanov, \Range

and Degree of RealizabilityofFormulas in the Restricted Predicate Calculus",

Kib ernetika (Kiev) 2 (1969), 17{28. English translation in Cyb ernetics 5 (1969),

142{154.

Go Warren D. Goldfarb, \The UnsolvabilityoftheGodel Class", J. Symb. Logic 49

(1984), 1237{1252 .

Gr Etienne Grandjean, \Complexity of the First-Order Theory of Almost All Struc-

tures", Information and Control 52 (1983), 180{204.

Gu1 Yuri Gurevich, \Logic and the Challenge of Computer Science", In \Current

Trends in Theoretical Computer Science" (ed. E. Borger), Computer Science

Press, 1988, 1{57.

Gu2 Yuri Gurevich, \On the Classical Decision Problem", Bulletin of Europ ean

Asso c. for Theor. Computer Science, Oct. 1990, 140{150. 15

HP Frank Harary and Edgar M. Palmer, \Graphical Enumeration", Academic Press,

New York and London, 1973.

Ka Matt Kaufmann, \A Counterexample to the 0{1 Law for Existential Monadic

Second Order Logic", Internal Note 32, Computational Logic, Inc., December

1987.

KS Matt Kaufmann and Saharon Shelah, \On Random Mo dels of Finite Power and

Monadic Logic", Discrete Mathematics 54 (1983), 285{293.

KR D. J. Kleitman and B. L. Rothschild, \Asymptotic enumeration of partial orders

on a nite set", Trans. Amer. Math. So c. 205 (1975), 205{220.

Kn V. V. Knyazev, \Iterative Extensions of First-Order Logic", Math. Problems in

Cyb ernetics, Moscow, 1989, 123{130 (Russian). Math. Reviews 91a:03062.

KPR P. G. Kolaitis, H. J. Promel and B. L. Rothschild, \K -Free Graphs: Asymp-

l+1

totic Structure and a 0{1 Law", Trans. Amer. Math. So c. 303, no.2 (Oct.

1987), 637{671.

KV1 Phokion G. Kolaitis and Moshe Y. Vardi, \The Decision Problem for the Prob-

abilities of Higher-Order Prop erties", Symp. on Theory of Computing, ACM,

1987, 425{435.

KV2 Phokion G. Kolaitis and Moshe Y. Vardi, \0{1 Laws for Fragments of Second-

Order Logic: An Overview", MSRI Workshop on Logic from Computer Science

(ed. Yiannis N. Moschovakis), Berkeley 1989, to app ear.

KV3 Phokion G. Kolaitis and Moshe Y. Vardi, \0{1 Laws and Decision Problems

for Fragments of Second-Order Logic", Information and Computation 87 (1990),

302{338.

KV4 Phokion G. Kolaitis and Moshe Y. Vardi, \In nitary Logics and 0{1 Laws",

Research Rep ort 8195 (75154), IBM, June 1991, to app ear in Information and

Computation (a sp ecial issue on LICS'90).

Li M. I. Liogonky, \On the Question of Quantitative Characteristics of Logical For-

mulae", Kib ernetika (Kiev) 3 (1970), 16{22. English translation in Cyb ernetics

6 (1970), 205{211.

Ly1 James F. Lynch, \Almost Sure Theories", Annals of Mathematical Logic 18

(1980), 91{135.

Ly2 James F. Lynch, \Probabilities of First-Order Sentences ab out Unary Func-

tions", Transactions of American Mathematical So ciety 287 (1985), 543{568. 16

Ly3 James F. Lynch, \Probabilities of Sentences ab out Very Sparse Random

Graphs", Random Structures and Algorithms 3 (1992), 33-53.

PS1 Leszek Pacholski and Wieslaw Szwast, \Asymptotic Probabilities of Existential

Second Order Godel Sentences", Journal of Symb olic Logic 56 (1991), 427{438.

PS2 Leszek Pacholski and WieslawSzwast, \On the 0{1 Law for the Class of Existen-

tial Second Order Minimal Godel Sentences with Equality", Pro c. 6th Annual

Symp osium on Logic and Computer Science, IEEE, 1991, 280{285.

Sp Jo el Sp encer, \Threshold Sp ectra via the Ehrenfeucht Game", Discrete Appl.

Math. 30 (1991), 235{252.

SS Saharon Shelah and Jo el Sp encer, \Zero-One Laws for Sparse Random Graphs",

J. Amer. Math. So c. 1 (1988), 97{115.

St Larry Sto ckmeyer, \The -Time Hierarchy", Theoretical Computer Sci-

ence 3 (1977), 1{22.

Ta V. A. Talanov, \Asymptotic Solvability of Logical Formulas", in \Combinatorial-

Algebraic Metho ds in Applied Mathematics", Gorky University, USSR, 1981,

118{126 (Russian). Math. Reviews 85i:03081.

TK V. A. Talanov and V. V. Knyazev, \The Asymptotic Truth Value of In nite For-

mulas", Pro c. of the All-Union Seminar on Discrete Math. and its Applications,

Moscow, 1986, 56{61 (Russian). Math Reviews 89g:03054.

Tr Boris A. Trachtenbrot, \The Imp ossibility of an Algorithm for the Decision Prob-

lem for Finite Mo dels", Dokl. Akad. Nauk SSSR 70 (1950), 569{572.

Va Moshe Y. Vardi, private communication. 17