{"id":212,"date":"2015-04-23T12:23:43","date_gmt":"2015-04-23T10:23:43","guid":{"rendered":"http:\/\/duch.mimuw.edu.pl\/~bojan\/podpunkt\/?page_id=212"},"modified":"2017-10-31T12:58:19","modified_gmt":"2017-10-31T11:58:19","slug":"5-piecewise-testable-languages","status":"publish","type":"page","link":"https:\/\/www.mimuw.edu.pl\/~bojan\/20142015-2\/alg\/5-piecewise-testable-languages","title":{"rendered":"5. Piecewise testable languages"},"content":{"rendered":"<p>The Sch\u00fctzenberger theorem shows which languages are definable in first-order logic. What about less expressive logics? One direction is to study formulas where the quantification pattern is somehow limited. This idea has been seen a lot of work, of which we only describe here the simplest quantification patterns.<\/p>\n<hr \/>\n<p><b>Existential formulas. <\/b>As a warmup, we will talk about existential formulas.\u00a0Define an <em>existential<\/em>, also known as <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-7f6abda01ec6a0a4f56864a0ee7d9f27_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#101;&#120;&#105;&#115;&#116;&#115;&#94;&#42;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"15\" style=\"vertical-align: 0px;\"\/> formula, to be a first-order formula of the form <\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 16px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-884d61162e62eccfb61089ee3b9b451d_l3.png\" height=\"16\" width=\"186\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#92;&#101;&#120;&#105;&#115;&#116;&#115;&#32;&#120;&#95;&#49;&#32;&#92;&#101;&#120;&#105;&#115;&#116;&#115;&#32;&#120;&#95;&#50;&#32;&#92;&#99;&#100;&#111;&#116;&#115;&#32;&#92;&#101;&#120;&#105;&#115;&#116;&#115;&#32;&#120;&#95;&#110;&#32;&#92;&#118;&#97;&#114;&#112;&#104;&#105;&#40;&#120;&#95;&#49;&#44;&#92;&#108;&#100;&#111;&#116;&#115;&#44;&#120;&#95;&#110;&#41;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>where <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-8cb1ea867e2888b522709f63bc7b588a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#118;&#97;&#114;&#112;&#104;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"10\" style=\"vertical-align: -3px;\"\/> is quantifier free and uses predicates as in the Sch\u00fctzenberger theorem, namely unary predicates for the labels and a binary predicate for the order. For example, the existential formula <\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 16px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-4d32bf8527a245d41a944be4c2709370_l3.png\" height=\"16\" width=\"169\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#92;&#101;&#120;&#105;&#115;&#116;&#115;&#32;&#120;&#32;&#92;&#101;&#120;&#105;&#115;&#116;&#115;&#32;&#121;&#32;&#32;&#92;&#32;&#97;&#40;&#120;&#41;&#32;&#92;&#108;&#97;&#110;&#100;&#32;&#98;&#40;&#121;&#41;&#32;&#92;&#108;&#97;&#110;&#100;&#32;&#120;&#32;&#60;&#32;&#121;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p> defines the words where some <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b9876851baf92019e82e43590932dc73_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/> is followed by some <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-d164b13e13a51517b6039136e0a957b5_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#98;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"7\" style=\"vertical-align: 0px;\"\/>.<\/p>\n<p>When talking about full first-order logic, the successor predicate does not need to be added to the vocabulary, because it can be defined in terms of the order predicate. However, for existential formulas, this is not the case, and therefore existential formulas which allow both order and successor would have different power than existential formulas with only order. We will not talk about the successor here, although it is studied.<\/p>\n<p>Define the\u00a0<em>Higman ordering<\/em> on words to be the ordering where <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-4522d054fc66f791bce756aecdb714d8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#32;&#92;&#108;&#101;&#32;&#118;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"40\" style=\"vertical-align: -2px;\"\/> holds if one can remove some letters, not necessarily in a connected way, to go from <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-8ecbc11e5f9047eaecdbfca853b87fd1_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#118;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/> to <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-eedf2e7eca2b090be6b3ece6f6e31f7b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"11\" style=\"vertical-align: 0px;\"\/>. This is also known as the\u00a0<em>subsequence\u00a0<\/em>ordering. For example &#8220;ila&#8221; is a subsequence of &#8220;Mikolaj&#8221;. We will use the following result:<\/p>\n<p><strong>Lemma\u00a0<\/strong><strong>(Higman&#8217;s Lemma)\u00a0<\/strong>For a fixed alphabet, the Higman ordering is a well quasi-order, which means that it is well founded and it does not have infinite antichains.<\/p>\n<p><strong>Proof.\u00a0<\/strong>For a finite or infinite\u00a0sequence of words <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-50175a3f975cca9721a00d89eba4f5a4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#49;&#44;&#119;&#95;&#50;&#44;&#92;&#108;&#100;&#111;&#116;&#115;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"67\" style=\"vertical-align: -3px;\"\/> define a <em>growth<\/em> to be positions <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-a116a094c2a8de0de71c27f0b364c526_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#105;&#32;&#60;&#32;&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"33\" style=\"vertical-align: -3px;\"\/> such that the word <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-cda4ecdf85ef282dd2cdc338de61ea83_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#105;\" title=\"Rendered by QuickLaTeX.com\" height=\"9\" width=\"15\" style=\"vertical-align: -2px;\"\/> is a subsequence of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-7d58cea84bffc71be49eff93fe656905_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"16\" style=\"vertical-align: -4px;\"\/>. Define a <em>growth-free\u00a0sequence\u00a0<\/em>to be a sequence of words without a growth. Antichains and violations of well-foundedness are examples of growth-free sequences, and therefore to prove the lemma it suffices to show that there is no infinite growth-free sequence.<\/p>\n<p>Define the radix ordering on words as follows: shorter words come before longer ones, and same length words are ordered lexicographically. \u00a0 To prove the lemma, suppose that an infinite growth-free sequence sequence exists. Define a sequence <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-50175a3f975cca9721a00d89eba4f5a4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#49;&#44;&#119;&#95;&#50;&#44;&#92;&#108;&#100;&#111;&#116;&#115;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"67\" style=\"vertical-align: -3px;\"\/> by induction as follows. The word <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-ff12f50b9b55c8730a129269d9af59fc_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"17\" style=\"vertical-align: -3px;\"\/> is the least word, in the radix ordering (which is well-founded, so it makes sense to talk about least words), which is the beginning of some infinite growth-free sequence. For <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-2779605f3912eb36fc2598e44ddf9b37_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#110;&#32;&#62;&#32;&#49;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"37\" style=\"vertical-align: -1px;\"\/>, define <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-6dc2b3291eb5ffad4b1343d6b0248b4b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"9\" width=\"18\" style=\"vertical-align: -2px;\"\/> to be the least\u00a0word in the radix ordering such that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-4f380ebaf7a5fb47ba132a19bed2cac0_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#49;&#44;&#92;&#108;&#100;&#111;&#116;&#115;&#44;&#119;&#95;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"71\" style=\"vertical-align: -3px;\"\/> is the beginning of some infinite growth-free sequence, in particular <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-4f380ebaf7a5fb47ba132a19bed2cac0_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#49;&#44;&#92;&#108;&#100;&#111;&#116;&#115;&#44;&#119;&#95;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"71\" style=\"vertical-align: -3px;\"\/> is a finite growth-free sequence. Growth-free sequences are closed under limits, and therefore <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-50175a3f975cca9721a00d89eba4f5a4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#49;&#44;&#119;&#95;&#50;&#44;&#92;&#108;&#100;&#111;&#116;&#115;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"67\" style=\"vertical-align: -3px;\"\/> is an infinite growth free sequence.<\/p>\n<p>Consider the sequence <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-50175a3f975cca9721a00d89eba4f5a4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#49;&#44;&#119;&#95;&#50;&#44;&#92;&#108;&#100;&#111;&#116;&#115;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"67\" style=\"vertical-align: -3px;\"\/> defined in the previous paragraph. Because the alphabet is finite, there must be some letter, call it <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b9876851baf92019e82e43590932dc73_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/>, such that infinitely many words in the sequence, say with indexes <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-24f5c52bd7153093b4c9729f2e8a35f5_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#110;&#95;&#49;&#32;&#60;&#32;&#110;&#95;&#50;&#32;&#60;&#32;&#92;&#99;&#100;&#111;&#116;&#115;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"91\" style=\"vertical-align: -3px;\"\/>, begin with the letter <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b9876851baf92019e82e43590932dc73_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/>. Define a new sequence as follows. Let <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1581bd603826320b358d867162d09127_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"9\" style=\"vertical-align: 0px;\"\/> be the first index such that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-6dc2b3291eb5ffad4b1343d6b0248b4b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"9\" width=\"18\" style=\"vertical-align: -2px;\"\/> begins with <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b9876851baf92019e82e43590932dc73_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/>. Remove from the sequence all words after <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-6dc2b3291eb5ffad4b1343d6b0248b4b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"9\" width=\"18\" style=\"vertical-align: -2px;\"\/> that <em>do not\u00a0<\/em>begin with <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b9876851baf92019e82e43590932dc73_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/>, and for all words that do begin with <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b9876851baf92019e82e43590932dc73_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"8\" style=\"vertical-align: 0px;\"\/>, remove the first letter. It is not difficult to show that the new sequence is also growth-free, but it contradicts the construction of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-4f380ebaf7a5fb47ba132a19bed2cac0_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#49;&#44;&#92;&#108;&#100;&#111;&#116;&#115;&#44;&#119;&#95;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"10\" width=\"71\" style=\"vertical-align: -3px;\"\/> because we have just shortened the word <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-6dc2b3291eb5ffad4b1343d6b0248b4b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#95;&#110;\" title=\"Rendered by QuickLaTeX.com\" height=\"9\" width=\"18\" style=\"vertical-align: -2px;\"\/>, and therefore decreased its position in the radix ordering. <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b06cee67d5b1a769f0a344ace98d5692_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#66;&#111;&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/><\/p>\n<p>&nbsp;<\/p>\n<p>From Higman&#8217;s Lemma, we obtain the following result.<\/p>\n<p><strong>Theorem.\u00a0<\/strong>A language <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-a6ccb424a819b1bee6d09fa6b1b2b4c1_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;&#32;&#92;&#115;&#117;&#98;&#115;&#101;&#116;&#101;&#113;&#32;&#65;&#94;&#42;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"49\" style=\"vertical-align: -2px;\"\/> is definable by an existential formula if and only if it is upward closed with respect to the Higman ordering.<\/p>\n<p><strong>Proof.\u00a0<\/strong>The left-to-right implication is immediate, because adding letters can only make an existential formula more true. Let us focus on the right-to-left implication. For a set of words <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-985853afefa0f9d11b09264aa12867af_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#88;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"14\" style=\"vertical-align: 0px;\"\/>, let us write <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c3b5bd536b82a712e88a054a60aab250_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#88;&#32;&#92;&#117;&#112;&#97;&#114;&#114;&#111;&#119;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"26\" style=\"vertical-align: -3px;\"\/> for its upward closure with \u00a0respect to the Higman ordering. Suppose that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c2289d1b720dbeb200c7be3944b43068_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/> is upward closed. Define <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-8eb2a6af038dd84b846d793d889334f4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#105;&#110;&#32;&#76;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"39\" style=\"vertical-align: 0px;\"\/> to be the elements of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c2289d1b720dbeb200c7be3944b43068_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/> that are minimal with respect to the Higman ordering. Clearly <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-8eb2a6af038dd84b846d793d889334f4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#105;&#110;&#32;&#76;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"39\" style=\"vertical-align: 0px;\"\/> is an antichain, and therefore by the Higman Lemma it is finite. \u00a0Finally, \u00a0observe that <\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 16px;\"><span class=\"ql-right-eqno\"> &nbsp; <\/span><span class=\"ql-left-eqno\"> &nbsp; <\/span><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1eeff461029ab7a1c778e777d2723de5_l3.png\" height=\"16\" width=\"95\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#76;&#32;&#61;&#32;&#40;&#92;&#109;&#105;&#110;&#32;&#76;&#41;&#92;&#117;&#112;&#97;&#114;&#114;&#111;&#119;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p> The inclusion <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-8eff219608899a84b8dcb02fad8e2030_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#115;&#117;&#112;&#115;&#101;&#116;&#101;&#113;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"10\" style=\"vertical-align: -2px;\"\/> is a consequence of the assumption that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c2289d1b720dbeb200c7be3944b43068_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/> is upward closed, while for the <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-f678eb7090e9db3035e284c528f415ee_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#115;&#117;&#98;&#115;&#101;&#116;&#101;&#113;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"10\" style=\"vertical-align: -2px;\"\/> inclusion we use well-foundedness of the Higman ordering to prove that for every word <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-ac2f63572b4c38b8fd7c6b645842a676_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#119;&#32;&#92;&#105;&#110;&#32;&#76;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"41\" style=\"vertical-align: -1px;\"\/>, there is some minimal word that is smaller than it. It is easy to see that for every finite set, its upward closure is definable by an existential formula, and therefore <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c2289d1b720dbeb200c7be3944b43068_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/> is definable by an existential formula. <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-b06cee67d5b1a769f0a344ace98d5692_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#66;&#111;&#120;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/><\/p>\n<p>This completes our study of languages defined by existential formulas. Let us move to a more interesting case, namely Boolean combinations of existential formulas.<\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<p><strong>Boolean combinations of existential formulas.\u00a0<\/strong>Boolean combinations of existential formulas, sometimes also known as piecewise testable languages, are a much more interesting class. In particular,\u00a0every finite language is a boolean combination of existential formulas. \u00a0For example, the language which contains only the word\u00a0<em>abaa<\/em> is equal to the set of words which contain\u00a0<em>abaa\u00a0<\/em>as a subsequence, but which do not contain any subsequence of length 5. \u00a0A beautiful result by Imre Simon characterises piecewise testable languages as follows.<\/p>\n<p><strong>Theorem (Piecewise is <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-8255b8636497b6ab6c2a22220b1ca86c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#74;&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"13\" style=\"vertical-align: -1px;\"\/>-trival).\u00a0<\/strong>A language is piecewise testable if and only its syntactic monoid is <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-8255b8636497b6ab6c2a22220b1ca86c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#74;&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"13\" style=\"vertical-align: -1px;\"\/>-trivial, i.e. all <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-8255b8636497b6ab6c2a22220b1ca86c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#74;&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"13\" style=\"vertical-align: -1px;\"\/>-classes are singletons.<\/p>\n<p>A corollary of the above theorem is that one can decide if a language is piecewise testable (whatever the use of that could be), by computing the syntactic monoid, and then computing the <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-8255b8636497b6ab6c2a22220b1ca86c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#74;&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"13\" style=\"vertical-align: -1px;\"\/>-classes.<\/p>\n<p>We will not\u00a0prove this theorem, but a very similar one, which uses separation. We say that two languages <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-7b2a7bcd1d1f12589ab1d1c8060505f4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;&#44;&#75;&#32;&#92;&#115;&#117;&#98;&#115;&#101;&#116;&#101;&#113;&#32;&#65;&#94;&#42;\" title=\"Rendered by QuickLaTeX.com\" height=\"15\" width=\"71\" style=\"vertical-align: -3px;\"\/> are separated by a language <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-361fcbd59862666c6a4178483821b904_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#77;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"17\" style=\"vertical-align: 0px;\"\/> if <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-361fcbd59862666c6a4178483821b904_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#77;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"17\" style=\"vertical-align: 0px;\"\/> contains <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-c2289d1b720dbeb200c7be3944b43068_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#76;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/> but is disjoint with <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-a1f49e25180030be8e0e2be723217e06_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#75;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"14\" style=\"vertical-align: 0px;\"\/>. \u00a0We will prove the following result.<\/p>\n<p><strong>Theorem (Piecewise Separation).\u00a0<\/strong>It is decidable if two regular languages can be separated by a piecewise testable one.<\/p>\n<p>A corollary of the above theorem is the same as the corollary of the theorem on piecewise being <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-8255b8636497b6ab6c2a22220b1ca86c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#74;&#106;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"13\" style=\"vertical-align: -1px;\"\/>-trivial, namely one can decide if a language is piecewise testable. This is because a language is piecewise testable if and only if it can be separated from its complement by a piecewise testable language.<\/p>\n<p>The proof of the Piecewise Separation Theorem will consist of two\u00a0parts. In <a title=\"Zigzags\" href=\"https:\/\/www.mimuw.edu.pl\/~bojan\/20142015-2\/alg\/5-piecewise-testable-languages\/zigzags\">part 1<\/a>, we will show that piecewise separability can be characterised in terms of something called zigzags. In <a title=\"Zigzag Game\" href=\"https:\/\/www.mimuw.edu.pl\/~bojan\/20142015-2\/alg\/5-piecewise-testable-languages\/zigzag-game\">part 2<\/a>, we will show that zigzags can be characterised by a certain game.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Sch\u00fctzenberger theorem shows which languages are definable in first-order logic. What about less expressive logics? One direction is to study formulas where the quantification pattern is somehow limited. This idea has been seen a lot of work, of which we only describe here the simplest quantification patterns. Existential formulas. As a warmup, we will [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":42,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"class_list":["post-212","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/212"}],"collection":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/comments?post=212"}],"version-history":[{"count":6,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/212\/revisions"}],"predecessor-version":[{"id":1404,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/212\/revisions\/1404"}],"up":[{"embeddable":true,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/42"}],"wp:attachment":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/media?parent=212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}