bsc-leon-vatthauer/public/Relation.Binary.Core.html

68 lines
19 KiB
HTML
Raw Normal View History

2023-08-19 16:11:22 +02:00
<!DOCTYPE HTML>
<html><head><meta charset="utf-8"><title>Relation.Binary.Core</title><link rel="stylesheet" href="Agda.css"></head><body><pre class="Agda"><a id="1" class="Comment">------------------------------------------------------------------------</a>
<a id="74" class="Comment">-- The Agda standard library</a>
<a id="103" class="Comment">--</a>
<a id="106" class="Comment">-- Properties of binary relations</a>
<a id="140" class="Comment">------------------------------------------------------------------------</a>
<a id="214" class="Comment">-- The contents of this module should be accessed via `Relation.Binary`.</a>
<a id="288" class="Symbol">{-#</a> <a id="292" class="Keyword">OPTIONS</a> <a id="300" class="Pragma">--cubical-compatible</a> <a id="321" class="Pragma">--safe</a> <a id="328" class="Symbol">#-}</a>
<a id="333" class="Keyword">module</a> <a id="340" href="Relation.Binary.Core.html" class="Module">Relation.Binary.Core</a> <a id="361" class="Keyword">where</a>
<a id="368" class="Keyword">open</a> <a id="373" class="Keyword">import</a> <a id="380" href="Data.Product.html" class="Module">Data.Product</a> <a id="393" class="Keyword">using</a> <a id="399" class="Symbol">(</a><a id="400" href="Data.Product.html#1176" class="Function Operator">_×_</a><a id="403" class="Symbol">)</a>
<a id="405" class="Keyword">open</a> <a id="410" class="Keyword">import</a> <a id="417" href="Function.Base.html" class="Module">Function.Base</a> <a id="431" class="Keyword">using</a> <a id="437" class="Symbol">(</a><a id="438" href="Function.Base.html#6294" class="Function Operator">_on_</a><a id="442" class="Symbol">)</a>
<a id="444" class="Keyword">open</a> <a id="449" class="Keyword">import</a> <a id="456" href="Level.html" class="Module">Level</a> <a id="462" class="Keyword">using</a> <a id="468" class="Symbol">(</a><a id="469" href="Agda.Primitive.html#591" class="Postulate">Level</a><a id="474" class="Symbol">;</a> <a id="476" href="Agda.Primitive.html#804" class="Primitive Operator">_⊔_</a><a id="479" class="Symbol">;</a> <a id="481" href="Agda.Primitive.html#774" class="Primitive">suc</a><a id="484" class="Symbol">)</a>
<a id="487" class="Keyword">private</a>
<a id="497" class="Keyword">variable</a>
<a id="510" href="Relation.Binary.Core.html#510" class="Generalizable">a</a> <a id="512" href="Relation.Binary.Core.html#512" class="Generalizable">b</a> <a id="514" href="Relation.Binary.Core.html#514" class="Generalizable">c</a> <a id="516" href="Relation.Binary.Core.html#516" class="Generalizable"></a> <a id="518" href="Relation.Binary.Core.html#518" class="Generalizable">ℓ₁</a> <a id="521" href="Relation.Binary.Core.html#521" class="Generalizable">ℓ₂</a> <a id="524" href="Relation.Binary.Core.html#524" class="Generalizable">ℓ₃</a> <a id="527" class="Symbol">:</a> <a id="529" href="Agda.Primitive.html#591" class="Postulate">Level</a>
<a id="539" href="Relation.Binary.Core.html#539" class="Generalizable">A</a> <a id="541" class="Symbol">:</a> <a id="543" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="547" href="Relation.Binary.Core.html#510" class="Generalizable">a</a>
<a id="553" href="Relation.Binary.Core.html#553" class="Generalizable">B</a> <a id="555" class="Symbol">:</a> <a id="557" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="561" href="Relation.Binary.Core.html#512" class="Generalizable">b</a>
<a id="567" href="Relation.Binary.Core.html#567" class="Generalizable">C</a> <a id="569" class="Symbol">:</a> <a id="571" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="575" href="Relation.Binary.Core.html#514" class="Generalizable">c</a>
<a id="578" class="Comment">------------------------------------------------------------------------</a>
<a id="651" class="Comment">-- Definitions</a>
<a id="666" class="Comment">------------------------------------------------------------------------</a>
<a id="740" class="Comment">-- Heterogeneous binary relations</a>
<a id="REL"></a><a id="775" href="Relation.Binary.Core.html#775" class="Function">REL</a> <a id="779" class="Symbol">:</a> <a id="781" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="785" href="Relation.Binary.Core.html#510" class="Generalizable">a</a> <a id="787" class="Symbol"></a> <a id="789" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="793" href="Relation.Binary.Core.html#512" class="Generalizable">b</a> <a id="795" class="Symbol"></a> <a id="797" class="Symbol">(</a><a id="798" href="Relation.Binary.Core.html#798" class="Bound"></a> <a id="800" class="Symbol">:</a> <a id="802" href="Agda.Primitive.html#591" class="Postulate">Level</a><a id="807" class="Symbol">)</a> <a id="809" class="Symbol"></a> <a id="811" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="815" class="Symbol">(</a><a id="816" href="Relation.Binary.Core.html#510" class="Generalizable">a</a> <a id="818" href="Agda.Primitive.html#804" class="Primitive Operator"></a> <a id="820" href="Relation.Binary.Core.html#512" class="Generalizable">b</a> <a id="822" href="Agda.Primitive.html#804" class="Primitive Operator"></a> <a id="824" href="Agda.Primitive.html#774" class="Primitive">suc</a> <a id="828" href="Relation.Binary.Core.html#798" class="Bound"></a><a id="829" class="Symbol">)</a>
<a id="831" href="Relation.Binary.Core.html#775" class="Function">REL</a> <a id="835" href="Relation.Binary.Core.html#835" class="Bound">A</a> <a id="837" href="Relation.Binary.Core.html#837" class="Bound">B</a> <a id="839" href="Relation.Binary.Core.html#839" class="Bound"></a> <a id="841" class="Symbol">=</a> <a id="843" href="Relation.Binary.Core.html#835" class="Bound">A</a> <a id="845" class="Symbol"></a> <a id="847" href="Relation.Binary.Core.html#837" class="Bound">B</a> <a id="849" class="Symbol"></a> <a id="851" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="855" href="Relation.Binary.Core.html#839" class="Bound"></a>
<a id="858" class="Comment">-- Homogeneous binary relations</a>
<a id="Rel"></a><a id="891" href="Relation.Binary.Core.html#891" class="Function">Rel</a> <a id="895" class="Symbol">:</a> <a id="897" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="901" href="Relation.Binary.Core.html#510" class="Generalizable">a</a> <a id="903" class="Symbol"></a> <a id="905" class="Symbol">(</a><a id="906" href="Relation.Binary.Core.html#906" class="Bound"></a> <a id="908" class="Symbol">:</a> <a id="910" href="Agda.Primitive.html#591" class="Postulate">Level</a><a id="915" class="Symbol">)</a> <a id="917" class="Symbol"></a> <a id="919" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="923" class="Symbol">(</a><a id="924" href="Relation.Binary.Core.html#510" class="Generalizable">a</a> <a id="926" href="Agda.Primitive.html#804" class="Primitive Operator"></a> <a id="928" href="Agda.Primitive.html#774" class="Primitive">suc</a> <a id="932" href="Relation.Binary.Core.html#906" class="Bound"></a><a id="933" class="Symbol">)</a>
<a id="935" href="Relation.Binary.Core.html#891" class="Function">Rel</a> <a id="939" href="Relation.Binary.Core.html#939" class="Bound">A</a> <a id="941" href="Relation.Binary.Core.html#941" class="Bound"></a> <a id="943" class="Symbol">=</a> <a id="945" href="Relation.Binary.Core.html#775" class="Function">REL</a> <a id="949" href="Relation.Binary.Core.html#939" class="Bound">A</a> <a id="951" href="Relation.Binary.Core.html#939" class="Bound">A</a> <a id="953" href="Relation.Binary.Core.html#941" class="Bound"></a>
<a id="956" class="Comment">------------------------------------------------------------------------</a>
<a id="1029" class="Comment">-- Relationships between relations</a>
<a id="1064" class="Comment">------------------------------------------------------------------------</a>
<a id="1138" class="Keyword">infix</a> <a id="1144" class="Number">4</a> <a id="1146" href="Relation.Binary.Core.html#1263" class="Function Operator">_⇒_</a> <a id="1150" href="Relation.Binary.Core.html#1334" class="Function Operator">_⇔_</a> <a id="1154" href="Relation.Binary.Core.html#1469" class="Function Operator">_=[_]⇒_</a>
<a id="1163" class="Comment">-- Implication/containment - could also be written _⊆_.</a>
<a id="1219" class="Comment">-- and corresponding notion of equivalence</a>
<a id="_⇒_"></a><a id="1263" href="Relation.Binary.Core.html#1263" class="Function Operator">_⇒_</a> <a id="1267" class="Symbol">:</a> <a id="1269" href="Relation.Binary.Core.html#775" class="Function">REL</a> <a id="1273" href="Relation.Binary.Core.html#539" class="Generalizable">A</a> <a id="1275" href="Relation.Binary.Core.html#553" class="Generalizable">B</a> <a id="1277" href="Relation.Binary.Core.html#518" class="Generalizable">ℓ₁</a> <a id="1280" class="Symbol"></a> <a id="1282" href="Relation.Binary.Core.html#775" class="Function">REL</a> <a id="1286" href="Relation.Binary.Core.html#539" class="Generalizable">A</a> <a id="1288" href="Relation.Binary.Core.html#553" class="Generalizable">B</a> <a id="1290" href="Relation.Binary.Core.html#521" class="Generalizable">ℓ₂</a> <a id="1293" class="Symbol"></a> <a id="1295" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1299" class="Symbol">_</a>
<a id="1301" href="Relation.Binary.Core.html#1301" class="Bound">P</a> <a id="1303" href="Relation.Binary.Core.html#1263" class="Function Operator"></a> <a id="1305" href="Relation.Binary.Core.html#1305" class="Bound">Q</a> <a id="1307" class="Symbol">=</a> <a id="1309" class="Symbol"></a> <a id="1311" class="Symbol">{</a><a id="1312" href="Relation.Binary.Core.html#1312" class="Bound">x</a> <a id="1314" href="Relation.Binary.Core.html#1314" class="Bound">y</a><a id="1315" class="Symbol">}</a> <a id="1317" class="Symbol"></a> <a id="1319" href="Relation.Binary.Core.html#1301" class="Bound">P</a> <a id="1321" href="Relation.Binary.Core.html#1312" class="Bound">x</a> <a id="1323" href="Relation.Binary.Core.html#1314" class="Bound">y</a> <a id="1325" class="Symbol"></a> <a id="1327" href="Relation.Binary.Core.html#1305" class="Bound">Q</a> <a id="1329" href="Relation.Binary.Core.html#1312" class="Bound">x</a> <a id="1331" href="Relation.Binary.Core.html#1314" class="Bound">y</a>
<a id="_⇔_"></a><a id="1334" href="Relation.Binary.Core.html#1334" class="Function Operator">_⇔_</a> <a id="1338" class="Symbol">:</a> <a id="1340" href="Relation.Binary.Core.html#775" class="Function">REL</a> <a id="1344" href="Relation.Binary.Core.html#539" class="Generalizable">A</a> <a id="1346" href="Relation.Binary.Core.html#553" class="Generalizable">B</a> <a id="1348" href="Relation.Binary.Core.html#518" class="Generalizable">ℓ₁</a> <a id="1351" class="Symbol"></a> <a id="1353" href="Relation.Binary.Core.html#775" class="Function">REL</a> <a id="1357" href="Relation.Binary.Core.html#539" class="Generalizable">A</a> <a id="1359" href="Relation.Binary.Core.html#553" class="Generalizable">B</a> <a id="1361" href="Relation.Binary.Core.html#521" class="Generalizable">ℓ₂</a> <a id="1364" class="Symbol"></a> <a id="1366" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1370" class="Symbol">_</a>
<a id="1372" href="Relation.Binary.Core.html#1372" class="Bound">P</a> <a id="1374" href="Relation.Binary.Core.html#1334" class="Function Operator"></a> <a id="1376" href="Relation.Binary.Core.html#1376" class="Bound">Q</a> <a id="1378" class="Symbol">=</a> <a id="1380" href="Relation.Binary.Core.html#1372" class="Bound">P</a> <a id="1382" href="Relation.Binary.Core.html#1263" class="Function Operator"></a> <a id="1384" href="Relation.Binary.Core.html#1376" class="Bound">Q</a> <a id="1386" href="Data.Product.html#1176" class="Function Operator">×</a> <a id="1388" href="Relation.Binary.Core.html#1376" class="Bound">Q</a> <a id="1390" href="Relation.Binary.Core.html#1263" class="Function Operator"></a> <a id="1392" href="Relation.Binary.Core.html#1372" class="Bound">P</a>
<a id="1395" class="Comment">-- Generalised implication - if P ≡ Q it can be read as &quot;f preserves P&quot;.</a>
<a id="_=[_]⇒_"></a><a id="1469" href="Relation.Binary.Core.html#1469" class="Function Operator">_=[_]⇒_</a> <a id="1477" class="Symbol">:</a> <a id="1479" href="Relation.Binary.Core.html#891" class="Function">Rel</a> <a id="1483" href="Relation.Binary.Core.html#539" class="Generalizable">A</a> <a id="1485" href="Relation.Binary.Core.html#518" class="Generalizable">ℓ₁</a> <a id="1488" class="Symbol"></a> <a id="1490" class="Symbol">(</a><a id="1491" href="Relation.Binary.Core.html#539" class="Generalizable">A</a> <a id="1493" class="Symbol"></a> <a id="1495" href="Relation.Binary.Core.html#553" class="Generalizable">B</a><a id="1496" class="Symbol">)</a> <a id="1498" class="Symbol"></a> <a id="1500" href="Relation.Binary.Core.html#891" class="Function">Rel</a> <a id="1504" href="Relation.Binary.Core.html#553" class="Generalizable">B</a> <a id="1506" href="Relation.Binary.Core.html#521" class="Generalizable">ℓ₂</a> <a id="1509" class="Symbol"></a> <a id="1511" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1515" class="Symbol">_</a>
<a id="1517" href="Relation.Binary.Core.html#1517" class="Bound">P</a> <a id="1519" href="Relation.Binary.Core.html#1469" class="Function Operator">=[</a> <a id="1522" href="Relation.Binary.Core.html#1522" class="Bound">f</a> <a id="1524" href="Relation.Binary.Core.html#1469" class="Function Operator">]⇒</a> <a id="1527" href="Relation.Binary.Core.html#1527" class="Bound">Q</a> <a id="1529" class="Symbol">=</a> <a id="1531" href="Relation.Binary.Core.html#1517" class="Bound">P</a> <a id="1533" href="Relation.Binary.Core.html#1263" class="Function Operator"></a> <a id="1535" class="Symbol">(</a><a id="1536" href="Relation.Binary.Core.html#1527" class="Bound">Q</a> <a id="1538" href="Function.Base.html#6294" class="Function Operator">on</a> <a id="1541" href="Relation.Binary.Core.html#1522" class="Bound">f</a><a id="1542" class="Symbol">)</a>
<a id="1545" class="Comment">-- A synonym for _=[_]⇒_.</a>
<a id="_Preserves_⟶_"></a><a id="1572" href="Relation.Binary.Core.html#1572" class="Function Operator">_Preserves_⟶_</a> <a id="1586" class="Symbol">:</a> <a id="1588" class="Symbol">(</a><a id="1589" href="Relation.Binary.Core.html#539" class="Generalizable">A</a> <a id="1591" class="Symbol"></a> <a id="1593" href="Relation.Binary.Core.html#553" class="Generalizable">B</a><a id="1594" class="Symbol">)</a> <a id="1596" class="Symbol"></a> <a id="1598" href="Relation.Binary.Core.html#891" class="Function">Rel</a> <a id="1602" href="Relation.Binary.Core.html#539" class="Generalizable">A</a> <a id="1604" href="Relation.Binary.Core.html#518" class="Generalizable">ℓ₁</a> <a id="1607" class="Symbol"></a> <a id="1609" href="Relation.Binary.Core.html#891" class="Function">Rel</a> <a id="1613" href="Relation.Binary.Core.html#553" class="Generalizable">B</a> <a id="1615" href="Relation.Binary.Core.html#521" class="Generalizable">ℓ₂</a> <a id="1618" class="Symbol"></a> <a id="1620" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1624" class="Symbol">_</a>
<a id="1626" href="Relation.Binary.Core.html#1626" class="Bound">f</a> <a id="1628" href="Relation.Binary.Core.html#1572" class="Function Operator">Preserves</a> <a id="1638" href="Relation.Binary.Core.html#1638" class="Bound">P</a> <a id="1640" href="Relation.Binary.Core.html#1572" class="Function Operator"></a> <a id="1642" href="Relation.Binary.Core.html#1642" class="Bound">Q</a> <a id="1644" class="Symbol">=</a> <a id="1646" href="Relation.Binary.Core.html#1638" class="Bound">P</a> <a id="1648" href="Relation.Binary.Core.html#1469" class="Function Operator">=[</a> <a id="1651" href="Relation.Binary.Core.html#1626" class="Bound">f</a> <a id="1653" href="Relation.Binary.Core.html#1469" class="Function Operator">]⇒</a> <a id="1656" href="Relation.Binary.Core.html#1642" class="Bound">Q</a>
<a id="1659" class="Comment">-- A binary variant of _Preserves_⟶_.</a>
<a id="_Preserves₂_⟶_⟶_"></a><a id="1698" href="Relation.Binary.Core.html#1698" class="Function Operator">_Preserves₂_⟶_⟶_</a> <a id="1715" class="Symbol">:</a> <a id="1717" class="Symbol">(</a><a id="1718" href="Relation.Binary.Core.html#539" class="Generalizable">A</a> <a id="1720" class="Symbol"></a> <a id="1722" href="Relation.Binary.Core.html#553" class="Generalizable">B</a> <a id="1724" class="Symbol"></a> <a id="1726" href="Relation.Binary.Core.html#567" class="Generalizable">C</a><a id="1727" class="Symbol">)</a> <a id="1729" class="Symbol"></a> <a id="1731" href="Relation.Binary.Core.html#891" class="Function">Rel</a> <a id="1735" href="Relation.Binary.Core.html#539" class="Generalizable">A</a> <a id="1737" href="Relation.Binary.Core.html#518" class="Generalizable">ℓ₁</a> <a id="1740" class="Symbol"></a> <a id="1742" href="Relation.Binary.Core.html#891" class="Function">Rel</a> <a id="1746" href="Relation.Binary.Core.html#553" class="Generalizable">B</a> <a id="1748" href="Relation.Binary.Core.html#521" class="Generalizable">ℓ₂</a> <a id="1751" class="Symbol"></a> <a id="1753" href="Relation.Binary.Core.html#891" class="Function">Rel</a> <a id="1757" href="Relation.Binary.Core.html#567" class="Generalizable">C</a> <a id="1759" href="Relation.Binary.Core.html#524" class="Generalizable">ℓ₃</a> <a id="1762" class="Symbol"></a> <a id="1764" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1768" class="Symbol">_</a>
<a id="1770" href="Relation.Binary.Core.html#1770" class="Bound Operator">_∙_</a> <a id="1774" href="Relation.Binary.Core.html#1698" class="Function Operator">Preserves₂</a> <a id="1785" href="Relation.Binary.Core.html#1785" class="Bound">P</a> <a id="1787" href="Relation.Binary.Core.html#1698" class="Function Operator"></a> <a id="1789" href="Relation.Binary.Core.html#1789" class="Bound">Q</a> <a id="1791" href="Relation.Binary.Core.html#1698" class="Function Operator"></a> <a id="1793" href="Relation.Binary.Core.html#1793" class="Bound">R</a> <a id="1795" class="Symbol">=</a> <a id="1797" class="Symbol"></a> <a id="1799" class="Symbol">{</a><a id="1800" href="Relation.Binary.Core.html#1800" class="Bound">x</a> <a id="1802" href="Relation.Binary.Core.html#1802" class="Bound">y</a> <a id="1804" href="Relation.Binary.Core.html#1804" class="Bound">u</a> <a id="1806" href="Relation.Binary.Core.html#1806" class="Bound">v</a><a id="1807" class="Symbol">}</a> <a id="1809" class="Symbol"></a> <a id="1811" href="Relation.Binary.Core.html#1785" class="Bound">P</a> <a id="1813" href="Relation.Binary.Core.html#1800" class="Bound">x</a> <a id="1815" href="Relation.Binary.Core.html#1802" class="Bound">y</a> <a id="1817" class="Symbol"></a> <a id="1819" href="Relation.Binary.Core.html#1789" class="Bound">Q</a> <a id="1821" href="Relation.Binary.Core.html#1804" class="Bound">u</a> <a id="1823" href="Relation.Binary.Core.html#1806" class="Bound">v</a> <a id="1825" class="Symbol"></a> <a id="1827" href="Relation.Binary.Core.html#1793" class="Bound">R</a> <a id="1829" class="Symbol">(</a><a id="1830" href="Relation.Binary.Core.html#1800" class="Bound">x</a> <a id="1832" href="Relation.Binary.Core.html#1770" class="Bound Operator"></a> <a id="1834" href="Relation.Binary.Core.html#1804" class="Bound">u</a><a id="1835" class="Symbol">)</a> <a id="1837" class="Symbol">(</a><a id="1838" href="Relation.Binary.Core.html#1802" class="Bound">y</a> <a id="1840" href="Relation.Binary.Core.html#1770" class="Bound Operator"></a> <a id="1842" href="Relation.Binary.Core.html#1806" class="Bound">v</a><a id="1843" class="Symbol">)</a>
</pre></body></html>