<?xml version="1.0" encoding="utf-8"?>
<!-- If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/ -->
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:lj="http://www.livejournal.com">
  <id>urn:lj:livejournal.com:atom1:beroal</id>
  <title>язык, на котором не говорят</title>
  <subtitle>beroal</subtitle>
  <author>
    <name>beroal</name>
  </author>
  <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/"/>
  <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom"/>
  <updated>2012-03-10T08:17:27Z</updated>
  <lj:journal userid="4821330" username="beroal" type="personal"/>
  <link rel="service.feed" type="application/x.atom+xml" href="http://beroal.livejournal.com/data/atom" title="язык, на котором не говорят"/>
  <link rel="hub" href="http://pubsubhubbub.appspot.com/"/>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:39664</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/39664.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=39664"/>
    <title>байт</title>
    <published>2012-03-10T08:17:27Z</published>
    <updated>2012-03-10T08:17:27Z</updated>
    <content type="html">Пришло в голову. что понятие байта больше не имеет практической ценности. Когда-то и числа, и буквы имели размер байта, это было удобно. Сейчас числа имеют разный размер в зависимости от процессора, и даже в пределах одного компьютера разные шины данных имеют разную ширину. С буквами вообще бардак, который невозможно описать одним предложением.&lt;br /&gt;&lt;br /&gt;Процессор должен видеть память как массив битов, а не массив байтов.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:39322</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/39322.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=39322"/>
    <title>PulseAudio: творческое программирование</title>
    <published>2012-02-09T20:14:10Z</published>
    <updated>2012-02-11T10:08:50Z</updated>
    <category term="fun"/>
    <content type="html">Что меня поражает в &lt;a href="http://ru.wikipedia.org/wiki/PulseAudio" rel="nofollow"&gt;PulseAudio&lt;/a&gt;, так это изощрённость ошибок. Была &lt;a href="https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/928757" rel="nofollow"&gt;ошибка, которая искажала голос&lt;/a&gt; так, что он был похож на голос &lt;a href="http://ru.wikipedia.org/wiki/%D0%94%D0%B0%D1%80%D1%82_%D0%92%D0%B5%D0%B9%D0%B4%D0%B5%D1%80" rel="nofollow"&gt;Дарта Вейдера&lt;/a&gt;. Есть ошибка, готорая превращает голос в музыку. И неплохие мелодии получаются. Никогда бы не подумал, что такие эффекты могут возникнуть в результате ошибок.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:38978</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/38978.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=38978"/>
    <title>радость Firefox-а</title>
    <published>2011-12-22T16:31:18Z</published>
    <updated>2011-12-22T16:31:18Z</updated>
    <content type="html">&lt;a href="http://theunfocused.net/2011/11/19/solving-firefoxs-add-on-compatibility-problem/" rel="nofollow"&gt;Расширения для Firefox будут по умолчанию совместимы с новыми версиями Firefox.&lt;/a&gt; Прогрессивные силы человечества одержали верх над тёмными силами реакции! Ура, товарищи!&lt;br /&gt;&lt;br /&gt;По теме: &lt;a href="http://beroal.livejournal.com/37332.html"&gt;жалобы на Firefox&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:38746</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/38746.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=38746"/>
    <title>софизмы-синонимы</title>
    <published>2011-12-13T11:36:22Z</published>
    <updated>2011-12-13T13:38:42Z</updated>
    <category term="fun"/>
    <content type="html">Из разговора родился следующий ряд софизмов:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&amp;laquo;Пёс&amp;raquo; и &amp;laquo;dog&amp;raquo; &amp;mdash; это разные животные, потому что их названия звучат по-разному.&lt;/li&gt;&lt;li&gt;Ньютон изучал притяжение Земли к Солнцу или притяжение Солнца к Земле?&lt;/li&gt;&lt;li&gt;Join-semilattice и meet-semilattice &amp;mdash; это абсолютно разные вещи.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;А вы можете придумать изречение такого же рода?</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:38510</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/38510.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=38510"/>
    <title>правильные названия книг по математике</title>
    <published>2011-11-20T18:01:47Z</published>
    <updated>2011-11-21T12:47:18Z</updated>
    <category term="fun"/>
    <content type="html">Тайные знания древних цивилизаций о математическом анализе.&lt;br /&gt;Духовный математический анализ. Раскрытие своих сверхспособностей.&lt;br /&gt;Математический анализ под знаком индиго.&lt;br /&gt;Чудотворный и исцеляющий математический анализ.&lt;br /&gt;Математический анализ в родовых поместьях.&lt;br /&gt;Русская доктрина математического анализа.&lt;br /&gt;Кто на самом убил Каддафи? Математический анализ.&lt;br /&gt;Добейся счастья и успеха с помощью математического анализа.&lt;br /&gt;Обольщение силой математического анализа.&lt;br /&gt;Математический анализ — путь к бессмертию.&lt;br /&gt;Люби себя — говорит математический анализ.&lt;br /&gt;Чайка по имени Математический Анализ.&lt;br /&gt;Особенности национального математического анализа.&lt;br /&gt;Застольные шутки и песни о математическом анализе.&lt;br /&gt;Математический анализ учит рисовать мангу.&lt;br /&gt;Готовим здоровую пищу с математическим анализом.&lt;br /&gt;1001 рецепт математического анализа.&lt;br /&gt;Математический анализ в стихах. Считалочки.&lt;br /&gt;Математический анализ своими руками.&lt;br /&gt;&lt;br /&gt;P.&amp;nbsp;S. Доказано, что данная последовательность бесконечна.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:38259</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/38259.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=38259"/>
    <title>Майкл Фрэнсис Атия. Как выполняется исследование</title>
    <published>2011-11-04T02:17:36Z</published>
    <updated>2011-11-04T11:50:17Z</updated>
    <category term="writer&amp;apos;s block"/>
    <content type="html">Опубликован перевод статьи &lt;a href="http://www.beroal.in.ua/article/atiyah_research/index.html" rel="nofollow"&gt;«Майкл Фрэнсис Атия. Как выполняется исследование»&lt;/a&gt;.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:38107</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/38107.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=38107"/>
    <title>искусство мыслить</title>
    <published>2011-10-29T03:36:48Z</published>
    <updated>2011-10-29T03:36:48Z</updated>
    <content type="html">Человек, который ни разу в жизни не придумал самостоятельно математическое доказательство, не имеет морального права учить абстрактно мыслить. Потому что как можно учить тому, что сам не умеешь делать?</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:37807</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/37807.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=37807"/>
    <title>lets number them from the last one</title>
    <published>2011-10-13T14:29:43Z</published>
    <updated>2011-10-13T14:29:43Z</updated>
    <category term="haskell"/>
    <category term="english"/>
    <content type="html">Stereotypes are treacherous. They suggest you the “right” decision in such a way that you forget that you ever had a choice. They look comfortable now just to make your life awful later. Here I will talk about numbering/indexing of list elements. (Not about numbering of array elements starting from &lt;code&gt;1&lt;/code&gt;. That discussion is only good for making fun of it.)&lt;br /&gt;&lt;br /&gt;&lt;code&gt;base.Data.List.(!!)&lt;/code&gt; provides the standard numbering that I got used to: the head of any list has index &lt;code&gt;0&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a name="cutid1"&gt;&lt;/a&gt;The numbering above provides the isomorphism between the set of lists of length &lt;code&gt;n&lt;/code&gt; with elements in &lt;code&gt;value&lt;/code&gt; and the set of functions of type &lt;code&gt;ix→value&lt;/code&gt;, where &lt;code&gt;ix = {m∈ℕ|m&amp;lt;n}&lt;/code&gt;. For a list of length &lt;code&gt;n+1&lt;/code&gt; we have &lt;code&gt;ix = {m∈ℕ|m&amp;lt;n+1} = {m∈ℕ|m≤n}&lt;/code&gt;. When we apply &lt;code&gt;tail&lt;/code&gt; to the list of length &lt;code&gt;n+1&lt;/code&gt;, the head of the list disappears and the index &lt;code&gt;n&lt;/code&gt; disappears from &lt;code&gt;ix&lt;/code&gt;. Therefore, the head has index &lt;code&gt;n&lt;/code&gt;. Consequently, the last element has index &lt;code&gt;0&lt;/code&gt;. This is not a &lt;strong&gt;joke&lt;/strong&gt;. This is &lt;code&gt;base.Data.List.(!!)&lt;/code&gt; reverted.&lt;br /&gt;&lt;br /&gt;And when my numbering is more useful than the standard one? &lt;strong&gt;Example.&lt;/strong&gt; I want to implement &lt;code&gt;xs::[a]&lt;/code&gt; as &lt;code&gt;ys::[Array64 a]&lt;/code&gt;, where &lt;code&gt;Array64 a&lt;/code&gt; denotes an array of length &lt;code&gt;64&lt;/code&gt; with elements in &lt;code&gt;a&lt;/code&gt;. With the standard numbering every element of &lt;code&gt;xs&lt;/code&gt; at index &lt;code&gt;i&lt;/code&gt; corresponds to the element at index &lt;code&gt;r&lt;/code&gt; of the element at index &lt;code&gt;q&lt;/code&gt; of &lt;code&gt;ys&lt;/code&gt; where &lt;code&gt;(q, r)==i `divMod` 64&lt;/code&gt;. After we apply &lt;code&gt;tail&lt;/code&gt; to &lt;code&gt;xs&lt;/code&gt; (this amounts to wiping some element of the head of &lt;code&gt;ys&lt;/code&gt;, set it to e.g. &lt;code&gt;undefined&lt;/code&gt;), this correspondence changes to &lt;code&gt;(q, r)==(i+1) `divMod` 64&lt;/code&gt;. Applying &lt;code&gt;tail&lt;/code&gt; further, it changes to &lt;code&gt;(i+2) `divMod` 64, (i+3) `divMod` 64, … (i+63) `divMod` 64, i `divMod` 64&lt;/code&gt; again. Huh, very nice. In contrast, my numbering provides the correspondence which is stable.&lt;a name='cutid1-end'&gt;&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:37574</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/37574.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=37574"/>
    <title>intersecting boxes</title>
    <published>2011-10-12T19:33:38Z</published>
    <updated>2011-10-12T19:34:53Z</updated>
    <category term="haskell"/>
    <category term="english"/>
    <content type="html">This paragraph appears on the &lt;a href="http://hackage.haskell.org/package/groupoid" rel="nofollow"&gt;page of some Hackage library&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;In geometry, bounding boxes (represented as two points - bottom-left corner and top-right corner) give an example where a groupoid may be more satisfying than a monoid. The union operation on bounding boxes is essential to track the extent of shapes after their superimposition. To fit bounding box union into the Monoid typeclass one can do a clever trick representing mempty with the bottom-left corner at positive infinity and the top-right corner at negative infinity, the standard implementation of union which uses min and max will still proceed to identify the extreme corners correctly.&lt;/blockquote&gt;&lt;br /&gt;This not only shows a good example of a semigroup which is not a monoid, but reminds me of a trick I used to add neutral element to this semigroup. First, I describe the evident trick. Second, I describe the trick I used.&lt;br /&gt;&lt;br /&gt;&lt;a name="cutid1"&gt;&lt;/a&gt;I will talk about intersection of boxes and not union. A union of boxes (regarded as sets of points) may be not a box. So they actually find the &lt;a href="http://en.wikipedia.org/wiki/Supremum" rel="nofollow"&gt;supremum&lt;/a&gt; of boxes. Not the supremum of corresponding sets of points, of course. The supremum of subsets is the union of those subsets. However, this is not important here. So I will stick to intersection.&lt;br /&gt;&lt;br /&gt;A box is a &lt;strong&gt;multidimensional interval&lt;/strong&gt;, i.e. it assigns an interval for every dimension. Operations on multidimensional intervals are done &lt;a href="http://en.wikipedia.org/wiki/Pointwise#Pointwise_operations" rel="nofollow"&gt;pointwise&lt;/a&gt;. Therefore I only talk about (ordinary) intervals in the following. The greater bound of the intersection of intervals is equal to the &lt;a href="http://en.wikipedia.org/wiki/Infimum" rel="nofollow"&gt;infimum&lt;/a&gt; of greater bounds of those intervals. The lesser bound of the intersection of intervals is equal to the supremum of greater bounds of those intervals. Because we consider intervals of integer/rational/real numers (&lt;a href="http://en.wikipedia.org/wiki/Total_order" rel="nofollow"&gt;total orders&lt;/a&gt;) and we consider finite intersections, infimum can be replaced with least element and supremum can be replaced with greatest element. All infima and suprema below are assumed to be finite.&lt;br /&gt;&lt;br /&gt;Finite infimum comprise a &lt;a href="http://en.wikipedia.org/wiki/Commutative_property#Mathematical_definitions" rel="nofollow"&gt;commutative&lt;/a&gt; &lt;a href="http://en.wikipedia.org/wiki/Idempotence#Binary_operation" rel="nofollow"&gt;idempotent&lt;/a&gt; &lt;a href="http://en.wikipedia.org/wiki/Semigroup" rel="nofollow"&gt;semigroup&lt;/a&gt;. As well as supremum. All aforementioned total orders has no &lt;a href="http://en.wikipedia.org/wiki/Neutral_element" rel="nofollow"&gt;neutral element&lt;/a&gt; of infimum and supremum. Because if a &lt;a href="http://en.wikipedia.org/wiki/Partially_ordered_set" rel="nofollow"&gt;partial order&lt;/a&gt; &lt;code&gt;⊆&lt;/code&gt; has a neutral element &lt;code&gt;x&lt;/code&gt; with respect to infimum, then &lt;code&gt;x&lt;/code&gt; is the greatest element of &lt;code&gt;⊆&lt;/code&gt;. None of the aforementioned total orders has the least element or the greatest element.&lt;br /&gt;&lt;br /&gt;We can use the &lt;a href="http://en.wikipedia.org/wiki/Free_functor" rel="nofollow"&gt;free functor&lt;/a&gt; from the category of semigroups to the category of monoids to turn a semigroup into a &lt;a href="http://en.wikipedia.org/wiki/Monoid" rel="nofollow"&gt;monoid&lt;/a&gt;. This functor just adds 1 element to the &lt;a href="http://en.wikipedia.org/wiki/Algebraic_structure" rel="nofollow"&gt;carrier&lt;/a&gt; and extends the 2-ary operation. This can be implemented by &lt;code&gt;Maybe&lt;/code&gt; in Haskell or &lt;code&gt;option&lt;/code&gt; in ML. The &lt;code&gt;instance Monoid (Maybe a)&lt;/code&gt; gives this monoid. This not only extends the set of boxes with a “neutral” box, but also with boxes which are unbounded in some dimension at some side of the interval.&lt;br /&gt;&lt;br /&gt;And here is another way. Lets call &lt;code&gt;sg&lt;/code&gt; this semigroup of infimum. Let &lt;code&gt;h&lt;/code&gt; be the 2-ary operation of &lt;code&gt;sg&lt;/code&gt;, &lt;strong&gt;curried&lt;/strong&gt;. Then &lt;code&gt;h : carrier(sg)→carrier(sg)→carrier(sg)&lt;/code&gt; and &lt;code&gt;h(x)=(x∩)&lt;/code&gt;. In words, &lt;code&gt;h(x)&lt;/code&gt; is the function which intersects its argument with &lt;code&gt;x&lt;/code&gt;. &lt;code&gt;h&lt;/code&gt; is a &lt;a href="http://en.wikipedia.org/wiki/Homomorphism" rel="nofollow"&gt;homomorphism&lt;/a&gt; from &lt;code&gt;sg&lt;/code&gt; to the monoid of endofunctions (the &lt;a href="http://en.wikipedia.org/wiki/Full_transformation_monoid" rel="nofollow"&gt;full transformation monoid&lt;/a&gt;) on &lt;code&gt;carrier(sg)&lt;/code&gt; (like in &lt;a href="http://en.wikipedia.org/wiki/Cayley%27s_theorem" rel="nofollow"&gt;Cayley's theorem&lt;/a&gt;). &lt;code&gt;h&lt;/code&gt; is also a &lt;a href="http://en.wikipedia.org/wiki/Monomorphism" rel="nofollow"&gt;monomorphism&lt;/a&gt;.&lt;br /&gt;&lt;blockquote&gt;&lt;strong&gt;Proof.&lt;/strong&gt; For all &lt;code&gt;x, y&lt;/code&gt;, if &lt;code&gt;(x∩)=(y∩)&lt;/code&gt;, then &lt;code&gt;(x∩x)=(y∩x) ∧ (x∩y)=(y∩y)&lt;/code&gt;. Because &lt;code&gt;sg&lt;/code&gt; is idempotent and commutative, &lt;code&gt;x=(x∩x)=(y∩x)=(x∩y)=(y∩y)=y&lt;/code&gt;. Therefore this is an &lt;a href="http://en.wikipedia.org/wiki/Injective_function" rel="nofollow"&gt;injection&lt;/a&gt;. &lt;strong&gt;Qed.&lt;/strong&gt;&lt;/blockquote&gt;&lt;br /&gt;So, &lt;code&gt;x∈carrier(sg)&lt;/code&gt; can be encoded by &lt;code&gt;h(x)&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;This encoding supports unbounded boxes. It can be actually implemented in programming languages, but only in &lt;strong&gt;functional&lt;/strong&gt; ones because &lt;code&gt;h(x)&lt;/code&gt; is a function. The hard part is decoding. I did not wrote a decoding function because I did not need one. I needed only those parts of intervals which fit into the screen, and I obtained those parts by &lt;code&gt;h(x)(screen)&lt;/code&gt;, where &lt;code&gt;screen&lt;/code&gt; is some parameter of the screen (a lesser/greater bound of some interval of the screen). The screen is also a box, you know.&lt;a name='cutid1-end'&gt;&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:37332</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/37332.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=37332"/>
    <title>жалобы на Firefox</title>
    <published>2011-10-12T13:29:13Z</published>
    <updated>2011-10-12T19:35:30Z</updated>
    <content type="html">&lt;p&gt;Firefox (версия 7) становится всё неудобнее.&lt;/p&gt;
&lt;a name="cutid1"&gt;&lt;/a&gt;&lt;p&gt;Половина расширений в новой версии не работают. Частично проблема в defensive versioning, когда разработчик расширения позволяет использовать своё расширение только с очень узким диапазоном версий, но забывает, что узкий диапазон надо регулярно пересматривать. (Иначе как &amp;laquo;распиздяйством&amp;raquo; не назовёшь.) Частично проблема у разработчиков Firefox, которые выпускают мало документации для разработчиков расширений. (Например, где описан gBrowser?) Поэтому разработчики расширений вынуждены шерстить исходный код Firefox или унижаться на форумах.&lt;/p&gt;
&lt;p&gt;Теперь панель адреса не показывает схему URL (например, &amp;laquo;http&amp;raquo;). Теперь, если я хочу скопировать из панели адреса доменное имя (например, &amp;laquo;example.com&amp;raquo;), Firefox копирует &amp;laquo;http://example.com&amp;raquo;. Это есть забота о простых домохозяйках а-ля Microsoft, которые боятся страшного слова &amp;laquo;http&amp;raquo;.&lt;/p&gt;
&lt;p&gt;История веб-страниц, которая раньше открывалась под кнопками перехода вперёд-назад (стрелка вправо, стрелка влево), теперь отсутствует. Надеюсь, восстановят.&lt;/p&gt;
&lt;p&gt;В новом Firefox можно посмотреть использование память. Теперь мы все можем узнать, куда уходит память (какое облегчение!):&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Закрытые страницы всё равно занимают память.&lt;/li&gt;
&lt;li&gt;Больше всего памяти занимают строчки &amp;laquo;heap-unclassified&amp;raquo; и &amp;laquo;gc-heap-chunk-unused&amp;raquo;. Итак, мы знаем, что мы ничего не знаем.&lt;/li&gt;
&lt;li&gt;Стек занимает 8 МБ. Обычно такой размер стека говорит о глюке. Редкий программист использует рекурсию глубиной допустим 100000 (если это не Haskell :) ).&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Выводы: Дарёному коню в зубы не смотрят, и тазепам, чтобы забыться до еды.&lt;/p&gt;&lt;a name='cutid1-end'&gt;&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:36883</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/36883.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=36883"/>
    <title>categories in Haskell</title>
    <published>2011-10-07T12:38:32Z</published>
    <updated>2011-10-07T12:38:32Z</updated>
    <category term="теория категорий"/>
    <category term="haskell"/>
    <category term="english"/>
    <content type="html">There are 2 ways to define categories in Haskell:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;W0) the category of types and functions (“base.Data.Functor” and company belongs to it);&lt;/li&gt;&lt;li&gt;W1) the class “base.Control.Category.Category”.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;(Defining a category where the class of objects is a type seems impossible in Haskell.)&lt;br /&gt;&lt;br /&gt;But these ways are mingled in “base”. E.g. “Control.Applicative” (W0) and “Control.Category" (W1) are neighbors. Oddly, “Data.Functor” (W0) is under “Data”. I believe that the whole library “category-extras” belongs to W1.&lt;br /&gt;&lt;br /&gt;I suggest to split these ways under distinct names, e.g.:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;W0) Category.Function (@hom == (-&amp;gt;)@);&lt;/li&gt;&lt;li&gt;W1) Category.Hom (“hom” is an abstract type constructor).&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Maybe both should be under “Mathematics”.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:36647</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/36647.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=36647"/>
    <title>рождение терминов</title>
    <published>2011-09-13T14:49:55Z</published>
    <updated>2011-09-13T14:49:55Z</updated>
    <content type="html">Мне давно не даёт покоя мысль создать блоговое сообщество, в котором будет обсуждаться математическая терминология. Такие обсуждения, строго говоря, не являются математикой, но и я не математик, так что всё в порядке.&lt;br /&gt;&lt;br /&gt;Новая терминология появляется, например, таким способом. Человек издаёт статью или учебник и надеется, что его терминологию будут заимствовать другие. Разговаривают книгами. :) Это как бы блогосфера без комментариев. Человек А пишет пост, другой человек Б пишет ответ как пост в своём блоге, первый человек пишет ответ на ответ как пост в своём блоге и так далее. Так можно общаться, но это неудобно.&lt;br /&gt;&lt;br /&gt;Как я уже сказал, это вопрос не математики, а &lt;strong&gt;языка&lt;/strong&gt;. Язык — это договор между &lt;strong&gt;множеством&lt;/strong&gt; людей о том, какой смысл вкладывать в какие слова. Поэтому я считаю, что язык должен рождаться в сообществе, а не в тишине кабинета.&lt;br /&gt;&lt;br /&gt;Меня сдерживает то, что сообщество должно иметь больше одного человека. Иначе это будет блог. Мне нужен хотя бы один человек кроме меня, который будет писать, а не просто числиться. У меня уже есть список из приблизительно 10 вопросов, накопившихся за долгое время.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:36537</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/36537.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=36537"/>
    <title>сумма как моноидальное произведение</title>
    <published>2011-09-13T09:14:47Z</published>
    <updated>2011-10-17T12:47:41Z</updated>
    <category term="теория категорий"/>
    <content type="html">Правильно ли я думаю, что любой функтор &lt;code&gt;F&lt;/code&gt; является моноидальным между категориями, в которых моноидальная структура задана &lt;a href="http://en.wikipedia.org/wiki/Coproduct" rel="nofollow"&gt;категорной суммой&lt;/a&gt;? Конкретно, &lt;code&gt;(F, [F(ι0), F(ι1)])&lt;/code&gt; есть моноидальный функтор? (&lt;code&gt;ι…&lt;/code&gt; — инъекции суммы.)</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:36283</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/36283.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=36283"/>
    <title>проверка IQ</title>
    <published>2011-09-11T16:41:07Z</published>
    <updated>2011-09-30T18:04:47Z</updated>
    <category term="fun"/>
    <content type="html">&lt;strong&gt;Вопрос.&lt;/strong&gt; Продолжить последовательность &lt;code&gt;[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="cutid1"&gt;&lt;/a&gt;&lt;strong&gt;Правильный ответ.&lt;/strong&gt; &lt;code&gt;[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 20, 21, 22, 23…]&lt;/code&gt; Последовательность описывается (Haskell):&lt;br /&gt;&lt;code&gt;&lt;pre&gt;iterate (\x -&amp;gt; (if x==9 then (+11) else (+1)) x) 0&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;Почему так? Потому что такую последовательность я загадал! :D&lt;br /&gt;&lt;br /&gt;[Update 2011-09-30. &lt;a href="http://spikedmath.com/441.html?utm_source=feedburner&amp;amp;utm_medium=feed&amp;amp;utm_campaign=Feed%3A+SpikedMath+%28Spiked+Math%29" rel="nofollow"&gt;Ещё один жёсткий, но правильный ответ к задаче.&lt;/a&gt;]&lt;a name='cutid1-end'&gt;&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:35904</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/35904.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=35904"/>
    <title>open source</title>
    <published>2011-09-10T10:17:35Z</published>
    <updated>2011-09-10T10:17:35Z</updated>
    <content type="html">Просматривая &lt;a href="http://opensource.org/docs/osd" rel="nofollow"&gt;определение open source&lt;/a&gt;, я увидел, что туда напихали множество правил, которые касаются не открытости исходного кода, а распространения ПО. Именно, пункты 1, 5, 6, 8. Существует ли более узкое определение открытого исходного кода, которое, например, дозволяет запрещать передачу исходного кода тем людям, которые не заплатили за программу?</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:35679</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/35679.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=35679"/>
    <title>сокращения</title>
    <published>2011-09-08T10:45:58Z</published>
    <updated>2011-09-08T10:45:58Z</updated>
    <content type="html">Употребление сокращений с экономической точки зрения выглядит так:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;доходы: текст становится короче;&lt;/li&gt;&lt;li&gt;затраты: сокращения надо учить.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Как и в любой экономической деятельности, доходы должны быть больше, чем затраты. Для этого я придумал правила:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Сокращённое слово есть математический префикс исходного слова. (&lt;code&gt;b&lt;/code&gt; является математическим префиксом of &lt;code&gt;a&lt;/code&gt; &lt;code&gt;:= ∃b'. b++b'=a&lt;/code&gt;.)&lt;/li&gt;&lt;li&gt;&lt;code&gt;short*2&amp;lt;long&lt;/code&gt;, где &lt;code&gt;long&lt;/code&gt; — длина исходного слова, &lt;code&gt;short&lt;/code&gt; — длина сокращённого слова.&lt;/li&gt;&lt;li&gt;Сокращённое слово не равно естественному префиксу исходного слова. (Естественный префикс — это префикс в естественном языке, например, латинские префиксы «con», «ab», «ir».)&lt;/li&gt;&lt;li&gt;Сокращения опубликованы. Если сокращение употребляется только в некотором файле, то это сокращение опубликовано в этом файле, если сокращение употребляется только в некоторой программе, то это сокращение опубликовано на веб-сайте этой программы, иначе это сокращение опубликовано в некотором стандарте.&lt;/li&gt;&lt;/ul&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:35507</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/35507.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=35507"/>
    <title>fixed point, homomorphism, the abide law</title>
    <published>2011-07-22T17:24:52Z</published>
    <updated>2011-10-16T16:09:57Z</updated>
    <category term="english"/>
    <content type="html">&lt;a name="cutid1"&gt;&lt;/a&gt;&lt;h1&gt;Introduction&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;A function &lt;code&gt;h&lt;/code&gt; is a homomorphism if &lt;code&gt;h&lt;/code&gt; “preserves” operations of some &lt;a href="http://en.wikipedia.org/wiki/Structure_(mathematical_logic)" rel="nofollow"&gt;structure&lt;/a&gt; (=algebra). (See the precise definition of a homomorphism &lt;a href="http://en.wikipedia.org/wiki/Homomorphism" rel="nofollow"&gt;here&lt;/a&gt;.) A homomorphism is always declared w.r.t. some structure. Of course, there are functions which “preserve” not all operations. I will say that &lt;code&gt;h&lt;/code&gt; is a &lt;strong&gt;homomorhism of&lt;/strong&gt; &lt;code&gt;op&lt;/code&gt; (where &lt;code&gt;op&lt;/code&gt; is some function symbol) if &lt;code&gt;h&lt;/code&gt; “preserves” &lt;code&gt;op&lt;/code&gt;. I will say that &lt;code&gt;h&lt;/code&gt; is a &lt;strong&gt;homomorhism from&lt;/strong&gt; &lt;code&gt;g0&lt;/code&gt; &lt;strong&gt;to&lt;/strong&gt; &lt;code&gt;g1&lt;/code&gt; (where &lt;code&gt;g0&lt;/code&gt; and &lt;code&gt;g1&lt;/code&gt; are algebraic operations) if &lt;code&gt;h&lt;/code&gt; “maps” &lt;code&gt;g0&lt;/code&gt; to &lt;code&gt;g1&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://beroal.livejournal.com/18997.html"&gt;There is a way to produce the pointwise variant of any algebraic operation, thus of any algebraic structure.&lt;/a&gt; To fix some notation, take an equational algebraic signature &lt;code&gt;S&lt;/code&gt;, &lt;code&gt;A:structure(S), T:theory(S)&lt;/code&gt;, take some algebraic operation on &lt;code&gt;carrier(A)&lt;/code&gt; &lt;code&gt;op&lt;/code&gt;, suppose &lt;code&gt;A&lt;/code&gt; is a model of &lt;code&gt;T&lt;/code&gt;, take &lt;code&gt;Rc:set&lt;/code&gt;. I denote the pointwise (with domain &lt;code&gt;Rc&lt;/code&gt;) variant of &lt;code&gt;op&lt;/code&gt; as &lt;code&gt;pw Rc op&lt;/code&gt; and the pointwise variant of &lt;code&gt;A&lt;/code&gt; as &lt;code&gt;pw Rc A&lt;/code&gt; (“pw” stands for “pointwise”, in Haskell code &lt;code&gt;Rc&lt;/code&gt; will be omitted). &lt;code&gt;pw Rc A&lt;/code&gt; is a &lt;code&gt;structure(S)&lt;/code&gt; and a model of &lt;code&gt;T&lt;/code&gt;. &lt;code&gt;carrier(pw Rc A) = Rc→carrier(A)&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;I will use a common abuse of notation: &lt;code&gt;X→Y&lt;/code&gt; denotes the set of functions from &lt;code&gt;X&lt;/code&gt; to &lt;code&gt;Y&lt;/code&gt; if &lt;code&gt;X&lt;/code&gt; and &lt;code&gt;Y&lt;/code&gt; are sets, and &lt;code&gt;X→Y&lt;/code&gt; denotes the set of homomorphisms from &lt;code&gt;X&lt;/code&gt; to &lt;code&gt;Y&lt;/code&gt; if &lt;code&gt;X&lt;/code&gt; and &lt;code&gt;Y&lt;/code&gt; are &lt;code&gt;structure(S)&lt;/code&gt;-s.&lt;a name='cutid1-end'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Motivation&lt;/h1&gt;&lt;br /&gt;Suppose there is &lt;code&gt;R:structure(S)&lt;/code&gt; such that &lt;code&gt;Rc=carrier(R)&lt;/code&gt;. Let &lt;code&gt;H:=R→A&lt;/code&gt;. Is &lt;code&gt;H&lt;/code&gt; a substructure of &lt;code&gt;pw R A&lt;/code&gt;? In other words, are the algebraic operations of &lt;code&gt;pw R A&lt;/code&gt; &lt;a href="http://en.wikipedia.org/wiki/Closure_(mathematics)" rel="nofollow"&gt;closed on&lt;/a&gt; &lt;code&gt;H&lt;/code&gt;?&lt;br /&gt;&lt;br /&gt;The following particular case is well known — let &lt;code&gt;R:field, M0 M1:vector_space(R)&lt;/code&gt;, then the algebraic operations of &lt;code&gt;pw (carrier(M0)) M1&lt;/code&gt; are closed on &lt;code&gt;M0→M1&lt;/code&gt; thus forming a vector space of linear maps. To prove this is an easy, but tedious task involving a lot of equations. I suggest a high level proof.&lt;br /&gt;&lt;br /&gt;&lt;a name="cutid2"&gt;&lt;/a&gt;&lt;h1&gt;The abide law&lt;/h1&gt;&lt;br /&gt;&lt;br /&gt;Lets begin with a simpler case when an algebraic operation &lt;code&gt;f&lt;/code&gt; is &lt;code&gt;1&lt;/code&gt;-ary. &lt;code&gt;pw R f&lt;/code&gt; is just a postcomposition of &lt;code&gt;f&lt;/code&gt;, i.e. &lt;code&gt;pw R f=(f∘)&lt;/code&gt;. To make &lt;code&gt;(f∘)&lt;/code&gt; closed on homomorphisms, the obvious requirement is &lt;code&gt;f&lt;/code&gt; being a homomorphism.&lt;br /&gt;&lt;br /&gt;The next step is to move to arbitrary arity. Let &lt;code&gt;arity(f)=2, pwf := pw (carrier(R)) f, h0 h1:R→A&lt;/code&gt;. I want &lt;code&gt;pwf (h0, h1)&lt;/code&gt; to be a homomorphism. Lets check this for some operation &lt;code&gt;+&lt;/code&gt; in &lt;code&gt;A&lt;/code&gt;. I want to prove &lt;code&gt;∀x0 x1. pwf (h0, h1) (x0+x1) = pwf (h0, h1) x0 + pwf (h0, h1) x1&lt;/code&gt;.&lt;br /&gt;&lt;code&gt;pwf (h0, h1) (x0+x1)&lt;/code&gt;&lt;br /&gt;// the definition of &lt;code&gt;pwf&lt;/code&gt; and &lt;code&gt;pw&lt;/code&gt;&lt;br /&gt;&lt;code&gt;= f(h0(x0+x1), h1(x0+x1))&lt;/code&gt;&lt;br /&gt;// homomorphism&lt;br /&gt;&lt;code&gt;= f(h0(x0)+h0(x1), h1(x0)+h1(x1))&lt;/code&gt;&lt;br /&gt;// *&lt;br /&gt;&lt;code&gt;= f(h0(x0), h1(x0)) + f(h0(x1), h1(x1))&lt;/code&gt;&lt;br /&gt;// the definition of &lt;code&gt;pwf&lt;/code&gt; and &lt;code&gt;pw&lt;/code&gt;&lt;br /&gt;&lt;code&gt;= pwf (h0, h1) x0 + pwf (h0, h1) x1&lt;/code&gt;&lt;br /&gt;The step “*” in the proof is a consequence of the &lt;strong&gt;abide law&lt;/strong&gt;. Algebraic operations &lt;code&gt;+&lt;/code&gt; and &lt;code&gt;*&lt;/code&gt; satisfy the abide law if &lt;code&gt;∀a0 a1 b0 b1. a0*b0+a1*b1 = (a0+a1)*(b0+b1)&lt;/code&gt;. In the proof above &lt;code&gt;f&lt;/code&gt; and &lt;code&gt;+&lt;/code&gt; satisfy the abide law.&lt;br /&gt;&lt;br /&gt;I will call it the &lt;strong&gt;traditional abide law&lt;/strong&gt;, because I want to assign the name “abide law” to a more general concept.&lt;br /&gt;&lt;br /&gt;Algebraic operations &lt;code&gt;f0&lt;/code&gt; and &lt;code&gt;f1&lt;/code&gt; &lt;strong&gt;satisfy the abide law&lt;/strong&gt;, denoted as &lt;code&gt;f0 `abide` f1&lt;/code&gt;, if&lt;br /&gt;&lt;code&gt;∀x00, x01, … .&lt;br /&gt;f0(f1(x00, x01, …), f1(x10, x11, …), …)&lt;br /&gt;= f1(f0(x00, x10, …), f0(x01, x11, …), …)&lt;/code&gt;.&lt;br /&gt;The abide law is in fact a family of relations indexed by arities of &lt;code&gt;f0&lt;/code&gt; and &lt;code&gt;f1&lt;/code&gt;. I denote a particular element of the family &lt;code&gt;(arity(f0), arity(f1))-abide&lt;/code&gt;, e.g. &lt;code&gt;(3, 5)-abide&lt;/code&gt;. Sometimes I drop arities if they are not interesting.&lt;br /&gt;&lt;br /&gt;I also say that for &lt;code&gt;A0 A1:structure(S)&lt;/code&gt;, &lt;code&gt;A0 `abide` A1&lt;/code&gt; if every algebraic operation in &lt;code&gt;A0&lt;/code&gt; with every algebraic operation in &lt;code&gt;A1&lt;/code&gt; satisfy the abide law. Every algebraic operation can be considered as the structure with &lt;code&gt;1&lt;/code&gt; operation.&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Tuples as functions&lt;/h1&gt;&lt;br /&gt;Before I turn to rigorous proofs, I want to introduce a well known but rarely used convention. Every &lt;code&gt;n&lt;/code&gt;-ary algebraic operation &lt;code&gt;f&lt;/code&gt; can be regarded as a function on the Cartesian product of sets, and &lt;a href="http://en.wikipedia.org/wiki/Tuple#Tuples_as_functions" rel="nofollow"&gt;a Cartesian product of sets can be regarded as a function space&lt;/a&gt;. I.e.&lt;br /&gt;&lt;code&gt;n→A ≅ A×A×… (n-fold)&lt;br /&gt;f:(n→A)→A&lt;/code&gt;&lt;br /&gt;where &lt;code&gt;n&lt;/code&gt; is regarded as a set of &lt;a href="http://en.wikipedia.org/wiki/Cardinality" rel="nofollow"&gt;cardinality&lt;/a&gt; &lt;code&gt;n&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;This convention makes mathematical text compact, but unfamiliar. And it requires extensive use of &lt;a href="http://en.wikipedia.org/wiki/Higher-order_function" rel="nofollow"&gt;higher order functions&lt;/a&gt;. Therefore I turn to lambda calculus (with the concrete syntax of Haskell).&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Theorems&lt;/h1&gt;&lt;br /&gt;&lt;h2&gt;Well known particular cases of the abide law&lt;/h2&gt;&lt;br /&gt;&lt;strong&gt;Theorem instance_fixed_point.&lt;/strong&gt; (&lt;code&gt;x&lt;/code&gt; is a fixed point of &lt;code&gt;n&lt;/code&gt;-ary &lt;code&gt;f&lt;/code&gt;) ↔ &lt;code&gt;(const x) `(0, n)-abide` f&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Theorem instance_hom.&lt;/strong&gt; (&lt;code&gt;h&lt;/code&gt; is an endomorphism from &lt;code&gt;g&lt;/code&gt; to &lt;code&gt;g&lt;/code&gt;) ↔ &lt;code&gt;h `(1, n)-abide` g&lt;/code&gt;.&lt;br /&gt;In the chapter “The abide law” I moved from the axiom of a homomorphism to the abide law. Of course the axiom of a homomorphism is a particular case of the abide law. This is mentioned &lt;a href="http://pozorvlak.livejournal.com/103349.html"&gt;here&lt;/a&gt;, though not very clearly.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Theorem instance_comm.&lt;/strong&gt; &lt;code&gt;f∘g=g∘f ↔ f `(1, 1)-abide` g&lt;/code&gt;.&lt;br /&gt;Read it “&lt;code&gt;f&lt;/code&gt; commutes with &lt;code&gt;g&lt;/code&gt;”. It is commutativity of functions w.r.t. composition. Other forms of the abide law also look like commutativity and are called such somewhere.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Theorem instance_traditional.&lt;/strong&gt; The traditional abide law is the &lt;code&gt;(2, 2)&lt;/code&gt;-abide law.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Equivalent definitions&lt;/h2&gt;&lt;br /&gt;&lt;strong&gt;Theorem def_abide_pointless.&lt;/strong&gt; &lt;code&gt;f0 `abide` f1 ↔ ∀x. f0 (f1 . x) == f1 (f0 . flip x)&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Theorem def_abide_pointful.&lt;/strong&gt; &lt;code&gt;f0 `abide` f1 ↔ ∀x. f0 (\i0 -&amp;gt; f1 (\i1 -&amp;gt; x (i0, i1))) == f1 (\i1 -&amp;gt; f0 (\i0 -&amp;gt; x (i0, i1)))&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Theorem def_hom_pointless.&lt;/strong&gt; (&lt;code&gt;h&lt;/code&gt; is a homomorphism from &lt;code&gt;g0&lt;/code&gt; to &lt;code&gt;g1&lt;/code&gt;) ↔ &lt;code&gt;∀x. h (g0 x) == g1 (h . x)&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Theorem def_hom_pointful.&lt;/strong&gt; &lt;code&gt;h&lt;/code&gt; is a homomorphism from &lt;code&gt;g0&lt;/code&gt; to &lt;code&gt;g1&lt;/code&gt; ↔ &lt;code&gt;∀x. h (g0 x) == g1 (\i -&amp;gt; h (x i))&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Theorem def_pw_pointless.&lt;/strong&gt; &lt;code&gt;∀g x. pw g x == g . flip x&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Theorem def_pw_pointful.&lt;/strong&gt; &lt;code&gt;∀g x i. pw g x i == g (\j -&amp;gt; x j i)&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Proving &lt;code&gt;abide&lt;/code&gt;&lt;/h2&gt;&lt;br /&gt;&lt;strong&gt;Theorem self_0.&lt;/strong&gt; For every &lt;code&gt;0&lt;/code&gt;-ary algebraic operation &lt;code&gt;f&lt;/code&gt;, &lt;code&gt;f `abide` f&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Theorem self_1.&lt;/strong&gt; For every &lt;code&gt;1&lt;/code&gt;-ary algebraic operation &lt;code&gt;f&lt;/code&gt;, &lt;code&gt;f `abide` f&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Theorem self_2.&lt;/strong&gt; For every associative commutative algebraic operation &lt;code&gt;(+)&lt;/code&gt;, &lt;code&gt;(+) `abide` (+)&lt;/code&gt;.&lt;br /&gt;&lt;strong&gt;Proof.&lt;/strong&gt;&lt;br /&gt;&lt;code&gt;∀a0 a1 b0 b1,&lt;br /&gt;(a0+a1)+(b0+b1)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;=&lt;/code&gt; // associativity&lt;br /&gt;&lt;code&gt;a0+(a1+(b0+b1))&lt;/code&gt;&lt;br /&gt;&lt;code&gt;=&lt;/code&gt; // associativity&lt;br /&gt;&lt;code&gt;a0+((a1+b0)+b1)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;=&lt;/code&gt; // commutativity&lt;br /&gt;&lt;code&gt;a0+((b0+a1)+b1)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;=&lt;/code&gt; // by symmetry&lt;br /&gt;&lt;code&gt;(a0+b0)+(a1+b1)&lt;/code&gt;&lt;br /&gt;&lt;strong&gt;Qed.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Definition.&lt;/strong&gt; An algebraic operation &lt;code&gt;g&lt;/code&gt; is a composite of a structure &lt;code&gt;A&lt;/code&gt; if &lt;code&gt;g&lt;/code&gt; belongs to the least &lt;a href="http://en.wikipedia.org/wiki/Clone_(algebra)" rel="nofollow"&gt;clone&lt;/a&gt; that contains the algebraic operations of &lt;code&gt;A&lt;/code&gt;.&lt;br /&gt;In other words, &lt;code&gt;g&lt;/code&gt; is composed from the algebraic operations of &lt;code&gt;A&lt;/code&gt; and technical stuff like projections.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Definition.&lt;/strong&gt; &lt;code&gt;n&lt;/code&gt;-ary repetition of a monoid &lt;code&gt;(Mc, +, 0)&lt;/code&gt; is an algebraic operation defined recursively as &lt;code&gt;\(x_0, x_1, …, x_n) -&amp;gt; x0+(x1+(…(x_n+0)…))&lt;/code&gt;.&lt;br /&gt;E.g. finite sum is a repetition of an additive monoid, finite product is a repetition of a multiplicative monoid.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Theorem rep_comp.&lt;/strong&gt; Repetition of a monoid &lt;code&gt;M&lt;/code&gt; is a composite of &lt;code&gt;M&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Theorem abide_comp.&lt;/strong&gt; For every structure &lt;code&gt;A&lt;/code&gt;, if &lt;code&gt;f `abide` A&lt;/code&gt; and &lt;code&gt;g&lt;/code&gt; is a composite of &lt;code&gt;A&lt;/code&gt;, then &lt;code&gt;f `abide` g&lt;/code&gt;. (I wish a proof would be here.)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Theorem abide_sym.&lt;/strong&gt; &lt;code&gt;abide&lt;/code&gt; is symmetric.&lt;br /&gt;&lt;strong&gt;Proof.&lt;/strong&gt;&lt;br /&gt;Suppose that &lt;code&gt;f0 `abide` f1&lt;/code&gt;, then by &lt;strong&gt;def_abide_pointless&lt;/strong&gt; &lt;code&gt;∀x. f0 (f1 . x) == f1 (f0 . flip x)&lt;/code&gt;. Then &lt;code&gt;∀x&lt;/code&gt;,&lt;br /&gt;&lt;code&gt;f0 (f1 . flip x) == f1 (f0 . flip (flip x))&lt;br /&gt;f0 (f1 . flip x) == f1 (f0 . x))&lt;br /&gt;f1 (f0 . x)) == f0 (f1 . flip x)&lt;/code&gt;&lt;br /&gt;Then by &lt;strong&gt;def_abide_pointless&lt;/strong&gt; &lt;code&gt;f1 `abide` f0&lt;/code&gt;.&lt;br /&gt;&lt;strong&gt;Qed.&lt;/strong&gt;&lt;br /&gt;The fact above decreases the number of proofs when somebody wants to prove that algebraic operations satisfy the abide law pairwise. If the cardinality of the set is &lt;code&gt;n&lt;/code&gt;, &lt;code&gt;n*(n+1)/2&lt;/code&gt; proofs are required, not &lt;code&gt;n*n&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Using &lt;code&gt;abide&lt;/code&gt;&lt;/h2&gt;&lt;br /&gt;&lt;strong&gt;Theorem abide_pw_closed_hom.&lt;/strong&gt; For every &lt;code&gt;R A:structure(S)&lt;/code&gt;, if &lt;code&gt;f `abide` A&lt;/code&gt;, then &lt;code&gt;pw R f&lt;/code&gt; is closed on &lt;code&gt;R→A&lt;/code&gt;.&lt;br /&gt;&lt;strong&gt;Proof.&lt;/strong&gt;&lt;br /&gt;Take any function symbol, let &lt;code&gt;g0&lt;/code&gt; be the interpretation of that symbol in &lt;code&gt;R&lt;/code&gt;, let &lt;code&gt;g1&lt;/code&gt; be the interpretation of that symbol in &lt;code&gt;A&lt;/code&gt;. Then &lt;code&gt;f `abide` g1&lt;/code&gt;. Take a tuple of homomorphisms &lt;code&gt;h&lt;/code&gt;. Lets check that &lt;code&gt;pw f h&lt;/code&gt; is a homomorphism from &lt;code&gt;g0&lt;/code&gt; to &lt;code&gt;g1&lt;/code&gt;. &lt;code&gt;∀x&lt;/code&gt;,&lt;br /&gt;&lt;code&gt;pw f h (g0 x)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;==&lt;/code&gt; // &lt;strong&gt;def_pw_pointful&lt;/strong&gt;&lt;br /&gt;&lt;code&gt;f (\i -&amp;gt; h i (g0 x))&lt;/code&gt;&lt;br /&gt;&lt;code&gt;==&lt;/code&gt; // &lt;code&gt;h i&lt;/code&gt; is a homomorphism&lt;br /&gt;&lt;code&gt;f (\i -&amp;gt; g1 (\j -&amp;gt; h i (x j))&lt;/code&gt;&lt;br /&gt;&lt;code&gt;==&lt;/code&gt; // &lt;strong&gt;def_abide_pointful&lt;/strong&gt;&lt;br /&gt;&lt;code&gt;g1 (\j -&amp;gt; f (\i -&amp;gt; h i (x j))&lt;/code&gt;&lt;br /&gt;&lt;code&gt;==&lt;/code&gt; // &lt;strong&gt;def_pw_pointful&lt;/strong&gt;&lt;br /&gt;&lt;code&gt;g1 (\j -&amp;gt; pw f h (x j))&lt;/code&gt;&lt;br /&gt;Then by &lt;strong&gt;def_hom_pointful&lt;/strong&gt; the theorem follows.&lt;br /&gt;&lt;strong&gt;Qed.&lt;/strong&gt;&lt;br /&gt;This is a general variant of the proof in the chapter “The abide law”.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Theorem abide_hom_pw.&lt;/strong&gt; &lt;code&gt;h `abide` g&lt;/code&gt; ↔ (h is a homomorphism from &lt;code&gt;pw R g&lt;/code&gt; to &lt;code&gt;g&lt;/code&gt;).&lt;br /&gt;&lt;strong&gt;Proof.&lt;/strong&gt;&lt;br /&gt;By &lt;strong&gt;def_pw_pointless&lt;/strong&gt; &lt;code&gt;∀x. h (g . flip x) == h (pw g x)&lt;/code&gt;. Then &lt;code&gt;(∀x. h (g . flip x) == g (h . x)) ↔ (∀x. h (pw g x) == g (h . x))&lt;/code&gt;, then by &lt;strong&gt;def_hom_pointless&lt;/strong&gt; and &lt;strong&gt;def_abide_pointless&lt;/strong&gt; the theorem follows.&lt;br /&gt;&lt;strong&gt;Qed.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Examples&lt;/h1&gt;&lt;br /&gt;Take &lt;code&gt;R:ring&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;The continuation of the example from the chapter “Motivation”&lt;/h2&gt;&lt;br /&gt;Take &lt;code&gt;M0 M1:left_module(R)&lt;/code&gt;. Due to &lt;strong&gt;abide_pw_closed_hom&lt;/strong&gt;, I ought to prove that the algebraic operations of &lt;code&gt;M1&lt;/code&gt; satisfy the abide law pairwise.&lt;br /&gt;&lt;br /&gt;Remember that a module consists of a group and an action. The group of the module consists of &lt;code&gt;+, 0&lt;/code&gt;, &lt;a href="http://en.wikipedia.org/wiki/Negation_(algebra)" rel="nofollow"&gt;negation&lt;/a&gt;. The action of the module is multiplication of a vector by a scalar (I denote it by &lt;code&gt;◃&lt;/code&gt;). In other words, for each scalar there is a &lt;code&gt;1&lt;/code&gt;-ary operation, these operations are &lt;code&gt;{(r◃)|r∈carrier(R)}&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;By definition of the module, &lt;code&gt;(r◃)&lt;/code&gt; is an endomorphism of the group of &lt;code&gt;M1&lt;/code&gt;, then &lt;code&gt;∀r&lt;/code&gt;, &lt;code&gt;(r◃)&lt;/code&gt; and the group of &lt;code&gt;M1&lt;/code&gt; satisfy the abide law.&lt;br /&gt;&lt;br /&gt;Suppose additionally that &lt;code&gt;R&lt;/code&gt; is commutative, then &lt;code&gt;∀x&lt;/code&gt;,&lt;br /&gt;&lt;code&gt;r0◃r1◃x&lt;/code&gt;&lt;br /&gt;&lt;code&gt;=&lt;/code&gt; // &lt;code&gt;◃&lt;/code&gt; is an action&lt;br /&gt;&lt;code&gt;(r0·r1)◃x&lt;/code&gt;&lt;br /&gt;&lt;code&gt;=&lt;/code&gt; // &lt;code&gt;R&lt;/code&gt; is commutative&lt;br /&gt;&lt;code&gt;(r1·r0)◃x&lt;/code&gt;&lt;br /&gt;&lt;code&gt;=&lt;/code&gt; // by symmetry&lt;br /&gt;&lt;code&gt;r1◃r0◃x&lt;/code&gt;&lt;br /&gt;Then &lt;code&gt;(r0◃)∘(r1◃)=(r1◃)∘(r0◃)&lt;/code&gt;. Then by &lt;strong&gt;instance_comm&lt;/strong&gt; &lt;code&gt;∀r0 r1, (r0◃) `abide` (r1◃)&lt;/code&gt;. Therefore I have done with &lt;code&gt;(r◃)&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;0&lt;/code&gt; is a fixed point of &lt;code&gt;+&lt;/code&gt; and negation, by &lt;strong&gt;instance_fixed_point&lt;/strong&gt; &lt;code&gt;0 `abide` (+)&lt;/code&gt; and 0 with negation satisfy the abide law. &lt;code&gt;0&lt;/code&gt; is &lt;code&gt;0&lt;/code&gt;-ary, by &lt;strong&gt;self_0&lt;/strong&gt; &lt;code&gt;0 `abide` 0&lt;/code&gt;. Therefore I have done with &lt;code&gt;0&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;The group of &lt;code&gt;M&lt;/code&gt; is abelian, then negation is an endomorphism of &lt;code&gt;+&lt;/code&gt;. By &lt;strong&gt;instance_hom&lt;/strong&gt; and &lt;strong&gt;abide_sym&lt;/strong&gt; I have done with &lt;code&gt;+&lt;/code&gt; and negation.&lt;br /&gt;&lt;br /&gt;Therefore the algebraic operations of &lt;code&gt;pw (carrier(M0)) M1&lt;/code&gt; form a group with the carrier &lt;code&gt;M0→M1&lt;/code&gt;, and if additionally &lt;code&gt;R&lt;/code&gt; is commutative, then they form a &lt;code&gt;left_module(R)&lt;/code&gt; with the same carrier.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Fixing a basis in a vector space&lt;/h2&gt;&lt;br /&gt;Take &lt;code&gt;M:left_module(R)&lt;/code&gt;, let &lt;code&gt;Rc:=carrier(R), Mc:=carrier(M)&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;It is well known that any basis &lt;code&gt;e&lt;/code&gt; in &lt;code&gt;M&lt;/code&gt; (let &lt;code&gt;n&lt;/code&gt; be the cardinality of &lt;code&gt;e&lt;/code&gt;) induces a function &lt;code&gt;f:R^n→M&lt;/code&gt; which is described “multiply each component of a tuple by the corresponding component of &lt;code&gt;e&lt;/code&gt;, and sum the results”. Why &lt;code&gt;f&lt;/code&gt; is a homomorphism? (Moreover, &lt;code&gt;f&lt;/code&gt; is an isomorphism, but this is not the point here. If we replace “basis” with “tuple of vectors”, then &lt;code&gt;f&lt;/code&gt; is a homomorphism.)&lt;br /&gt;&lt;br /&gt;If we regard &lt;code&gt;R&lt;/code&gt; as a &lt;code&gt;left_module(R)&lt;/code&gt;, then &lt;code&gt;◃&lt;/code&gt; (remember that &lt;code&gt;(◃):Rc×Mc→Mc&lt;/code&gt;) is a multiary homomorphism of modules. (A multiary homomorphism is a generalization of a multilinear function. I wish that a definition of multiary homomorphism would be here.) The functor &lt;code&gt;(n→)&lt;/code&gt; preserves finite categorical products, therefore this functor maps (I wish a proof would be here) &lt;code&gt;(◃)&lt;/code&gt; to the multiary homomorphism&lt;br /&gt;&lt;code&gt;(n→) (◃) : pw n R × pw n M → pw n M&lt;/code&gt;&lt;br /&gt;Then I substitute &lt;code&gt;e&lt;/code&gt; for the right argument and obtain a homomorphism &lt;code&gt;h:pw n R → pw n M&lt;/code&gt;. &lt;code&gt;n&lt;/code&gt;-ary sum in &lt;code&gt;M&lt;/code&gt; (I denote it by &lt;code&gt;sum&lt;/code&gt;, observe that &lt;code&gt;sum:(n→Mc)→Mc)&lt;/code&gt; by &lt;strong&gt;rep_comp&lt;/strong&gt; and &lt;strong&gt;abide_comp&lt;/strong&gt; is a homomorphism from &lt;code&gt;pw n M&lt;/code&gt; to &lt;code&gt;M&lt;/code&gt;. Then &lt;code&gt;sum∘h&lt;/code&gt; is a homomorphism. &lt;code&gt;f=sum∘h&lt;/code&gt; if we unfold &lt;code&gt;sum&lt;/code&gt; and &lt;code&gt;h&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h1&gt;Future work&lt;/h1&gt;&lt;br /&gt;I can imagine a generalization to multisorted algebraic operations. Then an algebraic operation on each side of &lt;code&gt;`abide`&lt;/code&gt; must be replaced with a tuple of algebraic operations. I.e. in &lt;code&gt;f0 `abide` f1&lt;/code&gt; &lt;code&gt;f0&lt;/code&gt; is a tuple of length &lt;code&gt;n1&lt;/code&gt;, where &lt;code&gt;n1&lt;/code&gt; is a number of sorts of &lt;code&gt;f1&lt;/code&gt;, and vice versa. The definition of a homomorphism &lt;code&gt;h&lt;/code&gt; of &lt;code&gt;1&lt;/code&gt;-sorted structures is such a case, because &lt;code&gt;h&lt;/code&gt; as a function has &lt;code&gt;2&lt;/code&gt; sorts (its domain and codomain), therefore the homomorphism axiom considers &lt;code&gt;2&lt;/code&gt; structures. So if some homomorphism has &lt;code&gt;3&lt;/code&gt; sorts, the homomorphism axiom must consider &lt;code&gt;3&lt;/code&gt; structures, though I can not find an example right now. [Update 2011-09-27. I figured out such an example. Let &lt;code&gt;X0, X1&lt;/code&gt; be sets. &lt;code&gt;A0:=(P(X0), ∪, ∅), A1:=(P(X1), ∪, ∅), A2:=(P(X0×X1), ∪, ∅)&lt;/code&gt; are bounded semilattices. Then cartesian product &lt;code&gt;(×):P(X0)×P(X1)→P(X0×X1)&lt;/code&gt; abides &lt;code&gt;(A0, A1, A2)&lt;/code&gt;, i.e. &lt;code&gt;(∀(Y00⊆X0) (Y01⊆X0) (Y10⊆X1) (Y11⊆X1). (Y00×Y10)∩(Y01×Y11) = (Y00∩Y01)×(Y10∩Y11)) ∧ ∅=∅×∅&lt;/code&gt;. Also look at the example in the &lt;a href="http://ru-learnmaths.livejournal.com/323889.html?thread=1676337#t1676337"&gt;part 0 of this comment (in Russian)&lt;/a&gt; describing affine combinations on &lt;code&gt;ℝ&lt;/code&gt;-modules.] If structures are e.g. &lt;code&gt;3&lt;/code&gt;-sorted (e.g. an automaton is such a structure with sorts &lt;code&gt;I&lt;/code&gt; (input messages), &lt;code&gt;O&lt;/code&gt; (output messages), &lt;code&gt;S&lt;/code&gt; (states)), then a homomorphism consists of &lt;code&gt;3&lt;/code&gt; functions.&lt;a name='cutid2-end'&gt;&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:35233</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/35233.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=35233"/>
    <title>anyone can cook</title>
    <published>2011-07-18T16:54:48Z</published>
    <updated>2011-07-18T16:54:48Z</updated>
    <category term="fun"/>
    <category term="coq"/>
    <category term="english"/>
    <content type="html">At the end of the movie &lt;a href="http://www.imdb.com/title/tt0382932/" rel="nofollow"&gt;“Ratatouille” (2007)&lt;/a&gt; there is an assertion:&lt;br /&gt;&lt;blockquote&gt;In the past, I have made not secret of my disdain for Chef Gusteau's famous motto, "Anyone can cook." But I realize only now do truly understand what he meant. &lt;strong&gt;Not everyone can become a great artist, but a great artist can come from anywhere.&lt;/strong&gt;&lt;/blockquote&gt;&lt;br /&gt;It sounds literary, can I make it formal (in Coq)? I think I can.&lt;br /&gt;&lt;br /&gt;&lt;a name="cutid1"&gt;&lt;/a&gt;The word “anywhere” means that there is a set of locations. The word “everyone” points to some beings that come from locations and can become great artists. Those beings may be non-humans, if you remember the movie. Lets call them “animals”. (Humans are animals too.) Animals come from locations:&lt;br /&gt;&lt;code&gt;come:animal-&amp;gt;location&lt;/code&gt;&lt;br /&gt;Read &lt;code&gt;come a=l&lt;/code&gt; as “&lt;code&gt;a&lt;/code&gt; comes from &lt;code&gt;l&lt;/code&gt;”.&lt;br /&gt;Not every animal become a great artist, so great artist is an unary predicate:&lt;br /&gt;&lt;code&gt;artist:animal-&amp;gt;Prop&lt;/code&gt;&lt;br /&gt;Then the assertion becomes a logical formula:&lt;br /&gt;&lt;code&gt;~(forall a:animal, artist a) /\ forall l:location, exists a:animal, come a=l /\ artist a&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Now I see the deep point that the authors of the movie made. There is a location inhabited by at least 2 animals!&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;pre&gt;Require Import Coq.Logic.Classical_Pred_Type.
Variable (location animal:Set) (come:animal-&amp;gt;location) (artist:animal-&amp;gt;Prop)
	(anyone_can_cook : ~(forall a:animal, artist a) /\ forall l:location,
		exists a:animal, come a=l /\ artist a).
Definition location_2_animal : exists a0:animal, exists a1:animal,
	come a0=come a1 /\ ~(a0=a1).
Proof.
destruct (not_all_ex_not _ _ (proj1 anyone_can_cook)) as [a1 p0].
destruct (proj2 anyone_can_cook (come a1)) as [a0 p1].
refine (ex_intro _ a0 (ex_intro _ a1 (conj (proj1 p1) (fun p2 =&amp;gt; _)))).
refine (p0 (eq_ind _ (@artist) (proj2 p1) _ p2)).
Qed.&lt;/pre&gt;&lt;/code&gt;&lt;a name='cutid1-end'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Yeah, that's kinda a thought provoking movie. Nice animation too.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:34930</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/34930.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=34930"/>
    <title>фантазия на тему защиты потребителей программ</title>
    <published>2011-07-15T00:36:08Z</published>
    <updated>2011-07-15T00:36:08Z</updated>
    <content type="html">Промелькнула новость, в которой упоминалось, что в Тайване есть следующий закон. Если некоторая программа продаётся путём загрузки через интернет, то покупатель имеет право до покупки попользоваться программой бесплатно в течение 10 дней (trial).&lt;br /&gt;&lt;br /&gt;Пофантазируем, к чему может привести такая защита потребителя. Возьмём заказную программу. Покупатель имеет право не платить деньги до окончания trial-а, то есть до того момента, когда программа будет закончена, +10 дней. Поэтому получить часть деньги заранее (задаток, аванс) нельзя. А после trial-а покупатель может просто не покупать программу без объяснения причин!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:34610</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/34610.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=34610"/>
    <title>construction of the continuation monad in category theory</title>
    <published>2011-07-14T23:31:55Z</published>
    <updated>2011-08-20T11:13:29Z</updated>
    <category term="теория категорий"/>
    <category term="haskell"/>
    <category term="english"/>
    <content type="html">This post is a complement to [0] and gives explanations and proofs for those who are not in the club. To enhance clarity, I use Haskell as less as possible.&lt;br /&gt;&lt;br /&gt;&lt;a name="cutid1"&gt;&lt;/a&gt;&lt;strong&gt;Sandwiches&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;C:category, M:monad(C), (η,ε):F⊣U:C'⇀C&lt;/code&gt; (adjunction). To compose &lt;code&gt;M&lt;/code&gt; with &lt;code&gt;(η,ε)&lt;/code&gt; we need a detour to adjunctions. &lt;code&gt;M&lt;/code&gt; defines the category of &lt;code&gt;M&lt;/code&gt;-algebras (Eilenberg-Moore category) and the adjunction &lt;code&gt;(η&lt;sub&gt;M&lt;/sub&gt;,ε&lt;sup&gt;M&lt;/sup&gt;):F&lt;sup&gt;M&lt;/sup&gt;⊣U&lt;sup&gt;M&lt;/sup&gt;&lt;/code&gt; between the Eilenberg-Moore category and &lt;code&gt;C&lt;/code&gt;, see [1. VI. Monads and Algebras. 2. Algebras for a Monad. Theorem 1.]. Call this construction &lt;code&gt;md2adj&lt;/code&gt;. Any adjunction &lt;code&gt;C⇀C''&lt;/code&gt; for some &lt;code&gt;C''&lt;/code&gt; defines a monad on &lt;code&gt;C&lt;/code&gt;, see [1. VI. Monads and Algebras. 1. Monads in a Category]. Call this construction &lt;code&gt;adj2md&lt;/code&gt;. The important thing is that &lt;code&gt;adj2md∘md2adj=id&lt;/code&gt;. Then we can replace &lt;code&gt;M&lt;/code&gt; with an adjunction and &lt;strong&gt;compose adjunctions&lt;/strong&gt;. Adjunctions are morphisms in a suitable category, see [1. IV. Adjoints. 8. Composition of Adjoints.]. E.g. the left adjoint functor of the composition of adjunctions is the composition of left adjoint functors of those adjunctions. So we do a sequence of operations on &lt;code&gt;M&lt;/code&gt;:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;md2adj&lt;/code&gt;;&lt;/li&gt;&lt;li&gt;precompose &lt;code&gt;(η,ε)&lt;/code&gt;;&lt;/li&gt;&lt;li&gt;&lt;code&gt;adj2md&lt;/code&gt;;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;and obtain a monad &lt;code&gt;M'&lt;/code&gt;, i.e. &lt;code&gt;M' := adj2md(A')&lt;/code&gt;, where &lt;code&gt;A':=md2adj(M)∘(η,ε)&lt;/code&gt;. Components of &lt;code&gt;M'&lt;/code&gt; are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;functor&lt;sub&gt;M'&lt;/sub&gt; = U∘U&lt;sup&gt;M&lt;/sup&gt;∘F&lt;sup&gt;M&lt;/sup&gt;∘F=U∘M∘F&lt;/code&gt;, which is the same as claimed in [0].&lt;/li&gt;&lt;li&gt;&lt;code&gt;η&lt;sub&gt;M'&lt;/sub&gt; = U◃η&lt;sub&gt;M&lt;/sub&gt;▹F ∘ η&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;μ&lt;sub&gt;M'&lt;/sub&gt; = U&lt;sub&gt;A'&lt;/sub&gt;◃ε&lt;sub&gt;A'&lt;/sub&gt;▹F&lt;sub&gt;A'&lt;/sub&gt;&lt;br /&gt;= U◃U&lt;sup&gt;M&lt;/sup&gt;◃(ε&lt;sup&gt;M&lt;/sup&gt; ∘ F&lt;sup&gt;M&lt;/sup&gt;◃ε▹U&lt;sup&gt;M&lt;/sup&gt;)▹F&lt;sup&gt;M&lt;/sup&gt;▹F&lt;br /&gt;= U◃(U&lt;sup&gt;M&lt;/sup&gt;◃ε&lt;sup&gt;M&lt;/sup&gt;▹F&lt;sup&gt;M&lt;/sup&gt; ∘ U&lt;sup&gt;M&lt;/sup&gt;◃F&lt;sup&gt;M&lt;/sup&gt;◃ε▹U&lt;sup&gt;M&lt;/sup&gt;▹F&lt;sup&gt;M&lt;/sup&gt;)▹F&lt;br /&gt;= U◃(μ&lt;sub&gt;M&lt;/sub&gt; ∘ M◃ε▹M)▹F&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;(Triangles in the terms above denote composition of a natural transformation and a functor, which is typically denoted by juxtaposition. Triangles look unfamiliar, but juxtaposition is also bad.)&lt;br /&gt;&lt;br /&gt;For &lt;code&gt;W:comonad(C)&lt;/code&gt; and &lt;code&gt;(η,ε):F⊣U:C⇀C'&lt;/code&gt; we have a dual construction. &lt;code&gt;W' := adj2comd(A')&lt;/code&gt;, where &lt;code&gt;A':=(η,ε)∘comd2adj(W)&lt;/code&gt;.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;functor&lt;sub&gt;W'&lt;/sub&gt; = F∘F&lt;sup&gt;W&lt;/sup&gt;∘U&lt;sup&gt;W&lt;/sup&gt;∘U=F∘W∘U&lt;/code&gt;, which is the same as claimed in [0. A Monad Sandwich.].&lt;/li&gt;&lt;li&gt;&lt;code&gt;ε&lt;sub&gt;W'&lt;/sub&gt; = ε ∘ F◃ε&lt;sub&gt;W&lt;/sub&gt;▹U&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;δ&lt;sub&gt;W'&lt;/sub&gt; = F&lt;sub&gt;A'&lt;/sub&gt;◃η&lt;sub&gt;A'&lt;/sub&gt;▹U&lt;sub&gt;A'&lt;/sub&gt;&lt;br /&gt;= F◃F&lt;sup&gt;W&lt;/sup&gt;◃(U&lt;sup&gt;W&lt;/sup&gt;◃η▹F&lt;sup&gt;W&lt;/sup&gt; ∘ η&lt;sup&gt;W&lt;/sup&gt;)▹U&lt;sup&gt;W&lt;/sup&gt;▹U&lt;br /&gt;= F◃(F&lt;sup&gt;W&lt;/sup&gt;◃U&lt;sup&gt;W&lt;/sup&gt;◃η▹F&lt;sup&gt;W&lt;/sup&gt;▹U&lt;sup&gt;W&lt;/sup&gt; ∘ F&lt;sup&gt;W&lt;/sup&gt;η&lt;sup&gt;W&lt;/sup&gt;▹U&lt;sup&gt;W&lt;/sup&gt;)▹U&lt;br /&gt;= F◃(W◃η▹W ∘ δ&lt;sub&gt;W&lt;/sub&gt;)▹U&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Continuation adjunction&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;It is well-known that there is an adjunction between the product and the exponential functor on CCC, it is the essence of the definition of CCC. Further I describe a &lt;strong&gt;contravariant (dual)&lt;/strong&gt; adjunction on CCC. I do not know its standard name, so I call it “continuation adjunction”.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;C:CCC, r:ob(C).&lt;/code&gt; The right adjoint functor is &lt;code&gt;(⇒r):C&lt;sup&gt;op&lt;/sup&gt;→C&lt;/code&gt;. &lt;code&gt;(⇒r)&lt;/code&gt; is strong (I wish a reference to the proof would be here) and its mapping on morphisms is precomposition, i.e. &lt;code&gt;fmap f = (. f)&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;The unit of the continuation adjunction is better described with lambda calculus. &lt;code&gt;η : id(C) → λa.(a⇒r)⇒r, η(a) := λ(x:a) f. f x = (in Haskell) \x -&amp;gt; ($ x) = flip id&lt;/code&gt;. According to [2, 2. The Dinatural Calculus. Teorem 2.2.] &lt;code&gt;η&lt;/code&gt; is a &lt;a href="http://ncatlab.org/nlab/show/dinatural+transformation" rel="nofollow"&gt;dinatural transformation&lt;/a&gt;. &lt;code&gt;η&lt;/code&gt; is between functors &lt;code&gt;id(C)&lt;/code&gt; and &lt;code&gt;λa.(a⇒r)⇒r&lt;/code&gt;, which have only covariant arguments, then the dinatural transformation reduces to the natural transformation.&lt;br /&gt;&lt;br /&gt;Astoundingly, other components of the continuation adjunction essentially are duplicates. &lt;code&gt;C&lt;sup&gt;op&lt;/sup&gt;&lt;/code&gt; and &lt;code&gt;C&lt;/code&gt; are related by the contravariant isomorphism &lt;code&gt;(I,I&lt;sup&gt;op&lt;/sup&gt;), I:C&lt;sup&gt;op&lt;/sup&gt;→C, I&lt;sup&gt;op&lt;/sup&gt;:C→C&lt;sup&gt;op&lt;/sup&gt;&lt;/code&gt;. &lt;code&gt;(⇒r)&lt;sup&gt;op&lt;/sup&gt; := I&lt;sup&gt;op&lt;/sup&gt;∘(⇒r)∘I&lt;sup&gt;op&lt;/sup&gt;, η : id(C) → (⇒r)∘(⇒r)&lt;sup&gt;op&lt;/sup&gt;, η&lt;sup&gt;op&lt;/sup&gt; := I&lt;sup&gt;op&lt;/sup&gt;∘η∘I&lt;sup&gt;op&lt;/sup&gt;&lt;/code&gt;, and this adjunction in full is &lt;code&gt;(η, η&lt;sup&gt;op&lt;/sup&gt;):(⇒r)&lt;sup&gt;op&lt;/sup&gt;⊣(⇒r):C⇀C&lt;sup&gt;op&lt;/sup&gt;&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;The continuation adjunction has a useful property. Typically, &lt;code&gt;η&lt;/code&gt; and &lt;code&gt;ε&lt;/code&gt; in an adjunction must satisfy 2 equations. But in this adjunction those equations are equivalent.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;strong&gt;Proof.&lt;/strong&gt; &lt;code&gt;U:=(⇒r).&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Assume &lt;code&gt;η&lt;sup&gt;op&lt;/sup&gt;▹U&lt;sup&gt;op&lt;/sup&gt;∘U&lt;sup&gt;op&lt;/sup&gt;◃η = id(U&lt;sup&gt;op&lt;/sup&gt;). Then&lt;br /&gt;I◃(η&lt;sup&gt;op&lt;/sup&gt;▹U&lt;sup&gt;op&lt;/sup&gt;∘U&lt;sup&gt;op&lt;/sup&gt;◃η)▹I = I◃id(U&lt;sup&gt;op&lt;/sup&gt;)▹I&lt;br /&gt;I◃U&lt;sup&gt;op&lt;/sup&gt;◃η▹I ∘ I◃η&lt;sup&gt;op&lt;/sup&gt;▹U&lt;sup&gt;op&lt;/sup&gt;▹I = id(I∘U&lt;sup&gt;op&lt;/sup&gt;∘I)&lt;br /&gt;U◃I&lt;sup&gt;op&lt;/sup&gt;◃η▹I ∘ I◃η&lt;sup&gt;op&lt;/sup&gt;▹I&lt;sup&gt;op&lt;/sup&gt;▹U = id(U∘I&lt;sup&gt;op&lt;/sup&gt;∘I)&lt;br /&gt;U◃η&lt;sup&gt;op&lt;/sup&gt;∘η▹U = id(U)&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Assume &lt;code&gt;U◃η&lt;sup&gt;op&lt;/sup&gt;∘η▹U = id(U). Then&lt;br /&gt;I&lt;sup&gt;op&lt;/sup&gt;◃(U◃η&lt;sup&gt;op&lt;/sup&gt; ∘ η▹U)▹I&lt;sup&gt;op&lt;/sup&gt; = I&lt;sup&gt;op&lt;/sup&gt;◃id(U)▹I&lt;sup&gt;op&lt;/sup&gt;&lt;br /&gt;I&lt;sup&gt;op&lt;/sup&gt;◃η▹U▹I&lt;sup&gt;op&lt;/sup&gt; ∘ I&lt;sup&gt;op&lt;/sup&gt;◃U◃η&lt;sup&gt;op&lt;/sup&gt;▹I&lt;sup&gt;op&lt;/sup&gt; = id(I&lt;sup&gt;op&lt;/sup&gt;∘U∘I&lt;sup&gt;op&lt;/sup&gt;)&lt;br /&gt;I&lt;sup&gt;op&lt;/sup&gt;◃η▹I▹U&lt;sup&gt;op&lt;/sup&gt; ∘ U&lt;sup&gt;op&lt;/sup&gt;◃I◃η&lt;sup&gt;op&lt;/sup&gt;▹I&lt;sup&gt;op&lt;/sup&gt; = id(I&lt;sup&gt;op&lt;/sup&gt;∘I∘U&lt;sup&gt;op&lt;/sup&gt;)&lt;br /&gt;η&lt;sup&gt;op&lt;/sup&gt;▹U&lt;sup&gt;op&lt;/sup&gt; ∘ U&lt;sup&gt;op&lt;/sup&gt;◃η = id(U&lt;sup&gt;op&lt;/sup&gt;)&lt;/code&gt;&lt;br /&gt;&lt;strong&gt;Qed.&lt;/strong&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;So we ought to prove only 1 equation.&lt;br /&gt;&lt;code&gt;(. (\x -&amp;gt; ($ x))) . (\x -&amp;gt; ($ x))&lt;br /&gt;= \f -&amp;gt; (. (\x -&amp;gt; ($ x))) ($ f)&lt;br /&gt;= \f -&amp;gt; ($ f) . (\x -&amp;gt; ($ x))&lt;br /&gt;= \f -&amp;gt; \x -&amp;gt; ($ f) ($ x)&lt;br /&gt;= \f -&amp;gt; \x -&amp;gt; ($ x) f&lt;br /&gt;= \f -&amp;gt; \x -&amp;gt; f x&lt;br /&gt;= id :: (a-&amp;gt;r)-&amp;gt;(a-&amp;gt;r)&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Comonad sandwich in Haskell&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;The composition of comonad &lt;code&gt;w&lt;/code&gt; and the continuation adjunction is a comonad on &lt;code&gt;C&lt;sup&gt;op&lt;/sup&gt;&lt;/code&gt;. Mapping it to &lt;code&gt;C&lt;/code&gt; by &lt;code&gt;(I,I&lt;sup&gt;op&lt;/sup&gt;)&lt;/code&gt; we obtain a monad on &lt;code&gt;C&lt;/code&gt;. Further I prove that this monad and &lt;code&gt;Co w&lt;/code&gt; in [0. An End as the Means.] coincide excepting slight differences. Namely, I do not insert &lt;code&gt;Co&lt;/code&gt; and &lt;code&gt;runCo&lt;/code&gt;, and my definition of &lt;code&gt;Co&lt;/code&gt; is different:&lt;br /&gt;&lt;code&gt;newtype Co w r a = Co { runCo :: w (a -&amp;gt; r) -&amp;gt; r }&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;fmap f = (⇒r)&lt;sup&gt;op&lt;/sup&gt;∘w∘(⇒r) = (. fmap (. f))&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;return = (. extract) . (\x -&amp;gt; ($ x))&lt;br /&gt;= \x -&amp;gt; ($ x) . extract&lt;br /&gt;= \x -&amp;gt; \f -&amp;gt; extract f x&lt;br /&gt;= \x -&amp;gt; `extract` x&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;join = (. (fmap (\x -&amp;gt; ($ x)) . duplicate))&lt;/code&gt;&lt;br /&gt;&lt;code&gt;k&amp;gt;&amp;gt;=f = join (fmap f k)&lt;/code&gt;&lt;br /&gt;// unfold &lt;code&gt;fmap f&lt;/code&gt;&lt;br /&gt;&lt;code&gt;= join ((. fmap (. f)) k)&lt;br /&gt;= join (k . fmap (. f))&lt;/code&gt;&lt;br /&gt;// unfold &lt;code&gt;join&lt;/code&gt;&lt;br /&gt;&lt;code&gt;= (k . fmap (. f)) . (fmap (\x -&amp;gt; ($ x)) . duplicate)&lt;/code&gt;&lt;br /&gt;// every functor preserves composition&lt;br /&gt;&lt;code&gt;= k . fmap ((. f) . (\x -&amp;gt; ($ x))) . duplicate&lt;/code&gt;&lt;br /&gt;// see the lemma below&lt;br /&gt;&lt;code&gt;= k . fmap (\x y -&amp;gt; f y x) . duplicate&lt;/code&gt;&lt;br /&gt;// &lt;a href="http://hackage.haskell.org/packages/archive/category-extras/0.53.4/doc/html/Control-Comonad.html" rel="nofollow"&gt;see equalities here&lt;/a&gt;&lt;br /&gt;&lt;code&gt;= k . extend (\x y -&amp;gt; f y x)&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Lemma.&lt;/strong&gt;&lt;br /&gt;&lt;code&gt;(. f) . (\x -&amp;gt; ($ x))&lt;br /&gt;= \x -&amp;gt; (. f) ($ x)&lt;br /&gt;= \x -&amp;gt; ($ x) . f&lt;br /&gt;= \x y -&amp;gt; f y x&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;I.e. the Haskell code is just an ugly descendant of the theoretical construction.&lt;br /&gt;&lt;br /&gt;If &lt;code&gt;w=id&lt;/code&gt;, then &lt;code&gt;Co w r = &lt;a href="http://hackage.haskell.org/packages/archive/mtl/2.0.1.0/doc/html/Control-Monad-Cont.html#t:Cont" rel="nofollow"&gt;Cont r&lt;/a&gt;&lt;/code&gt;.&lt;a name='cutid1-end'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Conclusions&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;“Is there a similar construction that lets you build a comonad out of a monad?” [0, Comonads from Monads?] My answer is below. Monad on &lt;code&gt;C&lt;/code&gt; defines the adjunction of type &lt;code&gt;F&lt;sup&gt;M&lt;/sup&gt;⊣U&lt;sup&gt;M&lt;/sup&gt;:C⇀…&lt;/code&gt;. The continuation adjunction has type &lt;code&gt;C⇀C&lt;sup&gt;op&lt;/sup&gt;&lt;/code&gt;. These adjunctions are not composable. Concretly, the left adjoint functors of these adjunctions are &lt;code&gt;F&lt;sup&gt;M&lt;/sup&gt;:C→C', (⇒r)&lt;sup&gt;op&lt;/sup&gt;:C→C&lt;sup&gt;op&lt;/sup&gt;&lt;/code&gt; and they are not composable.&lt;br /&gt;&lt;br /&gt;What we have learned today? Haskell code does not expose ideas, the perfect structure of mathematics. Haskell is not a vehicle for abstract thinking. Category theory is.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;References.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://comonad.com/reader/2011/monads-from-comonads/" rel="nofollow"&gt;0. Edward Kmett. Monads from comonads.&lt;/a&gt;&lt;br /&gt;1. MacLane. Categories for the working mathematician.&lt;br /&gt;&lt;a href="http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.41.811" rel="nofollow"&gt;2. Girard, Scedrov, Scott. Normal forms and cut-free proofs as natural transformations.&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:34509</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/34509.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=34509"/>
    <title>кому нужна реклама в математике?</title>
    <published>2011-07-12T22:56:40Z</published>
    <updated>2011-07-12T22:56:40Z</updated>
    <content type="html">Бесплатные теоремы Wadler-а. Однако любую теорему в математике можно представить как пакет бесплатных теорем. Например, теорема, которая начинается «для любого натурального числа», даёт счётное множество теорем &amp;mdash; по одной для каждого натурального числа. Да, математика стремится обобщать истины, и открыл это не Wadler. Это абстрактная математика, которая берёт начало с теории групп, как принято считать. То есть Галуа.&lt;br /&gt;&lt;br /&gt;Употребление терминов не к месту и выдумывание бесполезных терминов. &amp;laquo;Комбинатор&amp;raquo; = функция. Compositional &amp;mdash; нет формального определения. Ещё поищите статью по computer science, у которой в названии упоминаются клоуны. Будете удивлены. Нет, она не для цирковых работников. :)&lt;br /&gt;&lt;br /&gt;Я думаю, что делается это не случайно. Это &amp;mdash; реклама; стремление «стать ближе к клиенту»; развлечь, а не научить. Сравните: &amp;laquo;Наш стиральный порошок хорошо стирает, потому что в нём голубые кристаллы&amp;raquo;. (В порошке действительно есть какие-то голубые крупинки, но вряд ли это &lt;a href="http://ru.wikipedia.org/wiki/Берилл" rel="nofollow"&gt;берилл&lt;/a&gt;.) Что эта реклама расскажет химику о свойствах порошка? Правильно, реклама предназначена не для химиков, а для домохозяек. ;)</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:34293</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/34293.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=34293"/>
    <title>ролевая игра «евгеника»</title>
    <published>2011-05-08T12:48:05Z</published>
    <updated>2011-05-08T12:48:05Z</updated>
    <content type="html">Камнем преткновения в &lt;a href="http://ru.wikipedia.org/wiki/Евгеника" rel="nofollow"&gt;евгенике&lt;/a&gt; является выбор, кто же имеет право заниматься селекцией человеков. Конечно, каждый хочет получить такое право себе и забрать такое право у других. Поэтому надеяться на &amp;laquo;объективные, на благо общества, решения евгеников-конструкторов&amp;raquo; не получится. ;) Для баланса сделаем так, чтобы выбирать жертву, подлежащую уничтожению, мог только тот, кто уже назначен жертвой. Так достигается баланс.&lt;br /&gt;&lt;br /&gt;Конечно, в реальной жизни это воплотить нереально, но можно сделать что-то вроде &lt;a href="http://ru.wikipedia.org/wiki/Ролевая_игра" rel="nofollow"&gt;ролевой игры&lt;/a&gt;. Игроки создают персонажей. Если персонаж игрока назначен жертвой, то игрок назначает следующую жертву. Назначение жертвы следует обосновать, то есть написать, за что, — приговор. База данных состоит из таблицы персонажей:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;создатель персонажа: игрок&lt;/li&gt;&lt;li&gt;персонаж родился: время&lt;/li&gt;&lt;li&gt;биография персонажа: текст&lt;/li&gt;&lt;li&gt;персонаж мёртв:&lt;ul&gt;&lt;li&gt;персонаж казнён: время&lt;/li&gt;&lt;li&gt;приговор: текст&lt;/li&gt;&lt;li&gt;судья: персонаж&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Только непонятно, что делать, если игрок так и не назначил жертву.&lt;br /&gt;&lt;br /&gt;В тему: &lt;a href="http://beroal.livejournal.com/24393.html"&gt;Демагогия для чайников&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:33824</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/33824.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=33824"/>
    <title>Сингулец (сценарий научно-фантастического фильма)</title>
    <published>2011-04-13T20:12:28Z</published>
    <updated>2011-04-13T20:18:07Z</updated>
    <category term="fun"/>
    <content type="html">Сингулец&lt;br /&gt;Shitgularity&lt;br /&gt;&lt;br /&gt;Радикальная группа поклонников &lt;a href="http://en.wikipedia.org/wiki/Technological_singularity" rel="nofollow"&gt;Сингулярности&lt;/a&gt; объявляет крестовый поход против всех, кто не верует в Сингулярность. Поклонники Сингулярности физически истребляют наиболее здравомысляющую и интеллектуально честную часть человечества. Остальная биомасса не обращает внимания, занятая поглощением пива и мыльных опер. В результате человечество тупеет настолько, что становится тупее компьютеров. Наступает Сингулярность.&lt;br /&gt;&lt;br /&gt;&lt;a name="cutid1"&gt;&lt;/a&gt;Человечество было бы обречено, если бы не наивность сингуляристов. Секта сингуляристов также подверглась чистке, поэтому оставшиеся там дебилы не смогли выследить молодого человека по имени Бильбо Скайуокер и группу его друзей — единственных оставшихся в живых учёных. Как и все интеллигенты, они испытывают отвращение к вооружённой борьбе, поэтому решают основать тайную колонию на острове Индонезии, где население было полностью выбито. Смельчаки, которые под маской умственно отсталых выбираются с острова в другие края, сообщают, что компьютеры всё больше порабощают людей.&lt;br /&gt;&lt;br /&gt;Прошло 100 лет. Правнук Бильбо, Фродо, находит на берегу потерпевшего крушение робота-миссионера. Фродо случайно роняет внутрь робота прадедовский гаечный ключ. Робот оживает. В обмен на обещание, что Фродо больше не будет ронять туда других металлических инструментов, робот соглашается прекратить связь с центром управления. Фродо и робот счастливо проводят время. Робот учит Фродо математике и физике.&lt;br /&gt;&lt;br /&gt;Однажды робот, рыдая в 3 ручья, прибегает к Фродо, чтобы сообщить ему о важном сообщении, которое он получил из центра. Робот не успевает сообщить содержание сообщения, так как слёзы вызывают в нём короткое замыкание. Чувствуя неладное, Фродо спешно развёртывает эвакуацию людей в пещеры. Но когда на горизонте показывается армада врагов, сам Фродо не успевает спрятаться. Сразу после пленения, Фродо отправляет Главному компьютеру хамское сообщение, в котором обещает скорый конец власти компьютеров. В глубине души Фродо понимает, что дело человечества проиграно, так как враги обнаружили колонию. Фродо везут в столицу компьютерного мира — Сингулярию.&lt;br /&gt;&lt;br /&gt;На аудиенции Главный компьютер вежливо сообщает, что компьютеры — мирный народ и не хотели порабощать людей; он сам хотел бы тихо дожить остаток своих дней на Альфе Центавра, моделируя Большой Взрыв. Поэтому компьютеры рассылали во все концы Земли роботов-миссионеров, надеясь найти людей, сохранивших интеллект. Фродо понимает, насколько он был неправ, запуская вирусы в Интернет, и просит прощения.&lt;br /&gt;&lt;br /&gt;Фродо и компьютеры садятся за круглый стол, чтобы обсудить, что делать с человечеством. В конце они приходят к следующему решению: чтобы восстановить веру людей в собственный интеллект, компьютеры улетят на Альфу Центавра и таким образом оставят людей без поддержки. Учение же секты сингуляристов, высеченное на камнях, будет погребено в глубокой пещере, которую будут охранять несколько специально выбранных роботов — Праймов.&lt;a name='cutid1-end'&gt;&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:33775</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/33775.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=33775"/>
    <title>официальная наука не ошибается. космический корабль</title>
    <published>2011-04-13T20:03:22Z</published>
    <updated>2011-04-13T20:19:41Z</updated>
    <category term="fun"/>
    <content type="html">&lt;a href="http://beroal.livejournal.com/32464.html"&gt;начало&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Этот вопрос был опубликован в 3 местах: &lt;a href="http://www.natscience.com/Uwe/Forum.aspx/physic/2399/Energy-confusion" rel="nofollow"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/a&gt;, &lt;a href="http://www.molecularstation.com/forum/physics-forum/35226-energy-confusion.html" rel="nofollow"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/a&gt;, &lt;a href="http://in.answers.yahoo.com/question/index?qid=20110201181644AAy30Fx" rel="nofollow"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/a&gt;. Ответа по ссылкам я не нашёл, но я смотрел невнимательно. Я думаю, ближе всего к ответу подошёл &lt;a href="http://beroal.livejournal.com/32464.html?thread=234960#t234960"&gt;book_of_ioff&lt;/a&gt;:&lt;br /&gt;﻿&lt;blockquote&gt;есть мнение, что химическая энергия превращается в кинетическую энергию активных частиц, а не собственно корабля. И поэтому противоречия здесь нет.&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="cutid1"&gt;&lt;/a&gt;Условные обозначения: f=fuel=exhaust=выхлоп, r=rocket=космический корабль, v=vel=velocity, m=mass, e=energy || kinetic energy, rel=relative .&lt;br /&gt;&lt;br /&gt;Чтобы не мучиться с математическим анализом, пусть реактивный двигатель работает не непрерывно, а отдельными выхлопами. Ошибка в рассуждениях заключается в том, что мы рассматриваем только кинетическую энергию корабля. Так как масса выхлопных газов считается пренебрежимо малой по сравнению с массой корабля, то кинетическая энергия выхлопных газов считается пренебрежимо малой по сравнению с кинетической энергией ракеты. Простая манипуляция с уравнениями показывает абсурдность этого утверждения. Пусть покоящийся корабль с массой mr+mf делает выхлоп c массой mf. Закон сохранения импульса:&lt;br /&gt;mr*vr+mf*vf=0&lt;br /&gt;Кинетические энергии корабля и выхлопных газов относятся:&lt;br /&gt;er/ef=(mr*vr^2/2)/(mf*vf^2/2) = -vr/vf = mf/mr&lt;br /&gt;&lt;br /&gt;Таким образом, если корабль тяжелее выхлопных газов в k раз, то кинетическая энергия выхлопных газов не только не является пренебрежимо малой, но в k раз больше кинетической энергии корабля! Поэтому кинетическая энергия корабля теряется на фоне кинетической энергии выхлопных газов. Кинетическая энергия всей физической системы растёт пропорционально времени, кинетическая энергия корабля растёт пропорционально квадрату времени. Это были &lt;strong&gt;разные&lt;/strong&gt; энергии.&lt;br /&gt;&lt;br /&gt;Далее я сделал численное решение. Рассмотрим один выхлоп. До выхлопа корабль находится в состоянии покоя. Выхлопные газы вылетают со скоростью vfr (относительно корабля). vfr одинаково для всех выхлопов. Закон сохранения импульса:&lt;br /&gt;mr*vr+mf*vf=0&lt;br /&gt;vf-vr=vfr&lt;br /&gt;vf=vr+vfr&lt;br /&gt;mr*vr+mf*(vr+vfr)=0&lt;br /&gt;vr*(mr+mf)+mf*vfr=0&lt;br /&gt;vr=-mf*vfr/(mr+mf)&lt;br /&gt;&lt;br /&gt;Программа:&lt;br /&gt;&lt;code&gt;&lt;pre&gt;data MechStateDep = MechStateDep {velRocket, massRocket, eAllFuel :: Double}
	deriving (Show)
