bsc-leon-vatthauer/public/MonadK.html

110 lines
15 KiB
HTML
Raw Normal View History

2023-08-19 16:11:22 +02:00
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>MonadK</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
ul.task-list{list-style: none;}
ul.task-list li input[type="checkbox"] {
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<link rel="stylesheet" href="Agda.css" />
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<!--
<pre class="Agda"><a id="14" class="Keyword">open</a> <a id="19" class="Keyword">import</a> <a id="26" href="Level.html" class="Module">Level</a>
<a id="32" class="Keyword">open</a> <a id="37" class="Keyword">import</a> <a id="44" href="Categories.Category.Core.html" class="Module">Categories.Category.Core</a>
<a id="69" class="Keyword">open</a> <a id="74" class="Keyword">import</a> <a id="81" href="Categories.Category.Equivalence.html" class="Module">Categories.Category.Equivalence</a> <a id="113" class="Keyword">using</a> <a id="119" class="Symbol">(</a><a id="120" href="Categories.Category.Equivalence.html#1000" class="Record">StrongEquivalence</a><a id="137" class="Symbol">)</a>
<a id="139" class="Keyword">open</a> <a id="144" class="Keyword">import</a> <a id="151" href="Categories.Category.Extensive.Bundle.html" class="Module">Categories.Category.Extensive.Bundle</a>
<a id="188" class="Keyword">open</a> <a id="193" class="Keyword">import</a> <a id="200" href="Function.html" class="Module">Function</a> <a id="209" class="Keyword">using</a> <a id="215" class="Symbol">(</a><a id="216" href="Function.Base.html#624" class="Function">id</a><a id="218" class="Symbol">)</a>
<a id="220" class="Keyword">open</a> <a id="225" class="Keyword">import</a> <a id="232" href="UniformIterationAlgebras.html" class="Module">UniformIterationAlgebras</a>
<a id="257" class="Keyword">open</a> <a id="262" class="Keyword">import</a> <a id="269" href="UniformIterationAlgebra.html" class="Module">UniformIterationAlgebra</a>
<a id="293" class="Keyword">open</a> <a id="298" class="Keyword">import</a> <a id="305" href="Categories.FreeObjects.Free.html" class="Module">Categories.FreeObjects.Free</a>
<a id="333" class="Keyword">open</a> <a id="338" class="Keyword">import</a> <a id="345" href="Categories.Functor.Core.html" class="Module">Categories.Functor.Core</a>
<a id="369" class="Keyword">open</a> <a id="374" class="Keyword">import</a> <a id="381" href="Categories.Adjoint.html" class="Module">Categories.Adjoint</a>
<a id="400" class="Keyword">open</a> <a id="405" class="Keyword">import</a> <a id="412" href="Categories.Adjoint.Properties.html" class="Module">Categories.Adjoint.Properties</a>
<a id="442" class="Keyword">open</a> <a id="447" class="Keyword">import</a> <a id="454" href="Categories.Adjoint.Monadic.Crude.html" class="Module">Categories.Adjoint.Monadic.Crude</a>
<a id="487" class="Keyword">open</a> <a id="492" class="Keyword">import</a> <a id="499" href="Categories.NaturalTransformation.Core.html" class="Module">Categories.NaturalTransformation.Core</a> <a id="537" class="Keyword">renaming</a> <a id="546" class="Symbol">(</a><a id="547" href="Categories.NaturalTransformation.Core.html#2132" class="Function">id</a> <a id="550" class="Symbol">to</a> <a id="553" class="Function">idN</a><a id="556" class="Symbol">)</a>
<a id="558" class="Keyword">open</a> <a id="563" class="Keyword">import</a> <a id="570" href="Categories.Monad.html" class="Module">Categories.Monad</a>
<a id="587" class="Keyword">open</a> <a id="592" class="Keyword">import</a> <a id="599" href="Categories.Category.Construction.EilenbergMoore.html" class="Module">Categories.Category.Construction.EilenbergMoore</a>
<a id="647" class="Keyword">open</a> <a id="652" class="Keyword">import</a> <a id="659" href="Categories.Category.Slice.html" class="Module">Categories.Category.Slice</a>
</pre>-->
<h2 id="summary">Summary</h2>
<p>In this file I explore the monad <strong><em>K</em></strong> and its
properties:</p>
<ul class="task-list">
<li><input type="checkbox" disabled="" checked="" /><em>Lemma 16</em>
Definition of the monad</li>
<li><input type="checkbox" disabled="" /><em>Lemma 16</em>
EilenbergMoore⇒UniformIterationAlgebras (use <a
href="https://agda.github.io/agda-categories/Categories.Adjoint.Monadic.Crude.html">crude
monadicity theorem</a>)</li>
<li><input type="checkbox" disabled="" /><em>Proposition 19</em>
<strong><em>K</em></strong> is strong</li>
<li><input type="checkbox" disabled="" /><em>Theorem 22</em>
<strong><em>K</em></strong> is an equational lifting monad</li>
<li><input type="checkbox" disabled="" /><em>Proposition 23</em> The
Kleisli category of <strong><em>K</em></strong> is enriched over pointed
partial orders and strict monotone maps</li>
<li><input type="checkbox" disabled="" /><em>Proposition 25</em>
<strong><em>K</em></strong> is copyable and weakly discardable</li>
<li><input type="checkbox" disabled="" /><em>Theorem 29</em>
<strong><em>K</em></strong> is an initial pre-Elgot monad and an initial
strong pre-Elgot monad</li>
</ul>
<h2 id="code">Code</h2>
<pre class="Agda"><a id="1375" class="Keyword">module</a> <a id="1382" href="MonadK.html" class="Module">MonadK</a> <a id="1389" class="Symbol">{</a><a id="1390" href="MonadK.html#1390" class="Bound">o</a> <a id="1392" href="MonadK.html#1392" class="Bound"></a> <a id="1394" href="MonadK.html#1394" class="Bound">e</a><a id="1395" class="Symbol">}</a> <a id="1397" class="Symbol">(</a><a id="1398" href="MonadK.html#1398" class="Bound">D</a> <a id="1400" class="Symbol">:</a> <a id="1402" href="Categories.Category.Extensive.Bundle.html#781" class="Record">ExtensiveDistributiveCategory</a> <a id="1432" href="MonadK.html#1390" class="Bound">o</a> <a id="1434" href="MonadK.html#1392" class="Bound"></a> <a id="1436" href="MonadK.html#1394" class="Bound">e</a><a id="1437" class="Symbol">)</a> <a id="1439" class="Keyword">where</a>
<a id="1447" class="Keyword">open</a> <a id="1452" href="Categories.Category.Extensive.Bundle.html#781" class="Module">ExtensiveDistributiveCategory</a> <a id="1482" href="MonadK.html#1398" class="Bound">D</a> <a id="1484" class="Keyword">renaming</a> <a id="1493" class="Symbol">(</a><a id="1494" href="Categories.Category.Extensive.Bundle.html#859" class="Field">U</a> <a id="1496" class="Symbol">to</a> <a id="1499" class="Field">C</a><a id="1500" class="Symbol">;</a> <a id="1502" href="Categories.Category.Core.html#630" class="Function">id</a> <a id="1505" class="Symbol">to</a> <a id="1508" class="Function">idC</a><a id="1511" class="Symbol">)</a>
<a id="1515" class="Keyword">open</a> <a id="1520" href="Categories.Category.Core.html#1530" class="Module">Equiv</a>
<a id="1529" class="Comment">-- TODO move this to a different file</a>
<a id="forgetfulF"></a><a id="1570" href="MonadK.html#1570" class="Function">forgetfulF</a> <a id="1581" class="Symbol">:</a> <a id="1583" href="Categories.Functor.Core.html#248" class="Record">Functor</a> <a id="1591" class="Symbol">(</a><a id="1592" href="UniformIterationAlgebras.html#1242" class="Function">Uniform-Iteration-Algebras</a> <a id="1619" href="MonadK.html#1398" class="Bound">D</a><a id="1620" class="Symbol">)</a> <a id="1622" href="MonadK.html#1499" class="Field">C</a>
<a id="1626" href="MonadK.html#1570" class="Function">forgetfulF</a> <a id="1637" class="Symbol">=</a> <a id="1639" class="Keyword">record</a>
<a id="1650" class="Symbol">{</a> <a id="1652" href="Categories.Functor.Core.html#432" class="Field">F₀</a> <a id="1655" class="Symbol">=</a> <a id="1657" class="Symbol">λ</a> <a id="1659" href="MonadK.html#1659" class="Bound">X</a> <a id="1661" class="Symbol"></a> <a id="1663" href="UniformIterationAlgebra.html#1139" class="Field">Uniform-Iteration-Algebra.A</a> <a id="1691" href="MonadK.html#1659" class="Bound">X</a>
<a id="1697" class="Symbol">;</a> <a id="1699" href="Categories.Functor.Core.html#455" class="Field">F₁</a> <a id="1702" class="Symbol">=</a> <a id="1704" class="Symbol">λ</a> <a id="1706" href="MonadK.html#1706" class="Bound">f</a> <a id="1708" class="Symbol"></a> <a id="1710" href="UniformIterationAlgebras.html#1084" class="Field">Uniform-Iteration-Algebra-Morphism.h</a> <a id="1747" href="MonadK.html#1706" class="Bound">f</a>
<a id="1753" class="Symbol">;</a> <a id="1755" href="Categories.Functor.Core.html#511" class="Field">identity</a> <a id="1764" class="Symbol">=</a> <a id="1766" href="Relation.Binary.Structures.html#1577" class="Function">refl</a>
<a id="1775" class="Symbol">;</a> <a id="1777" href="Categories.Functor.Core.html#565" class="Field">homomorphism</a> <a id="1790" class="Symbol">=</a> <a id="1792" href="Relation.Binary.Structures.html#1577" class="Function">refl</a>
<a id="1801" class="Symbol">;</a> <a id="1803" href="Categories.Functor.Core.html#696" class="Field">F-resp-≈</a> <a id="1812" class="Symbol">=</a> <a id="1814" href="Function.Base.html#624" class="Function">id</a>
<a id="1821" class="Symbol">}</a>
<a id="1826" class="Comment">-- typedef</a>
<a id="FreeUniformIterationAlgebra"></a><a id="1839" href="MonadK.html#1839" class="Function">FreeUniformIterationAlgebra</a> <a id="1867" class="Symbol">:</a> <a id="1869" href="Categories.Category.Core.html#559" class="Function">Obj</a> <a id="1873" class="Symbol"></a> <a id="1875" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1879" class="Symbol">(</a><a id="1880" href="Agda.Primitive.html#774" class="Primitive">suc</a> <a id="1884" href="MonadK.html#1390" class="Bound">o</a> <a id="1886" href="Agda.Primitive.html#804" class="Primitive Operator"></a> <a id="1888" href="Agda.Primitive.html#774" class="Primitive">suc</a> <a id="1892" href="MonadK.html#1392" class="Bound"></a> <a id="1894" href="Agda.Primitive.html#804" class="Primitive Operator"></a> <a id="1896" href="Agda.Primitive.html#774" class="Primitive">suc</a> <a id="1900" href="MonadK.html#1394" class="Bound">e</a><a id="1901" class="Symbol">)</a>
<a id="1905" href="MonadK.html#1839" class="Function">FreeUniformIterationAlgebra</a> <a id="1933" href="MonadK.html#1933" class="Bound">X</a> <a id="1935" class="Symbol">=</a> <a id="1937" href="Categories.FreeObjects.Free.html#485" class="Record">FreeObject</a> <a id="1948" class="Symbol">{</a><a id="1949" class="Argument">C</a> <a id="1951" class="Symbol">=</a> <a id="1953" href="MonadK.html#1499" class="Field">C</a><a id="1954" class="Symbol">}</a> <a id="1956" class="Symbol">{</a><a id="1957" class="Argument">D</a> <a id="1959" class="Symbol">=</a> <a id="1961" href="UniformIterationAlgebras.html#1242" class="Function">Uniform-Iteration-Algebras</a> <a id="1988" href="MonadK.html#1398" class="Bound">D</a><a id="1989" class="Symbol">}</a> <a id="1991" href="MonadK.html#1570" class="Function">forgetfulF</a> <a id="2002" href="MonadK.html#1933" class="Bound">X</a>
</pre>
<h3 id="lemma-16-definition-of-monad-k"><em>Lemma 16</em>: definition of
monad <strong><em>K</em></strong></h3>
<pre class="Agda"> <a id="2065" class="Keyword">record</a> <a id="MonadK"></a><a id="2072" href="MonadK.html#2072" class="Record">MonadK</a> <a id="2079" class="Symbol">:</a> <a id="2081" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="2085" class="Symbol">(</a><a id="2086" href="Agda.Primitive.html#774" class="Primitive">suc</a> <a id="2090" href="MonadK.html#1390" class="Bound">o</a> <a id="2092" href="Agda.Primitive.html#804" class="Primitive Operator"></a> <a id="2094" href="Agda.Primitive.html#774" class="Primitive">suc</a> <a id="2098" href="MonadK.html#1392" class="Bound"></a> <a id="2100" href="Agda.Primitive.html#804" class="Primitive Operator"></a> <a id="2102" href="Agda.Primitive.html#774" class="Primitive">suc</a> <a id="2106" href="MonadK.html#1394" class="Bound">e</a><a id="2107" class="Symbol">)</a> <a id="2109" class="Keyword">where</a>
<a id="2119" class="Keyword">field</a>
<a id="MonadK.algebras"></a><a id="2131" href="MonadK.html#2131" class="Field">algebras</a> <a id="2140" class="Symbol">:</a> <a id="2142" class="Symbol"></a> <a id="2144" href="MonadK.html#2144" class="Bound">X</a> <a id="2146" class="Symbol"></a> <a id="2148" href="MonadK.html#1839" class="Function">FreeUniformIterationAlgebra</a> <a id="2176" href="MonadK.html#2144" class="Bound">X</a>
<a id="MonadK.freeF"></a><a id="2183" href="MonadK.html#2183" class="Function">freeF</a> <a id="2189" class="Symbol">:</a> <a id="2191" href="Categories.Functor.Core.html#248" class="Record">Functor</a> <a id="2199" href="MonadK.html#1499" class="Field">C</a> <a id="2201" class="Symbol">(</a><a id="2202" href="UniformIterationAlgebras.html#1242" class="Function">Uniform-Iteration-Algebras</a> <a id="2229" href="MonadK.html#1398" class="Bound">D</a><a id="2230" class="Symbol">)</a>
<a id="2236" href="MonadK.html#2183" class="Function">freeF</a> <a id="2242" class="Symbol">=</a> <a id="2244" href="Categories.FreeObjects.Free.html#1758" class="Function">FO⇒Functor</a> <a id="2255" href="MonadK.html#1570" class="Function">forgetfulF</a> <a id="2266" href="MonadK.html#2131" class="Field">algebras</a>
<a id="MonadK.adjoint"></a><a id="2284" href="MonadK.html#2284" class="Function">adjoint</a> <a id="2292" class="Symbol">:</a> <a id="2294" href="MonadK.html#2183" class="Function">freeF</a> <a id="2300" href="Categories.Adjoint.html#7972" class="Function Operator"></a> <a id="2302" href="MonadK.html#1570" class="Function">forgetfulF</a>
<a id="2317" href="MonadK.html#2284" class="Function">adjoint</a> <a id="2325" class="Symbol">=</a> <a id="2327" href="Categories.FreeObjects.Free.html#7309" class="Function">FO⇒LAdj</a> <a id="2335" href="MonadK.html#1570" class="Function">forgetfulF</a> <a id="2346" href="MonadK.html#2131" class="Field">algebras</a>
<a id="MonadK.K"></a><a id="2360" href="MonadK.html#2360" class="Function">K</a> <a id="2362" class="Symbol">:</a> <a id="2364" href="Categories.Monad.html#454" class="Record">Monad</a> <a id="2370" href="MonadK.html#1499" class="Field">C</a>
<a id="2376" href="MonadK.html#2360" class="Function">K</a> <a id="2378" class="Symbol">=</a> <a id="2380" href="Categories.Adjoint.Properties.html#9436" class="Function">adjoint⇒monad</a> <a id="2394" href="MonadK.html#2284" class="Function">adjoint</a>
<a id="2407" class="Comment">-- EilenbergMoore⇒UniformIterationAlgebras : StrongEquivalence (EilenbergMoore K) (Uniform-Iteration-Algebras D)</a>
<a id="2524" class="Comment">-- EilenbergMoore⇒UniformIterationAlgebras = {! !}</a>
</pre>
</body>
</html>