mirror of
https://git8.cs.fau.de/theses/bsc-leon-vatthauer.git
synced 2024-05-31 07:28:34 +02:00
138 lines
No EOL
39 KiB
HTML
138 lines
No EOL
39 KiB
HTML
<!DOCTYPE HTML>
|
||
<html><head><meta charset="utf-8"><title>Relation.Nullary.Negation</title><link rel="stylesheet" href="Agda.css"></head><body><pre class="Agda"><a id="1" class="Comment">------------------------------------------------------------------------</a>
|
||
<a id="74" class="Comment">-- The Agda standard library</a>
|
||
<a id="103" class="Comment">--</a>
|
||
<a id="106" class="Comment">-- Properties related to negation</a>
|
||
<a id="140" class="Comment">------------------------------------------------------------------------</a>
|
||
|
||
<a id="214" class="Symbol">{-#</a> <a id="218" class="Keyword">OPTIONS</a> <a id="226" class="Pragma">--cubical-compatible</a> <a id="247" class="Pragma">--safe</a> <a id="254" class="Symbol">#-}</a>
|
||
|
||
<a id="259" class="Keyword">module</a> <a id="266" href="Relation.Nullary.Negation.html" class="Module">Relation.Nullary.Negation</a> <a id="292" class="Keyword">where</a>
|
||
|
||
<a id="299" class="Keyword">open</a> <a id="304" class="Keyword">import</a> <a id="311" href="Category.Monad.html" class="Module">Category.Monad</a>
|
||
<a id="326" class="Keyword">open</a> <a id="331" class="Keyword">import</a> <a id="338" href="Data.Bool.Base.html" class="Module">Data.Bool.Base</a> <a id="353" class="Keyword">using</a> <a id="359" class="Symbol">(</a><a id="360" href="Agda.Builtin.Bool.html#156" class="Datatype">Bool</a><a id="364" class="Symbol">;</a> <a id="366" href="Agda.Builtin.Bool.html#175" class="InductiveConstructor">false</a><a id="371" class="Symbol">;</a> <a id="373" href="Agda.Builtin.Bool.html#181" class="InductiveConstructor">true</a><a id="377" class="Symbol">;</a> <a id="379" href="Data.Bool.Base.html#1292" class="Function Operator">if_then_else_</a><a id="392" class="Symbol">;</a> <a id="394" href="Data.Bool.Base.html#941" class="Function">not</a><a id="397" class="Symbol">)</a>
|
||
<a id="399" class="Keyword">open</a> <a id="404" class="Keyword">import</a> <a id="411" href="Data.Empty.html" class="Module">Data.Empty</a>
|
||
<a id="422" class="Keyword">open</a> <a id="427" class="Keyword">import</a> <a id="434" href="Data.Product.html" class="Module">Data.Product</a> <a id="447" class="Symbol">as</a> <a id="450" class="Module">Prod</a>
|
||
<a id="455" class="Keyword">open</a> <a id="460" class="Keyword">import</a> <a id="467" href="Data.Sum.Base.html" class="Module">Data.Sum.Base</a> <a id="481" class="Symbol">as</a> <a id="484" class="Module">Sum</a> <a id="488" class="Keyword">using</a> <a id="494" class="Symbol">(</a><a id="495" href="Data.Sum.Base.html#743" class="Datatype Operator">_⊎_</a><a id="498" class="Symbol">;</a> <a id="500" href="Data.Sum.Base.html#793" class="InductiveConstructor">inj₁</a><a id="504" class="Symbol">;</a> <a id="506" href="Data.Sum.Base.html#818" class="InductiveConstructor">inj₂</a><a id="510" class="Symbol">;</a> <a id="512" href="Data.Sum.Base.html#929" class="Function Operator">[_,_]</a><a id="517" class="Symbol">)</a>
|
||
<a id="519" class="Keyword">open</a> <a id="524" class="Keyword">import</a> <a id="531" href="Function.html" class="Module">Function</a>
|
||
<a id="540" class="Keyword">open</a> <a id="545" class="Keyword">import</a> <a id="552" href="Level.html" class="Module">Level</a>
|
||
<a id="558" class="Keyword">open</a> <a id="563" class="Keyword">import</a> <a id="570" href="Relation.Nullary.html" class="Module">Relation.Nullary</a>
|
||
<a id="587" class="Keyword">open</a> <a id="592" class="Keyword">import</a> <a id="599" href="Relation.Nullary.Decidable.html" class="Module">Relation.Nullary.Decidable</a>
|
||
<a id="626" class="Keyword">open</a> <a id="631" class="Keyword">import</a> <a id="638" href="Relation.Unary.html" class="Module">Relation.Unary</a>
|
||
|
||
<a id="654" class="Keyword">private</a>
|
||
<a id="664" class="Keyword">variable</a>
|
||
<a id="677" href="Relation.Nullary.Negation.html#677" class="Generalizable">a</a> <a id="679" href="Relation.Nullary.Negation.html#679" class="Generalizable">p</a> <a id="681" href="Relation.Nullary.Negation.html#681" class="Generalizable">q</a> <a id="683" href="Relation.Nullary.Negation.html#683" class="Generalizable">r</a> <a id="685" href="Relation.Nullary.Negation.html#685" class="Generalizable">w</a> <a id="687" class="Symbol">:</a> <a id="689" href="Agda.Primitive.html#591" class="Postulate">Level</a>
|
||
<a id="699" href="Relation.Nullary.Negation.html#699" class="Generalizable">A</a> <a id="701" class="Symbol">:</a> <a id="703" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="707" href="Relation.Nullary.Negation.html#677" class="Generalizable">a</a>
|
||
<a id="713" href="Relation.Nullary.Negation.html#713" class="Generalizable">P</a> <a id="715" class="Symbol">:</a> <a id="717" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="721" href="Relation.Nullary.Negation.html#679" class="Generalizable">p</a>
|
||
<a id="727" href="Relation.Nullary.Negation.html#727" class="Generalizable">Q</a> <a id="729" class="Symbol">:</a> <a id="731" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="735" href="Relation.Nullary.Negation.html#681" class="Generalizable">q</a>
|
||
<a id="741" href="Relation.Nullary.Negation.html#741" class="Generalizable">R</a> <a id="743" class="Symbol">:</a> <a id="745" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="749" href="Relation.Nullary.Negation.html#683" class="Generalizable">r</a>
|
||
<a id="755" href="Relation.Nullary.Negation.html#755" class="Generalizable">Whatever</a> <a id="764" class="Symbol">:</a> <a id="766" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="770" href="Relation.Nullary.Negation.html#685" class="Generalizable">w</a>
|
||
|
||
<a id="773" class="Comment">------------------------------------------------------------------------</a>
|
||
<a id="846" class="Comment">-- Re-export public definitions</a>
|
||
|
||
<a id="879" class="Keyword">open</a> <a id="884" class="Keyword">import</a> <a id="891" href="Relation.Nullary.Negation.Core.html" class="Module">Relation.Nullary.Negation.Core</a> <a id="922" class="Keyword">public</a>
|
||
|
||
<a id="930" class="Comment">------------------------------------------------------------------------</a>
|
||
<a id="1003" class="Comment">-- Other properties</a>
|
||
|
||
<a id="1024" class="Comment">-- Decidable predicates are stable.</a>
|
||
|
||
<a id="decidable-stable"></a><a id="1061" href="Relation.Nullary.Negation.html#1061" class="Function">decidable-stable</a> <a id="1078" class="Symbol">:</a> <a id="1080" href="Relation.Nullary.html#1520" class="Record">Dec</a> <a id="1084" href="Relation.Nullary.Negation.html#713" class="Generalizable">P</a> <a id="1086" class="Symbol">→</a> <a id="1088" href="Relation.Nullary.Negation.Core.html#2110" class="Function">Stable</a> <a id="1095" href="Relation.Nullary.Negation.html#713" class="Generalizable">P</a>
|
||
<a id="1097" href="Relation.Nullary.Negation.html#1061" class="Function">decidable-stable</a> <a id="1114" class="Symbol">(</a><a id="1115" href="Relation.Nullary.html#1657" class="InductiveConstructor">yes</a> <a id="1119" href="Relation.Nullary.Negation.html#1119" class="Bound">p</a><a id="1120" class="Symbol">)</a> <a id="1122" href="Relation.Nullary.Negation.html#1122" class="Bound">¬¬p</a> <a id="1126" class="Symbol">=</a> <a id="1128" href="Relation.Nullary.Negation.html#1119" class="Bound">p</a>
|
||
<a id="1130" href="Relation.Nullary.Negation.html#1061" class="Function">decidable-stable</a> <a id="1147" class="Symbol">(</a><a id="1148" href="Relation.Nullary.html#1694" class="InductiveConstructor">no</a> <a id="1151" href="Relation.Nullary.Negation.html#1151" class="Bound">¬p</a><a id="1153" class="Symbol">)</a> <a id="1155" href="Relation.Nullary.Negation.html#1155" class="Bound">¬¬p</a> <a id="1159" class="Symbol">=</a> <a id="1161" href="Data.Empty.html#637" class="Function">⊥-elim</a> <a id="1168" class="Symbol">(</a><a id="1169" href="Relation.Nullary.Negation.html#1155" class="Bound">¬¬p</a> <a id="1173" href="Relation.Nullary.Negation.html#1151" class="Bound">¬p</a><a id="1175" class="Symbol">)</a>
|
||
|
||
<a id="¬-drop-Dec"></a><a id="1178" href="Relation.Nullary.Negation.html#1178" class="Function">¬-drop-Dec</a> <a id="1189" class="Symbol">:</a> <a id="1191" href="Relation.Nullary.html#1520" class="Record">Dec</a> <a id="1195" class="Symbol">(</a><a id="1196" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="1198" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="1200" href="Relation.Nullary.Negation.html#713" class="Generalizable">P</a><a id="1201" class="Symbol">)</a> <a id="1203" class="Symbol">→</a> <a id="1205" href="Relation.Nullary.html#1520" class="Record">Dec</a> <a id="1209" class="Symbol">(</a><a id="1210" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="1212" href="Relation.Nullary.Negation.html#713" class="Generalizable">P</a><a id="1213" class="Symbol">)</a>
|
||
<a id="1215" href="Relation.Nullary.Negation.html#1178" class="Function">¬-drop-Dec</a> <a id="1226" href="Relation.Nullary.Negation.html#1226" class="Bound">¬¬p?</a> <a id="1231" class="Symbol">=</a> <a id="1233" href="Relation.Nullary.Decidable.Core.html#3645" class="Function">map′</a> <a id="1238" href="Relation.Nullary.Negation.Core.html#2337" class="Function">negated-stable</a> <a id="1253" href="Relation.Nullary.Negation.Core.html#787" class="Function">contradiction</a> <a id="1267" class="Symbol">(</a><a id="1268" href="Relation.Nullary.Negation.Core.html#1364" class="Function">¬?</a> <a id="1271" href="Relation.Nullary.Negation.html#1226" class="Bound">¬¬p?</a><a id="1275" class="Symbol">)</a>
|
||
|
||
<a id="1278" class="Comment">-- Double-negation is a monad (if we assume that all elements of ¬ ¬ P</a>
|
||
<a id="1349" class="Comment">-- are equal).</a>
|
||
|
||
<a id="¬¬-Monad"></a><a id="1365" href="Relation.Nullary.Negation.html#1365" class="Function">¬¬-Monad</a> <a id="1374" class="Symbol">:</a> <a id="1376" href="Category.Monad.html#457" class="Function">RawMonad</a> <a id="1385" class="Symbol">(λ</a> <a id="1388" class="Symbol">(</a><a id="1389" href="Relation.Nullary.Negation.html#1389" class="Bound">P</a> <a id="1391" class="Symbol">:</a> <a id="1393" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1397" href="Relation.Nullary.Negation.html#679" class="Generalizable">p</a><a id="1398" class="Symbol">)</a> <a id="1400" class="Symbol">→</a> <a id="1402" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="1404" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="1406" href="Relation.Nullary.Negation.html#1389" class="Bound">P</a><a id="1407" class="Symbol">)</a>
|
||
<a id="1409" href="Relation.Nullary.Negation.html#1365" class="Function">¬¬-Monad</a> <a id="1418" class="Symbol">=</a> <a id="1420" class="Keyword">record</a>
|
||
<a id="1429" class="Symbol">{</a> <a id="1431" href="Category.Monad.Indexed.html#653" class="Field">return</a> <a id="1438" class="Symbol">=</a> <a id="1440" href="Relation.Nullary.Negation.Core.html#787" class="Function">contradiction</a>
|
||
<a id="1456" class="Symbol">;</a> <a id="1458" href="Category.Monad.Indexed.html#686" class="Field Operator">_>>=_</a> <a id="1465" class="Symbol">=</a> <a id="1467" class="Symbol">λ</a> <a id="1469" href="Relation.Nullary.Negation.html#1469" class="Bound">x</a> <a id="1471" href="Relation.Nullary.Negation.html#1471" class="Bound">f</a> <a id="1473" class="Symbol">→</a> <a id="1475" href="Relation.Nullary.Negation.Core.html#2337" class="Function">negated-stable</a> <a id="1490" class="Symbol">(</a><a id="1491" href="Relation.Nullary.Negation.Core.html#1994" class="Function">¬¬-map</a> <a id="1498" href="Relation.Nullary.Negation.html#1471" class="Bound">f</a> <a id="1500" href="Relation.Nullary.Negation.html#1469" class="Bound">x</a><a id="1501" class="Symbol">)</a>
|
||
<a id="1505" class="Symbol">}</a>
|
||
|
||
<a id="¬¬-push"></a><a id="1508" href="Relation.Nullary.Negation.html#1508" class="Function">¬¬-push</a> <a id="1516" class="Symbol">:</a> <a id="1518" class="Symbol">∀</a> <a id="1520" class="Symbol">{</a><a id="1521" href="Relation.Nullary.Negation.html#1521" class="Bound">P</a> <a id="1523" class="Symbol">:</a> <a id="1525" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1529" href="Relation.Nullary.Negation.html#679" class="Generalizable">p</a><a id="1530" class="Symbol">}</a> <a id="1532" class="Symbol">{</a><a id="1533" href="Relation.Nullary.Negation.html#1533" class="Bound">Q</a> <a id="1535" class="Symbol">:</a> <a id="1537" href="Relation.Nullary.Negation.html#1521" class="Bound">P</a> <a id="1539" class="Symbol">→</a> <a id="1541" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="1545" href="Relation.Nullary.Negation.html#681" class="Generalizable">q</a><a id="1546" class="Symbol">}</a> <a id="1548" class="Symbol">→</a>
|
||
<a id="1560" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="1562" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="1564" class="Symbol">((</a><a id="1566" href="Relation.Nullary.Negation.html#1566" class="Bound">x</a> <a id="1568" class="Symbol">:</a> <a id="1570" href="Relation.Nullary.Negation.html#1521" class="Bound">P</a><a id="1571" class="Symbol">)</a> <a id="1573" class="Symbol">→</a> <a id="1575" href="Relation.Nullary.Negation.html#1533" class="Bound">Q</a> <a id="1577" href="Relation.Nullary.Negation.html#1566" class="Bound">x</a><a id="1578" class="Symbol">)</a> <a id="1580" class="Symbol">→</a> <a id="1582" class="Symbol">(</a><a id="1583" href="Relation.Nullary.Negation.html#1583" class="Bound">x</a> <a id="1585" class="Symbol">:</a> <a id="1587" href="Relation.Nullary.Negation.html#1521" class="Bound">P</a><a id="1588" class="Symbol">)</a> <a id="1590" class="Symbol">→</a> <a id="1592" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="1594" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="1596" href="Relation.Nullary.Negation.html#1533" class="Bound">Q</a> <a id="1598" href="Relation.Nullary.Negation.html#1583" class="Bound">x</a>
|
||
<a id="1600" href="Relation.Nullary.Negation.html#1508" class="Function">¬¬-push</a> <a id="1608" href="Relation.Nullary.Negation.html#1608" class="Bound">¬¬P⟶Q</a> <a id="1614" href="Relation.Nullary.Negation.html#1614" class="Bound">P</a> <a id="1616" href="Relation.Nullary.Negation.html#1616" class="Bound">¬Q</a> <a id="1619" class="Symbol">=</a> <a id="1621" href="Relation.Nullary.Negation.html#1608" class="Bound">¬¬P⟶Q</a> <a id="1627" class="Symbol">(λ</a> <a id="1630" href="Relation.Nullary.Negation.html#1630" class="Bound">P⟶Q</a> <a id="1634" class="Symbol">→</a> <a id="1636" href="Relation.Nullary.Negation.html#1616" class="Bound">¬Q</a> <a id="1639" class="Symbol">(</a><a id="1640" href="Relation.Nullary.Negation.html#1630" class="Bound">P⟶Q</a> <a id="1644" href="Relation.Nullary.Negation.html#1614" class="Bound">P</a><a id="1645" class="Symbol">))</a>
|
||
|
||
<a id="1649" class="Comment">-- A double-negation-translated variant of excluded middle (or: every</a>
|
||
<a id="1719" class="Comment">-- nullary relation is decidable in the double-negation monad).</a>
|
||
|
||
<a id="excluded-middle"></a><a id="1784" href="Relation.Nullary.Negation.html#1784" class="Function">excluded-middle</a> <a id="1800" class="Symbol">:</a> <a id="1802" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="1804" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="1806" href="Relation.Nullary.html#1520" class="Record">Dec</a> <a id="1810" href="Relation.Nullary.Negation.html#713" class="Generalizable">P</a>
|
||
<a id="1812" href="Relation.Nullary.Negation.html#1784" class="Function">excluded-middle</a> <a id="1828" href="Relation.Nullary.Negation.html#1828" class="Bound">¬h</a> <a id="1831" class="Symbol">=</a> <a id="1833" href="Relation.Nullary.Negation.html#1828" class="Bound">¬h</a> <a id="1836" class="Symbol">(</a><a id="1837" href="Relation.Nullary.html#1694" class="InductiveConstructor">no</a> <a id="1840" class="Symbol">(λ</a> <a id="1843" href="Relation.Nullary.Negation.html#1843" class="Bound">p</a> <a id="1845" class="Symbol">→</a> <a id="1847" href="Relation.Nullary.Negation.html#1828" class="Bound">¬h</a> <a id="1850" class="Symbol">(</a><a id="1851" href="Relation.Nullary.html#1657" class="InductiveConstructor">yes</a> <a id="1855" href="Relation.Nullary.Negation.html#1843" class="Bound">p</a><a id="1856" class="Symbol">)))</a>
|
||
|
||
<a id="1861" class="Comment">-- If Whatever is instantiated with ¬ ¬ something, then this function</a>
|
||
<a id="1931" class="Comment">-- is call with current continuation in the double-negation monad, or,</a>
|
||
<a id="2002" class="Comment">-- if you will, a double-negation translation of Peirce's law.</a>
|
||
<a id="2065" class="Comment">--</a>
|
||
<a id="2068" class="Comment">-- In order to prove ¬ ¬ P one can assume ¬ P and prove ⊥. However,</a>
|
||
<a id="2136" class="Comment">-- sometimes it is nice to avoid leaving the double-negation monad; in</a>
|
||
<a id="2207" class="Comment">-- that case this function can be used (with Whatever instantiated to</a>
|
||
<a id="2277" class="Comment">-- ⊥).</a>
|
||
|
||
<a id="call/cc"></a><a id="2285" href="Relation.Nullary.Negation.html#2285" class="Function">call/cc</a> <a id="2293" class="Symbol">:</a> <a id="2295" class="Symbol">((</a><a id="2297" href="Relation.Nullary.Negation.html#713" class="Generalizable">P</a> <a id="2299" class="Symbol">→</a> <a id="2301" href="Relation.Nullary.Negation.html#755" class="Generalizable">Whatever</a><a id="2309" class="Symbol">)</a> <a id="2311" class="Symbol">→</a> <a id="2313" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="2315" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="2317" href="Relation.Nullary.Negation.html#713" class="Generalizable">P</a><a id="2318" class="Symbol">)</a> <a id="2320" class="Symbol">→</a> <a id="2322" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="2324" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="2326" href="Relation.Nullary.Negation.html#713" class="Generalizable">P</a>
|
||
<a id="2328" href="Relation.Nullary.Negation.html#2285" class="Function">call/cc</a> <a id="2336" href="Relation.Nullary.Negation.html#2336" class="Bound">hyp</a> <a id="2340" href="Relation.Nullary.Negation.html#2340" class="Bound">¬p</a> <a id="2343" class="Symbol">=</a> <a id="2345" href="Relation.Nullary.Negation.html#2336" class="Bound">hyp</a> <a id="2349" class="Symbol">(λ</a> <a id="2352" href="Relation.Nullary.Negation.html#2352" class="Bound">p</a> <a id="2354" class="Symbol">→</a> <a id="2356" href="Data.Empty.html#637" class="Function">⊥-elim</a> <a id="2363" class="Symbol">(</a><a id="2364" href="Relation.Nullary.Negation.html#2340" class="Bound">¬p</a> <a id="2367" href="Relation.Nullary.Negation.html#2352" class="Bound">p</a><a id="2368" class="Symbol">))</a> <a id="2371" href="Relation.Nullary.Negation.html#2340" class="Bound">¬p</a>
|
||
|
||
<a id="2375" class="Comment">-- The "independence of premise" rule, in the double-negation monad.</a>
|
||
<a id="2444" class="Comment">-- It is assumed that the index set (Q) is inhabited.</a>
|
||
|
||
<a id="independence-of-premise"></a><a id="2499" href="Relation.Nullary.Negation.html#2499" class="Function">independence-of-premise</a> <a id="2523" class="Symbol">:</a> <a id="2525" class="Symbol">∀</a> <a id="2527" class="Symbol">{</a><a id="2528" href="Relation.Nullary.Negation.html#2528" class="Bound">P</a> <a id="2530" class="Symbol">:</a> <a id="2532" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="2536" href="Relation.Nullary.Negation.html#679" class="Generalizable">p</a><a id="2537" class="Symbol">}</a> <a id="2539" class="Symbol">{</a><a id="2540" href="Relation.Nullary.Negation.html#2540" class="Bound">Q</a> <a id="2542" class="Symbol">:</a> <a id="2544" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="2548" href="Relation.Nullary.Negation.html#681" class="Generalizable">q</a><a id="2549" class="Symbol">}</a> <a id="2551" class="Symbol">{</a><a id="2552" href="Relation.Nullary.Negation.html#2552" class="Bound">R</a> <a id="2554" class="Symbol">:</a> <a id="2556" href="Relation.Nullary.Negation.html#2540" class="Bound">Q</a> <a id="2558" class="Symbol">→</a> <a id="2560" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="2564" href="Relation.Nullary.Negation.html#683" class="Generalizable">r</a><a id="2565" class="Symbol">}</a> <a id="2567" class="Symbol">→</a>
|
||
<a id="2595" href="Relation.Nullary.Negation.html#2540" class="Bound">Q</a> <a id="2597" class="Symbol">→</a> <a id="2599" class="Symbol">(</a><a id="2600" href="Relation.Nullary.Negation.html#2528" class="Bound">P</a> <a id="2602" class="Symbol">→</a> <a id="2604" href="Agda.Builtin.Sigma.html#148" class="Record">Σ</a> <a id="2606" href="Relation.Nullary.Negation.html#2540" class="Bound">Q</a> <a id="2608" href="Relation.Nullary.Negation.html#2552" class="Bound">R</a><a id="2609" class="Symbol">)</a> <a id="2611" class="Symbol">→</a> <a id="2613" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="2615" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="2617" class="Symbol">(</a><a id="2618" href="Data.Product.html#925" class="Function">Σ[</a> <a id="2621" href="Relation.Nullary.Negation.html#2621" class="Bound">x</a> <a id="2623" href="Data.Product.html#925" class="Function">∈</a> <a id="2625" href="Relation.Nullary.Negation.html#2540" class="Bound">Q</a> <a id="2627" href="Data.Product.html#925" class="Function">]</a> <a id="2629" class="Symbol">(</a><a id="2630" href="Relation.Nullary.Negation.html#2528" class="Bound">P</a> <a id="2632" class="Symbol">→</a> <a id="2634" href="Relation.Nullary.Negation.html#2552" class="Bound">R</a> <a id="2636" href="Relation.Nullary.Negation.html#2621" class="Bound">x</a><a id="2637" class="Symbol">))</a>
|
||
<a id="2640" href="Relation.Nullary.Negation.html#2499" class="Function">independence-of-premise</a> <a id="2664" class="Symbol">{</a><a id="2665" class="Argument">P</a> <a id="2667" class="Symbol">=</a> <a id="2669" href="Relation.Nullary.Negation.html#2669" class="Bound">P</a><a id="2670" class="Symbol">}</a> <a id="2672" href="Relation.Nullary.Negation.html#2672" class="Bound">q</a> <a id="2674" href="Relation.Nullary.Negation.html#2674" class="Bound">f</a> <a id="2676" class="Symbol">=</a> <a id="2678" href="Relation.Nullary.Negation.Core.html#1994" class="Function">¬¬-map</a> <a id="2685" href="Relation.Nullary.Negation.html#2718" class="Function">helper</a> <a id="2692" href="Relation.Nullary.Negation.html#1784" class="Function">excluded-middle</a>
|
||
<a id="2710" class="Keyword">where</a>
|
||
<a id="2718" href="Relation.Nullary.Negation.html#2718" class="Function">helper</a> <a id="2725" class="Symbol">:</a> <a id="2727" href="Relation.Nullary.html#1520" class="Record">Dec</a> <a id="2731" href="Relation.Nullary.Negation.html#2669" class="Bound">P</a> <a id="2733" class="Symbol">→</a> <a id="2735" class="Symbol">_</a>
|
||
<a id="2739" href="Relation.Nullary.Negation.html#2718" class="Function">helper</a> <a id="2746" class="Symbol">(</a><a id="2747" href="Relation.Nullary.html#1657" class="InductiveConstructor">yes</a> <a id="2751" href="Relation.Nullary.Negation.html#2751" class="Bound">p</a><a id="2752" class="Symbol">)</a> <a id="2754" class="Symbol">=</a> <a id="2756" href="Data.Product.html#2495" class="Function">Prod.map</a> <a id="2765" href="Function.Base.html#624" class="Function">id</a> <a id="2768" href="Function.Base.html#645" class="Function">const</a> <a id="2774" class="Symbol">(</a><a id="2775" href="Relation.Nullary.Negation.html#2674" class="Bound">f</a> <a id="2777" href="Relation.Nullary.Negation.html#2751" class="Bound">p</a><a id="2778" class="Symbol">)</a>
|
||
<a id="2782" href="Relation.Nullary.Negation.html#2718" class="Function">helper</a> <a id="2789" class="Symbol">(</a><a id="2790" href="Relation.Nullary.html#1694" class="InductiveConstructor">no</a> <a id="2793" href="Relation.Nullary.Negation.html#2793" class="Bound">¬p</a><a id="2795" class="Symbol">)</a> <a id="2797" class="Symbol">=</a> <a id="2799" class="Symbol">(</a><a id="2800" href="Relation.Nullary.Negation.html#2672" class="Bound">q</a> <a id="2802" href="Agda.Builtin.Sigma.html#218" class="InductiveConstructor Operator">,</a> <a id="2804" href="Data.Empty.html#637" class="Function">⊥-elim</a> <a id="2811" href="Function.Base.html#3715" class="Function Operator">∘′</a> <a id="2814" href="Relation.Nullary.Negation.html#2793" class="Bound">¬p</a><a id="2816" class="Symbol">)</a>
|
||
|
||
<a id="2819" class="Comment">-- The independence of premise rule for binary sums.</a>
|
||
|
||
<a id="independence-of-premise-⊎"></a><a id="2873" href="Relation.Nullary.Negation.html#2873" class="Function">independence-of-premise-⊎</a> <a id="2899" class="Symbol">:</a> <a id="2901" class="Symbol">(</a><a id="2902" href="Relation.Nullary.Negation.html#713" class="Generalizable">P</a> <a id="2904" class="Symbol">→</a> <a id="2906" href="Relation.Nullary.Negation.html#727" class="Generalizable">Q</a> <a id="2908" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="2910" href="Relation.Nullary.Negation.html#741" class="Generalizable">R</a><a id="2911" class="Symbol">)</a> <a id="2913" class="Symbol">→</a> <a id="2915" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="2917" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="2919" class="Symbol">((</a><a id="2921" href="Relation.Nullary.Negation.html#713" class="Generalizable">P</a> <a id="2923" class="Symbol">→</a> <a id="2925" href="Relation.Nullary.Negation.html#727" class="Generalizable">Q</a><a id="2926" class="Symbol">)</a> <a id="2928" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="2930" class="Symbol">(</a><a id="2931" href="Relation.Nullary.Negation.html#713" class="Generalizable">P</a> <a id="2933" class="Symbol">→</a> <a id="2935" href="Relation.Nullary.Negation.html#741" class="Generalizable">R</a><a id="2936" class="Symbol">))</a>
|
||
<a id="2939" href="Relation.Nullary.Negation.html#2873" class="Function">independence-of-premise-⊎</a> <a id="2965" class="Symbol">{</a><a id="2966" class="Argument">P</a> <a id="2968" class="Symbol">=</a> <a id="2970" href="Relation.Nullary.Negation.html#2970" class="Bound">P</a><a id="2971" class="Symbol">}</a> <a id="2973" href="Relation.Nullary.Negation.html#2973" class="Bound">f</a> <a id="2975" class="Symbol">=</a> <a id="2977" href="Relation.Nullary.Negation.Core.html#1994" class="Function">¬¬-map</a> <a id="2984" href="Relation.Nullary.Negation.html#3017" class="Function">helper</a> <a id="2991" href="Relation.Nullary.Negation.html#1784" class="Function">excluded-middle</a>
|
||
<a id="3009" class="Keyword">where</a>
|
||
<a id="3017" href="Relation.Nullary.Negation.html#3017" class="Function">helper</a> <a id="3024" class="Symbol">:</a> <a id="3026" href="Relation.Nullary.html#1520" class="Record">Dec</a> <a id="3030" href="Relation.Nullary.Negation.html#2970" class="Bound">P</a> <a id="3032" class="Symbol">→</a> <a id="3034" class="Symbol">_</a>
|
||
<a id="3038" href="Relation.Nullary.Negation.html#3017" class="Function">helper</a> <a id="3045" class="Symbol">(</a><a id="3046" href="Relation.Nullary.html#1657" class="InductiveConstructor">yes</a> <a id="3050" href="Relation.Nullary.Negation.html#3050" class="Bound">p</a><a id="3051" class="Symbol">)</a> <a id="3053" class="Symbol">=</a> <a id="3055" href="Data.Sum.Base.html#1371" class="Function">Sum.map</a> <a id="3063" href="Function.Base.html#645" class="Function">const</a> <a id="3069" href="Function.Base.html#645" class="Function">const</a> <a id="3075" class="Symbol">(</a><a id="3076" href="Relation.Nullary.Negation.html#2973" class="Bound">f</a> <a id="3078" href="Relation.Nullary.Negation.html#3050" class="Bound">p</a><a id="3079" class="Symbol">)</a>
|
||
<a id="3083" href="Relation.Nullary.Negation.html#3017" class="Function">helper</a> <a id="3090" class="Symbol">(</a><a id="3091" href="Relation.Nullary.html#1694" class="InductiveConstructor">no</a> <a id="3094" href="Relation.Nullary.Negation.html#3094" class="Bound">¬p</a><a id="3096" class="Symbol">)</a> <a id="3098" class="Symbol">=</a> <a id="3100" href="Data.Sum.Base.html#793" class="InductiveConstructor">inj₁</a> <a id="3105" class="Symbol">(</a><a id="3106" href="Data.Empty.html#637" class="Function">⊥-elim</a> <a id="3113" href="Function.Base.html#3715" class="Function Operator">∘′</a> <a id="3116" href="Relation.Nullary.Negation.html#3094" class="Bound">¬p</a><a id="3118" class="Symbol">)</a>
|
||
|
||
<a id="3121" class="Keyword">private</a>
|
||
|
||
<a id="3132" class="Comment">-- Note that independence-of-premise-⊎ is a consequence of</a>
|
||
<a id="3193" class="Comment">-- independence-of-premise (for simplicity it is assumed that Q and</a>
|
||
<a id="3263" class="Comment">-- R have the same type here):</a>
|
||
|
||
<a id="corollary"></a><a id="3297" href="Relation.Nullary.Negation.html#3297" class="Function">corollary</a> <a id="3307" class="Symbol">:</a> <a id="3309" class="Symbol">{</a><a id="3310" href="Relation.Nullary.Negation.html#3310" class="Bound">P</a> <a id="3312" class="Symbol">:</a> <a id="3314" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="3318" href="Relation.Nullary.Negation.html#679" class="Generalizable">p</a><a id="3319" class="Symbol">}</a> <a id="3321" class="Symbol">{</a><a id="3322" href="Relation.Nullary.Negation.html#3322" class="Bound">Q</a> <a id="3324" href="Relation.Nullary.Negation.html#3324" class="Bound">R</a> <a id="3326" class="Symbol">:</a> <a id="3328" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="3332" href="Relation.Nullary.Negation.html#681" class="Generalizable">q</a><a id="3333" class="Symbol">}</a> <a id="3335" class="Symbol">→</a>
|
||
<a id="3351" class="Symbol">(</a><a id="3352" href="Relation.Nullary.Negation.html#3310" class="Bound">P</a> <a id="3354" class="Symbol">→</a> <a id="3356" href="Relation.Nullary.Negation.html#3322" class="Bound">Q</a> <a id="3358" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="3360" href="Relation.Nullary.Negation.html#3324" class="Bound">R</a><a id="3361" class="Symbol">)</a> <a id="3363" class="Symbol">→</a> <a id="3365" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="3367" href="Relation.Nullary.html#665" class="Function Operator">¬</a> <a id="3369" class="Symbol">((</a><a id="3371" href="Relation.Nullary.Negation.html#3310" class="Bound">P</a> <a id="3373" class="Symbol">→</a> <a id="3375" href="Relation.Nullary.Negation.html#3322" class="Bound">Q</a><a id="3376" class="Symbol">)</a> <a id="3378" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="3380" class="Symbol">(</a><a id="3381" href="Relation.Nullary.Negation.html#3310" class="Bound">P</a> <a id="3383" class="Symbol">→</a> <a id="3385" href="Relation.Nullary.Negation.html#3324" class="Bound">R</a><a id="3386" class="Symbol">))</a>
|
||
<a id="3391" href="Relation.Nullary.Negation.html#3297" class="Function">corollary</a> <a id="3401" class="Symbol">{</a><a id="3402" class="Argument">P</a> <a id="3404" class="Symbol">=</a> <a id="3406" href="Relation.Nullary.Negation.html#3406" class="Bound">P</a><a id="3407" class="Symbol">}</a> <a id="3409" class="Symbol">{</a><a id="3410" href="Relation.Nullary.Negation.html#3410" class="Bound">Q</a><a id="3411" class="Symbol">}</a> <a id="3413" class="Symbol">{</a><a id="3414" href="Relation.Nullary.Negation.html#3414" class="Bound">R</a><a id="3415" class="Symbol">}</a> <a id="3417" href="Relation.Nullary.Negation.html#3417" class="Bound">f</a> <a id="3419" class="Symbol">=</a>
|
||
<a id="3425" href="Relation.Nullary.Negation.Core.html#1994" class="Function">¬¬-map</a> <a id="3432" href="Relation.Nullary.Negation.html#3537" class="Function">helper</a> <a id="3439" class="Symbol">(</a><a id="3440" href="Relation.Nullary.Negation.html#2499" class="Function">independence-of-premise</a>
|
||
<a id="3485" href="Agda.Builtin.Bool.html#181" class="InductiveConstructor">true</a> <a id="3490" class="Symbol">(</a><a id="3491" href="Data.Sum.Base.html#929" class="Function Operator">[</a> <a id="3493" href="Agda.Builtin.Sigma.html#218" class="InductiveConstructor Operator">_,_</a> <a id="3497" href="Agda.Builtin.Bool.html#181" class="InductiveConstructor">true</a> <a id="3502" href="Data.Sum.Base.html#929" class="Function Operator">,</a> <a id="3504" href="Agda.Builtin.Sigma.html#218" class="InductiveConstructor Operator">_,_</a> <a id="3508" href="Agda.Builtin.Bool.html#175" class="InductiveConstructor">false</a> <a id="3514" href="Data.Sum.Base.html#929" class="Function Operator">]</a> <a id="3516" href="Function.Base.html#3715" class="Function Operator">∘′</a> <a id="3519" href="Relation.Nullary.Negation.html#3417" class="Bound">f</a><a id="3520" class="Symbol">))</a>
|
||
<a id="3527" class="Keyword">where</a>
|
||
<a id="3537" href="Relation.Nullary.Negation.html#3537" class="Function">helper</a> <a id="3544" class="Symbol">:</a> <a id="3546" href="Data.Product.html#1378" class="Function">∃</a> <a id="3548" class="Symbol">(λ</a> <a id="3551" href="Relation.Nullary.Negation.html#3551" class="Bound">b</a> <a id="3553" class="Symbol">→</a> <a id="3555" href="Relation.Nullary.Negation.html#3406" class="Bound">P</a> <a id="3557" class="Symbol">→</a> <a id="3559" href="Data.Bool.Base.html#1292" class="Function Operator">if</a> <a id="3562" href="Relation.Nullary.Negation.html#3551" class="Bound">b</a> <a id="3564" href="Data.Bool.Base.html#1292" class="Function Operator">then</a> <a id="3569" href="Relation.Nullary.Negation.html#3410" class="Bound">Q</a> <a id="3571" href="Data.Bool.Base.html#1292" class="Function Operator">else</a> <a id="3576" href="Relation.Nullary.Negation.html#3414" class="Bound">R</a><a id="3577" class="Symbol">)</a> <a id="3579" class="Symbol">→</a> <a id="3581" class="Symbol">(</a><a id="3582" href="Relation.Nullary.Negation.html#3406" class="Bound">P</a> <a id="3584" class="Symbol">→</a> <a id="3586" href="Relation.Nullary.Negation.html#3410" class="Bound">Q</a><a id="3587" class="Symbol">)</a> <a id="3589" href="Data.Sum.Base.html#743" class="Datatype Operator">⊎</a> <a id="3591" class="Symbol">(</a><a id="3592" href="Relation.Nullary.Negation.html#3406" class="Bound">P</a> <a id="3594" class="Symbol">→</a> <a id="3596" href="Relation.Nullary.Negation.html#3414" class="Bound">R</a><a id="3597" class="Symbol">)</a>
|
||
<a id="3603" href="Relation.Nullary.Negation.html#3537" class="Function">helper</a> <a id="3610" class="Symbol">(</a><a id="3611" href="Agda.Builtin.Bool.html#181" class="InductiveConstructor">true</a> <a id="3617" href="Agda.Builtin.Sigma.html#218" class="InductiveConstructor Operator">,</a> <a id="3619" href="Relation.Nullary.Negation.html#3619" class="Bound">f</a><a id="3620" class="Symbol">)</a> <a id="3622" class="Symbol">=</a> <a id="3624" href="Data.Sum.Base.html#793" class="InductiveConstructor">inj₁</a> <a id="3629" href="Relation.Nullary.Negation.html#3619" class="Bound">f</a>
|
||
<a id="3635" href="Relation.Nullary.Negation.html#3537" class="Function">helper</a> <a id="3642" class="Symbol">(</a><a id="3643" href="Agda.Builtin.Bool.html#175" class="InductiveConstructor">false</a> <a id="3649" href="Agda.Builtin.Sigma.html#218" class="InductiveConstructor Operator">,</a> <a id="3651" href="Relation.Nullary.Negation.html#3651" class="Bound">f</a><a id="3652" class="Symbol">)</a> <a id="3654" class="Symbol">=</a> <a id="3656" href="Data.Sum.Base.html#818" class="InductiveConstructor">inj₂</a> <a id="3661" href="Relation.Nullary.Negation.html#3651" class="Bound">f</a>
|
||
|
||
|
||
<a id="3665" class="Comment">------------------------------------------------------------------------</a>
|
||
<a id="3738" class="Comment">-- DEPRECATED NAMES</a>
|
||
<a id="3758" class="Comment">------------------------------------------------------------------------</a>
|
||
<a id="3831" class="Comment">-- Please use the new names as continuing support for the old names is</a>
|
||
<a id="3902" class="Comment">-- not guaranteed.</a>
|
||
|
||
<a id="3922" class="Comment">-- Version 1.0</a>
|
||
|
||
<a id="Excluded-Middle"></a><a id="3938" href="Relation.Nullary.Negation.html#3938" class="Function">Excluded-Middle</a> <a id="3954" class="Symbol">:</a> <a id="3956" class="Symbol">(</a><a id="3957" href="Relation.Nullary.Negation.html#3957" class="Bound">ℓ</a> <a id="3959" class="Symbol">:</a> <a id="3961" href="Agda.Primitive.html#591" class="Postulate">Level</a><a id="3966" class="Symbol">)</a> <a id="3968" class="Symbol">→</a> <a id="3970" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="3974" class="Symbol">(</a><a id="3975" href="Agda.Primitive.html#774" class="Primitive">suc</a> <a id="3979" href="Relation.Nullary.Negation.html#3957" class="Bound">ℓ</a><a id="3980" class="Symbol">)</a>
|
||
<a id="3982" href="Relation.Nullary.Negation.html#3938" class="Function">Excluded-Middle</a> <a id="3998" href="Relation.Nullary.Negation.html#3998" class="Bound">p</a> <a id="4000" class="Symbol">=</a> <a id="4002" class="Symbol">{</a><a id="4003" href="Relation.Nullary.Negation.html#4003" class="Bound">P</a> <a id="4005" class="Symbol">:</a> <a id="4007" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="4011" href="Relation.Nullary.Negation.html#3998" class="Bound">p</a><a id="4012" class="Symbol">}</a> <a id="4014" class="Symbol">→</a> <a id="4016" href="Relation.Nullary.html#1520" class="Record">Dec</a> <a id="4020" href="Relation.Nullary.Negation.html#4003" class="Bound">P</a>
|
||
<a id="4022" class="Symbol">{-#</a> <a id="4026" class="Keyword">WARNING_ON_USAGE</a> <a id="4043" class="Pragma">Excluded-Middle</a>
|
||
<a id="4059" class="String">"Warning: Excluded-Middle was deprecated in v1.0.
|
||
Please use ExcludedMiddle from `Axiom.ExcludedMiddle` instead."</a>
|
||
<a id="4173" class="Symbol">#-}</a>
|
||
|
||
<a id="Double-Negation-Elimination"></a><a id="4178" href="Relation.Nullary.Negation.html#4178" class="Function">Double-Negation-Elimination</a> <a id="4206" class="Symbol">:</a> <a id="4208" class="Symbol">(</a><a id="4209" href="Relation.Nullary.Negation.html#4209" class="Bound">ℓ</a> <a id="4211" class="Symbol">:</a> <a id="4213" href="Agda.Primitive.html#591" class="Postulate">Level</a><a id="4218" class="Symbol">)</a> <a id="4220" class="Symbol">→</a> <a id="4222" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="4226" class="Symbol">(</a><a id="4227" href="Agda.Primitive.html#774" class="Primitive">suc</a> <a id="4231" href="Relation.Nullary.Negation.html#4209" class="Bound">ℓ</a><a id="4232" class="Symbol">)</a>
|
||
<a id="4234" href="Relation.Nullary.Negation.html#4178" class="Function">Double-Negation-Elimination</a> <a id="4262" href="Relation.Nullary.Negation.html#4262" class="Bound">p</a> <a id="4264" class="Symbol">=</a> <a id="4266" class="Symbol">{</a><a id="4267" href="Relation.Nullary.Negation.html#4267" class="Bound">P</a> <a id="4269" class="Symbol">:</a> <a id="4271" href="Agda.Primitive.html#320" class="Primitive">Set</a> <a id="4275" href="Relation.Nullary.Negation.html#4262" class="Bound">p</a><a id="4276" class="Symbol">}</a> <a id="4278" class="Symbol">→</a> <a id="4280" href="Relation.Nullary.Negation.Core.html#2110" class="Function">Stable</a> <a id="4287" href="Relation.Nullary.Negation.html#4267" class="Bound">P</a>
|
||
<a id="4289" class="Symbol">{-#</a> <a id="4293" class="Keyword">WARNING_ON_USAGE</a> <a id="4310" class="Pragma">Double-Negation-Elimination</a>
|
||
<a id="4338" class="String">"Warning: Double-Negation-Elimination was deprecated in v1.0.
|
||
Please use DoubleNegationElimination from `Axiom.DoubleNegationElimination` instead."</a>
|
||
<a id="4486" class="Symbol">#-}</a>
|
||
</pre></body></html> |