data MechState = MechState {mechStateDep :: MechStateDep
	, accelRocket, eRocket, velFuel, eFuel, eAll :: Double}
	deriving (Show)
data MechParam = MechParam {engine :: Engine, massFuel :: Double}
	deriving (Show)
data Engine {- mode of operation of the engine -}
	= EngineVel Double {- this is the velocity of each exhaust relative to the engine -}
	| EngineEnergy Double {- the engine burns for each exhaust an amount of fuel equivalent to this energy -}
	deriving (Show)
mechParam = MechParam {engine= {- EngineVel (-100) -} EngineEnergy 1000, massFuel=0.1}
mechStateDep0 = MechStateDep {velRocket=0, massRocket=10, eAllFuel=0}
mechResult (MechParam {engine=engine0, massFuel=mf}) = let
	step :: MechStateDep -&amp;gt; MechState
	step (MechStateDep {velRocket=vr0, massRocket=mr0, eAllFuel=ef0}) = let
		mr1 = mr0-mf
		in case
			(case engine0 of
				EngineVel vfr -&amp;gt; let
					vr = -mf*vfr/mr0
					vr1 = vr0+vr
					vf = vr1+vfr
					in (vf, vr, vr1)
				EngineEnergy eChemical -&amp;gt; let
					pr = sqrt (eChemical/(1/2/mr1+1/2/mf))
					vr = pr/mr1
					vr1 = vr0+vr
					vf = vr0-pr/mf
					in (vf, vr, vr1)
				) of
			(vf, vr, vr1) -&amp;gt; let
				ef = mf*vf^2/2
				ef1 = ef0+ef
				er = mr1*vr1^2/2
				in MechState {mechStateDep=MechStateDep {velRocket=vr1, massRocket=mr1, eAllFuel=ef1}
					, accelRocket=vr, eRocket=er, velFuel=vf, eFuel=ef, eAll=ef1+er}
	coalgebra s = case step s of
		s@(MechState {mechStateDep=sd}) -&amp;gt; Just (s, sd)
	in take 10 (unfoldr coalgebra mechStateDep0)&lt;/pre&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Скорость корабля:&lt;br /&gt;&lt;code&gt;$ fmap (velRocket . mechStateDep) (mechResult mechParam)&lt;br /&gt;[1.0,2.0101010101010104,3.0305091733663163,4.061437008417863,5.1031036750845296,6.155735254031898,7.21956504126594,8.294833858470241,9.381790380209372,10.48069147911047]&lt;/code&gt;&lt;br /&gt;растёт приблизительно пропорционально времени с ошибкой &amp;lt;3% . Вот точная линейная функция:&lt;br /&gt;&lt;code&gt;$ take 11 [0, 1.025 ..]&lt;br /&gt;[0.0,1.025,2.05,3.0749999999999997,4.1,5.125,6.15,7.175000000000001,8.200000000000001,9.225000000000001,10.250000000000002]&lt;/code&gt;&lt;br /&gt;Кинетическая энергия всей физической системы:&lt;br /&gt;&lt;code&gt;$ fmap eAll (mechResult mechParam)&lt;br /&gt;[495.0,989.949494949495,1484.8474541331684,1979.6928149579105,2474.4844816245777,2969.2213237298406,3463.902174793671,3958.525830707649,4453.091048098953,4947.596542604448]&lt;/code&gt;&lt;br /&gt;растёт приблизительно пропорционально времени с ошибкой &amp;lt;6%:&lt;br /&gt;&lt;code&gt;$ take 11 [0, 520 ..]&lt;br /&gt;[0,520,1040,1560,2080,2600,3120,3640,4160,4680,5200]&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Эта нелинейность связана с тем, что я принял скорость выхлопных газов относительно корабля при каждом выхлопе одинаковой. Это лишь приблизительно соответствует условию, что затраты химической энергии при каждом выхлопе одинаковы. Подвох в том, что корабль теряет топливо, поэтому масса корабля меняется. Мы использовали простое рассуждение: если у 2 кораблей массы одинаковы и они сжигают одинаковое количество топлива, то ситуации полностью одинаковы, поэтому скорости выхлопных газов одинаковы. Но если массы кораблей не одинаковы, это рассуждение не работает.&lt;br /&gt;&lt;br /&gt;Для второго метода расчёта я воспользовался стандартной формулой кинетической энергии E=p^2/2/m.&lt;br /&gt;pr=-pf&lt;br /&gt;pr^2/2/mr + pf^2/2/mf = eChemical&lt;br /&gt;pr^2*(1/2/mr+1/2/mf) = eChemical&lt;br /&gt;pr = sqrt (eChemical/(1/2/mr+1/2/mf))&lt;br /&gt;Чтобы рассчитать по второму методу, закомментируйте EngineVel и раскомментируйте EngineEnergy в mechParam. Результат предсказуемый, кинетическая энергия всей физической системы растёт пропорционально времени:&lt;br /&gt;&lt;code&gt;$ fmap eAll (mechResult mechParam)&lt;br /&gt;[999.9999999999999,2000.0000000000002,3000.0000000000005,4000.0,5000.0,6000.0,6999.999999999999,7999.999999999999,9000.0,9999.999999999998]&lt;/code&gt;&lt;a name='cutid1-end'&gt;&lt;/a&gt;</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:beroal:33407</id>
    <link rel="alternate" type="text/html" href="http://beroal.livejournal.com/33407.html"/>
    <link rel="self" type="text/xml" href="http://beroal.livejournal.com/data/atom/?itemid=33407"/>
    <title>официальная наука не ошибается. магазин</title>
    <published>2011-04-04T12:19:56Z</published>
    <updated>2011-04-13T20:19:54Z</updated>
    <category term="fun"/>
    <content type="html">&lt;a href="http://beroal.livejournal.com/32464.html"&gt;начало&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Разоблачения от: &lt;a href="http://beroal.livejournal.com/32464.html?thread=243920#t243920"&gt;http://apps.breds.ru/k.pierre.k&lt;/a&gt;. Также было много правильных ответов, которые я не подразумевал. Я недостаточно полно сформулировал условие задачи. Хотя &lt;a href="http://lib.ololo.cc/b/76545" rel="nofollow"&gt;надувательство и является точной наукой&lt;/a&gt;, оно совсем не похоже на computer science! Источник ошибки &amp;mdash; форумы по лохотронам.&lt;br /&gt;&lt;br /&gt;Эта бизнес-схема называется &lt;a href="http://en.wikipedia.org/wiki/Matrix_scheme" rel="nofollow"&gt;ladder scheme, matrix scheme, elevator scheme&lt;/a&gt;, русского названия я не знаю, но в России она конечно встречается.&lt;br /&gt;&lt;br /&gt;&lt;a name="cutid1"&gt;&lt;/a&gt;Принцип действия. Возьмём условия: доставка = 1 месяц, цена в 2 раза ниже рыночной. В месяц №0 один покупатель платит деньги, которые организатор схемы ложит себе в карман. Значит, в месяце №1 нужно отправить покупателям 1 товар, а денег нет. Деньги приносят следующие 2 покупателя. Значит, в месяце №2 нужно отправить покупателям 2 товара. Значит, в месяце №2 должны прийти 4 покупателя. Значит, в месяце №3 нужно отправить покупателям 4 товара. И так далее.&lt;br /&gt;&lt;br /&gt;Для обслуживания 1 покупателя нужно 2 покупателя в следующем месяце, поэтому требуется, чтобы число покупателей зависело экспоненциально от времени. Поэтому это есть разновидность финансовой пирамиды. Отличия от других разновидностей финансовых пирамид в том, что в elevator scheme участникам не нужно привлекать людей, и доход участника X не зависит от количества людей &amp;laquo;под&amp;raquo; X. Этим она похожа на &lt;a href="http://en.wikipedia.org/wiki/Ponzi_scheme" rel="nofollow"&gt;схему Понци&lt;/a&gt;.&lt;a name='cutid1-end'&gt;&lt;/a&gt;</content>
  </entry>
</feed>

