bsc-leon-vatthauer/agda/bsc-thesis/Function.Definitions.html

66 lines
21 KiB
HTML
Raw Normal View History

2024-02-09 17:53:52 +01:00
<!DOCTYPE HTML>
<html><head><meta charset="utf-8"><title>Function.Definitions</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">-- Definitions for types of functions.</a>
<a id="145" class="Comment">------------------------------------------------------------------------</a>
<a id="219" class="Comment">-- The contents of this file should usually be accessed from `Function`.</a>
<a id="293" class="Symbol">{-#</a> <a id="297" class="Keyword">OPTIONS</a> <a id="305" class="Pragma">--cubical-compatible</a> <a id="326" class="Pragma">--safe</a> <a id="333" class="Symbol">#-}</a>
<a id="338" class="Keyword">module</a> <a id="345" href="Function.Definitions.html" class="Module">Function.Definitions</a> <a id="366" class="Keyword">where</a>
<a id="373" class="Keyword">open</a> <a id="378" class="Keyword">import</a> <a id="385" href="Data.Product.Base.html" class="Module">Data.Product.Base</a> <a id="403" class="Keyword">using</a> <a id="409" class="Symbol">(</a><a id="410" href="Data.Product.Base.html#852" class="Function"></a><a id="411" class="Symbol">;</a> <a id="413" href="Data.Product.Base.html#1618" class="Function Operator">_×_</a><a id="416" class="Symbol">)</a>
<a id="418" class="Keyword">open</a> <a id="423" class="Keyword">import</a> <a id="430" href="Level.html" class="Module">Level</a> <a id="436" class="Keyword">using</a> <a id="442" class="Symbol">(</a><a id="443" href="Agda.Primitive.html#742" class="Postulate">Level</a><a id="448" class="Symbol">)</a>
<a id="450" class="Keyword">open</a> <a id="455" class="Keyword">import</a> <a id="462" href="Relation.Binary.Core.html" class="Module">Relation.Binary.Core</a> <a id="483" class="Keyword">using</a> <a id="489" class="Symbol">(</a><a id="490" href="Relation.Binary.Core.html#896" class="Function">Rel</a><a id="493" class="Symbol">)</a>
<a id="496" class="Keyword">private</a>
<a id="506" class="Keyword">variable</a>
<a id="519" href="Function.Definitions.html#519" class="Generalizable">a</a> <a id="521" href="Function.Definitions.html#521" class="Generalizable">ℓ₁</a> <a id="524" href="Function.Definitions.html#524" class="Generalizable">ℓ₂</a> <a id="527" class="Symbol">:</a> <a id="529" href="Agda.Primitive.html#742" class="Postulate">Level</a>
<a id="539" href="Function.Definitions.html#539" class="Generalizable">A</a> <a id="541" href="Function.Definitions.html#541" class="Generalizable">B</a> <a id="543" class="Symbol">:</a> <a id="545" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="549" href="Function.Definitions.html#519" class="Generalizable">a</a>
<a id="552" class="Comment">------------------------------------------------------------------------</a>
<a id="625" class="Comment">-- Basic definitions</a>
<a id="647" class="Keyword">module</a> <a id="654" href="Function.Definitions.html#654" class="Module">_</a>
<a id="658" class="Symbol">(</a><a id="659" href="Function.Definitions.html#659" class="Bound Operator">_≈₁_</a> <a id="664" class="Symbol">:</a> <a id="666" href="Relation.Binary.Core.html#896" class="Function">Rel</a> <a id="670" href="Function.Definitions.html#539" class="Generalizable">A</a> <a id="672" href="Function.Definitions.html#521" class="Generalizable">ℓ₁</a><a id="674" class="Symbol">)</a> <a id="676" class="Comment">-- Equality over the domain</a>
<a id="706" class="Symbol">(</a><a id="707" href="Function.Definitions.html#707" class="Bound Operator">_≈₂_</a> <a id="712" class="Symbol">:</a> <a id="714" href="Relation.Binary.Core.html#896" class="Function">Rel</a> <a id="718" href="Function.Definitions.html#541" class="Generalizable">B</a> <a id="720" href="Function.Definitions.html#524" class="Generalizable">ℓ₂</a><a id="722" class="Symbol">)</a> <a id="724" class="Comment">-- Equality over the codomain</a>
<a id="756" class="Keyword">where</a>
<a id="765" href="Function.Definitions.html#765" class="Function">Congruent</a> <a id="775" class="Symbol">:</a> <a id="777" class="Symbol">(</a><a id="778" href="Function.Definitions.html#670" class="Bound">A</a> <a id="780" class="Symbol"></a> <a id="782" href="Function.Definitions.html#718" class="Bound">B</a><a id="783" class="Symbol">)</a> <a id="785" class="Symbol"></a> <a id="787" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="791" class="Symbol">_</a>
<a id="795" href="Function.Definitions.html#765" class="Function">Congruent</a> <a id="805" href="Function.Definitions.html#805" class="Bound">f</a> <a id="807" class="Symbol">=</a> <a id="809" class="Symbol"></a> <a id="811" class="Symbol">{</a><a id="812" href="Function.Definitions.html#812" class="Bound">x</a> <a id="814" href="Function.Definitions.html#814" class="Bound">y</a><a id="815" class="Symbol">}</a> <a id="817" class="Symbol"></a> <a id="819" href="Function.Definitions.html#812" class="Bound">x</a> <a id="821" href="Function.Definitions.html#659" class="Bound Operator">≈₁</a> <a id="824" href="Function.Definitions.html#814" class="Bound">y</a> <a id="826" class="Symbol"></a> <a id="828" href="Function.Definitions.html#805" class="Bound">f</a> <a id="830" href="Function.Definitions.html#812" class="Bound">x</a> <a id="832" href="Function.Definitions.html#707" class="Bound Operator">≈₂</a> <a id="835" href="Function.Definitions.html#805" class="Bound">f</a> <a id="837" href="Function.Definitions.html#814" class="Bound">y</a>
<a id="842" href="Function.Definitions.html#842" class="Function">Injective</a> <a id="852" class="Symbol">:</a> <a id="854" class="Symbol">(</a><a id="855" href="Function.Definitions.html#670" class="Bound">A</a> <a id="857" class="Symbol"></a> <a id="859" href="Function.Definitions.html#718" class="Bound">B</a><a id="860" class="Symbol">)</a> <a id="862" class="Symbol"></a> <a id="864" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="868" class="Symbol">_</a>
<a id="872" href="Function.Definitions.html#842" class="Function">Injective</a> <a id="882" href="Function.Definitions.html#882" class="Bound">f</a> <a id="884" class="Symbol">=</a> <a id="886" class="Symbol"></a> <a id="888" class="Symbol">{</a><a id="889" href="Function.Definitions.html#889" class="Bound">x</a> <a id="891" href="Function.Definitions.html#891" class="Bound">y</a><a id="892" class="Symbol">}</a> <a id="894" class="Symbol"></a> <a id="896" href="Function.Definitions.html#882" class="Bound">f</a> <a id="898" href="Function.Definitions.html#889" class="Bound">x</a> <a id="900" href="Function.Definitions.html#707" class="Bound Operator">≈₂</a> <a id="903" href="Function.Definitions.html#882" class="Bound">f</a> <a id="905" href="Function.Definitions.html#891" class="Bound">y</a> <a id="907" class="Symbol"></a> <a id="909" href="Function.Definitions.html#889" class="Bound">x</a> <a id="911" href="Function.Definitions.html#659" class="Bound Operator">≈₁</a> <a id="914" href="Function.Definitions.html#891" class="Bound">y</a>
<a id="919" href="Function.Definitions.html#919" class="Function">Surjective</a> <a id="930" class="Symbol">:</a> <a id="932" class="Symbol">(</a><a id="933" href="Function.Definitions.html#670" class="Bound">A</a> <a id="935" class="Symbol"></a> <a id="937" href="Function.Definitions.html#718" class="Bound">B</a><a id="938" class="Symbol">)</a> <a id="940" class="Symbol"></a> <a id="942" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="946" class="Symbol">_</a>
<a id="950" href="Function.Definitions.html#919" class="Function">Surjective</a> <a id="961" href="Function.Definitions.html#961" class="Bound">f</a> <a id="963" class="Symbol">=</a> <a id="965" class="Symbol"></a> <a id="967" href="Function.Definitions.html#967" class="Bound">y</a> <a id="969" class="Symbol"></a> <a id="971" href="Data.Product.Base.html#852" class="Function"></a> <a id="973" class="Symbol">λ</a> <a id="975" href="Function.Definitions.html#975" class="Bound">x</a> <a id="977" class="Symbol"></a> <a id="979" class="Symbol"></a> <a id="981" class="Symbol">{</a><a id="982" href="Function.Definitions.html#982" class="Bound">z</a><a id="983" class="Symbol">}</a> <a id="985" class="Symbol"></a> <a id="987" href="Function.Definitions.html#982" class="Bound">z</a> <a id="989" href="Function.Definitions.html#659" class="Bound Operator">≈₁</a> <a id="992" href="Function.Definitions.html#975" class="Bound">x</a> <a id="994" class="Symbol"></a> <a id="996" href="Function.Definitions.html#961" class="Bound">f</a> <a id="998" href="Function.Definitions.html#982" class="Bound">z</a> <a id="1000" href="Function.Definitions.html#707" class="Bound Operator">≈₂</a> <a id="1003" href="Function.Definitions.html#967" class="Bound">y</a>
<a id="1008" href="Function.Definitions.html#1008" class="Function">Bijective</a> <a id="1018" class="Symbol">:</a> <a id="1020" class="Symbol">(</a><a id="1021" href="Function.Definitions.html#670" class="Bound">A</a> <a id="1023" class="Symbol"></a> <a id="1025" href="Function.Definitions.html#718" class="Bound">B</a><a id="1026" class="Symbol">)</a> <a id="1028" class="Symbol"></a> <a id="1030" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1034" class="Symbol">_</a>
<a id="1038" href="Function.Definitions.html#1008" class="Function">Bijective</a> <a id="1048" href="Function.Definitions.html#1048" class="Bound">f</a> <a id="1050" class="Symbol">=</a> <a id="1052" href="Function.Definitions.html#842" class="Function">Injective</a> <a id="1062" href="Function.Definitions.html#1048" class="Bound">f</a> <a id="1064" href="Data.Product.Base.html#1618" class="Function Operator">×</a> <a id="1066" href="Function.Definitions.html#919" class="Function">Surjective</a> <a id="1077" href="Function.Definitions.html#1048" class="Bound">f</a>
<a id="1082" href="Function.Definitions.html#1082" class="Function">Inverseˡ</a> <a id="1091" class="Symbol">:</a> <a id="1093" class="Symbol">(</a><a id="1094" href="Function.Definitions.html#670" class="Bound">A</a> <a id="1096" class="Symbol"></a> <a id="1098" href="Function.Definitions.html#718" class="Bound">B</a><a id="1099" class="Symbol">)</a> <a id="1101" class="Symbol"></a> <a id="1103" class="Symbol">(</a><a id="1104" href="Function.Definitions.html#718" class="Bound">B</a> <a id="1106" class="Symbol"></a> <a id="1108" href="Function.Definitions.html#670" class="Bound">A</a><a id="1109" class="Symbol">)</a> <a id="1111" class="Symbol"></a> <a id="1113" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1117" class="Symbol">_</a>
<a id="1121" href="Function.Definitions.html#1082" class="Function">Inverseˡ</a> <a id="1130" href="Function.Definitions.html#1130" class="Bound">f</a> <a id="1132" href="Function.Definitions.html#1132" class="Bound">g</a> <a id="1134" class="Symbol">=</a> <a id="1136" class="Symbol"></a> <a id="1138" class="Symbol">{</a><a id="1139" href="Function.Definitions.html#1139" class="Bound">x</a> <a id="1141" href="Function.Definitions.html#1141" class="Bound">y</a><a id="1142" class="Symbol">}</a> <a id="1144" class="Symbol"></a> <a id="1146" href="Function.Definitions.html#1141" class="Bound">y</a> <a id="1148" href="Function.Definitions.html#659" class="Bound Operator">≈₁</a> <a id="1151" href="Function.Definitions.html#1132" class="Bound">g</a> <a id="1153" href="Function.Definitions.html#1139" class="Bound">x</a> <a id="1155" class="Symbol"></a> <a id="1157" href="Function.Definitions.html#1130" class="Bound">f</a> <a id="1159" href="Function.Definitions.html#1141" class="Bound">y</a> <a id="1161" href="Function.Definitions.html#707" class="Bound Operator">≈₂</a> <a id="1164" href="Function.Definitions.html#1139" class="Bound">x</a>
<a id="1169" href="Function.Definitions.html#1169" class="Function">Inverseʳ</a> <a id="1178" class="Symbol">:</a> <a id="1180" class="Symbol">(</a><a id="1181" href="Function.Definitions.html#670" class="Bound">A</a> <a id="1183" class="Symbol"></a> <a id="1185" href="Function.Definitions.html#718" class="Bound">B</a><a id="1186" class="Symbol">)</a> <a id="1188" class="Symbol"></a> <a id="1190" class="Symbol">(</a><a id="1191" href="Function.Definitions.html#718" class="Bound">B</a> <a id="1193" class="Symbol"></a> <a id="1195" href="Function.Definitions.html#670" class="Bound">A</a><a id="1196" class="Symbol">)</a> <a id="1198" class="Symbol"></a> <a id="1200" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1204" class="Symbol">_</a>
<a id="1208" href="Function.Definitions.html#1169" class="Function">Inverseʳ</a> <a id="1217" href="Function.Definitions.html#1217" class="Bound">f</a> <a id="1219" href="Function.Definitions.html#1219" class="Bound">g</a> <a id="1221" class="Symbol">=</a> <a id="1223" class="Symbol"></a> <a id="1225" class="Symbol">{</a><a id="1226" href="Function.Definitions.html#1226" class="Bound">x</a> <a id="1228" href="Function.Definitions.html#1228" class="Bound">y</a><a id="1229" class="Symbol">}</a> <a id="1231" class="Symbol"></a> <a id="1233" href="Function.Definitions.html#1228" class="Bound">y</a> <a id="1235" href="Function.Definitions.html#707" class="Bound Operator">≈₂</a> <a id="1238" href="Function.Definitions.html#1217" class="Bound">f</a> <a id="1240" href="Function.Definitions.html#1226" class="Bound">x</a> <a id="1242" class="Symbol"></a> <a id="1244" href="Function.Definitions.html#1219" class="Bound">g</a> <a id="1246" href="Function.Definitions.html#1228" class="Bound">y</a> <a id="1248" href="Function.Definitions.html#659" class="Bound Operator">≈₁</a> <a id="1251" href="Function.Definitions.html#1226" class="Bound">x</a>
<a id="1256" href="Function.Definitions.html#1256" class="Function">Inverseᵇ</a> <a id="1265" class="Symbol">:</a> <a id="1267" class="Symbol">(</a><a id="1268" href="Function.Definitions.html#670" class="Bound">A</a> <a id="1270" class="Symbol"></a> <a id="1272" href="Function.Definitions.html#718" class="Bound">B</a><a id="1273" class="Symbol">)</a> <a id="1275" class="Symbol"></a> <a id="1277" class="Symbol">(</a><a id="1278" href="Function.Definitions.html#718" class="Bound">B</a> <a id="1280" class="Symbol"></a> <a id="1282" href="Function.Definitions.html#670" class="Bound">A</a><a id="1283" class="Symbol">)</a> <a id="1285" class="Symbol"></a> <a id="1287" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1291" class="Symbol">_</a>
<a id="1295" href="Function.Definitions.html#1256" class="Function">Inverseᵇ</a> <a id="1304" href="Function.Definitions.html#1304" class="Bound">f</a> <a id="1306" href="Function.Definitions.html#1306" class="Bound">g</a> <a id="1308" class="Symbol">=</a> <a id="1310" href="Function.Definitions.html#1082" class="Function">Inverseˡ</a> <a id="1319" href="Function.Definitions.html#1304" class="Bound">f</a> <a id="1321" href="Function.Definitions.html#1306" class="Bound">g</a> <a id="1323" href="Data.Product.Base.html#1618" class="Function Operator">×</a> <a id="1325" href="Function.Definitions.html#1169" class="Function">Inverseʳ</a> <a id="1334" href="Function.Definitions.html#1304" class="Bound">f</a> <a id="1336" href="Function.Definitions.html#1306" class="Bound">g</a>
<a id="1339" class="Comment">------------------------------------------------------------------------</a>
<a id="1412" class="Comment">-- Strict definitions</a>
<a id="1435" class="Comment">-- These are often easier to use once but much harder to compose and</a>
<a id="1504" class="Comment">-- reason about.</a>
<a id="StrictlySurjective"></a><a id="1522" href="Function.Definitions.html#1522" class="Function">StrictlySurjective</a> <a id="1541" class="Symbol">:</a> <a id="1543" href="Relation.Binary.Core.html#896" class="Function">Rel</a> <a id="1547" href="Function.Definitions.html#541" class="Generalizable">B</a> <a id="1549" href="Function.Definitions.html#524" class="Generalizable">ℓ₂</a> <a id="1552" class="Symbol"></a> <a id="1554" class="Symbol">(</a><a id="1555" href="Function.Definitions.html#539" class="Generalizable">A</a> <a id="1557" class="Symbol"></a> <a id="1559" href="Function.Definitions.html#541" class="Generalizable">B</a><a id="1560" class="Symbol">)</a> <a id="1562" class="Symbol"></a> <a id="1564" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1568" class="Symbol">_</a>
<a id="1570" href="Function.Definitions.html#1522" class="Function">StrictlySurjective</a> <a id="1589" href="Function.Definitions.html#1589" class="Bound Operator">_≈₂_</a> <a id="1594" href="Function.Definitions.html#1594" class="Bound">f</a> <a id="1596" class="Symbol">=</a> <a id="1598" class="Symbol"></a> <a id="1600" href="Function.Definitions.html#1600" class="Bound">y</a> <a id="1602" class="Symbol"></a> <a id="1604" href="Data.Product.Base.html#852" class="Function"></a> <a id="1606" class="Symbol">λ</a> <a id="1608" href="Function.Definitions.html#1608" class="Bound">x</a> <a id="1610" class="Symbol"></a> <a id="1612" href="Function.Definitions.html#1594" class="Bound">f</a> <a id="1614" href="Function.Definitions.html#1608" class="Bound">x</a> <a id="1616" href="Function.Definitions.html#1589" class="Bound Operator">≈₂</a> <a id="1619" href="Function.Definitions.html#1600" class="Bound">y</a>
<a id="StrictlyInverseˡ"></a><a id="1622" href="Function.Definitions.html#1622" class="Function">StrictlyInverseˡ</a> <a id="1639" class="Symbol">:</a> <a id="1641" href="Relation.Binary.Core.html#896" class="Function">Rel</a> <a id="1645" href="Function.Definitions.html#541" class="Generalizable">B</a> <a id="1647" href="Function.Definitions.html#524" class="Generalizable">ℓ₂</a> <a id="1650" class="Symbol"></a> <a id="1652" class="Symbol">(</a><a id="1653" href="Function.Definitions.html#539" class="Generalizable">A</a> <a id="1655" class="Symbol"></a> <a id="1657" href="Function.Definitions.html#541" class="Generalizable">B</a><a id="1658" class="Symbol">)</a> <a id="1660" class="Symbol"></a> <a id="1662" class="Symbol">(</a><a id="1663" href="Function.Definitions.html#541" class="Generalizable">B</a> <a id="1665" class="Symbol"></a> <a id="1667" href="Function.Definitions.html#539" class="Generalizable">A</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" class="Symbol">_</a>
<a id="1678" href="Function.Definitions.html#1622" class="Function">StrictlyInverseˡ</a> <a id="1695" href="Function.Definitions.html#1695" class="Bound Operator">_≈₂_</a> <a id="1700" href="Function.Definitions.html#1700" class="Bound">f</a> <a id="1702" href="Function.Definitions.html#1702" class="Bound">g</a> <a id="1704" class="Symbol">=</a> <a id="1706" class="Symbol"></a> <a id="1708" href="Function.Definitions.html#1708" class="Bound">y</a> <a id="1710" class="Symbol"></a> <a id="1712" href="Function.Definitions.html#1700" class="Bound">f</a> <a id="1714" class="Symbol">(</a><a id="1715" href="Function.Definitions.html#1702" class="Bound">g</a> <a id="1717" href="Function.Definitions.html#1708" class="Bound">y</a><a id="1718" class="Symbol">)</a> <a id="1720" href="Function.Definitions.html#1695" class="Bound Operator">≈₂</a> <a id="1723" href="Function.Definitions.html#1708" class="Bound">y</a>
<a id="StrictlyInverseʳ"></a><a id="1726" href="Function.Definitions.html#1726" class="Function">StrictlyInverseʳ</a> <a id="1743" class="Symbol">:</a> <a id="1745" href="Relation.Binary.Core.html#896" class="Function">Rel</a> <a id="1749" href="Function.Definitions.html#539" class="Generalizable">A</a> <a id="1751" href="Function.Definitions.html#521" class="Generalizable">ℓ₁</a> <a id="1754" class="Symbol"></a> <a id="1756" class="Symbol">(</a><a id="1757" href="Function.Definitions.html#539" class="Generalizable">A</a> <a id="1759" class="Symbol"></a> <a id="1761" href="Function.Definitions.html#541" class="Generalizable">B</a><a id="1762" class="Symbol">)</a> <a id="1764" class="Symbol"></a> <a id="1766" class="Symbol">(</a><a id="1767" href="Function.Definitions.html#541" class="Generalizable">B</a> <a id="1769" class="Symbol"></a> <a id="1771" href="Function.Definitions.html#539" class="Generalizable">A</a><a id="1772" class="Symbol">)</a> <a id="1774" class="Symbol"></a> <a id="1776" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1780" class="Symbol">_</a>
<a id="1782" href="Function.Definitions.html#1726" class="Function">StrictlyInverseʳ</a> <a id="1799" href="Function.Definitions.html#1799" class="Bound Operator">_≈₁_</a> <a id="1804" href="Function.Definitions.html#1804" class="Bound">f</a> <a id="1806" href="Function.Definitions.html#1806" class="Bound">g</a> <a id="1808" class="Symbol">=</a> <a id="1810" class="Symbol"></a> <a id="1812" href="Function.Definitions.html#1812" class="Bound">x</a> <a id="1814" class="Symbol"></a> <a id="1816" href="Function.Definitions.html#1806" class="Bound">g</a> <a id="1818" class="Symbol">(</a><a id="1819" href="Function.Definitions.html#1804" class="Bound">f</a> <a id="1821" href="Function.Definitions.html#1812" class="Bound">x</a><a id="1822" class="Symbol">)</a> <a id="1824" href="Function.Definitions.html#1799" class="Bound Operator">≈₁</a> <a id="1827" href="Function.Definitions.html#1812" class="Bound">x</a>
</pre></body></html>