bsc-leon-vatthauer/public/Function.Equivalence.html

130 lines
No EOL
40 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>Function.Equivalence</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">-- Equivalence (coinhabitance)</a>
<a id="137" class="Comment">------------------------------------------------------------------------</a>
<a id="211" class="Symbol">{-#</a> <a id="215" class="Keyword">OPTIONS</a> <a id="223" class="Pragma">--cubical-compatible</a> <a id="244" class="Pragma">--safe</a> <a id="251" class="Symbol">#-}</a>
<a id="256" class="Keyword">module</a> <a id="263" href="Function.Equivalence.html" class="Module">Function.Equivalence</a> <a id="284" class="Keyword">where</a>
<a id="291" class="Comment">-- Note: use of the standard function hierarchy is encouraged. The</a>
<a id="358" class="Comment">-- module `Function` re-exports `Congruent` and `IsCongruent`.</a>
<a id="421" class="Comment">-- The alternative definitions found in this file will eventually be</a>
<a id="490" class="Comment">-- deprecated.</a>
<a id="506" class="Keyword">open</a> <a id="511" class="Keyword">import</a> <a id="518" href="Function.Base.html" class="Module">Function.Base</a> <a id="532" class="Keyword">using</a> <a id="538" class="Symbol">(</a><a id="539" href="Function.Base.html#1563" class="Function">flip</a><a id="543" class="Symbol">)</a>
<a id="545" class="Keyword">open</a> <a id="550" class="Keyword">import</a> <a id="557" href="Function.Equality.html" class="Module">Function.Equality</a> <a id="575" class="Symbol">as</a> <a id="578" class="Module">F</a>
<a id="582" class="Keyword">using</a> <a id="588" class="Symbol">(</a><a id="589" href="Function.Equality.html#1227" class="Function Operator">_⟶_</a><a id="592" class="Symbol">;</a> <a id="594" href="Function.Equality.html#1073" class="Field Operator">_⟨$⟩_</a><a id="599" class="Symbol">)</a> <a id="601" class="Keyword">renaming</a> <a id="610" class="Symbol">(</a><a id="611" href="Function.Equality.html#1540" class="Function Operator">_∘_</a> <a id="615" class="Symbol">to</a> <a id="618" class="Function Operator">_⟪∘⟫_</a><a id="623" class="Symbol">)</a>
<a id="625" class="Keyword">open</a> <a id="630" class="Keyword">import</a> <a id="637" href="Level.html" class="Module">Level</a>
<a id="643" class="Keyword">open</a> <a id="648" class="Keyword">import</a> <a id="655" href="Relation.Binary.html" class="Module">Relation.Binary</a> <a id="671" class="Keyword">hiding</a> <a id="678" class="Symbol">(</a><a id="679" href="Relation.Binary.Core.html#1334" class="Function Operator">_⇔_</a><a id="682" class="Symbol">)</a>
<a id="684" class="Keyword">import</a> <a id="691" href="Relation.Binary.PropositionalEquality.html" class="Module">Relation.Binary.PropositionalEquality</a> <a id="729" class="Symbol">as</a> <a id="732" class="Module">P</a>
<a id="735" class="Comment">------------------------------------------------------------------------</a>
<a id="808" class="Comment">-- Setoid equivalence</a>
<a id="831" class="Keyword">record</a> <a id="Equivalence"></a><a id="838" href="Function.Equivalence.html#838" class="Record">Equivalence</a> <a id="850" class="Symbol">{</a><a id="851" href="Function.Equivalence.html#851" class="Bound">f₁</a> <a id="854" href="Function.Equivalence.html#854" class="Bound">f₂</a> <a id="857" href="Function.Equivalence.html#857" class="Bound">t₁</a> <a id="860" href="Function.Equivalence.html#860" class="Bound">t₂</a><a id="862" class="Symbol">}</a>
<a id="883" class="Symbol">(</a><a id="884" href="Function.Equivalence.html#884" class="Bound">From</a> <a id="889" class="Symbol">:</a> <a id="891" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="898" href="Function.Equivalence.html#851" class="Bound">f₁</a> <a id="901" href="Function.Equivalence.html#854" class="Bound">f₂</a><a id="903" class="Symbol">)</a> <a id="905" class="Symbol">(</a><a id="906" href="Function.Equivalence.html#906" class="Bound">To</a> <a id="909" class="Symbol">:</a> <a id="911" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="918" href="Function.Equivalence.html#857" class="Bound">t₁</a> <a id="921" href="Function.Equivalence.html#860" class="Bound">t₂</a><a id="923" class="Symbol">)</a> <a id="925" class="Symbol">:</a>
<a id="946" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="950" class="Symbol">(</a><a id="951" href="Function.Equivalence.html#851" class="Bound">f₁</a> <a id="954" href="Agda.Primitive.html#804" class="Primitive Operator"></a> <a id="956" href="Function.Equivalence.html#854" class="Bound">f₂</a> <a id="959" href="Agda.Primitive.html#804" class="Primitive Operator"></a> <a id="961" href="Function.Equivalence.html#857" class="Bound">t₁</a> <a id="964" href="Agda.Primitive.html#804" class="Primitive Operator"></a> <a id="966" href="Function.Equivalence.html#860" class="Bound">t₂</a><a id="968" class="Symbol">)</a> <a id="970" class="Keyword">where</a>
<a id="978" class="Keyword">field</a>
<a id="Equivalence.to"></a><a id="988" href="Function.Equivalence.html#988" class="Field">to</a> <a id="993" class="Symbol">:</a> <a id="995" href="Function.Equivalence.html#884" class="Bound">From</a> <a id="1000" href="Function.Equality.html#1227" class="Function Operator"></a> <a id="1002" href="Function.Equivalence.html#906" class="Bound">To</a>
<a id="Equivalence.from"></a><a id="1009" href="Function.Equivalence.html#1009" class="Field">from</a> <a id="1014" class="Symbol">:</a> <a id="1016" href="Function.Equivalence.html#906" class="Bound">To</a> <a id="1019" href="Function.Equality.html#1227" class="Function Operator"></a> <a id="1021" href="Function.Equivalence.html#884" class="Bound">From</a>
<a id="1027" class="Comment">------------------------------------------------------------------------</a>
<a id="1100" class="Comment">-- The set of all equivalences between two sets (i.e. equivalences</a>
<a id="1167" class="Comment">-- with propositional equality)</a>
<a id="1200" class="Keyword">infix</a> <a id="1206" class="Number">3</a> <a id="1208" href="Function.Equivalence.html#1213" class="Function Operator">_⇔_</a>
<a id="_⇔_"></a><a id="1213" href="Function.Equivalence.html#1213" class="Function Operator">_⇔_</a> <a id="1217" class="Symbol">:</a> <a id="1219" class="Symbol"></a> <a id="1221" class="Symbol">{</a><a id="1222" href="Function.Equivalence.html#1222" class="Bound">f</a> <a id="1224" href="Function.Equivalence.html#1224" class="Bound">t</a><a id="1225" class="Symbol">}</a> <a id="1227" class="Symbol"></a> <a id="1229" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1233" href="Function.Equivalence.html#1222" class="Bound">f</a> <a id="1235" class="Symbol"></a> <a id="1237" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1241" href="Function.Equivalence.html#1224" class="Bound">t</a> <a id="1243" class="Symbol"></a> <a id="1245" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1249" class="Symbol">_</a>
<a id="1251" href="Function.Equivalence.html#1251" class="Bound">From</a> <a id="1256" href="Function.Equivalence.html#1213" class="Function Operator"></a> <a id="1258" href="Function.Equivalence.html#1258" class="Bound">To</a> <a id="1261" class="Symbol">=</a> <a id="1263" href="Function.Equivalence.html#838" class="Record">Equivalence</a> <a id="1275" class="Symbol">(</a><a id="1276" href="Relation.Binary.PropositionalEquality.Properties.html#3981" class="Function">P.setoid</a> <a id="1285" href="Function.Equivalence.html#1251" class="Bound">From</a><a id="1289" class="Symbol">)</a> <a id="1291" class="Symbol">(</a><a id="1292" href="Relation.Binary.PropositionalEquality.Properties.html#3981" class="Function">P.setoid</a> <a id="1301" href="Function.Equivalence.html#1258" class="Bound">To</a><a id="1303" class="Symbol">)</a>
<a id="equivalence"></a><a id="1306" href="Function.Equivalence.html#1306" class="Function">equivalence</a> <a id="1318" class="Symbol">:</a> <a id="1320" class="Symbol"></a> <a id="1322" class="Symbol">{</a><a id="1323" href="Function.Equivalence.html#1323" class="Bound">f</a> <a id="1325" href="Function.Equivalence.html#1325" class="Bound">t</a><a id="1326" class="Symbol">}</a> <a id="1328" class="Symbol">{</a><a id="1329" href="Function.Equivalence.html#1329" class="Bound">From</a> <a id="1334" class="Symbol">:</a> <a id="1336" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1340" href="Function.Equivalence.html#1323" class="Bound">f</a><a id="1341" class="Symbol">}</a> <a id="1343" class="Symbol">{</a><a id="1344" href="Function.Equivalence.html#1344" class="Bound">To</a> <a id="1347" class="Symbol">:</a> <a id="1349" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1353" href="Function.Equivalence.html#1325" class="Bound">t</a><a id="1354" class="Symbol">}</a> <a id="1356" class="Symbol"></a>
<a id="1372" class="Symbol">(</a><a id="1373" href="Function.Equivalence.html#1329" class="Bound">From</a> <a id="1378" class="Symbol"></a> <a id="1380" href="Function.Equivalence.html#1344" class="Bound">To</a><a id="1382" class="Symbol">)</a> <a id="1384" class="Symbol"></a> <a id="1386" class="Symbol">(</a><a id="1387" href="Function.Equivalence.html#1344" class="Bound">To</a> <a id="1390" class="Symbol"></a> <a id="1392" href="Function.Equivalence.html#1329" class="Bound">From</a><a id="1396" class="Symbol">)</a> <a id="1398" class="Symbol"></a> <a id="1400" href="Function.Equivalence.html#1329" class="Bound">From</a> <a id="1405" href="Function.Equivalence.html#1213" class="Function Operator"></a> <a id="1407" href="Function.Equivalence.html#1344" class="Bound">To</a>
<a id="1410" href="Function.Equivalence.html#1306" class="Function">equivalence</a> <a id="1422" href="Function.Equivalence.html#1422" class="Bound">to</a> <a id="1425" href="Function.Equivalence.html#1425" class="Bound">from</a> <a id="1430" class="Symbol">=</a> <a id="1432" class="Keyword">record</a>
<a id="1441" class="Symbol">{</a> <a id="1443" href="Function.Equivalence.html#988" class="Field">to</a> <a id="1448" class="Symbol">=</a> <a id="1450" href="Relation.Binary.PropositionalEquality.html#1807" class="Function">P.→-to-⟶</a> <a id="1459" href="Function.Equivalence.html#1422" class="Bound">to</a>
<a id="1464" class="Symbol">;</a> <a id="1466" href="Function.Equivalence.html#1009" class="Field">from</a> <a id="1471" class="Symbol">=</a> <a id="1473" href="Relation.Binary.PropositionalEquality.html#1807" class="Function">P.→-to-⟶</a> <a id="1482" href="Function.Equivalence.html#1425" class="Bound">from</a>
<a id="1489" class="Symbol">}</a>
<a id="1492" class="Comment">------------------------------------------------------------------------</a>
<a id="1565" class="Comment">-- Equivalence is an equivalence relation</a>
<a id="1608" class="Comment">-- Identity and composition (reflexivity and transitivity).</a>
<a id="id"></a><a id="1669" href="Function.Equivalence.html#1669" class="Function">id</a> <a id="1672" class="Symbol">:</a> <a id="1674" class="Symbol"></a> <a id="1676" class="Symbol">{</a><a id="1677" href="Function.Equivalence.html#1677" class="Bound">s₁</a> <a id="1680" href="Function.Equivalence.html#1680" class="Bound">s₂</a><a id="1682" class="Symbol">}</a> <a id="1684" class="Symbol"></a> <a id="1686" href="Relation.Binary.Definitions.html#1348" class="Function">Reflexive</a> <a id="1696" class="Symbol">(</a><a id="1697" href="Function.Equivalence.html#838" class="Record">Equivalence</a> <a id="1709" class="Symbol">{</a><a id="1710" href="Function.Equivalence.html#1677" class="Bound">s₁</a><a id="1712" class="Symbol">}</a> <a id="1714" class="Symbol">{</a><a id="1715" href="Function.Equivalence.html#1680" class="Bound">s₂</a><a id="1717" class="Symbol">})</a>
<a id="1720" href="Function.Equivalence.html#1669" class="Function">id</a> <a id="1723" class="Symbol">{</a><a id="1724" class="Argument">x</a> <a id="1726" class="Symbol">=</a> <a id="1728" href="Function.Equivalence.html#1728" class="Bound">S</a><a id="1729" class="Symbol">}</a> <a id="1731" class="Symbol">=</a> <a id="1733" class="Keyword">record</a>
<a id="1742" class="Symbol">{</a> <a id="1744" href="Function.Equivalence.html#988" class="Field">to</a> <a id="1749" class="Symbol">=</a> <a id="1751" href="Function.Equality.html#1437" class="Function">F.id</a>
<a id="1758" class="Symbol">;</a> <a id="1760" href="Function.Equivalence.html#1009" class="Field">from</a> <a id="1765" class="Symbol">=</a> <a id="1767" href="Function.Equality.html#1437" class="Function">F.id</a>
<a id="1774" class="Symbol">}</a>
<a id="1777" class="Keyword">infixr</a> <a id="1784" class="Number">9</a> <a id="1786" href="Function.Equivalence.html#1791" class="Function Operator">_∘_</a>
<a id="_∘_"></a><a id="1791" href="Function.Equivalence.html#1791" class="Function Operator">_∘_</a> <a id="1795" class="Symbol">:</a> <a id="1797" class="Symbol"></a> <a id="1799" class="Symbol">{</a><a id="1800" href="Function.Equivalence.html#1800" class="Bound">f₁</a> <a id="1803" href="Function.Equivalence.html#1803" class="Bound">f₂</a> <a id="1806" href="Function.Equivalence.html#1806" class="Bound">m₁</a> <a id="1809" href="Function.Equivalence.html#1809" class="Bound">m₂</a> <a id="1812" href="Function.Equivalence.html#1812" class="Bound">t₁</a> <a id="1815" href="Function.Equivalence.html#1815" class="Bound">t₂</a><a id="1817" class="Symbol">}</a> <a id="1819" class="Symbol"></a>
<a id="1827" href="Relation.Binary.Definitions.html#1747" class="Function">TransFlip</a> <a id="1837" class="Symbol">(</a><a id="1838" href="Function.Equivalence.html#838" class="Record">Equivalence</a> <a id="1850" class="Symbol">{</a><a id="1851" href="Function.Equivalence.html#1800" class="Bound">f₁</a><a id="1853" class="Symbol">}</a> <a id="1855" class="Symbol">{</a><a id="1856" href="Function.Equivalence.html#1803" class="Bound">f₂</a><a id="1858" class="Symbol">}</a> <a id="1860" class="Symbol">{</a><a id="1861" href="Function.Equivalence.html#1806" class="Bound">m₁</a><a id="1863" class="Symbol">}</a> <a id="1865" class="Symbol">{</a><a id="1866" href="Function.Equivalence.html#1809" class="Bound">m₂</a><a id="1868" class="Symbol">})</a>
<a id="1887" class="Symbol">(</a><a id="1888" href="Function.Equivalence.html#838" class="Record">Equivalence</a> <a id="1900" class="Symbol">{</a><a id="1901" href="Function.Equivalence.html#1806" class="Bound">m₁</a><a id="1903" class="Symbol">}</a> <a id="1905" class="Symbol">{</a><a id="1906" href="Function.Equivalence.html#1809" class="Bound">m₂</a><a id="1908" class="Symbol">}</a> <a id="1910" class="Symbol">{</a><a id="1911" href="Function.Equivalence.html#1812" class="Bound">t₁</a><a id="1913" class="Symbol">}</a> <a id="1915" class="Symbol">{</a><a id="1916" href="Function.Equivalence.html#1815" class="Bound">t₂</a><a id="1918" class="Symbol">})</a>
<a id="1937" class="Symbol">(</a><a id="1938" href="Function.Equivalence.html#838" class="Record">Equivalence</a> <a id="1950" class="Symbol">{</a><a id="1951" href="Function.Equivalence.html#1800" class="Bound">f₁</a><a id="1953" class="Symbol">}</a> <a id="1955" class="Symbol">{</a><a id="1956" href="Function.Equivalence.html#1803" class="Bound">f₂</a><a id="1958" class="Symbol">}</a> <a id="1960" class="Symbol">{</a><a id="1961" href="Function.Equivalence.html#1812" class="Bound">t₁</a><a id="1963" class="Symbol">}</a> <a id="1965" class="Symbol">{</a><a id="1966" href="Function.Equivalence.html#1815" class="Bound">t₂</a><a id="1968" class="Symbol">})</a>
<a id="1971" href="Function.Equivalence.html#1971" class="Bound">f</a> <a id="1973" href="Function.Equivalence.html#1791" class="Function Operator"></a> <a id="1975" href="Function.Equivalence.html#1975" class="Bound">g</a> <a id="1977" class="Symbol">=</a> <a id="1979" class="Keyword">record</a>
<a id="1988" class="Symbol">{</a> <a id="1990" href="Function.Equivalence.html#988" class="Field">to</a> <a id="1995" class="Symbol">=</a> <a id="1997" href="Function.Equivalence.html#988" class="Field">to</a> <a id="2002" href="Function.Equivalence.html#1971" class="Bound">f</a> <a id="2004" href="Function.Equivalence.html#618" class="Function Operator">⟪∘⟫</a> <a id="2008" href="Function.Equivalence.html#988" class="Field">to</a> <a id="2013" href="Function.Equivalence.html#1975" class="Bound">g</a>
<a id="2017" class="Symbol">;</a> <a id="2019" href="Function.Equivalence.html#1009" class="Field">from</a> <a id="2024" class="Symbol">=</a> <a id="2026" href="Function.Equivalence.html#1009" class="Field">from</a> <a id="2031" href="Function.Equivalence.html#1975" class="Bound">g</a> <a id="2033" href="Function.Equivalence.html#618" class="Function Operator">⟪∘⟫</a> <a id="2037" href="Function.Equivalence.html#1009" class="Field">from</a> <a id="2042" href="Function.Equivalence.html#1971" class="Bound">f</a>
<a id="2046" class="Symbol">}</a> <a id="2048" class="Keyword">where</a> <a id="2054" class="Keyword">open</a> <a id="2059" href="Function.Equivalence.html#838" class="Module">Equivalence</a>
<a id="2072" class="Comment">-- Symmetry.</a>
<a id="sym"></a><a id="2086" href="Function.Equivalence.html#2086" class="Function">sym</a> <a id="2090" class="Symbol">:</a> <a id="2092" class="Symbol"></a> <a id="2094" class="Symbol">{</a><a id="2095" href="Function.Equivalence.html#2095" class="Bound">f₁</a> <a id="2098" href="Function.Equivalence.html#2098" class="Bound">f₂</a> <a id="2101" href="Function.Equivalence.html#2101" class="Bound">t₁</a> <a id="2104" href="Function.Equivalence.html#2104" class="Bound">t₂</a><a id="2106" class="Symbol">}</a> <a id="2108" class="Symbol"></a>
<a id="2116" href="Relation.Binary.Definitions.html#1433" class="Function">Sym</a> <a id="2120" class="Symbol">(</a><a id="2121" href="Function.Equivalence.html#838" class="Record">Equivalence</a> <a id="2133" class="Symbol">{</a><a id="2134" href="Function.Equivalence.html#2095" class="Bound">f₁</a><a id="2136" class="Symbol">}</a> <a id="2138" class="Symbol">{</a><a id="2139" href="Function.Equivalence.html#2098" class="Bound">f₂</a><a id="2141" class="Symbol">}</a> <a id="2143" class="Symbol">{</a><a id="2144" href="Function.Equivalence.html#2101" class="Bound">t₁</a><a id="2146" class="Symbol">}</a> <a id="2148" class="Symbol">{</a><a id="2149" href="Function.Equivalence.html#2104" class="Bound">t₂</a><a id="2151" class="Symbol">})</a>
<a id="2164" class="Symbol">(</a><a id="2165" href="Function.Equivalence.html#838" class="Record">Equivalence</a> <a id="2177" class="Symbol">{</a><a id="2178" href="Function.Equivalence.html#2101" class="Bound">t₁</a><a id="2180" class="Symbol">}</a> <a id="2182" class="Symbol">{</a><a id="2183" href="Function.Equivalence.html#2104" class="Bound">t₂</a><a id="2185" class="Symbol">}</a> <a id="2187" class="Symbol">{</a><a id="2188" href="Function.Equivalence.html#2095" class="Bound">f₁</a><a id="2190" class="Symbol">}</a> <a id="2192" class="Symbol">{</a><a id="2193" href="Function.Equivalence.html#2098" class="Bound">f₂</a><a id="2195" class="Symbol">})</a>
<a id="2198" href="Function.Equivalence.html#2086" class="Function">sym</a> <a id="2202" href="Function.Equivalence.html#2202" class="Bound">eq</a> <a id="2205" class="Symbol">=</a> <a id="2207" class="Keyword">record</a>
<a id="2216" class="Symbol">{</a> <a id="2218" href="Function.Equivalence.html#1009" class="Field">from</a> <a id="2229" class="Symbol">=</a> <a id="2231" href="Function.Equivalence.html#988" class="Field">to</a>
<a id="2236" class="Symbol">;</a> <a id="2238" href="Function.Equivalence.html#988" class="Field">to</a> <a id="2249" class="Symbol">=</a> <a id="2251" href="Function.Equivalence.html#1009" class="Field">from</a>
<a id="2258" class="Symbol">}</a> <a id="2260" class="Keyword">where</a> <a id="2266" class="Keyword">open</a> <a id="2271" href="Function.Equivalence.html#838" class="Module">Equivalence</a> <a id="2283" href="Function.Equivalence.html#2202" class="Bound">eq</a>
<a id="2287" class="Comment">-- For fixed universe levels we can construct setoids.</a>
<a id="setoid"></a><a id="2343" href="Function.Equivalence.html#2343" class="Function">setoid</a> <a id="2350" class="Symbol">:</a> <a id="2352" class="Symbol">(</a><a id="2353" href="Function.Equivalence.html#2353" class="Bound">s₁</a> <a id="2356" href="Function.Equivalence.html#2356" class="Bound">s₂</a> <a id="2359" class="Symbol">:</a> <a id="2361" href="Agda.Primitive.html#591" class="Postulate">Level</a><a id="2366" class="Symbol">)</a> <a id="2368" class="Symbol"></a> <a id="2370" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="2377" class="Symbol">(</a><a id="2378" href="Agda.Primitive.html#774" class="Primitive">suc</a> <a id="2382" class="Symbol">(</a><a id="2383" href="Function.Equivalence.html#2353" class="Bound">s₁</a> <a id="2386" href="Agda.Primitive.html#804" class="Primitive Operator"></a> <a id="2388" href="Function.Equivalence.html#2356" class="Bound">s₂</a><a id="2390" class="Symbol">))</a> <a id="2393" class="Symbol">(</a><a id="2394" href="Function.Equivalence.html#2353" class="Bound">s₁</a> <a id="2397" href="Agda.Primitive.html#804" class="Primitive Operator"></a> <a id="2399" href="Function.Equivalence.html#2356" class="Bound">s₂</a><a id="2401" class="Symbol">)</a>
<a id="2403" href="Function.Equivalence.html#2343" class="Function">setoid</a> <a id="2410" href="Function.Equivalence.html#2410" class="Bound">s₁</a> <a id="2413" href="Function.Equivalence.html#2413" class="Bound">s₂</a> <a id="2416" class="Symbol">=</a> <a id="2418" class="Keyword">record</a>
<a id="2427" class="Symbol">{</a> <a id="2429" href="Relation.Binary.Bundles.html#1081" class="Field">Carrier</a> <a id="2443" class="Symbol">=</a> <a id="2445" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="2452" href="Function.Equivalence.html#2410" class="Bound">s₁</a> <a id="2455" href="Function.Equivalence.html#2413" class="Bound">s₂</a>
<a id="2460" class="Symbol">;</a> <a id="2462" href="Relation.Binary.Bundles.html#1107" class="Field Operator">_≈_</a> <a id="2476" class="Symbol">=</a> <a id="2478" href="Function.Equivalence.html#838" class="Record">Equivalence</a>
<a id="2492" class="Symbol">;</a> <a id="2494" href="Relation.Binary.Bundles.html#1141" class="Field">isEquivalence</a> <a id="2508" class="Symbol">=</a> <a id="2510" class="Keyword">record</a>
<a id="2521" class="Symbol">{</a> <a id="2523" href="Relation.Binary.Structures.html#1577" class="Field">refl</a> <a id="2529" class="Symbol">=</a> <a id="2531" href="Function.Equivalence.html#1669" class="Function">id</a>
<a id="2538" class="Symbol">;</a> <a id="2540" href="Relation.Binary.Structures.html#1603" class="Field">sym</a> <a id="2546" class="Symbol">=</a> <a id="2548" href="Function.Equivalence.html#2086" class="Function">sym</a>
<a id="2556" class="Symbol">;</a> <a id="2558" href="Relation.Binary.Structures.html#1629" class="Field">trans</a> <a id="2564" class="Symbol">=</a> <a id="2566" href="Function.Base.html#1563" class="Function">flip</a> <a id="2571" href="Function.Equivalence.html#1791" class="Function Operator">_∘_</a>
<a id="2579" class="Symbol">}</a>
<a id="2583" class="Symbol">}</a>
<a id="⇔-setoid"></a><a id="2586" href="Function.Equivalence.html#2586" class="Function">⇔-setoid</a> <a id="2595" class="Symbol">:</a> <a id="2597" class="Symbol">(</a><a id="2598" href="Function.Equivalence.html#2598" class="Bound"></a> <a id="2600" class="Symbol">:</a> <a id="2602" href="Agda.Primitive.html#591" class="Postulate">Level</a><a id="2607" class="Symbol">)</a> <a id="2609" class="Symbol"></a> <a id="2611" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="2618" class="Symbol">(</a><a id="2619" href="Agda.Primitive.html#774" class="Primitive">suc</a> <a id="2623" href="Function.Equivalence.html#2598" class="Bound"></a><a id="2624" class="Symbol">)</a> <a id="2626" href="Function.Equivalence.html#2598" class="Bound"></a>
<a id="2628" href="Function.Equivalence.html#2586" class="Function">⇔-setoid</a> <a id="2637" href="Function.Equivalence.html#2637" class="Bound"></a> <a id="2639" class="Symbol">=</a> <a id="2641" class="Keyword">record</a>
<a id="2650" class="Symbol">{</a> <a id="2652" href="Relation.Binary.Bundles.html#1081" class="Field">Carrier</a> <a id="2666" class="Symbol">=</a> <a id="2668" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="2672" href="Function.Equivalence.html#2637" class="Bound"></a>
<a id="2676" class="Symbol">;</a> <a id="2678" href="Relation.Binary.Bundles.html#1107" class="Field Operator">_≈_</a> <a id="2692" class="Symbol">=</a> <a id="2694" href="Function.Equivalence.html#1213" class="Function Operator">_⇔_</a>
<a id="2700" class="Symbol">;</a> <a id="2702" href="Relation.Binary.Bundles.html#1141" class="Field">isEquivalence</a> <a id="2716" class="Symbol">=</a> <a id="2718" class="Keyword">record</a>
<a id="2729" class="Symbol">{</a> <a id="2731" href="Relation.Binary.Structures.html#1577" class="Field">refl</a> <a id="2737" class="Symbol">=</a> <a id="2739" href="Function.Equivalence.html#1669" class="Function">id</a>
<a id="2746" class="Symbol">;</a> <a id="2748" href="Relation.Binary.Structures.html#1603" class="Field">sym</a> <a id="2754" class="Symbol">=</a> <a id="2756" href="Function.Equivalence.html#2086" class="Function">sym</a>
<a id="2764" class="Symbol">;</a> <a id="2766" href="Relation.Binary.Structures.html#1629" class="Field">trans</a> <a id="2772" class="Symbol">=</a> <a id="2774" href="Function.Base.html#1563" class="Function">flip</a> <a id="2779" href="Function.Equivalence.html#1791" class="Function Operator">_∘_</a>
<a id="2787" class="Symbol">}</a>
<a id="2791" class="Symbol">}</a>
<a id="2794" class="Comment">------------------------------------------------------------------------</a>
<a id="2867" class="Comment">-- Transformations</a>
<a id="map"></a><a id="2887" href="Function.Equivalence.html#2887" class="Function">map</a> <a id="2891" class="Symbol">:</a> <a id="2893" class="Symbol"></a> <a id="2895" class="Symbol">{</a><a id="2896" href="Function.Equivalence.html#2896" class="Bound">f₁</a> <a id="2899" href="Function.Equivalence.html#2899" class="Bound">f₂</a> <a id="2902" href="Function.Equivalence.html#2902" class="Bound">t₁</a> <a id="2905" href="Function.Equivalence.html#2905" class="Bound">t₂</a><a id="2907" class="Symbol">}</a> <a id="2909" class="Symbol">{</a><a id="2910" href="Function.Equivalence.html#2910" class="Bound">From</a> <a id="2915" class="Symbol">:</a> <a id="2917" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="2924" href="Function.Equivalence.html#2896" class="Bound">f₁</a> <a id="2927" href="Function.Equivalence.html#2899" class="Bound">f₂</a><a id="2929" class="Symbol">}</a> <a id="2931" class="Symbol">{</a><a id="2932" href="Function.Equivalence.html#2932" class="Bound">To</a> <a id="2935" class="Symbol">:</a> <a id="2937" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="2944" href="Function.Equivalence.html#2902" class="Bound">t₁</a> <a id="2947" href="Function.Equivalence.html#2905" class="Bound">t₂</a><a id="2949" class="Symbol">}</a>
<a id="2959" class="Symbol">{</a><a id="2960" href="Function.Equivalence.html#2960" class="Bound">f₁</a> <a id="2964" href="Function.Equivalence.html#2964" class="Bound">f₂</a> <a id="2968" href="Function.Equivalence.html#2968" class="Bound">t₁</a> <a id="2972" href="Function.Equivalence.html#2972" class="Bound">t₂</a><a id="2975" class="Symbol">}</a>
<a id="2985" class="Symbol">{</a><a id="2986" href="Function.Equivalence.html#2986" class="Bound">From</a> <a id="2992" class="Symbol">:</a> <a id="2994" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="3001" href="Function.Equivalence.html#2960" class="Bound">f₁</a> <a id="3005" href="Function.Equivalence.html#2964" class="Bound">f₂</a><a id="3008" class="Symbol">}</a> <a id="3010" class="Symbol">{</a><a id="3011" href="Function.Equivalence.html#3011" class="Bound">To</a> <a id="3015" class="Symbol">:</a> <a id="3017" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="3024" href="Function.Equivalence.html#2968" class="Bound">t₁</a> <a id="3028" href="Function.Equivalence.html#2972" class="Bound">t₂</a><a id="3031" class="Symbol">}</a> <a id="3033" class="Symbol"></a>
<a id="3041" class="Symbol">((</a><a id="3043" href="Function.Equivalence.html#2910" class="Bound">From</a> <a id="3048" href="Function.Equality.html#1227" class="Function Operator"></a> <a id="3050" href="Function.Equivalence.html#2932" class="Bound">To</a><a id="3052" class="Symbol">)</a> <a id="3054" class="Symbol"></a> <a id="3056" class="Symbol">(</a><a id="3057" href="Function.Equivalence.html#2986" class="Bound">From</a> <a id="3063" href="Function.Equality.html#1227" class="Function Operator"></a> <a id="3065" href="Function.Equivalence.html#3011" class="Bound">To</a><a id="3068" class="Symbol">))</a> <a id="3071" class="Symbol"></a>
<a id="3079" class="Symbol">((</a><a id="3081" href="Function.Equivalence.html#2932" class="Bound">To</a> <a id="3084" href="Function.Equality.html#1227" class="Function Operator"></a> <a id="3086" href="Function.Equivalence.html#2910" class="Bound">From</a><a id="3090" class="Symbol">)</a> <a id="3092" class="Symbol"></a> <a id="3094" class="Symbol">(</a><a id="3095" href="Function.Equivalence.html#3011" class="Bound">To</a> <a id="3099" href="Function.Equality.html#1227" class="Function Operator"></a> <a id="3101" href="Function.Equivalence.html#2986" class="Bound">From</a><a id="3106" class="Symbol">))</a> <a id="3109" class="Symbol"></a>
<a id="3117" href="Function.Equivalence.html#838" class="Record">Equivalence</a> <a id="3129" href="Function.Equivalence.html#2910" class="Bound">From</a> <a id="3134" href="Function.Equivalence.html#2932" class="Bound">To</a> <a id="3137" class="Symbol"></a> <a id="3139" href="Function.Equivalence.html#838" class="Record">Equivalence</a> <a id="3151" href="Function.Equivalence.html#2986" class="Bound">From</a> <a id="3157" href="Function.Equivalence.html#3011" class="Bound">To</a>
<a id="3161" href="Function.Equivalence.html#2887" class="Function">map</a> <a id="3165" href="Function.Equivalence.html#3165" class="Bound">t</a> <a id="3167" href="Function.Equivalence.html#3167" class="Bound">f</a> <a id="3169" href="Function.Equivalence.html#3169" class="Bound">eq</a> <a id="3172" class="Symbol">=</a> <a id="3174" class="Keyword">record</a> <a id="3181" class="Symbol">{</a> <a id="3183" href="Function.Equivalence.html#988" class="Field">to</a> <a id="3186" class="Symbol">=</a> <a id="3188" href="Function.Equivalence.html#3165" class="Bound">t</a> <a id="3190" href="Function.Equivalence.html#988" class="Field">to</a><a id="3192" class="Symbol">;</a> <a id="3194" href="Function.Equivalence.html#1009" class="Field">from</a> <a id="3199" class="Symbol">=</a> <a id="3201" href="Function.Equivalence.html#3167" class="Bound">f</a> <a id="3203" href="Function.Equivalence.html#1009" class="Field">from</a> <a id="3208" class="Symbol">}</a>
<a id="3212" class="Keyword">where</a> <a id="3218" class="Keyword">open</a> <a id="3223" href="Function.Equivalence.html#838" class="Module">Equivalence</a> <a id="3235" href="Function.Equivalence.html#3169" class="Bound">eq</a>
<a id="zip"></a><a id="3239" href="Function.Equivalence.html#3239" class="Function">zip</a> <a id="3243" class="Symbol">:</a> <a id="3245" class="Symbol"></a> <a id="3247" class="Symbol">{</a><a id="3248" href="Function.Equivalence.html#3248" class="Bound">f₁₁</a> <a id="3252" href="Function.Equivalence.html#3252" class="Bound">f₂₁</a> <a id="3256" href="Function.Equivalence.html#3256" class="Bound">t₁₁</a> <a id="3260" href="Function.Equivalence.html#3260" class="Bound">t₂₁</a><a id="3263" class="Symbol">}</a>
<a id="3273" class="Symbol">{</a><a id="3274" href="Function.Equivalence.html#3274" class="Bound">From₁</a> <a id="3280" class="Symbol">:</a> <a id="3282" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="3289" href="Function.Equivalence.html#3248" class="Bound">f₁₁</a> <a id="3293" href="Function.Equivalence.html#3252" class="Bound">f₂₁</a><a id="3296" class="Symbol">}</a> <a id="3298" class="Symbol">{</a><a id="3299" href="Function.Equivalence.html#3299" class="Bound">To₁</a> <a id="3303" class="Symbol">:</a> <a id="3305" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="3312" href="Function.Equivalence.html#3256" class="Bound">t₁₁</a> <a id="3316" href="Function.Equivalence.html#3260" class="Bound">t₂₁</a><a id="3319" class="Symbol">}</a>
<a id="3329" class="Symbol">{</a><a id="3330" href="Function.Equivalence.html#3330" class="Bound">f₁₂</a> <a id="3334" href="Function.Equivalence.html#3334" class="Bound">f₂₂</a> <a id="3338" href="Function.Equivalence.html#3338" class="Bound">t₁₂</a> <a id="3342" href="Function.Equivalence.html#3342" class="Bound">t₂₂</a><a id="3345" class="Symbol">}</a>
<a id="3355" class="Symbol">{</a><a id="3356" href="Function.Equivalence.html#3356" class="Bound">From₂</a> <a id="3362" class="Symbol">:</a> <a id="3364" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="3371" href="Function.Equivalence.html#3330" class="Bound">f₁₂</a> <a id="3375" href="Function.Equivalence.html#3334" class="Bound">f₂₂</a><a id="3378" class="Symbol">}</a> <a id="3380" class="Symbol">{</a><a id="3381" href="Function.Equivalence.html#3381" class="Bound">To₂</a> <a id="3385" class="Symbol">:</a> <a id="3387" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="3394" href="Function.Equivalence.html#3338" class="Bound">t₁₂</a> <a id="3398" href="Function.Equivalence.html#3342" class="Bound">t₂₂</a><a id="3401" class="Symbol">}</a>
<a id="3411" class="Symbol">{</a><a id="3412" href="Function.Equivalence.html#3412" class="Bound">f₁</a> <a id="3415" href="Function.Equivalence.html#3415" class="Bound">f₂</a> <a id="3418" href="Function.Equivalence.html#3418" class="Bound">t₁</a> <a id="3421" href="Function.Equivalence.html#3421" class="Bound">t₂</a><a id="3423" class="Symbol">}</a> <a id="3425" class="Symbol">{</a><a id="3426" href="Function.Equivalence.html#3426" class="Bound">From</a> <a id="3431" class="Symbol">:</a> <a id="3433" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="3440" href="Function.Equivalence.html#3412" class="Bound">f₁</a> <a id="3443" href="Function.Equivalence.html#3415" class="Bound">f₂</a><a id="3445" class="Symbol">}</a> <a id="3447" class="Symbol">{</a><a id="3448" href="Function.Equivalence.html#3448" class="Bound">To</a> <a id="3451" class="Symbol">:</a> <a id="3453" href="Relation.Binary.Bundles.html#1018" class="Record">Setoid</a> <a id="3460" href="Function.Equivalence.html#3418" class="Bound">t₁</a> <a id="3463" href="Function.Equivalence.html#3421" class="Bound">t₂</a><a id="3465" class="Symbol">}</a> <a id="3467" class="Symbol"></a>
<a id="3475" class="Symbol">((</a><a id="3477" href="Function.Equivalence.html#3274" class="Bound">From₁</a> <a id="3483" href="Function.Equality.html#1227" class="Function Operator"></a> <a id="3485" href="Function.Equivalence.html#3299" class="Bound">To₁</a><a id="3488" class="Symbol">)</a> <a id="3490" class="Symbol"></a> <a id="3492" class="Symbol">(</a><a id="3493" href="Function.Equivalence.html#3356" class="Bound">From₂</a> <a id="3499" href="Function.Equality.html#1227" class="Function Operator"></a> <a id="3501" href="Function.Equivalence.html#3381" class="Bound">To₂</a><a id="3504" class="Symbol">)</a> <a id="3506" class="Symbol"></a> <a id="3508" class="Symbol">(</a><a id="3509" href="Function.Equivalence.html#3426" class="Bound">From</a> <a id="3514" href="Function.Equality.html#1227" class="Function Operator"></a> <a id="3516" href="Function.Equivalence.html#3448" class="Bound">To</a><a id="3518" class="Symbol">))</a> <a id="3521" class="Symbol"></a>
<a id="3529" class="Symbol">((</a><a id="3531" href="Function.Equivalence.html#3299" class="Bound">To₁</a> <a id="3535" href="Function.Equality.html#1227" class="Function Operator"></a> <a id="3537" href="Function.Equivalence.html#3274" class="Bound">From₁</a><a id="3542" class="Symbol">)</a> <a id="3544" class="Symbol"></a> <a id="3546" class="Symbol">(</a><a id="3547" href="Function.Equivalence.html#3381" class="Bound">To₂</a> <a id="3551" href="Function.Equality.html#1227" class="Function Operator"></a> <a id="3553" href="Function.Equivalence.html#3356" class="Bound">From₂</a><a id="3558" class="Symbol">)</a> <a id="3560" class="Symbol"></a> <a id="3562" class="Symbol">(</a><a id="3563" href="Function.Equivalence.html#3448" class="Bound">To</a> <a id="3566" href="Function.Equality.html#1227" class="Function Operator"></a> <a id="3568" href="Function.Equivalence.html#3426" class="Bound">From</a><a id="3572" class="Symbol">))</a> <a id="3575" class="Symbol"></a>
<a id="3583" href="Function.Equivalence.html#838" class="Record">Equivalence</a> <a id="3595" href="Function.Equivalence.html#3274" class="Bound">From₁</a> <a id="3601" href="Function.Equivalence.html#3299" class="Bound">To₁</a> <a id="3605" class="Symbol"></a> <a id="3607" href="Function.Equivalence.html#838" class="Record">Equivalence</a> <a id="3619" href="Function.Equivalence.html#3356" class="Bound">From₂</a> <a id="3625" href="Function.Equivalence.html#3381" class="Bound">To₂</a> <a id="3629" class="Symbol"></a>
<a id="3637" href="Function.Equivalence.html#838" class="Record">Equivalence</a> <a id="3649" href="Function.Equivalence.html#3426" class="Bound">From</a> <a id="3654" href="Function.Equivalence.html#3448" class="Bound">To</a>
<a id="3657" href="Function.Equivalence.html#3239" class="Function">zip</a> <a id="3661" href="Function.Equivalence.html#3661" class="Bound">t</a> <a id="3663" href="Function.Equivalence.html#3663" class="Bound">f</a> <a id="3665" href="Function.Equivalence.html#3665" class="Bound">eq₁</a> <a id="3669" href="Function.Equivalence.html#3669" class="Bound">eq₂</a> <a id="3673" class="Symbol">=</a>
<a id="3677" class="Keyword">record</a> <a id="3684" class="Symbol">{</a> <a id="3686" href="Function.Equivalence.html#988" class="Field">to</a> <a id="3689" class="Symbol">=</a> <a id="3691" href="Function.Equivalence.html#3661" class="Bound">t</a> <a id="3693" class="Symbol">(</a><a id="3694" href="Function.Equivalence.html#988" class="Field">to</a> <a id="3697" href="Function.Equivalence.html#3665" class="Bound">eq₁</a><a id="3700" class="Symbol">)</a> <a id="3702" class="Symbol">(</a><a id="3703" href="Function.Equivalence.html#988" class="Field">to</a> <a id="3706" href="Function.Equivalence.html#3669" class="Bound">eq₂</a><a id="3709" class="Symbol">);</a> <a id="3712" href="Function.Equivalence.html#1009" class="Field">from</a> <a id="3717" class="Symbol">=</a> <a id="3719" href="Function.Equivalence.html#3663" class="Bound">f</a> <a id="3721" class="Symbol">(</a><a id="3722" href="Function.Equivalence.html#1009" class="Field">from</a> <a id="3727" href="Function.Equivalence.html#3665" class="Bound">eq₁</a><a id="3730" class="Symbol">)</a> <a id="3732" class="Symbol">(</a><a id="3733" href="Function.Equivalence.html#1009" class="Field">from</a> <a id="3738" href="Function.Equivalence.html#3669" class="Bound">eq₂</a><a id="3741" class="Symbol">)</a> <a id="3743" class="Symbol">}</a>
<a id="3747" class="Keyword">where</a> <a id="3753" class="Keyword">open</a> <a id="3758" href="Function.Equivalence.html#838" class="Module">Equivalence</a>
</pre></body></html>