{"id":608,"date":"2008-03-06T21:39:19","date_gmt":"2008-03-06T21:39:19","guid":{"rendered":"http:\/\/scientopia.org\/blogs\/goodmath\/2008\/03\/06\/monoids-and-computation-syntactic-monoids\/"},"modified":"2008-03-06T21:39:19","modified_gmt":"2008-03-06T21:39:19","slug":"monoids-and-computation-syntactic-monoids","status":"publish","type":"post","link":"http:\/\/www.goodmath.org\/blog\/2008\/03\/06\/monoids-and-computation-syntactic-monoids\/","title":{"rendered":"Monoids and Computation: Syntactic Monoids"},"content":{"rendered":"<p> While doing some reading on rings, I came across some interesting stuff about<br \/>\nMonoids and syntax. That&#8217;s right up my alley, so I decided to write a post about that.<\/p>\n<p><!--more--><\/p>\n<p> We start by defining a new property for monoids &#8211; a kind of equivalence<br \/>\nrelation called a <em>monoid congruence<\/em>. A Monoid congruence defines<br \/>\nequivalence classes within the set of values in a monoid. The monoid congruence<br \/>\nrelation is generally written as &#8220;~&#8221;, and it&#8217;s a relation between two values in a<br \/>\nmonoid: ~&sube;M&times;M. A monoid congruence has all of the usual properties<br \/>\nof an equivalence relation: it&#8217;s symmetric, reflexive, and transitive. It also<br \/>\nrespects the monoid operator: if a, b, c, and d are all members of a monoid M,<br \/>\na~c, and b~d, then a&ordm;b~c&ordm;d. <\/p>\n<p> If we have a monoid congruence relation &#8220;~&#8221;, then we can obviously use it to create a collection of equivalence classes, called <em>congruence classes<\/em>. If a is a member of monoid (M,&ordm;), then we can define the congruence class [a]={m&isin;M | x~a } &#8211; that is, the set of objects in M that are &#8220;~&#8221; with a. <\/p>\n<p> We can then define a new operation on the congruence classes: if a and b are members of a monoid (M,&ordm;), then we can define an operation &#8220;*&#8221; by<br \/>\n[a]*[b]=[a&ordm;b]. If you look at the set of congruence classes of M given by &#8220;~&#8221;, and the &#8220;*&#8221;, what do you get? <em>Another monoid<\/em>, which we call a <em>quotient monoid<\/em>. The quotient monoid created by a particular congruence relation &#8220;~&#8221; is<br \/>\nwritten M\/~.<\/p>\n<p> Now, we take a new step, and this is where it starts to get really interesting. Remember how I described the relationship between monoids and computing devices? We&#8217;re going to start taking advantage of that. If we take a monoid, and use concatenation<br \/>\nas the notation for the monoid operator, then we can describe products as strings: &#8220;abc&#8221; is (a&ordm;b)&ordm;c. <\/p>\n<p> In automata theory, we talk about formal languages, which are specific sets of strings of symbols. A formal language is usually described by some system of rules, which describe<br \/>\nhow the strings in the language are generated. For a very simple example, we can<br \/>\nuse a regular expression, like &#8220;a<sup>+<\/sup>b<sup>*<\/sup>&#8221; to represent the language consisting of any number of &#8220;a&#8221;s, possibly followed by any number of &#8220;b&#8221;s. We can<br \/>\ntalk about more complicated languages, by using grammars. For example, the classic<br \/>\nfirst language that can&#8217;t be described by simple regular expressions is the following:<\/p>\n<pre>\n<em>X<\/em> &rarr; (<em>X<\/em>)\n<em>X<\/em> &rarr; <em>X<\/em> <em>X<\/em>\n<em>X<\/em> &rarr; &epsilon;\n<\/pre>\n<p> This language consists of sequences of open and close parens where the number of opens and closes is balanced: strings like &#8220;()&#8221;, &#8220;(())&#8221;, &#8220;((()(()(()))))&#8221;, and so on.<\/p>\n<p> If we think of a monoid as a meta-computing machine, then we can<br \/>\ntalk about the kinds of languages that can be accepted by a particular<br \/>\nmonoid &#8211; that is, if we&#8217;re working with a machine built from the monoid, what kinds of languages can that machine accept? It turns out that we can define that<br \/>\nset using monoid quotients!<\/p>\n<p> We can start by defining a <em>syntactic quotient<\/em>, using contatenation to denote the monoid operator. If M is a monoid, and S is a subset of M,<br \/>\nthen we can define left and right <em>syntactic quotients<\/em> of S:<\/p>\n<ul>\n<li> If m&isin;M, then the <em>right syntactic quotient<\/em> of S by m,<br \/>\nwritten S\/m = { a&isin;M | am &isin; S }.<\/li>\n<li> If n&isin;M, then the <em>left syntactic quotient<\/em> of S by n,<br \/>\nwritten nS = { b&isin;M | mb&isin;S }.<\/li>\n<\/ul>\n<p> We can then use the syntactic quotients to define congruence relations,<br \/>\nexactly as we did above. We get two congruence relations, the <em>right syntactic equivalence<\/em>, ~s, which is the congruence relation induced by the right syntactic quotient, and the <em>left syntactic equivalence<\/em> s~, which is the congruence relation implied by the left syntactic quotient. And finally, we can define a total syntactic congruence (also called a double-sided congruence), written ~<sub>s<\/sub> using both:<\/p>\n<p> a ~<sub>s<\/sub> b &hArr; (&forall;x,y&isin;M: xay&isin;S &hArr; xby&isin;S<\/p>\n<p> So, here&#8217;s where the connection to computable languages comes in. The syntactic quotient, following the procedure above, defines a new monoid &#8211; the syntactic monoid of S, which we call M(S). The syntactic monoid of S is a monoid which <em>accepts<\/em><br \/>\nthe set S. We call a <em>language<\/em> &#8211; consisting of the strings of symbols that<br \/>\nconcatenated together by M&#8217;s monoid operator result in values in S. So we&#8217;ve finally really gotten to the point where we can really see how a monoid represents a computing device. In computation theory, we can describe every computing device in terms of languages. We can likewise describe computable languages in terms of monoids.<\/p>\n<p> In particular, we can define what it means for a language to be recognizable by a<br \/>\nmonoid, M. Take a language, L&sube;M. If the set of quotients {L\/m|m&isin;M} is finite,<br \/>\nthen L is recognizable by M. <\/p>\n<p> There&#8217;s more to it than this &#8211; transition monoids are particularly interesting. But that&#8217;s enough for this post. We&#8217;ll save it for later.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>While doing some reading on rings, I came across some interesting stuff about Monoids and syntax. That&#8217;s right up my alley, so I decided to write a post about that.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[69,79],"tags":[],"class_list":["post-608","post","type-post","status-publish","format-standard","hentry","category-abstract-algebra","category-computation"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4lzZS-9O","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/comments?post=608"}],"version-history":[{"count":0,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/posts\/608\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/media?parent=608"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/categories?post=608"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.goodmath.org\/blog\/wp-json\/wp\/v2\/tags?post=608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}