bsc-leon-vatthauer/agda/bsc-thesis/Categories.Category.Restriction.html
2024-02-09 17:53:52 +01:00

47 lines
No EOL
18 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE HTML>
<html><head><meta charset="utf-8"><title>Categories.Category.Restriction</title><link rel="stylesheet" href="Agda.css"></head><body><pre class="Agda"><a id="1" class="Symbol">{-#</a> <a id="5" class="Keyword">OPTIONS</a> <a id="13" class="Pragma">--without-K</a> <a id="25" class="Pragma">--safe</a> <a id="32" class="Symbol">#-}</a>
<a id="37" class="Comment">-- Defines Restriction Category</a>
<a id="69" class="Comment">-- https://ncatlab.org/nlab/show/restriction+category</a>
<a id="125" class="Comment">-- but see also</a>
<a id="141" class="Comment">-- https://github.com/jmchapman/restriction-categories</a>
<a id="199" class="Comment">-- Notation choice: one of the interpretations is that the</a>
<a id="258" class="Comment">-- restriction structure captures the &quot;domain of definedness&quot;</a>
<a id="320" class="Comment">-- of a morphism, as a (partial) identity. As this is positive</a>
<a id="383" class="Comment">-- information, we will use f ↓ (as a postfix operation) to</a>
<a id="443" class="Comment">-- denote this. Note that computability theory uses the same</a>
<a id="504" class="Comment">-- notation to mean definedness.</a>
<a id="538" class="Comment">-- Note, as we&#39;re working in Setoid-Enriched Categories, we need</a>
<a id="603" class="Comment">-- to add an explicit axiom, that ↓ preserves ≈</a>
<a id="651" class="Keyword">module</a> <a id="658" href="Categories.Category.Restriction.html" class="Module">Categories.Category.Restriction</a> <a id="690" class="Keyword">where</a>
<a id="697" class="Keyword">open</a> <a id="702" class="Keyword">import</a> <a id="709" href="Level.html" class="Module">Level</a> <a id="715" class="Keyword">using</a> <a id="721" class="Symbol">(</a><a id="722" href="Agda.Primitive.html#742" class="Postulate">Level</a><a id="727" class="Symbol">;</a> <a id="729" href="Agda.Primitive.html#961" class="Primitive Operator">_⊔_</a><a id="732" class="Symbol">)</a>
<a id="735" class="Keyword">open</a> <a id="740" class="Keyword">import</a> <a id="747" href="Categories.Category.Core.html" class="Module">Categories.Category.Core</a> <a id="772" class="Keyword">using</a> <a id="778" class="Symbol">(</a><a id="779" href="Categories.Category.Core.html#442" class="Record">Category</a><a id="787" class="Symbol">)</a>
<a id="790" class="Keyword">private</a>
<a id="800" class="Keyword">variable</a>
<a id="813" href="Categories.Category.Restriction.html#813" class="Generalizable">o</a> <a id="815" href="Categories.Category.Restriction.html#815" class="Generalizable"></a> <a id="817" href="Categories.Category.Restriction.html#817" class="Generalizable">e</a> <a id="819" class="Symbol">:</a> <a id="821" href="Agda.Primitive.html#742" class="Postulate">Level</a>
<a id="828" class="Keyword">record</a> <a id="Restriction"></a><a id="835" href="Categories.Category.Restriction.html#835" class="Record">Restriction</a> <a id="847" class="Symbol">(</a><a id="848" href="Categories.Category.Restriction.html#848" class="Bound">C</a> <a id="850" class="Symbol">:</a> <a id="852" href="Categories.Category.Core.html#442" class="Record">Category</a> <a id="861" href="Categories.Category.Restriction.html#813" class="Generalizable">o</a> <a id="863" href="Categories.Category.Restriction.html#815" class="Generalizable"></a> <a id="865" href="Categories.Category.Restriction.html#817" class="Generalizable">e</a><a id="866" class="Symbol">)</a> <a id="868" class="Symbol">:</a> <a id="870" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="874" class="Symbol">(</a><a id="875" href="Categories.Category.Restriction.html#861" class="Bound">o</a> <a id="877" href="Agda.Primitive.html#961" class="Primitive Operator"></a> <a id="879" href="Categories.Category.Restriction.html#863" class="Bound"></a> <a id="881" href="Agda.Primitive.html#961" class="Primitive Operator"></a> <a id="883" href="Categories.Category.Restriction.html#865" class="Bound">e</a><a id="884" class="Symbol">)</a> <a id="886" class="Keyword">where</a>
<a id="894" class="Keyword">open</a> <a id="899" href="Categories.Category.Core.html#442" class="Module">Category</a> <a id="908" href="Categories.Category.Restriction.html#848" class="Bound">C</a> <a id="910" class="Keyword">using</a> <a id="916" class="Symbol">(</a><a id="917" href="Categories.Category.Core.html#559" class="Field">Obj</a><a id="920" class="Symbol">;</a> <a id="922" href="Categories.Category.Core.html#575" class="Field Operator">_⇒_</a><a id="925" class="Symbol">;</a> <a id="927" href="Categories.Category.Core.html#656" class="Field Operator">_∘_</a><a id="930" class="Symbol">;</a> <a id="932" href="Categories.Category.Core.html#595" class="Field Operator">_≈_</a><a id="935" class="Symbol">;</a> <a id="937" href="Categories.Category.Core.html#630" class="Field">id</a><a id="939" class="Symbol">)</a>
<a id="944" class="Keyword">field</a>
<a id="Restriction._↓"></a><a id="954" href="Categories.Category.Restriction.html#954" class="Field Operator">_↓</a> <a id="957" class="Symbol">:</a> <a id="960" class="Symbol">{</a><a id="961" href="Categories.Category.Restriction.html#961" class="Bound">A</a> <a id="963" href="Categories.Category.Restriction.html#963" class="Bound">B</a> <a id="965" class="Symbol">:</a> <a id="967" href="Categories.Category.Core.html#559" class="Function">Obj</a><a id="970" class="Symbol">}</a> <a id="972" class="Symbol"></a> <a id="974" href="Categories.Category.Restriction.html#961" class="Bound">A</a> <a id="976" href="Categories.Category.Core.html#575" class="Function Operator"></a> <a id="978" href="Categories.Category.Restriction.html#963" class="Bound">B</a> <a id="980" class="Symbol"></a> <a id="982" href="Categories.Category.Restriction.html#961" class="Bound">A</a> <a id="984" href="Categories.Category.Core.html#575" class="Function Operator"></a> <a id="986" href="Categories.Category.Restriction.html#961" class="Bound">A</a>
<a id="992" class="Comment">-- partial identity on the right</a>
<a id="Restriction.pidʳ"></a><a id="1029" href="Categories.Category.Restriction.html#1029" class="Field">pidʳ</a> <a id="1034" class="Symbol">:</a> <a id="1036" class="Symbol">{</a><a id="1037" href="Categories.Category.Restriction.html#1037" class="Bound">A</a> <a id="1039" href="Categories.Category.Restriction.html#1039" class="Bound">B</a> <a id="1041" class="Symbol">:</a> <a id="1043" href="Categories.Category.Core.html#559" class="Function">Obj</a><a id="1046" class="Symbol">}</a> <a id="1048" class="Symbol">{</a><a id="1049" href="Categories.Category.Restriction.html#1049" class="Bound">f</a> <a id="1051" class="Symbol">:</a> <a id="1053" href="Categories.Category.Restriction.html#1037" class="Bound">A</a> <a id="1055" href="Categories.Category.Core.html#575" class="Function Operator"></a> <a id="1057" href="Categories.Category.Restriction.html#1039" class="Bound">B</a><a id="1058" class="Symbol">}</a> <a id="1060" class="Symbol"></a> <a id="1062" href="Categories.Category.Restriction.html#1049" class="Bound">f</a> <a id="1064" href="Categories.Category.Core.html#656" class="Function Operator"></a> <a id="1066" href="Categories.Category.Restriction.html#1049" class="Bound">f</a> <a id="1068" href="Categories.Category.Restriction.html#954" class="Field Operator"></a> <a id="1070" href="Categories.Category.Core.html#595" class="Function Operator"></a> <a id="1072" href="Categories.Category.Restriction.html#1049" class="Bound">f</a>
<a id="1078" class="Comment">-- the domain-of-definition arrows commute</a>
<a id="Restriction.↓-comm"></a><a id="1125" href="Categories.Category.Restriction.html#1125" class="Field">↓-comm</a> <a id="1132" class="Symbol">:</a> <a id="1134" class="Symbol">{</a><a id="1135" href="Categories.Category.Restriction.html#1135" class="Bound">A</a> <a id="1137" href="Categories.Category.Restriction.html#1137" class="Bound">B</a> <a id="1139" href="Categories.Category.Restriction.html#1139" class="Bound">C</a> <a id="1141" class="Symbol">:</a> <a id="1143" href="Categories.Category.Core.html#559" class="Function">Obj</a><a id="1146" class="Symbol">}</a> <a id="1148" class="Symbol">{</a><a id="1149" href="Categories.Category.Restriction.html#1149" class="Bound">f</a> <a id="1151" class="Symbol">:</a> <a id="1153" href="Categories.Category.Restriction.html#1135" class="Bound">A</a> <a id="1155" href="Categories.Category.Core.html#575" class="Function Operator"></a> <a id="1157" href="Categories.Category.Restriction.html#1137" class="Bound">B</a><a id="1158" class="Symbol">}</a> <a id="1160" class="Symbol">{</a><a id="1161" href="Categories.Category.Restriction.html#1161" class="Bound">g</a> <a id="1163" class="Symbol">:</a> <a id="1165" href="Categories.Category.Restriction.html#1135" class="Bound">A</a> <a id="1167" href="Categories.Category.Core.html#575" class="Function Operator"></a> <a id="1169" href="Categories.Category.Restriction.html#1139" class="Bound">C</a><a id="1170" class="Symbol">}</a> <a id="1172" class="Symbol"></a> <a id="1174" href="Categories.Category.Restriction.html#1149" class="Bound">f</a> <a id="1176" href="Categories.Category.Restriction.html#954" class="Field Operator"></a> <a id="1178" href="Categories.Category.Core.html#656" class="Function Operator"></a> <a id="1180" href="Categories.Category.Restriction.html#1161" class="Bound">g</a> <a id="1182" href="Categories.Category.Restriction.html#954" class="Field Operator"></a> <a id="1184" href="Categories.Category.Core.html#595" class="Function Operator"></a> <a id="1186" href="Categories.Category.Restriction.html#1161" class="Bound">g</a> <a id="1188" href="Categories.Category.Restriction.html#954" class="Field Operator"></a> <a id="1190" href="Categories.Category.Core.html#656" class="Function Operator"></a> <a id="1192" href="Categories.Category.Restriction.html#1149" class="Bound">f</a> <a id="1194" href="Categories.Category.Restriction.html#954" class="Field Operator"></a>
<a id="1200" class="Comment">-- domain-of-definition denests (on the right)</a>
<a id="Restriction.↓-denestʳ"></a><a id="1251" href="Categories.Category.Restriction.html#1251" class="Field">↓-denestʳ</a> <a id="1261" class="Symbol">:</a> <a id="1263" class="Symbol">{</a><a id="1264" href="Categories.Category.Restriction.html#1264" class="Bound">A</a> <a id="1266" href="Categories.Category.Restriction.html#1266" class="Bound">B</a> <a id="1268" href="Categories.Category.Restriction.html#1268" class="Bound">C</a> <a id="1270" class="Symbol">:</a> <a id="1272" href="Categories.Category.Core.html#559" class="Function">Obj</a><a id="1275" class="Symbol">}</a> <a id="1277" class="Symbol">{</a><a id="1278" href="Categories.Category.Restriction.html#1278" class="Bound">f</a> <a id="1280" class="Symbol">:</a> <a id="1282" href="Categories.Category.Restriction.html#1264" class="Bound">A</a> <a id="1284" href="Categories.Category.Core.html#575" class="Function Operator"></a> <a id="1286" href="Categories.Category.Restriction.html#1266" class="Bound">B</a><a id="1287" class="Symbol">}</a> <a id="1289" class="Symbol">{</a><a id="1290" href="Categories.Category.Restriction.html#1290" class="Bound">g</a> <a id="1292" class="Symbol">:</a> <a id="1294" href="Categories.Category.Restriction.html#1264" class="Bound">A</a> <a id="1296" href="Categories.Category.Core.html#575" class="Function Operator"></a> <a id="1298" href="Categories.Category.Restriction.html#1268" class="Bound">C</a><a id="1299" class="Symbol">}</a> <a id="1301" class="Symbol"></a> <a id="1303" class="Symbol">(</a><a id="1304" href="Categories.Category.Restriction.html#1290" class="Bound">g</a> <a id="1306" href="Categories.Category.Core.html#656" class="Function Operator"></a> <a id="1308" href="Categories.Category.Restriction.html#1278" class="Bound">f</a> <a id="1310" href="Categories.Category.Restriction.html#954" class="Field Operator"></a><a id="1311" class="Symbol">)</a> <a id="1313" href="Categories.Category.Restriction.html#954" class="Field Operator"></a> <a id="1315" href="Categories.Category.Core.html#595" class="Function Operator"></a> <a id="1317" href="Categories.Category.Restriction.html#1290" class="Bound">g</a> <a id="1319" href="Categories.Category.Restriction.html#954" class="Field Operator"></a> <a id="1321" href="Categories.Category.Core.html#656" class="Function Operator"></a> <a id="1323" href="Categories.Category.Restriction.html#1278" class="Bound">f</a> <a id="1325" href="Categories.Category.Restriction.html#954" class="Field Operator"></a>
<a id="1331" class="Comment">-- domain-of-definition has a skew-commutative law</a>
<a id="Restriction.↓-skew-comm"></a><a id="1386" href="Categories.Category.Restriction.html#1386" class="Field">↓-skew-comm</a> <a id="1398" class="Symbol">:</a> <a id="1400" class="Symbol">{</a><a id="1401" href="Categories.Category.Restriction.html#1401" class="Bound">A</a> <a id="1403" href="Categories.Category.Restriction.html#1403" class="Bound">B</a> <a id="1405" href="Categories.Category.Restriction.html#1405" class="Bound">C</a> <a id="1407" class="Symbol">:</a> <a id="1409" href="Categories.Category.Core.html#559" class="Function">Obj</a><a id="1412" class="Symbol">}</a> <a id="1414" class="Symbol">{</a><a id="1415" href="Categories.Category.Restriction.html#1415" class="Bound">g</a> <a id="1417" class="Symbol">:</a> <a id="1419" href="Categories.Category.Restriction.html#1401" class="Bound">A</a> <a id="1421" href="Categories.Category.Core.html#575" class="Function Operator"></a> <a id="1423" href="Categories.Category.Restriction.html#1403" class="Bound">B</a><a id="1424" class="Symbol">}</a> <a id="1426" class="Symbol">{</a><a id="1427" href="Categories.Category.Restriction.html#1427" class="Bound">f</a> <a id="1429" class="Symbol">:</a> <a id="1431" href="Categories.Category.Restriction.html#1405" class="Bound">C</a> <a id="1433" href="Categories.Category.Core.html#575" class="Function Operator"></a> <a id="1435" href="Categories.Category.Restriction.html#1401" class="Bound">A</a><a id="1436" class="Symbol">}</a> <a id="1438" class="Symbol"></a> <a id="1440" href="Categories.Category.Restriction.html#1415" class="Bound">g</a> <a id="1442" href="Categories.Category.Restriction.html#954" class="Field Operator"></a> <a id="1444" href="Categories.Category.Core.html#656" class="Function Operator"></a> <a id="1446" href="Categories.Category.Restriction.html#1427" class="Bound">f</a> <a id="1448" href="Categories.Category.Core.html#595" class="Function Operator"></a> <a id="1450" href="Categories.Category.Restriction.html#1427" class="Bound">f</a> <a id="1452" href="Categories.Category.Core.html#656" class="Function Operator"></a> <a id="1454" class="Symbol">(</a><a id="1455" href="Categories.Category.Restriction.html#1415" class="Bound">g</a> <a id="1457" href="Categories.Category.Core.html#656" class="Function Operator"></a> <a id="1459" href="Categories.Category.Restriction.html#1427" class="Bound">f</a><a id="1460" class="Symbol">)</a> <a id="1462" href="Categories.Category.Restriction.html#954" class="Field Operator"></a>
<a id="1468" class="Comment">-- and the new axiom, ↓ is a congruence</a>
<a id="Restriction.↓-cong"></a><a id="1512" href="Categories.Category.Restriction.html#1512" class="Field">↓-cong</a> <a id="1519" class="Symbol">:</a> <a id="1521" class="Symbol">{</a><a id="1522" href="Categories.Category.Restriction.html#1522" class="Bound">A</a> <a id="1524" href="Categories.Category.Restriction.html#1524" class="Bound">B</a> <a id="1526" class="Symbol">:</a> <a id="1528" href="Categories.Category.Core.html#559" class="Function">Obj</a><a id="1531" class="Symbol">}</a> <a id="1533" class="Symbol">{</a><a id="1534" href="Categories.Category.Restriction.html#1534" class="Bound">f</a> <a id="1536" href="Categories.Category.Restriction.html#1536" class="Bound">g</a> <a id="1538" class="Symbol">:</a> <a id="1540" href="Categories.Category.Restriction.html#1522" class="Bound">A</a> <a id="1542" href="Categories.Category.Core.html#575" class="Function Operator"></a> <a id="1544" href="Categories.Category.Restriction.html#1524" class="Bound">B</a><a id="1545" class="Symbol">}</a> <a id="1547" class="Symbol"></a> <a id="1549" href="Categories.Category.Restriction.html#1534" class="Bound">f</a> <a id="1551" href="Categories.Category.Core.html#595" class="Function Operator"></a> <a id="1553" href="Categories.Category.Restriction.html#1536" class="Bound">g</a> <a id="1555" class="Symbol"></a> <a id="1557" href="Categories.Category.Restriction.html#1534" class="Bound">f</a> <a id="1559" href="Categories.Category.Restriction.html#954" class="Field Operator"></a> <a id="1561" href="Categories.Category.Core.html#595" class="Function Operator"></a> <a id="1563" href="Categories.Category.Restriction.html#1536" class="Bound">g</a> <a id="1565" href="Categories.Category.Restriction.html#954" class="Field Operator"></a>
<a id="1570" class="Comment">-- it is convenient to define the total predicate in this context</a>
<a id="Restriction.total"></a><a id="1638" href="Categories.Category.Restriction.html#1638" class="Function">total</a> <a id="1644" class="Symbol">:</a> <a id="1646" class="Symbol">{</a><a id="1647" href="Categories.Category.Restriction.html#1647" class="Bound">A</a> <a id="1649" href="Categories.Category.Restriction.html#1649" class="Bound">B</a> <a id="1651" class="Symbol">:</a> <a id="1653" href="Categories.Category.Core.html#559" class="Function">Obj</a><a id="1656" class="Symbol">}</a> <a id="1658" class="Symbol">(</a><a id="1659" href="Categories.Category.Restriction.html#1659" class="Bound">f</a> <a id="1661" class="Symbol">:</a> <a id="1663" href="Categories.Category.Restriction.html#1647" class="Bound">A</a> <a id="1665" href="Categories.Category.Core.html#575" class="Function Operator"></a> <a id="1667" href="Categories.Category.Restriction.html#1649" class="Bound">B</a><a id="1668" class="Symbol">)</a> <a id="1670" class="Symbol"></a> <a id="1672" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1676" href="Categories.Category.Restriction.html#865" class="Bound">e</a>
<a id="1680" href="Categories.Category.Restriction.html#1638" class="Function">total</a> <a id="1686" href="Categories.Category.Restriction.html#1686" class="Bound">f</a> <a id="1688" class="Symbol">=</a> <a id="1690" href="Categories.Category.Restriction.html#1686" class="Bound">f</a> <a id="1692" href="Categories.Category.Restriction.html#954" class="Field Operator"></a> <a id="1694" href="Categories.Category.Core.html#595" class="Function Operator"></a> <a id="1696" href="Categories.Category.Core.html#630" class="Function">id</a>
</pre></body></html>