bsc-leon-vatthauer/agda/bsc-thesis/Relation.Binary.Reasoning.Base.Single.html

52 lines
14 KiB
HTML
Raw Normal View History

2024-02-09 17:53:52 +01:00
<!DOCTYPE HTML>
<html><head><meta charset="utf-8"><title>Relation.Binary.Reasoning.Base.Single</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">-- The basic code for equational reasoning with a single relation</a>
<a id="172" class="Comment">------------------------------------------------------------------------</a>
<a id="246" class="Symbol">{-#</a> <a id="250" class="Keyword">OPTIONS</a> <a id="258" class="Pragma">--cubical-compatible</a> <a id="279" class="Pragma">--safe</a> <a id="286" class="Symbol">#-}</a>
<a id="291" class="Keyword">open</a> <a id="296" class="Keyword">import</a> <a id="303" href="Level.html" class="Module">Level</a> <a id="309" class="Keyword">using</a> <a id="315" class="Symbol">(</a><a id="316" href="Agda.Primitive.html#961" class="Primitive Operator">_⊔_</a><a id="319" class="Symbol">)</a>
<a id="321" class="Keyword">open</a> <a id="326" class="Keyword">import</a> <a id="333" href="Function.Base.html" class="Module">Function.Base</a> <a id="347" class="Keyword">using</a> <a id="353" class="Symbol">(</a><a id="354" href="Function.Base.html#4042" class="Function Operator">case_of_</a><a id="362" class="Symbol">)</a>
<a id="364" class="Keyword">open</a> <a id="369" class="Keyword">import</a> <a id="376" href="Relation.Binary.Core.html" class="Module">Relation.Binary.Core</a> <a id="397" class="Keyword">using</a> <a id="403" class="Symbol">(</a><a id="404" href="Relation.Binary.Core.html#896" class="Function">Rel</a><a id="407" class="Symbol">;</a> <a id="409" href="Relation.Binary.Core.html#1268" class="Function Operator">_⇒_</a><a id="412" class="Symbol">)</a>
<a id="414" class="Keyword">open</a> <a id="419" class="Keyword">import</a> <a id="426" href="Relation.Binary.Definitions.html" class="Module">Relation.Binary.Definitions</a> <a id="454" class="Keyword">using</a> <a id="460" class="Symbol">(</a><a id="461" href="Relation.Binary.Definitions.html#1428" class="Function">Reflexive</a><a id="470" class="Symbol">;</a> <a id="472" href="Relation.Binary.Definitions.html#2103" class="Function">Transitive</a><a id="482" class="Symbol">;</a> <a id="484" href="Relation.Binary.Definitions.html#1674" class="Function">Trans</a><a id="489" class="Symbol">)</a>
<a id="491" class="Keyword">open</a> <a id="496" class="Keyword">import</a> <a id="503" href="Relation.Binary.PropositionalEquality.Core.html" class="Module">Relation.Binary.PropositionalEquality.Core</a> <a id="546" class="Symbol">as</a> <a id="549" class="Module">P</a> <a id="551" class="Keyword">using</a> <a id="557" class="Symbol">(</a><a id="558" href="Agda.Builtin.Equality.html#150" class="Datatype Operator">_≡_</a><a id="561" class="Symbol">)</a>
<a id="563" class="Keyword">open</a> <a id="568" class="Keyword">import</a> <a id="575" href="Relation.Binary.Reasoning.Syntax.html" class="Module">Relation.Binary.Reasoning.Syntax</a>
<a id="609" class="Keyword">module</a> <a id="616" href="Relation.Binary.Reasoning.Base.Single.html" class="Module">Relation.Binary.Reasoning.Base.Single</a>
<a id="656" class="Symbol">{</a><a id="657" href="Relation.Binary.Reasoning.Base.Single.html#657" class="Bound">a</a> <a id="659" href="Relation.Binary.Reasoning.Base.Single.html#659" class="Bound"></a><a id="660" class="Symbol">}</a> <a id="662" class="Symbol">{</a><a id="663" href="Relation.Binary.Reasoning.Base.Single.html#663" class="Bound">A</a> <a id="665" class="Symbol">:</a> <a id="667" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="671" href="Relation.Binary.Reasoning.Base.Single.html#657" class="Bound">a</a><a id="672" class="Symbol">}</a> <a id="674" class="Symbol">(</a><a id="675" href="Relation.Binary.Reasoning.Base.Single.html#675" class="Bound Operator">__</a> <a id="679" class="Symbol">:</a> <a id="681" href="Relation.Binary.Core.html#896" class="Function">Rel</a> <a id="685" href="Relation.Binary.Reasoning.Base.Single.html#663" class="Bound">A</a> <a id="687" href="Relation.Binary.Reasoning.Base.Single.html#659" class="Bound"></a><a id="688" class="Symbol">)</a>
<a id="692" class="Symbol">(</a><a id="693" href="Relation.Binary.Reasoning.Base.Single.html#693" class="Bound">refl</a> <a id="698" class="Symbol">:</a> <a id="700" href="Relation.Binary.Definitions.html#1428" class="Function">Reflexive</a> <a id="710" href="Relation.Binary.Reasoning.Base.Single.html#675" class="Bound Operator">__</a><a id="713" class="Symbol">)</a> <a id="715" class="Symbol">(</a><a id="716" href="Relation.Binary.Reasoning.Base.Single.html#716" class="Bound">trans</a> <a id="722" class="Symbol">:</a> <a id="724" href="Relation.Binary.Definitions.html#2103" class="Function">Transitive</a> <a id="735" href="Relation.Binary.Reasoning.Base.Single.html#675" class="Bound Operator">__</a><a id="738" class="Symbol">)</a>
<a id="742" class="Keyword">where</a>
<a id="749" class="Comment">------------------------------------------------------------------------</a>
<a id="822" class="Comment">-- Definition of &quot;related to&quot;</a>
<a id="853" class="Comment">-- This seemingly unnecessary type is used to make it possible to</a>
<a id="919" class="Comment">-- infer arguments even if the underlying equality evaluates.</a>
<a id="982" class="Keyword">infix</a> <a id="988" class="Number">4</a> <a id="990" href="Relation.Binary.Reasoning.Base.Single.html#1010" class="Datatype Operator">_IsRelatedTo_</a>
<a id="1005" class="Keyword">data</a> <a id="_IsRelatedTo_"></a><a id="1010" href="Relation.Binary.Reasoning.Base.Single.html#1010" class="Datatype Operator">_IsRelatedTo_</a> <a id="1024" class="Symbol">(</a><a id="1025" href="Relation.Binary.Reasoning.Base.Single.html#1025" class="Bound">x</a> <a id="1027" href="Relation.Binary.Reasoning.Base.Single.html#1027" class="Bound">y</a> <a id="1029" class="Symbol">:</a> <a id="1031" href="Relation.Binary.Reasoning.Base.Single.html#663" class="Bound">A</a><a id="1032" class="Symbol">)</a> <a id="1034" class="Symbol">:</a> <a id="1036" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="1040" href="Relation.Binary.Reasoning.Base.Single.html#659" class="Bound"></a> <a id="1042" class="Keyword">where</a>
<a id="_IsRelatedTo_.relTo"></a><a id="1050" href="Relation.Binary.Reasoning.Base.Single.html#1050" class="InductiveConstructor">relTo</a> <a id="1056" class="Symbol">:</a> <a id="1058" class="Symbol">(</a><a id="1059" href="Relation.Binary.Reasoning.Base.Single.html#1059" class="Bound">xy</a> <a id="1063" class="Symbol">:</a> <a id="1065" href="Relation.Binary.Reasoning.Base.Single.html#1025" class="Bound">x</a> <a id="1067" href="Relation.Binary.Reasoning.Base.Single.html#675" class="Bound Operator"></a> <a id="1069" href="Relation.Binary.Reasoning.Base.Single.html#1027" class="Bound">y</a><a id="1070" class="Symbol">)</a> <a id="1072" class="Symbol"></a> <a id="1074" href="Relation.Binary.Reasoning.Base.Single.html#1025" class="Bound">x</a> <a id="1076" href="Relation.Binary.Reasoning.Base.Single.html#1010" class="Datatype Operator">IsRelatedTo</a> <a id="1088" href="Relation.Binary.Reasoning.Base.Single.html#1027" class="Bound">y</a>
<a id="start"></a><a id="1091" href="Relation.Binary.Reasoning.Base.Single.html#1091" class="Function">start</a> <a id="1097" class="Symbol">:</a> <a id="1099" href="Relation.Binary.Reasoning.Base.Single.html#1010" class="Datatype Operator">_IsRelatedTo_</a> <a id="1113" href="Relation.Binary.Core.html#1268" class="Function Operator"></a> <a id="1115" href="Relation.Binary.Reasoning.Base.Single.html#675" class="Bound Operator">__</a>
<a id="1119" href="Relation.Binary.Reasoning.Base.Single.html#1091" class="Function">start</a> <a id="1125" class="Symbol">(</a><a id="1126" href="Relation.Binary.Reasoning.Base.Single.html#1050" class="InductiveConstructor">relTo</a> <a id="1132" href="Relation.Binary.Reasoning.Base.Single.html#1132" class="Bound">xy</a><a id="1135" class="Symbol">)</a> <a id="1137" class="Symbol">=</a> <a id="1139" href="Relation.Binary.Reasoning.Base.Single.html#1132" class="Bound">xy</a>
<a id="-go"></a><a id="1144" href="Relation.Binary.Reasoning.Base.Single.html#1144" class="Function">-go</a> <a id="1149" class="Symbol">:</a> <a id="1151" href="Relation.Binary.Definitions.html#1674" class="Function">Trans</a> <a id="1157" href="Relation.Binary.Reasoning.Base.Single.html#675" class="Bound Operator">__</a> <a id="1161" href="Relation.Binary.Reasoning.Base.Single.html#1010" class="Datatype Operator">_IsRelatedTo_</a> <a id="1175" href="Relation.Binary.Reasoning.Base.Single.html#1010" class="Datatype Operator">_IsRelatedTo_</a>
<a id="1189" href="Relation.Binary.Reasoning.Base.Single.html#1144" class="Function">-go</a> <a id="1194" href="Relation.Binary.Reasoning.Base.Single.html#1194" class="Bound">xy</a> <a id="1198" class="Symbol">(</a><a id="1199" href="Relation.Binary.Reasoning.Base.Single.html#1050" class="InductiveConstructor">relTo</a> <a id="1205" href="Relation.Binary.Reasoning.Base.Single.html#1205" class="Bound">yz</a><a id="1208" class="Symbol">)</a> <a id="1210" class="Symbol">=</a> <a id="1212" href="Relation.Binary.Reasoning.Base.Single.html#1050" class="InductiveConstructor">relTo</a> <a id="1218" class="Symbol">(</a><a id="1219" href="Relation.Binary.Reasoning.Base.Single.html#716" class="Bound">trans</a> <a id="1225" href="Relation.Binary.Reasoning.Base.Single.html#1194" class="Bound">xy</a> <a id="1229" href="Relation.Binary.Reasoning.Base.Single.html#1205" class="Bound">yz</a><a id="1232" class="Symbol">)</a>
<a id="≡-go"></a><a id="1235" href="Relation.Binary.Reasoning.Base.Single.html#1235" class="Function">≡-go</a> <a id="1240" class="Symbol">:</a> <a id="1242" href="Relation.Binary.Definitions.html#1674" class="Function">Trans</a> <a id="1248" href="Agda.Builtin.Equality.html#150" class="Datatype Operator">_≡_</a> <a id="1252" href="Relation.Binary.Reasoning.Base.Single.html#1010" class="Datatype Operator">_IsRelatedTo_</a> <a id="1266" href="Relation.Binary.Reasoning.Base.Single.html#1010" class="Datatype Operator">_IsRelatedTo_</a>
<a id="1280" href="Relation.Binary.Reasoning.Base.Single.html#1235" class="Function">≡-go</a> <a id="1285" href="Relation.Binary.Reasoning.Base.Single.html#1285" class="Bound">x≡y</a> <a id="1289" class="Symbol">(</a><a id="1290" href="Relation.Binary.Reasoning.Base.Single.html#1050" class="InductiveConstructor">relTo</a> <a id="1296" href="Relation.Binary.Reasoning.Base.Single.html#1296" class="Bound">yz</a><a id="1299" class="Symbol">)</a> <a id="1301" class="Symbol">=</a> <a id="1303" href="Relation.Binary.Reasoning.Base.Single.html#1050" class="InductiveConstructor">relTo</a> <a id="1309" class="Symbol">(</a><a id="1310" href="Function.Base.html#4042" class="Function Operator">case</a> <a id="1315" href="Relation.Binary.Reasoning.Base.Single.html#1285" class="Bound">x≡y</a> <a id="1319" href="Function.Base.html#4042" class="Function Operator">of</a> <a id="1322" class="Symbol">λ</a> <a id="1324" class="Keyword">where</a> <a id="1330" href="Agda.Builtin.Equality.html#207" class="InductiveConstructor">P.refl</a> <a id="1337" class="Symbol"></a> <a id="1339" href="Relation.Binary.Reasoning.Base.Single.html#1296" class="Bound">yz</a><a id="1342" class="Symbol">)</a>
<a id="stop"></a><a id="1345" href="Relation.Binary.Reasoning.Base.Single.html#1345" class="Function">stop</a> <a id="1350" class="Symbol">:</a> <a id="1352" href="Relation.Binary.Definitions.html#1428" class="Function">Reflexive</a> <a id="1362" href="Relation.Binary.Reasoning.Base.Single.html#1010" class="Datatype Operator">_IsRelatedTo_</a>
<a id="1376" href="Relation.Binary.Reasoning.Base.Single.html#1345" class="Function">stop</a> <a id="1381" class="Symbol">=</a> <a id="1383" href="Relation.Binary.Reasoning.Base.Single.html#1050" class="InductiveConstructor">relTo</a> <a id="1389" href="Relation.Binary.Reasoning.Base.Single.html#693" class="Bound">refl</a>
<a id="1395" class="Comment">------------------------------------------------------------------------</a>
<a id="1468" class="Comment">-- Reasoning combinators</a>
<a id="1494" class="Keyword">open</a> <a id="1499" href="Relation.Binary.Reasoning.Syntax.html#1408" class="Module">begin-syntax</a> <a id="1512" href="Relation.Binary.Reasoning.Base.Single.html#1010" class="Datatype Operator">_IsRelatedTo_</a> <a id="1526" href="Relation.Binary.Reasoning.Base.Single.html#1091" class="Function">start</a> <a id="1532" class="Keyword">public</a>
<a id="1539" class="Keyword">open</a> <a id="1544" href="Relation.Binary.Reasoning.Syntax.html#10883" class="Module">≡-syntax</a> <a id="1553" href="Relation.Binary.Reasoning.Base.Single.html#1010" class="Datatype Operator">_IsRelatedTo_</a> <a id="1567" href="Relation.Binary.Reasoning.Base.Single.html#1235" class="Function">≡-go</a> <a id="1572" class="Keyword">public</a>
<a id="1579" class="Keyword">open</a> <a id="1584" href="Relation.Binary.Reasoning.Syntax.html#5172" class="Module">-syntax</a> <a id="1593" href="Relation.Binary.Reasoning.Base.Single.html#1010" class="Datatype Operator">_IsRelatedTo_</a> <a id="1607" href="Relation.Binary.Reasoning.Base.Single.html#1010" class="Datatype Operator">_IsRelatedTo_</a> <a id="1621" href="Relation.Binary.Reasoning.Base.Single.html#1144" class="Function">-go</a> <a id="1626" class="Keyword">public</a>
<a id="1633" class="Keyword">open</a> <a id="1638" href="Relation.Binary.Reasoning.Syntax.html#12202" class="Module">end-syntax</a> <a id="1649" href="Relation.Binary.Reasoning.Base.Single.html#1010" class="Datatype Operator">_IsRelatedTo_</a> <a id="1663" href="Relation.Binary.Reasoning.Base.Single.html#1345" class="Function">stop</a> <a id="1668" class="Keyword">public</a>
</pre></body></html>