{"id":315,"date":"2015-06-09T13:37:13","date_gmt":"2015-06-09T11:37:13","guid":{"rendered":"http:\/\/duch.mimuw.edu.pl\/~bojan\/podpunkt\/?page_id=315"},"modified":"2015-06-09T16:49:41","modified_gmt":"2015-06-09T14:49:41","slug":"8-monads","status":"publish","type":"page","link":"https:\/\/www.mimuw.edu.pl\/~bojan\/20142015-2\/alg\/8-monads","title":{"rendered":"8. Monads"},"content":{"rendered":"<p>So far, we had monoids (and semigroups), as well as an algebraic structure for <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-fd88311a96936352f6e78a3e0a06c929_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#111;&#109;&#101;&#103;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"10\" style=\"vertical-align: 0px;\"\/>-words. In the future, we will also study algebraic structures for other kinds of words, e.g. words indexed by countable total orders, or maybe even arbitrary total orders. Before presenting those structures, we will introduce some general theory, which will allow us to skip some of the standard symbol-pushing that is common to all algebras. This general theory is\u00a0<em>monads.\u00a0<\/em>The idea is that the notion of finite nonempty words is one monad, while the notion of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-90f63237486d55b6ffb6e96fb45a4260_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#105;&#110;&#102;&#116;&#121;\" title=\"Rendered by QuickLaTeX.com\" height=\"7\" width=\"14\" style=\"vertical-align: 0px;\"\/>-words is another monad.<\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<p><strong>Definition.\u00a0<\/strong>A\u00a0<em>monad,\u00a0<\/em>consists of the following ingredients:<\/p>\n<p>\u2022 for each set <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;\"\/>, a new set <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-558fe3c8e8336d21fa8562aa1e2efd7a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"25\" style=\"vertical-align: 0px;\"\/>, called the <em>structures<\/em> over <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;\"\/>.<br \/>\n\u2022 for each function\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1d57f51cc9ddfd69a8631167fa49a4b4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#32;&#58;&#32;&#88;&#32;&#92;&#116;&#111;&#32;&#89;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"73\" style=\"vertical-align: -3px;\"\/>, a new function <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-ae8858189ef33bc052a4790569e633e8_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#102;&#32;&#58;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;&#32;&#92;&#116;&#111;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#89;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"105\" style=\"vertical-align: -3px;\"\/>, called the <em>lifting<\/em> of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-f93f283f23c84021475a1b4449b05867_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"9\" style=\"vertical-align: -3px;\"\/>.<br \/>\n\u2022 for each set <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;\"\/>, a <i>flattening\u00a0<\/i>operation <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-d756fb8ce27587ab9a3b9059cd35c973_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#102;&#108;&#97;&#116;&#116;&#32;&#88;&#32;&#58;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;&#32;&#92;&#116;&#111;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"132\" style=\"vertical-align: -2px;\"\/>.<br \/>\n\u2022 for each set <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;\"\/>, a\u00a0<em>unit\u00a0<\/em>operation <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-284790fb87b3562d41f136c32934badb_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#117;&#110;&#105;&#116;&#32;&#88;&#32;&#58;&#32;&#88;&#32;&#92;&#116;&#111;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"116\" style=\"vertical-align: -2px;\"\/>.<\/p>\n<p>These ingredients are subject to axioms called &#8220;functor&#8221;, &#8220;natural&#8221; and &#8220;monoid&#8221; that will be discussed below. <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<hr \/>\n<p>&nbsp;<\/p>\n<p>The above definition is actually a special case of the general definition of monads. Monads can be applied to any category, while the above definition is only given for the category of sets. However, since in this lecture we only use monads in the category of sets, we only give the special case of the definition.<\/p>\n<p><strong>Example.\u00a0<\/strong>The <em>monad of<\/em>\u00a0<em>nonempty finite words<\/em>\u00a0is defined as follows. The<em>\u00a0<\/em>structures over <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;\"\/> are <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-0e57946b28b1d1550e072b07b3209870_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#88;&#94;&#43;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"23\" style=\"vertical-align: 0px;\"\/>, i.e. the nonempty finite words over <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;\"\/>. The lifting <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-519fe15ac76182d98c4d5dc50dddc1d2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#94;&#43;&#40;&#119;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"17\" width=\"42\" style=\"vertical-align: -4px;\"\/> is obtained by applying <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-f93f283f23c84021475a1b4449b05867_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"9\" style=\"vertical-align: -3px;\"\/> to each letter of <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;\"\/>. The flattening operation is the natural one which takes a word of words into a single word, e.g. the flattening of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-399ee63699abd0d17b8f10fa934bb08f_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#40;&#97;&#98;&#97;&#41;&#40;&#97;&#97;&#41;&#40;&#98;&#41;\" title=\"Rendered by QuickLaTeX.com\" height=\"16\" width=\"80\" style=\"vertical-align: -4px;\"\/> is <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-fd4560a84412df950148b4844a9a8df0_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#97;&#98;&#97;&#97;&#97;&#98;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"46\" style=\"vertical-align: 0px;\"\/>. The unit operation maps a letter to a single letter word consisting of this letter. <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>We now begin discussing the axioms of a monad. When reading the axioms below, it is a good idea to check that they are satisfied by the monad of nonempty words in the example above.<\/p>\n<p><b>Functor axioms.\u00a0<\/b>The first group\u00a0of axioms is that the first two ingredients of a monad are a functor in the sense of category theory. This means lifting is preserves the identity and composition of functions. Preserving identity means that if we lift the identity function on <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;\"\/>, the result is the identity function on <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-558fe3c8e8336d21fa8562aa1e2efd7a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"25\" style=\"vertical-align: 0px;\"\/>. Preserving composition means that for every functions <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1d57f51cc9ddfd69a8631167fa49a4b4_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#32;&#58;&#32;&#88;&#32;&#92;&#116;&#111;&#32;&#89;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"73\" style=\"vertical-align: -3px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-2f25f003b4d481e8fe553019effde0b2_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#103;&#32;&#58;&#32;&#89;&#32;&#92;&#116;&#111;&#32;&#90;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"70\" style=\"vertical-align: -3px;\"\/>, the following diagram commutes <\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 72px;\"><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-6ffe3933dd5e1169e6af9b0a6dc86cfb_l3.png\" height=\"72\" width=\"97\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#32;&#92;&#120;&#121;&#109;&#97;&#116;&#114;&#105;&#120;&#32;&#64;&#82;&#61;&#50;&#112;&#99;&#32;&#123;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#94;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#102;&#125;&#32;&#92;&#97;&#114;&#91;&#100;&#114;&#93;&#95;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#40;&#103;&#32;&#92;&#99;&#105;&#114;&#99;&#32;&#102;&#41;&#125;&#32;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#89;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#94;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#103;&#125;&#32;&#92;&#92;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#90; &#125;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p><strong>Natural axioms. <\/strong>\u00a0The second group of axioms is that for every function <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-47d02e1d7fa3487f1374144d9fff9f6d_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;&#32;&#88;&#32;&#92;&#116;&#111;&#32;&#89;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"60\" style=\"vertical-align: -3px;\"\/>, the following diagrams commute. This means that flattening and unit are what category theorists call<em> natural transformations<\/em>.<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 82px;\"><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-4ee844bfdba16087eca061bd4e791c9c_l3.png\" height=\"82\" width=\"316\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#32;&#92;&#118;&#99;&#101;&#110;&#116;&#101;&#114;&#123;&#92;&#120;&#121;&#109;&#97;&#116;&#114;&#105;&#120;&#32;&#64;&#82;&#61;&#50;&#112;&#99;&#32;&#123;&#32;&#88;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#94;&#123;&#102;&#125;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#95;&#123;&#92;&#117;&#110;&#105;&#116;&#32;&#88;&#125;&#32;&#38;&#32;&#89;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#94;&#123;&#92;&#117;&#110;&#105;&#116;&#32;&#89;&#125;&#32;&#92;&#92; &#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#95;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#102;&#125;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#89; &#125;&#125;&#32;&#92;&#113;&#113;&#117;&#97;&#100;&#32;&#92;&#118;&#99;&#101;&#110;&#116;&#101;&#114;&#123;&#92;&#120;&#121;&#109;&#97;&#116;&#114;&#105;&#120;&#32;&#64;&#82;&#61;&#50;&#112;&#99;&#32;&#123;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#94;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#102;&#125;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#95;&#123;&#92;&#102;&#108;&#97;&#116;&#116;&#32;&#88;&#125;&#32;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#89;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#94;&#123;&#92;&#102;&#108;&#97;&#116;&#116;&#32;&#89;&#125;&#32;&#92;&#92; &#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#95;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#102;&#125;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#89; &#125;&#125;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p><strong>Monoid axioms.\u00a0<\/strong>The first monoid axiom says, essentially, that applying the unit to a structure (i.e. an element of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-558fe3c8e8336d21fa8562aa1e2efd7a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"25\" style=\"vertical-align: 0px;\"\/>) and flattening has no effect. The expression &#8220;applying the unit to a structure&#8221; is ambiguous in the sense that it has two different interpretations, and both interpretations are dealt with in the axiom, which says that the following diagram commutes for every set <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;\"\/>:<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 81px;\"><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-7c6c3f337cb07ef7dbae1bad047a6be6_l3.png\" height=\"81\" width=\"153\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#92;&#118;&#99;&#101;&#110;&#116;&#101;&#114;&#123;&#92;&#120;&#121;&#109;&#97;&#116;&#114;&#105;&#120;&#32;&#64;&#82;&#61;&#50;&#112;&#99;&#32;&#123;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;&#32;&#92;&#97;&#114;&#91;&#100;&#114;&#93;&#94;&#123;&#92;&#109;&#97;&#116;&#104;&#114;&#109;&#123;&#105;&#100;&#125;&#95;&#88;&#125;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#94;&#123;&#92;&#117;&#110;&#105;&#116;&#32;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;&#125;&#125;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#95;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#117;&#110;&#105;&#116;&#32;&#88;&#125;&#32;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#94;&#123;&#92;&#102;&#108;&#97;&#116;&#116;&#32;&#88;&#125;&#32;&#92;&#92; &#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#95;&#123;&#32;&#92;&#117;&#110;&#105;&#116;&#32;&#88;&#32;&#125;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88; &#125;&#125;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>The second monoid axiom is the most important one. It says that if we start with a structure of structures of structures, and we flatten it twice, then we get the same result regardless of which order of flattening we employ. The appropriate commuting diagram is given below.<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 82px;\"><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-40aa7b0812a0d93572ec2ace84943fbf_l3.png\" height=\"82\" width=\"172\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#32;&#92;&#118;&#99;&#101;&#110;&#116;&#101;&#114;&#123;&#92;&#120;&#121;&#109;&#97;&#116;&#114;&#105;&#120;&#32;&#64;&#82;&#61;&#50;&#112;&#99;&#32;&#64;&#67;&#61;&#51;&#112;&#99;&#32;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#94;&#123;&#92;&#102;&#108;&#97;&#116;&#116;&#123;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;&#125;&#125;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#95;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#123;&#32;&#92;&#102;&#108;&#97;&#116;&#116;&#32;&#88;&#125;&#125;&#32;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#94;&#123;&#92;&#102;&#108;&#97;&#116;&#116;&#32;&#88;&#125;&#32;&#92;&#92; &#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#95;&#123;&#32;&#92;&#102;&#108;&#97;&#116;&#116;&#32;&#88;&#125;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88; &#125;&#125;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>This completes the axioms\u00a0of a monad, and therefore also the definition of a monad.<\/p>\n<hr \/>\n<p>&nbsp;<\/p>\n<p><strong>Eilenberg-Moore algebras.\u00a0<\/strong>In this lecture, the point of monads is that each monad comes with a natural notion of algebra, called its<em> Eilenberg-Moore algebra<\/em>. For example, in the monad of nonempty finite words, Eilenberg-Moore algebras will be semigroups, in the monad of possibly empty finite words (with the obvious definition), the Eilenberg-Moore algebras will be monoids.<\/p>\n<p><strong>Definition.\u00a0<\/strong>An <em>Eilenberg-Moore algebra for a monad<\/em> <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1aebe85881328be6a73a06cb8939fb2c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/> is defined to be a pair\u00a0of:<br \/>\n\u2022 a set <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-6363e50f682c03591aa80dd1c1c3d8ac_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"12\" style=\"vertical-align: 0px;\"\/>, called the\u00a0<em>universe\u00a0<\/em>of the algebra, and<br \/>\n\u2022 a\u00a0<em>multiplication operation\u00a0<\/em><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-503e7a78b14f8bdf201969734b3ad4e6_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#117;&#108;&#116;&#32;&#58;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#65;&#32;&#92;&#116;&#111;&#32;&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"92\" style=\"vertical-align: -2px;\"\/><br \/>\nsuch that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-ca9ed6326dfe749d8e6dad838680f917_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#117;&#108;&#116;&#110;&#111;&#97;&#114;&#103;&#32;&#92;&#99;&#105;&#114;&#99;&#32;&#92;&#117;&#110;&#105;&#116;&#32;&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"80\" style=\"vertical-align: -2px;\"\/> is the identity on <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-6363e50f682c03591aa80dd1c1c3d8ac_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"12\" style=\"vertical-align: 0px;\"\/>, and which is associative in the sense that the following diagram commutes<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 80px;\"><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-ed81c35ae9b8af4f9ccc9e3c3b959633_l3.png\" height=\"80\" width=\"152\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#92;&#118;&#99;&#101;&#110;&#116;&#101;&#114;&#123;&#92;&#120;&#121;&#109;&#97;&#116;&#114;&#105;&#120;&#32;&#64;&#82;&#61;&#50;&#112;&#99;&#32;&#64;&#67;&#61;&#51;&#112;&#99;&#32;&#123;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#65;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#94;&#123;&#92;&#102;&#108;&#97;&#116;&#116;&#32;&#65;&#125;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#95;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#117;&#108;&#116;&#110;&#111;&#97;&#114;&#103;&#125;&#32;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#65;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#94;&#123;&#92;&#109;&#117;&#108;&#116;&#110;&#111;&#97;&#114;&#103;&#125;&#32;&#92;&#92; &#92;&#109;&#111;&#110;&#97;&#100;&#32;&#65;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#95;&#123;&#92;&#109;&#117;&#108;&#116;&#110;&#111;&#97;&#114;&#103;&#125;&#32;&#38;&#32;&#65; &#125;&#125;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p> <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>Instead of Eilenberg-Moore algebra for a monad <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1aebe85881328be6a73a06cb8939fb2c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/>, we will write <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1aebe85881328be6a73a06cb8939fb2c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/>-algebra. We denote <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1aebe85881328be6a73a06cb8939fb2c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/>-algebras by\u00a0blackboard\u00a0letters <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-571dff900a291078b942a8cfd0d1b4ee_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#97;&#108;&#103;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/>, and use the convention that the\u00a0universe of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-571dff900a291078b942a8cfd0d1b4ee_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#97;&#108;&#103;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/> (respectively <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-ce1ca3e76cec20cdddb096d70c802240_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#98;&#97;&#108;&#103;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/>) is written by a non-boldface letter <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-6363e50f682c03591aa80dd1c1c3d8ac_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#65;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"12\" style=\"vertical-align: 0px;\"\/> (respectively <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-19b05d631b5bf57a37c7695615ec2b6b_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#66;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"12\" style=\"vertical-align: 0px;\"\/>), while its multiplication operation is denoted by <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-453fb305bf5e6f8323c1178208dc5316_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#117;&#108;&#116;&#32;&#92;&#97;&#108;&#103;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"37\" style=\"vertical-align: -2px;\"\/> (respectively <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-e9efa4967707939e6c4905962c00c053_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#117;&#108;&#116;&#32;&#92;&#98;&#97;&#108;&#103;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"37\" style=\"vertical-align: -2px;\"\/>). In the special case of the monad of possibly\u00a0finite words, an Eilenberg-Moore algebra is the same thing as a monoid, in the sense of Definition 2 <a title=\"1. Introduction to monoids\" href=\"http:\/\/duch.mimuw.edu.pl\/~bojan\/podpunkt\/20142015-2\/alg\/1-introduction-to-monoids\">here<\/a>. Likewise, semigroups are Eilenberg-Moore algebras for the monad of nonempty finite words.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><b>Homomorphisms.\u00a0<\/b>A <em>homomorphism\u00a0of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1aebe85881328be6a73a06cb8939fb2c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/>-algebras <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-571dff900a291078b942a8cfd0d1b4ee_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#97;&#108;&#103;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/> and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-ce1ca3e76cec20cdddb096d70c802240_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#98;&#97;&#108;&#103;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/>\u00a0<\/em>is a function <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1c05de789900e4724e1dc1b2a539f3a3_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#104;&#32;&#58;&#32;&#65;&#32;&#92;&#116;&#111;&#32;&#66;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"70\" style=\"vertical-align: -1px;\"\/> between their universes which is consistent with the multiplication operation in the sense that the following diagram commutes <\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 61px;\"><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-eddf64de0ab7199202142f370cf8612e_l3.png\" height=\"61\" width=\"152\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#118;&#99;&#101;&#110;&#116;&#101;&#114;&#123;&#92;&#120;&#121;&#109;&#97;&#116;&#114;&#105;&#120;&#32;&#64;&#82;&#61;&#49;&#112;&#99;&#32;&#64;&#67;&#61;&#51;&#112;&#99;&#32;&#123;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#65;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#94;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#104;&#125;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#95;&#123;&#32;&#92;&#109;&#117;&#108;&#116;&#95;&#92;&#97;&#108;&#103;&#125;&#32;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#66;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#94;&#123;&#92;&#109;&#117;&#108;&#116;&#95;&#92;&#98;&#97;&#108;&#103;&#125;&#32;&#92;&#92; &#65;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#95;&#123;&#104;&#125;&#32;&#38;&#32;&#66; &#125;&#125; &#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p><strong>Free algebra.\u00a0<\/strong>For a set <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;\"\/>, define its <em>free <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1aebe85881328be6a73a06cb8939fb2c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/>-algebra\u00a0<\/em>as follows: the universe is\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-558fe3c8e8336d21fa8562aa1e2efd7a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"25\" style=\"vertical-align: 0px;\"\/>,\u00a0while the\u00a0multiplication operation is flattening. The two monoid axioms of a monad imply that this is indeed a <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1aebe85881328be6a73a06cb8939fb2c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/>-algebra. By abuse of notation, we denote the free <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1aebe85881328be6a73a06cb8939fb2c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/>-algebra by <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-558fe3c8e8336d21fa8562aa1e2efd7a_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#88;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"25\" style=\"vertical-align: 0px;\"\/>. \u00a0For example, in the special case of the monad of nonempty finite words, the free algebra is\u00a0<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-0e57946b28b1d1550e072b07b3209870_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#88;&#94;&#43;\" title=\"Rendered by QuickLaTeX.com\" height=\"13\" width=\"23\" style=\"vertical-align: 0px;\"\/>. The reason for the name\u00a0<em>free\u00a0<\/em>is given in the following lemma.<\/p>\n<p><strong>Free Algebra Lemma. \u00a0<\/strong>If <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-571dff900a291078b942a8cfd0d1b4ee_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#97;&#108;&#103;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/> is a <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1aebe85881328be6a73a06cb8939fb2c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/>-algebra and <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-aeb6fee794feaade92eebde4e9865fd9_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#83;&#105;&#103;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/> is a set, then for every\u00a0function <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-f93f283f23c84021475a1b4449b05867_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"9\" style=\"vertical-align: -3px;\"\/> from <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-aeb6fee794feaade92eebde4e9865fd9_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#83;&#105;&#103;&#109;&#97;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/> to the universe of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-571dff900a291078b942a8cfd0d1b4ee_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#97;&#108;&#103;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/> there is a unique homomorphism of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1aebe85881328be6a73a06cb8939fb2c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/>-algebras <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-ee64b2c0a888d4ca40708da3a5271992_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#104;&#32;&#58;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#32;&#92;&#116;&#111;&#32;&#92;&#97;&#108;&#103;\" title=\"Rendered by QuickLaTeX.com\" height=\"12\" width=\"79\" style=\"vertical-align: -1px;\"\/> which extends it in the sense that the following diagram commutes<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 71px;\"><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-e84abe4f1888efacc035f9794c330b1e_l3.png\" height=\"71\" width=\"77\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#92;&#120;&#121;&#109;&#97;&#116;&#114;&#105;&#120;&#123;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#32;&#92;&#97;&#114;&#91;&#100;&#114;&#93;&#95;&#123;&#102;&#125;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#94;&#123;&#92;&#117;&#110;&#105;&#116;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#125;&#32;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#94;&#104;&#32;&#92;&#92;&#32;&#38;&#32;&#92;&#97;&#108;&#103;&#125;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p> <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><b>Proof.<\/b>\u00a0Let us first show that if the homomorphism <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-60f817b38fe1ea150775070c85afb9ae_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#104;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"9\" style=\"vertical-align: 0px;\"\/> exists, then it is unique. Suppose that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-60f817b38fe1ea150775070c85afb9ae_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#104;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"9\" style=\"vertical-align: 0px;\"\/> is a homomorphism which extends <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-f93f283f23c84021475a1b4449b05867_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"9\" style=\"vertical-align: -3px;\"\/> in the sense of the diagram above. Consider the following diagram:<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 161px;\"><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-e8ccbcbe69310c72580e184d877bc207_l3.png\" height=\"161\" width=\"231\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#91;&#92;&#120;&#121;&#109;&#97;&#116;&#114;&#105;&#120;&#64;&#67;&#61;&#52;&#112;&#99;&#123; &#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#32;&#92;&#97;&#114;&#91;&#100;&#100;&#108;&#93;&#95;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#102;&#125;&#32;&#92;&#97;&#114;&#91;&#100;&#100;&#114;&#93;&#94;&#123;&#92;&#105;&#100;&#101;&#110;&#116;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#125;&#32;&#92;&#97;&#114;&#91;&#100;&#100;&#93;&#95;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#117;&#110;&#105;&#116;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#125;&#92;&#92; &#92;&#92; &#92;&#109;&#111;&#110;&#97;&#100;&#32;&#65;&#32;&#92;&#97;&#114;&#91;&#100;&#114;&#93;&#95;&#123;&#92;&#109;&#117;&#108;&#116;&#32;&#92;&#97;&#108;&#103;&#125;&#32;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#32;&#92;&#97;&#114;&#91;&#108;&#93;&#95;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#104;&#125;&#32;&#92;&#97;&#114;&#91;&#114;&#93;&#94;&#123;&#92;&#102;&#108;&#97;&#116;&#116;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#125;&#32;&#32;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#32;&#92;&#97;&#114;&#91;&#100;&#108;&#93;&#95;&#123;&#104;&#125;&#32;&#92;&#92; &#38;&#32;&#65;&#125;&#92;&#93;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p>The left triangular face commutes by applying the functor <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1aebe85881328be6a73a06cb8939fb2c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/> to the diagram in the statement of the lemma which says that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-60f817b38fe1ea150775070c85afb9ae_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#104;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"9\" style=\"vertical-align: 0px;\"\/> extends <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-f93f283f23c84021475a1b4449b05867_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#102;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"9\" style=\"vertical-align: -3px;\"\/>.\u00a0(Applying a functor preserves commuting diagrams.) \u00a0The right triangular face commutes by the first monoid axiom of a monad. The lower face commutes by the assumption that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-60f817b38fe1ea150775070c85afb9ae_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#104;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"9\" style=\"vertical-align: 0px;\"\/> is a homomorphism. Therefore, the perimeter of the diagram says that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-60f817b38fe1ea150775070c85afb9ae_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#104;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"9\" style=\"vertical-align: 0px;\"\/> must be equal to <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-300e3f73f38dbb57c6d2c8fa39bf0338_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#102;\" title=\"Rendered by QuickLaTeX.com\" height=\"14\" width=\"20\" style=\"vertical-align: -3px;\"\/> followed by multiplication in <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-571dff900a291078b942a8cfd0d1b4ee_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#97;&#108;&#103;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/>. We now show that <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-60f817b38fe1ea150775070c85afb9ae_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#104;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"9\" style=\"vertical-align: 0px;\"\/> defined this way really is a homomorphism.<\/p>\n<p>Being a homomorphism is that the perimeter of the following diagram commutes.<\/p>\n<p class=\"ql-center-displayed-equation\" style=\"line-height: 185px;\"><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-d526b48dc4fa10deb357ae79722e8d3b_l3.png\" height=\"185\" width=\"278\" class=\"ql-img-displayed-equation quicklatex-auto-format\" alt=\"&#92;&#98;&#101;&#103;&#105;&#110;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125; &#92;&#120;&#121;&#109;&#97;&#116;&#114;&#105;&#120;&#64;&#67;&#61;&#52;&#112;&#99;&#123;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#32;&#92;&#97;&#114;&#91;&#100;&#100;&#100;&#93;&#95;&#123;&#92;&#102;&#108;&#97;&#116;&#116;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#125;&#32;&#92;&#97;&#114;&#91;&#114;&#114;&#93;&#94;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#104;&#125;&#32;&#92;&#97;&#114;&#91;&#100;&#114;&#93;&#95;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#102;&#125;&#32;&#38;&#32;&#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#65;&#32;&#32;&#92;&#97;&#114;&#91;&#100;&#100;&#100;&#93;&#94;&#123;&#92;&#109;&#117;&#108;&#116;&#32;&#92;&#97;&#108;&#103;&#125;&#92;&#92; &#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#65;&#32;&#92;&#97;&#114;&#91;&#117;&#114;&#93;&#95;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#109;&#117;&#108;&#116;&#32;&#92;&#97;&#108;&#103;&#125;&#32;&#92;&#97;&#114;&#91;&#100;&#93;&#95;&#123;&#92;&#102;&#108;&#97;&#116;&#116;&#32;&#65;&#125;&#32;&#32;&#92;&#92; &#38;&#32;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#65;&#32;&#92;&#97;&#114;&#91;&#100;&#114;&#93;&#94;&#123;&#92;&#109;&#117;&#108;&#116;&#32;&#92;&#97;&#108;&#103;&#125;&#32;&#92;&#92; &#92;&#109;&#111;&#110;&#97;&#100;&#32;&#92;&#83;&#105;&#103;&#109;&#97;&#32;&#32;&#92;&#97;&#114;&#91;&#114;&#114;&#93;&#95;&#123;&#104;&#125;&#32;&#92;&#97;&#114;&#91;&#117;&#114;&#93;&#94;&#123;&#92;&#109;&#111;&#110;&#97;&#100;&#32;&#102;&#125;&#32;&#38;&#32;&#38;&#32;&#65;&#125;&#92;&#101;&#110;&#100;&#123;&#97;&#108;&#105;&#103;&#110;&#42;&#125;\" title=\"Rendered by QuickLaTeX.com\"\/><\/p>\n<p> The lower triangular face is simply the definition of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-60f817b38fe1ea150775070c85afb9ae_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#104;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"9\" style=\"vertical-align: 0px;\"\/>, while the upper triangular face is the definition of <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-60f817b38fe1ea150775070c85afb9ae_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#104;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"9\" style=\"vertical-align: 0px;\"\/> with the functor <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-1aebe85881328be6a73a06cb8939fb2c_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#109;&#111;&#110;&#97;&#100;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"10\" style=\"vertical-align: 0px;\"\/> applied to it. The left trapezoid face is the second of the &#8220;natural axioms&#8221;, while the right trapezoid face is the associativity of multiplication in <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-content\/ql-cache\/quicklatex.com-571dff900a291078b942a8cfd0d1b4ee_l3.png\" class=\"ql-img-inline-formula quicklatex-auto-format\" alt=\"&#92;&#97;&#108;&#103;\" title=\"Rendered by QuickLaTeX.com\" height=\"11\" width=\"11\" style=\"vertical-align: 0px;\"\/>. \u00a0<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","protected":false},"excerpt":{"rendered":"<p>So far, we had monoids (and semigroups), as well as an algebraic structure for -words. In the future, we will also study algebraic structures for other kinds of words, e.g. words indexed by countable total orders, or maybe even arbitrary total orders. Before presenting those structures, we will introduce some general theory, which will allow [&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-315","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/315"}],"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=315"}],"version-history":[{"count":4,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/315\/revisions"}],"predecessor-version":[{"id":320,"href":"https:\/\/www.mimuw.edu.pl\/~bojan\/wp-json\/wp\/v2\/pages\/315\/revisions\/320"}],"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=315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}