mirror of
https://git8.cs.fau.de/theses/bsc-leon-vatthauer.git
synced 2024-05-31 07:28:34 +02:00
113 lines
7.7 KiB
HTML
113 lines
7.7 KiB
HTML
<!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>index</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;}
|
||
/* The extra [class] is a hack that increases specificity enough to
|
||
override a similar rule in reveal.js */
|
||
ul.task-list[class]{list-style: none;}
|
||
ul.task-list li input[type="checkbox"] {
|
||
font-size: inherit;
|
||
width: 0.8em;
|
||
margin: 0 0.8em 0.2em -1.6em;
|
||
vertical-align: middle;
|
||
}
|
||
</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="Symbol">{-#</a> <a id="18" class="Keyword">OPTIONS</a> <a id="26" class="Pragma">--guardedness</a> <a id="40" class="Symbol">#-}</a>
|
||
</pre>-->
|
||
<h1
|
||
id="implementing-categorical-notions-of-partiality-and-delay-in-agda">Implementing
|
||
Categorical Notions of Partiality and Delay in Agda</h1>
|
||
<p>To see a full list of all the modules go to:</p>
|
||
<pre class="Agda"><a id="175" class="Keyword">open</a> <a id="180" class="Keyword">import</a> <a id="187" href="Everything.html" class="Module">Everything</a>
|
||
</pre>
|
||
<p>For my bachelor thesis I am implementing categorical notions of
|
||
partiality in agda using the <em>agda-categories</em> library. The repo
|
||
for this project can be found <a
|
||
href="https://git8.cs.fau.de/theses/bsc-leon-vatthauer">here</a>. This
|
||
is an implementation of this paper by Sergey Goncharov: <a
|
||
href="https://arxiv.org/abs/2102.11828">arxiv</a></p>
|
||
<h2 id="index">Index</h2>
|
||
<h3 id="preliminaries">Preliminaries</h3>
|
||
<p>The work takes place in an ambient category that fits our needs:</p>
|
||
<pre class="Agda"><a id="627" class="Keyword">open</a> <a id="632" class="Keyword">import</a> <a id="639" href="Category.Ambient.html" class="Module">Category.Ambient</a> <a id="656" class="Keyword">using</a> <a id="662" class="Symbol">(</a><a id="663" href="Category.Ambient.html#1681" class="Record">Ambient</a><a id="670" class="Symbol">)</a>
|
||
</pre>
|
||
<h3 id="delay-monad">Delay Monad</h3>
|
||
<p>We start out by formalizing Capretta’s <em>Delay Monad</em> in a
|
||
categorical setting and then proving that it is strong and
|
||
commutative.</p>
|
||
<pre class="Agda"><a id="833" class="Keyword">open</a> <a id="838" class="Keyword">import</a> <a id="845" href="Monad.Instance.Delay.html" class="Module">Monad.Instance.Delay</a>
|
||
<a id="866" class="Keyword">open</a> <a id="871" class="Keyword">import</a> <a id="878" href="Monad.Instance.Delay.Strong.html" class="Module">Monad.Instance.Delay.Strong</a>
|
||
<a id="906" class="Keyword">open</a> <a id="911" class="Keyword">import</a> <a id="918" href="Monad.Instance.Delay.Commutative.html" class="Module">Monad.Instance.Delay.Commutative</a>
|
||
</pre>
|
||
<p>The next step is to quotient the delay monad by weak bisimilarity,
|
||
but this quotiented structure is not monadic, so we postulate conditions
|
||
under which it extends to a monad.</p>
|
||
<pre class="Agda"><a id="1140" class="Keyword">open</a> <a id="1145" class="Keyword">import</a> <a id="1152" href="Monad.Instance.Delay.Quotienting.html" class="Module">Monad.Instance.Delay.Quotienting</a>
|
||
</pre>
|
||
<h3 id="monad-k">Monad K</h3>
|
||
<p>The goal of this last section is to formalize an equational lifting
|
||
monad <strong>K</strong> that generalizes both the maybe monad and the
|
||
delay monad.</p>
|
||
<p>To do so we first need to look at iteration structures, i.e. functor
|
||
algebras with an iteration operator, these are called <em>Elgot
|
||
Algebras</em>.</p>
|
||
<pre class="Agda"><a id="1493" class="Keyword">open</a> <a id="1498" class="Keyword">import</a> <a id="1505" href="Algebra.Elgot.html" class="Module">Algebra.Elgot</a>
|
||
</pre>
|
||
<p>Afterwards we also introduce categories of iteration algebras with
|
||
iteration preserving morphisms:</p>
|
||
<pre class="Agda"><a id="1632" class="Keyword">open</a> <a id="1637" class="Keyword">import</a> <a id="1644" href="Category.Construction.ElgotAlgebras.html" class="Module">Category.Construction.ElgotAlgebras</a>
|
||
</pre>
|
||
<p>Free Elgot algebras are free objects in the category of Elgot
|
||
algebras, we will be needing a notion of stability for them:</p>
|
||
<pre class="Agda"><a id="1817" class="Keyword">open</a> <a id="1822" class="Keyword">import</a> <a id="1829" href="Algebra.Elgot.Free.html" class="Module">Algebra.Elgot.Free</a>
|
||
<a id="1848" class="Keyword">open</a> <a id="1853" class="Keyword">import</a> <a id="1860" href="Algebra.Elgot.Stable.html" class="Module">Algebra.Elgot.Stable</a>
|
||
</pre>
|
||
In a CCC stability follows directly
|
||
<pre class="Agda"><a id="1930" class="Keyword">open</a> <a id="1935" class="Keyword">import</a> <a id="1942" href="Algebra.Elgot.Properties.html" class="Module">Algebra.Elgot.Properties</a>
|
||
</pre>
|
||
<p>With this in hand we can now define <em>KX</em> as a <em>free Elgot
|
||
algebra</em> and proof that under <em>stability</em> it is a strong
|
||
monad.</p>
|
||
<pre class="Agda"><a id="2104" class="Keyword">open</a> <a id="2109" class="Keyword">import</a> <a id="2116" href="Monad.Instance.K.html" class="Module">Monad.Instance.K</a>
|
||
<a id="2133" class="Keyword">open</a> <a id="2138" class="Keyword">import</a> <a id="2145" href="Monad.Instance.K.Strong.html" class="Module">Monad.Instance.K.Strong</a>
|
||
</pre>
|
||
<p>and with this we can show that K is and equational lifting monad,
|
||
i.e. a commutative monad satisfying the equational lifting law:</p>
|
||
<pre class="Agda"><a id="2313" class="Keyword">open</a> <a id="2318" class="Keyword">import</a> <a id="2325" href="Monad.Instance.K.Commutative.html" class="Module">Monad.Instance.K.Commutative</a>
|
||
<a id="2354" class="Keyword">open</a> <a id="2359" class="Keyword">import</a> <a id="2366" href="Monad.Instance.K.EquationalLifting.html" class="Module">Monad.Instance.K.EquationalLifting</a>
|
||
</pre>
|
||
<p>and lastly we formalize the notion of <em>pre-Elgot monad</em> and
|
||
show that <strong>K</strong> is the initial (strong) pre-Elgot
|
||
monad.</p>
|
||
<pre class="Agda"><a id="2532" class="Keyword">open</a> <a id="2537" class="Keyword">import</a> <a id="2544" href="Monad.PreElgot.html" class="Module">Monad.PreElgot</a>
|
||
<a id="2559" class="Keyword">open</a> <a id="2564" class="Keyword">import</a> <a id="2571" href="Category.Construction.PreElgotMonads.html" class="Module">Category.Construction.PreElgotMonads</a>
|
||
<a id="2608" class="Keyword">open</a> <a id="2613" class="Keyword">import</a> <a id="2620" href="Category.Construction.StrongPreElgotMonads.html" class="Module">Category.Construction.StrongPreElgotMonads</a>
|
||
<a id="2663" class="Keyword">open</a> <a id="2668" class="Keyword">import</a> <a id="2675" href="Monad.Instance.K.PreElgot.html" class="Module">Monad.Instance.K.PreElgot</a>
|
||
<a id="2701" class="Keyword">open</a> <a id="2706" class="Keyword">import</a> <a id="2713" href="Monad.Instance.K.StrongPreElgot.html" class="Module">Monad.Instance.K.StrongPreElgot</a>
|
||
</pre>
|
||
<h3 id="a-case-study-on-setoids">A case study on setoids</h3>
|
||
<p>Lastly we do a case study on the category of setoids.</p>
|
||
<p>First we look at the (quotiented delay monad) on setoids:</p>
|
||
<pre class="Agda"><a id="2900" class="Keyword">open</a> <a id="2905" class="Keyword">import</a> <a id="2912" href="Monad.Instance.Setoids.Delay.html" class="Module">Monad.Instance.Setoids.Delay</a>
|
||
</pre>
|
||
<p>and then we show that it is an instance of K on setoids:</p>
|
||
<pre class="Agda"><a id="3012" class="Keyword">open</a> <a id="3017" class="Keyword">import</a> <a id="3024" href="Monad.Instance.Setoids.K.html" class="Module">Monad.Instance.Setoids.K</a>
|
||
</pre>
|
||
</body>
|
||
</html>
|