Ehrenfeucht-Frïssé Gmes: Applictions nd Complexity Angelo Montnri Nicol Vitcolonn Deprtment of Mthemtics nd Computer Science University of Udine, Itly ESSLLI 2010 CPH Outline Introduction to EF-gmes Inexpressivity results for first-order logic Norml forms for first-order logic Algorithms nd complexity for specific clsses of structures Generl complexity ounds
Introduction to EF-gmes Inexpressivity results for first-order logic Norml forms for first-order logic Algorithms nd complexity for specific clsses of structures Generl complexity ounds Bckground on finite model theory Books H.-D. Einghus nd J. Flum Finite Model Theory Springer, 2nd edition, 2005 L. Likin Elements of Finite Model Theory Springer, 2004
Why finite model theory? Connections with computtion Verifiction finite structures cn e coded s words nd thus cn e ojects of computtions; moreover, finite structures cn e used to descrie finite runs of mchines Dtse theory the reltionl model identifies dtse with finite reltionl structure (formuls of forml lnguge cn e viewed s progrms to evlute their mening in structure nd, vice vers, one cn express queries of certin computtionl complexity in given forml lnguge) Genuinely finite queries, e.g., Hs the reltion R even crdinlity? Computtionl complexity logicl description of complexity clsses (e.g., the prolem P = NP mounts to the question whether two fixed-point logics hve the sme expressive power in finite structures) Most theorems fil, one method survives We focus our ttention on first-order (FO) logic Results of model theory often do not pply to the finite Gödel s completeness theorem Compctness theorem Löwenheim-Skolem theorem Definility nd interpoltion results etc. Ehrenfeucht-Frïssé gmes re n exception
An ppliction of the compctness theorem Theorem (Compctness Theorem) (i) If ψ is consequence of Φ, then ψ is consequence of finite suset of Φ. (ii) If every finite suset of Φ is stisfile, then Φ is stisfile. Connectivity is not FO-definle over the clss of ll grphs G =(G, E) The proof is vi compctness Assume φ defines connectivity ψ n : there is no pth of length n + 1fromc 1 to c 2 Let T = { ψ n n>0 } {c 1 = c 2, E(c 1, c 2 ), φ} Every finite suset of T is stisfile, ut T is not Compctness fils in the finite γ n : there re t lest n distinct elements γ n def = x 1 x n 1i<jn (x i = x j ) Γ = { γ n n>0 } Generl cse: every finite suset of Γ is stisfile nd thus (compctness theorem) Γ is stisfile, tht is, it hs n (infinite) model Finite structures: every finite suset of Γ is stisfile (it hs finitemodel),utγ hs no finite model Is connectivity definle over ll finite grphs? We cnnot exploit the compctness theorem to nswer the question
Isomorphic nd elementrily equivlent structures Definition (Isomorphic structures) Two structures A, B, over the sme finite voculry τ, re isomorphic (A = B) ifthereisnisomorphismfroma to B, tht is, ijection π : A B preserving reltions nd constnts. Theorem Every finite structure cn e chrcterized in FO logic up to isomorphism, tht is, for every finite structure A there exists FO sentence ϕ A such tht, for every B, we hve B = ϕ A iff A = B. Definition (Elementrily equivlent structures) Two structures A, B re elementrily equivlent (A B) ifthey stisfy the sme FO sentences. Nottion Voculry: finite set of reltion symols including = (for the ske of simplicity, we restrict ourselves to purely reltionl voculry; however, ll results extend to voculries tht hve constnt symols). A nd B structures on the sme voculry # = 1,..., k dom(a) # = 1,..., k dom(b) (A, # ): expnsion of structure A y k elements from its universe (B, # ): expnsion of structure B y k elements from its universe Configurtion: (A, #, B, # ), with # = # It represents the reltion { ( i, i ) 1 i # }
Awekeningofelementryequivlence:m-equivlent structures Quntifier rnk qr(φ) of FO-formul φ = mximum numer of nested quntifiers in φ: if φ is tomic then qr(φ) =0; qr( φ 1 )=qr(φ 1 ); qr(φ 1 φ 2 )=mx(qr(φ 1 ), qr(φ 2 )); qr( x φ 1 )=qr(φ 1 )+1. Exmple φ = x (P(x) yq(x, y) yr(y)) hs qr(φ) =2. Definition (m-equivlent structures) Two structures A nd B re m-equivlent, denoted A m B, with m 0, if they stisfy the sme FO sentences of quntifier rnk up to m. m-equivlence cn e esily generlized to expnded structures: (A, # ) m (B, # ) if they stisfy the sme FO formuls of quntifier rnk m with t most # free vriles A wekening of isomorphism:m-isomorphic structures Definition (prtil isomorphisms) (A, #, B, # ) is prtil isomorphism if it is n isomorphism of the sustructures induced y # nd #, respectively. Let I 1,...,I m e sets of prtil isomorphisms such tht, for every k, I k contins prtil isomorphisms which llow k-fold extensions. Definition (m-isomorphic structures) Two pirs (A, # ) nd (B, # ) re m-isomorphic, denoted (A, # ) = m (B, # ), if there re nonempty sets I 0, I 1,...,I m of prtil isomorphisms, ech of them extending the prtil isomorphism (A, #, B, # ), such tht, for ll k = 1,..., m, (forth property) p I k A B(p {(, )} I k 1 ) (ck property) p I k B A(p {(, )} I k 1 ) Theorem (Frïssé, 1954) For m 0, (A, # ) m (B, # ) iff (A, # ) = m (B, # ).
Comintoril Gmes Ehrenfeucht-Frïssé gmes re (logicl) comintoril gmes. Comintoril gmes: Two opponents Alternte moves No chnce No hidden informtion No loops The plyer who cnnot move loses 1 E. R. Berlekmp, J. H. Conwy, nd R. K. Guy Winning Wys for your mthemticl plys AKPetersLTD,2ndedition,2001 1 In Comintoril Gme Theory (CGT), this is clled norml ply (the opposite rule: the plyer who cnnot move wins is clled misère ply, nd it gives rise to quite different theory) Ehrenfeucht-Frïssé gmes (EF-gmes) (Logicl) comintoril gmes The plyground: two reltionl structures A nd B (over the sme finite voculry) Two plyers: I (Spoiler) nd II (Duplictor) Perfect informtion Move y I : select structure nd pick n element in it Move y II : pick n element in the opposite structure Round: move y I followed y move y II Gme: sequence of rounds II tries to imitte I Aplyerwhocnnotmoveloses
Winning strtegies A ply from (A, #, B, # ) proceeds y extending the initil configurtion with the pir of elements chosen y the two plyers, e.g., if I picks c in A nd II replies with d in B then the new configurtion is (A, #, c, B, #, d) Ending condition: plyer repets move or the configurtion is not prtil isomorphism Definition II hs winning strtegy from (A, #, B, # ) if every configurtion of the gme until n ending configurtion is reched is prtil isomorphism, no mtter how I plys. An exmple on grphs G 1 G 2 II must respect the djcency reltion...... nd pick nodes with the sme lel s I does
An exmple on grphs G 1 G 2 II must respect the djcency reltion...... nd pick nodes with the sme lel s I does An exmple on grphs G 1 G 2 II must respect the djcency reltion...... nd pick nodes with the sme lel s I does
An exmple on grphs G 1 G 2 II must respect the djcency reltion...... nd pick nodes with the sme lel s I does An exmple on grphs G 1 G 2 II must respect the djcency reltion...... nd pick nodes with the sme lel s I does
An exmple on grphs G 1 G 2 II must respect the djcency reltion...... nd pick nodes with the sme lel s I does Bounded nd unounded gmes How long does gme lst? Bounded gme: G m (A, #, B, # ) (G m (A, B) if k = 0) the numer of rounds is fixed: the gme ends fter m rounds hve een plyed Unounded gme: G(A, #, B, # ) (G(A, B) if k = 0) the gme goes on s long s either plyer repets move or the current configurtion in not prtil isomorphism II wins if nd only if the ending configurtion is prtil isomorphism Unounded gmes turn out to e useful to compre (finite) structures (comprison gmes): the remoteness (durtion) of n unounded gme s mesure of structure similrity (the notion of remoteness will e formlized lter).
Min result First-order EF-gmes cpture m-equivlence Theorem (Ehrenfeucht, 1961) II hs winning strtegy in G m (A, #, B, # ) iff (A, # ) m (B, # ). Remrks. If two structures A nd B re m-equivlent for every nturl numer m, then they re elementrily equivlent In finite structures, A nd B re elementrily equivlent if nd only if they re isomorphic (in generl, this is not the cse: consider, for instnce, N nd the ordered sum N Z) Definition (EF-prolem) The EF-prolem is the prolem of determining whether II hs winning strtegy in G m (A, B), given A, B nd n integer m. Correspondence etween gmes nd formuls EF-gmes hve nturl logicl counterprt which is sed on the following simple properties of II winning strtegies. Given two structures A nd B, tuple # of elements of A nd tuple # of elements of B, with # = #, nd m 0, we hve tht: II wins G 0 (A, #, B, # ) iff (A, #, B, # ) is prtil isomorphism for every m>0, II wins G m (A, #, B, # ) iff for ll A, there exists B such tht II wins G m 1 (A, #,, B, #, ) for ll B, there exists A such tht II win G m 1 (A, #,, B, #, )
From gmes to formuls: Hintikk formuls Definition (Hintikk formuls) Given structure A, tuple # of elements of A, with # = k, nd tuple # x of vriles x 1,...,x k, let ϕ 0 (A, # ) (# x ) def = nd, for m 0, ϕ( # x ) tomic (A, # ) =ϕ( # x ) ϕ m+1 (A, # ) (# x ) def = A x k+1 ϕ( # x ) ϕ( # x ) tomic (A, # ) = ϕ( # x ) x k+1 ϕ m (A, #,) (# x, x k+1 ) A ϕ m (A, #,) (# x, x k+1 ). ϕ( # x ) For ech m, ϕ m (A, # ) (# x ) is clled the m-hintikk formul. From gmes to formuls: Hintikk formuls (cont.) The Hintikk formul ϕ 0 (A, # ) (# x ) descries the isomorphism type of the sustructure of A induced y #. In generl, ϕ m (A, # ) (# x ) descries to which isomorphism types the tuple # cn e extended in m steps y dding one element in ech step. Since the voculry is finite, the ove conjunctions nd disjunctions re finite even if the structure is infinite. Theorem (Ehrenfeucht, 1961 - cont.) For ny given (A, # ), (B, # ), nd m 0, we hve (B, # ) = ϕ m (A, # ) (# x ) (A, # ) m (B, # ) II hs winning strtegy in G m (A, #, B, # ).
Distriutive norml form Hintikk formuls re the sis of norml form for FO formuls: the clss of structures which stisfies given FO formul ϕ( # x ) of quntifier rnk m must e union of m -clsses ech m -clss is defined y Hintikk formul hence, ϕ( # x ) is logiclly equivlent to the (finite) disjunction of those Hintikk formuls which define these m -clsses (distriutive norml form for FO logic) FO definility AwinningstrtegyforI in G m (A, B) cn e converted into FO sentence of quntifier rnk t most m tht is true in exctly one of A nd B (the Hintikk formul ϕ m (A, # ) (# x ) or the Hintikk formul ϕ m (B, # ) (# x )). A chrcteriztion of FO-definle (FO-xiomtizle) clsses A clss K of structures (on the sme finite voculry) is FO-definle if nd only if there is m N such tht I hs winning strtegy whenever A K nd B K. The sme chrcteriztion holds in the finite cse (clsses of finite structures) the sme rgument pplies.
FO undefinility FO-undefinle clsses of structures AclssK of structures is not FO-definle if nd only if, for ll m N, there re A K nd B K such tht II hs winning strtegy in G m (A, B). Exmple Let L k def =({1,..., k}, <). It is possile to show tht n, p 2 m 1 II wins G m (L n, L p ) The clss of liner orderings of even crdinlity is not FO-definle : given m, choose ñ = 2 m nd p = 2 m + 1; II wins G m (Lñ, L p ) (i.e., Lñ m L p ). Other pplictions will e given lter (inexpressivity results for FO logic). From differentiting formuls to gmes Let A nd B e fixed Let φ e formul with quntifier rnk m Let A = φ ut B = φ Repet m times: 1 If φ = x 1 ψ, let φ φ nd swp A nd B So, φ holds in A ut not in B nd its first quntifier is 2 Let ψ ψ{ x 1/ c 1 }, with c 1 freshconstntsymol 3 Let I pick 1 in A such tht (A, 1 ) = ψ[ c 1/ 1 ] (since A = φ, such n 1 must exist) 4 Whtever 1 II chooses in B, (B, 1 ) = ψ[ c 1/ 1 ] 5 Let A (A, 1 ), B (B, 1 ) nd φ ψ Switching etween models is encoded in φ s quntifier lterntions (step 1)
Exmple Consider the formul for density: φ = x 1 x 2 x 3 (x 1 <x 2 x 1 <x 3 <x 2 ), which holds in (Q, <) ut not in (Z, <). (step 1) φ x 1 x 2 x 3 (x 1 <x 2 (x 1 <x 3 <x 2 )) (step 2) ψ x 2 x 3 (x 1 <x 2 (x 1 <x 3 <x 2 )){ x 1/ c 1 } = x 2 x 3 ( c 1 <x 2 ( c 1 <x 3 <x 2 )) (step 3) I chooses z in (Z, <) such tht (Z, <, z) = ψ [ c 1/z] (step 4) II replies q in (Q, <) such tht (Q, <, q) = ψ [ c 1/q] (step 2) ψ x 3 ( c 1 <x 2 ( c 1 <x 3 <x 2 )){ x 2/ c 2 } = x 3 ( c 1 < c 2 ( c 1 <x 3 < c 2 )) Exmple (cont.) (step 3) I chooses z + 1in(Z, <, z) such tht (Z, <, z, z + 1) = ψ [ c 1/z, c 2/z+1] (step 4) II replies with q >qin (Q, <, q) (otherwise it loses immeditely) such tht (Q, <, q, q ) = ψ [ c 1/q, c 2/q ] (step 1) φ x 3 ( c 1 < c 2 ( c 1 <x 3 < c 2 )) (step 2) ψ c 1 < c 2 ( c 1 <x 3 < c 2 ){ x 3/ c 3 } = c 1 < c 2 ( c 1 < c 3 < c 2 ) (step 3) I chooses q + q q 2 in (Q, <, q) such tht (Q, <, q, q, q + q q 2 ) = c 1 < c 2 c 1 < c 3 < c 2 [ c 1/q, c 2/q, c 3/q+( q q 2 )]
Exmple (cont.) (step 4) Of course, whtever z II chooses, we hve (Z, <, z, z + 1, z ) = c 1 < c 2 c 1 < c 3 < c 2 [ c 1/z, c 2/z+1, c 3/z ] (gme over) The resulting mpping from Q to Z: q z q z + 1 q + q q 2 z is not prtil isomorphism, so I wins Applictions of EF-gmes EF-gmes hve een exploited to prove some sic results out (the expressive power of) FO logic: Hnf s theorem Sphere lemm Gifmn s theorem EF-gmes hve een extensively used to prove negtive expressivity results (sufficient conditions tht gurntee winning strtegy for II suffice) Gifmn s theorem nd norml forms for FO logic
Gifmn grph Gifmn grph G(A) of structure A: undirected grph (dom(a), E) where (, ) E iff nd occur in the sme tuple of some reltion of A If A itself is (directed) grph, then G(A) is (the undirected version of) A itself, plus ll self-loops The degree of node is the numer of nodes (= ) such tht (, ) E (the degree of G is the mximum of the degrees of its nodes) δ(, ): length of the shortest pth etween nd in G(A) (if there is not such pth, δ(, ) = ) Exmple A =({,, c, d}, R, S), R = {(, )}, S = {(, c, d)} δ(, c) =δ(, d) =2 d c r-sphere nd r-neighorhood Definition (r-sphere) Let A e structure with domin A, A, nd r N. The r-sphere of (in A), denoted S A r (), is defined s follows: S A r () def = { A δ(, ) r }. The notion of r-sphere cn e extended to vector # = 1... s (r-sphere S A r ( # )): S A r ( # ) def = { A δ( #, ) r } = S A r ( 1 )... S A r ( s ). Definition (r-neighorhood) The r-neighorhood N A r ( # ) is the sustructure of A induced y S A r ( # ). If we restrict ourselves to grphs of degree d for some fixed d, there re, for ny r>0, only finitely mny possile isomorphism types of r-spheres.
Hnf s theorem A r B: there is ijection f: A B such tht N A r () = N B r (f()) for every A The reltion A r B sttes tht loclly A nd B look the sme. Theorem (Hnf, 1965) Let A nd B e two structures such tht, for ny r N, ech r-sphere in A or B contins finitely mny elements. Then, A nd B re elementrily equivlent if A r B for every r N. Hnf s result does not hold if the Gifmn grph of (t lest) one structure hs infinite degree, e.g., the usul ordering reltion on nturl numers From the infinite cse to the finite one Hnf s theorem is of interest only for infinite structures: s we lredy pointed out, two finite structures re elementrily equivlent if nd only if they re isomorphic A wekened version of Hnf s theorem, clled sphere theorem, provides sufficient condition for m-equivlence (insted of sufficient condition for elementry equivlence) nd it turns out to e of interest for finite structures The proofs of oth Hnf s theorem nd sphere theorem use Frïssé s theorem
Sphere theorem A t r B: isomorphic r-neighorhoods occur the sme numer of times in oth structures (tht is, they hve the sme multiplicity) or they occur more thn t times in oth structures Theorem (Sphere theorem) Given A nd B with degree t most d nd m N, if A t r B for r = 3 m+1 nd t = m d 3m+1, then A m B. For ll m there re r nd t such tht t r is finer thn m with respect to the clss of structures with degree d Strong hypotheses (it is sufficient condition) isomorphic neighorhoods uniform threshold for ll neighorhood sizes scttering of neighorhoods is not tken into ccount Sphere theorem: proof Thnks to Frïssé s theorem, it suffices to show tht (A, # ) = m (B, # ). The required sequence of sets I 0,...,I m of prtil isomorphisms is defined s follows: p = { ( 1, 1 ),...,( m k, m k ) } I k iff N A 3 k ( 1,..., m k ) = N B 3 k ( 1,..., m k ) To prove the forth property ( similr rgument holds for the ck property), we ssume tht such condition holds for p nd we show tht, for every possile choice of (= m (k 1) ) A, we cn find (= m (k 1) ) B such tht: N A 3 k 1 ( 1,..., m (k 1) ) = N B 3 k 1 ( 1,..., m (k 1) )
Sphere theorem: proof (cont.) We must distinguish two cses: if S A 2/3 3 k ( i ) for some i, then we my choose corresponding from S B 2/3 3 k ( i ) (S A 3 k 1 () is contined in S A 3 k ( i ) nd S B 3 k 1 () is contined in S B 3 k ( i ), nd thus N A 3 k 1 () = N B 3 k 1 ()); otherwise, S A 3 k 1 () (of some isomorphism type σ) isdisjoint from S A 3 k 1 ( i ), for i = 1,..., m k. From A t r B, with r = 3 m+1 nd t = m d 3m+1, it follows tht the numer of occurrences of spheres of type σ in B is lrge enough to gurntee tht we my find one which is disjoint from S B 3 k 1 ( i ), for i = 1,..., m k. By sphere lemm nd distriutive norml form, ny FO formul is equivlent (over grphs of degree d) to Boolen comintion of sttements of the form there exist k occurrences of spheres of types σ : FO logic cn only express locl properties of grphs. References for Hnf s nd Sphere theorems W. Hnf Model-Theoretic Methods in the Study of Elementry Logic The Theory of Model, 1965 W. Thoms On logics, tilings, nd utomt Proc. 18th ICALP, LNCS 510, 1991 W. Thoms On the Ehrenfeucht-Frïssé gme in Theoreticl Computer Science Proc. 4th TAPSOFT, LNCS 668, 1993 R. Fgin, L. J. Stockmeyer, nd M. Y. Vrdi On mondic NP vs mondic co-np Informtion nd Computtion, 1995