mirror of
https://git8.cs.fau.de/theses/bsc-leon-vatthauer.git
synced 2024-05-31 07:28:34 +02:00
77 lines
20 KiB
HTML
77 lines
20 KiB
HTML
|
<!DOCTYPE HTML>
|
||
|
<html><head><meta charset="utf-8"><title>Relation.Nullary.Negation.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">-- Core properties related to negation</a>
|
||
|
<a id="145" class="Comment">------------------------------------------------------------------------</a>
|
||
|
|
||
|
<a id="219" class="Symbol">{-#</a> <a id="223" class="Keyword">OPTIONS</a> <a id="231" class="Pragma">--cubical-compatible</a> <a id="252" class="Pragma">--safe</a> <a id="259" class="Symbol">#-}</a>
|
||
|
|
||
|
<a id="264" class="Keyword">module</a> <a id="271" href="Relation.Nullary.Negation.Core.html" class="Module">Relation.Nullary.Negation.Core</a> <a id="302" class="Keyword">where</a>
|
||
|
|
||
|
<a id="309" class="Keyword">open</a> <a id="314" class="Keyword">import</a> <a id="321" href="Data.Bool.Base.html" class="Module">Data.Bool.Base</a> <a id="336" class="Keyword">using</a> <a id="342" class="Symbol">(</a><a id="343" href="Data.Bool.Base.html#941" class="Function">not</a><a id="346" class="Symbol">)</a>
|
||
|
<a id="348" class="Keyword">open</a> <a id="353" class="Keyword">import</a> <a id="360" href="Data.Empty.html" class="Module">Data.Empty</a> <a id="371" class="Keyword">using</a> <a id="377" class="Symbol">(</a><a id="378" href="Data.Empty.html#895" class="Function">⊥</a><a id="379" class="Symbol">;</a> <a id="381" href="Data.Empty.html#1050" class="Function">⊥-elim</a><a id="387" class="Symbol">)</a>
|
||
|
<a id="389" class="Keyword">open</a> <a id="394" class="Keyword">import</a> <a id="401" href="Data.Sum.Base.html" class="Module">Data.Sum.Base</a> <a id="415" class="Keyword">using</a> <a id="421" class="Symbol">(</a><a id="422" href="Data.Sum.Base.html#625" class="Datatype Operator">_⊎_</a><a id="425" class="Symbol">;</a> <a id="427" href="Data.Sum.Base.html#811" class="Function Operator">[_,_]</a><a id="432" class="Symbol">;</a> <a id="434" href="Data.Sum.Base.html#675" class="InductiveConstructor">inj₁</a><a id="438" class="Symbol">;</a> <a id="440" href="Data.Sum.Base.html#700" class="InductiveConstructor">inj₂</a><a id="444" class="Symbol">)</a>
|
||
|
<a id="446" class="Keyword">open</a> <a id="451" class="Keyword">import</a> <a id="458" href="Function.Base.html" class="Module">Function.Base</a> <a id="472" class="Keyword">using</a> <a id="478" class="Symbol">(</a><a id="479" href="Function.Base.html#1638" class="Function">flip</a><a id="483" class="Symbol">;</a> <a id="485" href="Function.Base.html#1974" class="Function Operator">_$_</a><a id="488" class="Symbol">;</a> <a id="490" href="Function.Base.html#1115" class="Function Operator">_∘_</a><a id="493" class="Symbol">;</a> <a id="495" href="Function.Base.html#725" class="Function">const</a><a id="500" class="Symbol">)</a>
|
||
|
<a id="502" class="Keyword">open</a> <a id="507" class="Keyword">import</a> <a id="514" href="Level.html" class="Module">Level</a>
|
||
|
|
||
|
<a id="521" class="Keyword">private</a>
|
||
|
<a id="531" class="Keyword">variable</a>
|
||
|
<a id="544" href="Relation.Nullary.Negation.Core.html#544" class="Generalizable">a</a> <a id="546" href="Relation.Nullary.Negation.Core.html#546" class="Generalizable">p</a> <a id="548" href="Relation.Nullary.Negation.Core.html#548" class="Generalizable">q</a> <a id="550" href="Relation.Nullary.Negation.Core.html#550" class="Generalizable">w</a> <a id="552" class="Symbol">:</a> <a id="554" href="Agda.Primitive.html#742" class="Postulate">Level</a>
|
||
|
<a id="564" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a> <a id="566" href="Relation.Nullary.Negation.Core.html#566" class="Generalizable">B</a> <a id="568" href="Relation.Nullary.Negation.Core.html#568" class="Generalizable">C</a> <a id="570" class="Symbol">:</a> <a id="572" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="576" href="Relation.Nullary.Negation.Core.html#544" class="Generalizable">a</a>
|
||
|
<a id="582" href="Relation.Nullary.Negation.Core.html#582" class="Generalizable">Whatever</a> <a id="591" class="Symbol">:</a> <a id="593" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="597" href="Relation.Nullary.Negation.Core.html#550" class="Generalizable">w</a>
|
||
|
|
||
|
<a id="600" class="Comment">------------------------------------------------------------------------</a>
|
||
|
<a id="673" class="Comment">-- Negation.</a>
|
||
|
|
||
|
<a id="687" class="Keyword">infix</a> <a id="693" class="Number">3</a> <a id="695" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬_</a>
|
||
|
<a id="¬_"></a><a id="698" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬_</a> <a id="701" class="Symbol">:</a> <a id="703" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="707" href="Relation.Nullary.Negation.Core.html#544" class="Generalizable">a</a> <a id="709" class="Symbol">→</a> <a id="711" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="715" href="Relation.Nullary.Negation.Core.html#544" class="Generalizable">a</a>
|
||
|
<a id="717" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="719" href="Relation.Nullary.Negation.Core.html#719" class="Bound">A</a> <a id="721" class="Symbol">=</a> <a id="723" href="Relation.Nullary.Negation.Core.html#719" class="Bound">A</a> <a id="725" class="Symbol">→</a> <a id="727" href="Data.Empty.html#895" class="Function">⊥</a>
|
||
|
|
||
|
<a id="730" class="Comment">------------------------------------------------------------------------</a>
|
||
|
<a id="803" class="Comment">-- Stability.</a>
|
||
|
|
||
|
<a id="818" class="Comment">-- Double-negation</a>
|
||
|
<a id="DoubleNegation"></a><a id="837" href="Relation.Nullary.Negation.Core.html#837" class="Function">DoubleNegation</a> <a id="852" class="Symbol">:</a> <a id="854" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="858" href="Relation.Nullary.Negation.Core.html#544" class="Generalizable">a</a> <a id="860" class="Symbol">→</a> <a id="862" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="866" href="Relation.Nullary.Negation.Core.html#544" class="Generalizable">a</a>
|
||
|
<a id="868" href="Relation.Nullary.Negation.Core.html#837" class="Function">DoubleNegation</a> <a id="883" href="Relation.Nullary.Negation.Core.html#883" class="Bound">A</a> <a id="885" class="Symbol">=</a> <a id="887" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="889" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="891" href="Relation.Nullary.Negation.Core.html#883" class="Bound">A</a>
|
||
|
|
||
|
<a id="894" class="Comment">-- Stability under double-negation.</a>
|
||
|
<a id="Stable"></a><a id="930" href="Relation.Nullary.Negation.Core.html#930" class="Function">Stable</a> <a id="937" class="Symbol">:</a> <a id="939" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="943" href="Relation.Nullary.Negation.Core.html#544" class="Generalizable">a</a> <a id="945" class="Symbol">→</a> <a id="947" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="951" href="Relation.Nullary.Negation.Core.html#544" class="Generalizable">a</a>
|
||
|
<a id="953" href="Relation.Nullary.Negation.Core.html#930" class="Function">Stable</a> <a id="960" href="Relation.Nullary.Negation.Core.html#960" class="Bound">A</a> <a id="962" class="Symbol">=</a> <a id="964" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="966" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="968" href="Relation.Nullary.Negation.Core.html#960" class="Bound">A</a> <a id="970" class="Symbol">→</a> <a id="972" href="Relation.Nullary.Negation.Core.html#960" class="Bound">A</a>
|
||
|
|
||
|
<a id="975" class="Comment">------------------------------------------------------------------------</a>
|
||
|
<a id="1048" class="Comment">-- Relationship to sum</a>
|
||
|
|
||
|
<a id="1072" class="Keyword">infixr</a> <a id="1079" class="Number">1</a> <a id="1081" href="Relation.Nullary.Negation.Core.html#1087" class="Function Operator">_¬-⊎_</a>
|
||
|
<a id="_¬-⊎_"></a><a id="1087" href="Relation.Nullary.Negation.Core.html#1087" class="Function Operator">_¬-⊎_</a> <a id="1093" class="Symbol">:</a> <a id="1095" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1097" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a> <a id="1099" class="Symbol">→</a> <a id="1101" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1103" href="Relation.Nullary.Negation.Core.html#566" class="Generalizable">B</a> <a id="1105" class="Symbol">→</a> <a id="1107" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1109" class="Symbol">(</a><a id="1110" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a> <a id="1112" href="Data.Sum.Base.html#625" class="Datatype Operator">⊎</a> <a id="1114" href="Relation.Nullary.Negation.Core.html#566" class="Generalizable">B</a><a id="1115" class="Symbol">)</a>
|
||
|
<a id="1117" href="Relation.Nullary.Negation.Core.html#1087" class="Function Operator">_¬-⊎_</a> <a id="1123" class="Symbol">=</a> <a id="1125" href="Data.Sum.Base.html#811" class="Function Operator">[_,_]</a>
|
||
|
|
||
|
<a id="1132" class="Comment">------------------------------------------------------------------------</a>
|
||
|
<a id="1205" class="Comment">-- Uses of negation</a>
|
||
|
|
||
|
<a id="contradiction"></a><a id="1226" href="Relation.Nullary.Negation.Core.html#1226" class="Function">contradiction</a> <a id="1240" class="Symbol">:</a> <a id="1242" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a> <a id="1244" class="Symbol">→</a> <a id="1246" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1248" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a> <a id="1250" class="Symbol">→</a> <a id="1252" href="Relation.Nullary.Negation.Core.html#582" class="Generalizable">Whatever</a>
|
||
|
<a id="1261" href="Relation.Nullary.Negation.Core.html#1226" class="Function">contradiction</a> <a id="1275" href="Relation.Nullary.Negation.Core.html#1275" class="Bound">a</a> <a id="1277" href="Relation.Nullary.Negation.Core.html#1277" class="Bound">¬a</a> <a id="1280" class="Symbol">=</a> <a id="1282" href="Data.Empty.html#1050" class="Function">⊥-elim</a> <a id="1289" class="Symbol">(</a><a id="1290" href="Relation.Nullary.Negation.Core.html#1277" class="Bound">¬a</a> <a id="1293" href="Relation.Nullary.Negation.Core.html#1275" class="Bound">a</a><a id="1294" class="Symbol">)</a>
|
||
|
|
||
|
<a id="contradiction₂"></a><a id="1297" href="Relation.Nullary.Negation.Core.html#1297" class="Function">contradiction₂</a> <a id="1312" class="Symbol">:</a> <a id="1314" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a> <a id="1316" href="Data.Sum.Base.html#625" class="Datatype Operator">⊎</a> <a id="1318" href="Relation.Nullary.Negation.Core.html#566" class="Generalizable">B</a> <a id="1320" class="Symbol">→</a> <a id="1322" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1324" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a> <a id="1326" class="Symbol">→</a> <a id="1328" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1330" href="Relation.Nullary.Negation.Core.html#566" class="Generalizable">B</a> <a id="1332" class="Symbol">→</a> <a id="1334" href="Relation.Nullary.Negation.Core.html#582" class="Generalizable">Whatever</a>
|
||
|
<a id="1343" href="Relation.Nullary.Negation.Core.html#1297" class="Function">contradiction₂</a> <a id="1358" class="Symbol">(</a><a id="1359" href="Data.Sum.Base.html#675" class="InductiveConstructor">inj₁</a> <a id="1364" href="Relation.Nullary.Negation.Core.html#1364" class="Bound">a</a><a id="1365" class="Symbol">)</a> <a id="1367" href="Relation.Nullary.Negation.Core.html#1367" class="Bound">¬a</a> <a id="1370" href="Relation.Nullary.Negation.Core.html#1370" class="Bound">¬b</a> <a id="1373" class="Symbol">=</a> <a id="1375" href="Relation.Nullary.Negation.Core.html#1226" class="Function">contradiction</a> <a id="1389" href="Relation.Nullary.Negation.Core.html#1364" class="Bound">a</a> <a id="1391" href="Relation.Nullary.Negation.Core.html#1367" class="Bound">¬a</a>
|
||
|
<a id="1394" href="Relation.Nullary.Negation.Core.html#1297" class="Function">contradiction₂</a> <a id="1409" class="Symbol">(</a><a id="1410" href="Data.Sum.Base.html#700" class="InductiveConstructor">inj₂</a> <a id="1415" href="Relation.Nullary.Negation.Core.html#1415" class="Bound">b</a><a id="1416" class="Symbol">)</a> <a id="1418" href="Relation.Nullary.Negation.Core.html#1418" class="Bound">¬a</a> <a id="1421" href="Relation.Nullary.Negation.Core.html#1421" class="Bound">¬b</a> <a id="1424" class="Symbol">=</a> <a id="1426" href="Relation.Nullary.Negation.Core.html#1226" class="Function">contradiction</a> <a id="1440" href="Relation.Nullary.Negation.Core.html#1415" class="Bound">b</a> <a id="1442" href="Relation.Nullary.Negation.Core.html#1421" class="Bound">¬b</a>
|
||
|
|
||
|
<a id="contraposition"></a><a id="1446" href="Relation.Nullary.Negation.Core.html#1446" class="Function">contraposition</a> <a id="1461" class="Symbol">:</a> <a id="1463" class="Symbol">(</a><a id="1464" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a> <a id="1466" class="Symbol">→</a> <a id="1468" href="Relation.Nullary.Negation.Core.html#566" class="Generalizable">B</a><a id="1469" class="Symbol">)</a> <a id="1471" class="Symbol">→</a> <a id="1473" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1475" href="Relation.Nullary.Negation.Core.html#566" class="Generalizable">B</a> <a id="1477" class="Symbol">→</a> <a id="1479" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1481" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a>
|
||
|
<a id="1483" href="Relation.Nullary.Negation.Core.html#1446" class="Function">contraposition</a> <a id="1498" href="Relation.Nullary.Negation.Core.html#1498" class="Bound">f</a> <a id="1500" href="Relation.Nullary.Negation.Core.html#1500" class="Bound">¬b</a> <a id="1503" href="Relation.Nullary.Negation.Core.html#1503" class="Bound">a</a> <a id="1505" class="Symbol">=</a> <a id="1507" href="Relation.Nullary.Negation.Core.html#1226" class="Function">contradiction</a> <a id="1521" class="Symbol">(</a><a id="1522" href="Relation.Nullary.Negation.Core.html#1498" class="Bound">f</a> <a id="1524" href="Relation.Nullary.Negation.Core.html#1503" class="Bound">a</a><a id="1525" class="Symbol">)</a> <a id="1527" href="Relation.Nullary.Negation.Core.html#1500" class="Bound">¬b</a>
|
||
|
|
||
|
<a id="1531" class="Comment">-- Everything is stable in the double-negation monad.</a>
|
||
|
<a id="stable"></a><a id="1585" href="Relation.Nullary.Negation.Core.html#1585" class="Function">stable</a> <a id="1592" class="Symbol">:</a> <a id="1594" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1596" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1598" href="Relation.Nullary.Negation.Core.html#930" class="Function">Stable</a> <a id="1605" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a>
|
||
|
<a id="1607" href="Relation.Nullary.Negation.Core.html#1585" class="Function">stable</a> <a id="1614" href="Relation.Nullary.Negation.Core.html#1614" class="Bound">¬[¬¬a→a]</a> <a id="1623" class="Symbol">=</a> <a id="1625" href="Relation.Nullary.Negation.Core.html#1614" class="Bound">¬[¬¬a→a]</a> <a id="1634" class="Symbol">(λ</a> <a id="1637" href="Relation.Nullary.Negation.Core.html#1637" class="Bound">¬¬a</a> <a id="1641" class="Symbol">→</a> <a id="1643" href="Data.Empty.html#1050" class="Function">⊥-elim</a> <a id="1650" class="Symbol">(</a><a id="1651" href="Relation.Nullary.Negation.Core.html#1637" class="Bound">¬¬a</a> <a id="1655" class="Symbol">(</a><a id="1656" href="Relation.Nullary.Negation.Core.html#1614" class="Bound">¬[¬¬a→a]</a> <a id="1665" href="Function.Base.html#1115" class="Function Operator">∘</a> <a id="1667" href="Function.Base.html#725" class="Function">const</a><a id="1672" class="Symbol">)))</a>
|
||
|
|
||
|
<a id="1677" class="Comment">-- Negated predicates are stable.</a>
|
||
|
<a id="negated-stable"></a><a id="1711" href="Relation.Nullary.Negation.Core.html#1711" class="Function">negated-stable</a> <a id="1726" class="Symbol">:</a> <a id="1728" href="Relation.Nullary.Negation.Core.html#930" class="Function">Stable</a> <a id="1735" class="Symbol">(</a><a id="1736" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1738" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a><a id="1739" class="Symbol">)</a>
|
||
|
<a id="1741" href="Relation.Nullary.Negation.Core.html#1711" class="Function">negated-stable</a> <a id="1756" href="Relation.Nullary.Negation.Core.html#1756" class="Bound">¬¬¬a</a> <a id="1761" href="Relation.Nullary.Negation.Core.html#1761" class="Bound">a</a> <a id="1763" class="Symbol">=</a> <a id="1765" href="Relation.Nullary.Negation.Core.html#1756" class="Bound">¬¬¬a</a> <a id="1770" class="Symbol">(</a><a id="1771" href="Function.Base.html#1974" class="Function Operator">_$</a> <a id="1774" href="Relation.Nullary.Negation.Core.html#1761" class="Bound">a</a><a id="1775" class="Symbol">)</a>
|
||
|
|
||
|
<a id="¬¬-map"></a><a id="1778" href="Relation.Nullary.Negation.Core.html#1778" class="Function">¬¬-map</a> <a id="1785" class="Symbol">:</a> <a id="1787" class="Symbol">(</a><a id="1788" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a> <a id="1790" class="Symbol">→</a> <a id="1792" href="Relation.Nullary.Negation.Core.html#566" class="Generalizable">B</a><a id="1793" class="Symbol">)</a> <a id="1795" class="Symbol">→</a> <a id="1797" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1799" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1801" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a> <a id="1803" class="Symbol">→</a> <a id="1805" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1807" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1809" href="Relation.Nullary.Negation.Core.html#566" class="Generalizable">B</a>
|
||
|
<a id="1811" href="Relation.Nullary.Negation.Core.html#1778" class="Function">¬¬-map</a> <a id="1818" href="Relation.Nullary.Negation.Core.html#1818" class="Bound">f</a> <a id="1820" class="Symbol">=</a> <a id="1822" href="Relation.Nullary.Negation.Core.html#1446" class="Function">contraposition</a> <a id="1837" class="Symbol">(</a><a id="1838" href="Relation.Nullary.Negation.Core.html#1446" class="Function">contraposition</a> <a id="1853" href="Relation.Nullary.Negation.Core.html#1818" class="Bound">f</a><a id="1854" class="Symbol">)</a>
|
||
|
|
||
|
<a id="1857" class="Comment">-- Note also the following use of flip:</a>
|
||
|
<a id="1897" class="Keyword">private</a>
|
||
|
<a id="note"></a><a id="1907" href="Relation.Nullary.Negation.Core.html#1907" class="Function">note</a> <a id="1912" class="Symbol">:</a> <a id="1914" class="Symbol">(</a><a id="1915" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a> <a id="1917" class="Symbol">→</a> <a id="1919" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1921" href="Relation.Nullary.Negation.Core.html#566" class="Generalizable">B</a><a id="1922" class="Symbol">)</a> <a id="1924" class="Symbol">→</a> <a id="1926" href="Relation.Nullary.Negation.Core.html#566" class="Generalizable">B</a> <a id="1928" class="Symbol">→</a> <a id="1930" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1932" href="Relation.Nullary.Negation.Core.html#564" class="Generalizable">A</a>
|
||
|
<a id="1936" href="Relation.Nullary.Negation.Core.html#1907" class="Function">note</a> <a id="1941" class="Symbol">=</a> <a id="1943" href="Function.Base.html#1638" class="Function">flip</a>
|
||
|
</pre></body></html>
|