mirror of
https://git8.cs.fau.de/theses/bsc-leon-vatthauer.git
synced 2024-05-31 07:28:34 +02:00
106 lines
No EOL
38 KiB
HTML
106 lines
No EOL
38 KiB
HTML
<!DOCTYPE HTML>
|
||
<html><head><meta charset="utf-8"><title>Relation.Nullary.Reflects</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 of the `Reflects` construct</a>
|
||
<a id="148" class="Comment">------------------------------------------------------------------------</a>
|
||
|
||
<a id="222" class="Symbol">{-#</a> <a id="226" class="Keyword">OPTIONS</a> <a id="234" class="Pragma">--cubical-compatible</a> <a id="255" class="Pragma">--safe</a> <a id="262" class="Symbol">#-}</a>
|
||
|
||
<a id="267" class="Keyword">module</a> <a id="274" href="Relation.Nullary.Reflects.html" class="Module">Relation.Nullary.Reflects</a> <a id="300" class="Keyword">where</a>
|
||
|
||
<a id="307" class="Keyword">open</a> <a id="312" class="Keyword">import</a> <a id="319" href="Agda.Builtin.Equality.html" class="Module">Agda.Builtin.Equality</a>
|
||
|
||
<a id="342" class="Keyword">open</a> <a id="347" class="Keyword">import</a> <a id="354" href="Data.Bool.Base.html" class="Module">Data.Bool.Base</a>
|
||
<a id="369" class="Keyword">open</a> <a id="374" class="Keyword">import</a> <a id="381" href="Data.Unit.Base.html" class="Module">Data.Unit.Base</a> <a id="396" class="Keyword">using</a> <a id="402" class="Symbol">(</a><a id="403" href="Agda.Builtin.Unit.html#175" class="Record">⊤</a><a id="404" class="Symbol">)</a>
|
||
<a id="406" class="Keyword">open</a> <a id="411" class="Keyword">import</a> <a id="418" href="Data.Empty.html" class="Module">Data.Empty</a>
|
||
<a id="429" class="Keyword">open</a> <a id="434" class="Keyword">import</a> <a id="441" href="Data.Sum.Base.html" class="Module">Data.Sum.Base</a> <a id="455" class="Keyword">using</a> <a id="461" class="Symbol">(</a><a id="462" href="Data.Sum.Base.html#625" class="Datatype Operator">_⊎_</a><a id="465" class="Symbol">;</a> <a id="467" href="Data.Sum.Base.html#675" class="InductiveConstructor">inj₁</a><a id="471" class="Symbol">;</a> <a id="473" href="Data.Sum.Base.html#700" class="InductiveConstructor">inj₂</a><a id="477" class="Symbol">)</a>
|
||
<a id="479" class="Keyword">open</a> <a id="484" class="Keyword">import</a> <a id="491" href="Data.Product.Base.html" class="Module">Data.Product.Base</a> <a id="509" class="Keyword">using</a> <a id="515" class="Symbol">(</a><a id="516" href="Data.Product.Base.html#1618" class="Function Operator">_×_</a><a id="519" class="Symbol">;</a> <a id="521" href="Agda.Builtin.Sigma.html#235" class="InductiveConstructor Operator">_,_</a><a id="524" class="Symbol">;</a> <a id="526" href="Data.Product.Base.html#636" class="Field">proj₁</a><a id="531" class="Symbol">;</a> <a id="533" href="Data.Product.Base.html#650" class="Field">proj₂</a><a id="538" class="Symbol">)</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">using</a> <a id="564" class="Symbol">(</a><a id="565" href="Agda.Primitive.html#742" class="Postulate">Level</a><a id="570" class="Symbol">)</a>
|
||
<a id="572" class="Keyword">open</a> <a id="577" class="Keyword">import</a> <a id="584" href="Function.Base.html" class="Module">Function.Base</a> <a id="598" class="Keyword">using</a> <a id="604" class="Symbol">(</a><a id="605" href="Function.Base.html#1974" class="Function Operator">_$_</a><a id="608" class="Symbol">;</a> <a id="610" href="Function.Base.html#1115" class="Function Operator">_∘_</a><a id="613" class="Symbol">;</a> <a id="615" href="Function.Base.html#725" class="Function">const</a><a id="620" class="Symbol">;</a> <a id="622" href="Function.Base.html#704" class="Function">id</a><a id="624" class="Symbol">)</a>
|
||
|
||
<a id="627" class="Keyword">open</a> <a id="632" class="Keyword">import</a> <a id="639" href="Relation.Nullary.Negation.Core.html" class="Module">Relation.Nullary.Negation.Core</a>
|
||
|
||
<a id="671" class="Keyword">private</a>
|
||
<a id="681" class="Keyword">variable</a>
|
||
<a id="694" href="Relation.Nullary.Reflects.html#694" class="Generalizable">a</a> <a id="696" class="Symbol">:</a> <a id="698" href="Agda.Primitive.html#742" class="Postulate">Level</a>
|
||
<a id="708" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="710" href="Relation.Nullary.Reflects.html#710" class="Generalizable">B</a> <a id="712" class="Symbol">:</a> <a id="714" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="718" href="Relation.Nullary.Reflects.html#694" class="Generalizable">a</a>
|
||
|
||
<a id="721" class="Comment">------------------------------------------------------------------------</a>
|
||
<a id="794" class="Comment">-- `Reflects` idiom.</a>
|
||
|
||
<a id="816" class="Comment">-- The truth value of A is reflected by a boolean value.</a>
|
||
<a id="873" class="Comment">-- `Reflects A b` is equivalent to `if b then A else ¬ A`.</a>
|
||
|
||
<a id="933" class="Keyword">data</a> <a id="Reflects"></a><a id="938" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="947" class="Symbol">(</a><a id="948" href="Relation.Nullary.Reflects.html#948" class="Bound">A</a> <a id="950" class="Symbol">:</a> <a id="952" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="956" href="Relation.Nullary.Reflects.html#694" class="Generalizable">a</a><a id="957" class="Symbol">)</a> <a id="959" class="Symbol">:</a> <a id="961" href="Agda.Builtin.Bool.html#173" class="Datatype">Bool</a> <a id="966" class="Symbol">→</a> <a id="968" href="Agda.Primitive.html#388" class="Primitive">Set</a> <a id="972" href="Relation.Nullary.Reflects.html#956" class="Bound">a</a> <a id="974" class="Keyword">where</a>
|
||
<a id="Reflects.ofʸ"></a><a id="982" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="986" class="Symbol">:</a> <a id="988" class="Symbol">(</a> <a id="990" href="Relation.Nullary.Reflects.html#990" class="Bound">a</a> <a id="992" class="Symbol">:</a> <a id="996" href="Relation.Nullary.Reflects.html#948" class="Bound">A</a><a id="997" class="Symbol">)</a> <a id="999" class="Symbol">→</a> <a id="1001" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="1010" href="Relation.Nullary.Reflects.html#948" class="Bound">A</a> <a id="1012" href="Agda.Builtin.Bool.html#198" class="InductiveConstructor">true</a>
|
||
<a id="Reflects.ofⁿ"></a><a id="1019" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="1023" class="Symbol">:</a> <a id="1025" class="Symbol">(</a><a id="1026" href="Relation.Nullary.Reflects.html#1026" class="Bound">¬a</a> <a id="1029" class="Symbol">:</a> <a id="1031" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1033" href="Relation.Nullary.Reflects.html#948" class="Bound">A</a><a id="1034" class="Symbol">)</a> <a id="1036" class="Symbol">→</a> <a id="1038" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="1047" href="Relation.Nullary.Reflects.html#948" class="Bound">A</a> <a id="1049" href="Agda.Builtin.Bool.html#192" class="InductiveConstructor">false</a>
|
||
|
||
<a id="1056" class="Comment">------------------------------------------------------------------------</a>
|
||
<a id="1129" class="Comment">-- Constructors and destructors</a>
|
||
|
||
<a id="1162" class="Comment">-- These lemmas are intended to be used mostly when `b` is a value, so</a>
|
||
<a id="1233" class="Comment">-- that the `if` expressions have already been evaluated away.</a>
|
||
<a id="1296" class="Comment">-- In this case, `of` works like the relevant constructor (`ofⁿ` or</a>
|
||
<a id="1364" class="Comment">-- `ofʸ`), and `invert` strips off the constructor to just give either</a>
|
||
<a id="1435" class="Comment">-- the proof of `A` or the proof of `¬ A`.</a>
|
||
|
||
<a id="of"></a><a id="1479" href="Relation.Nullary.Reflects.html#1479" class="Function">of</a> <a id="1482" class="Symbol">:</a> <a id="1484" class="Symbol">∀</a> <a id="1486" class="Symbol">{</a><a id="1487" href="Relation.Nullary.Reflects.html#1487" class="Bound">b</a><a id="1488" class="Symbol">}</a> <a id="1490" class="Symbol">→</a> <a id="1492" href="Data.Bool.Base.html#1505" class="Function Operator">if</a> <a id="1495" href="Relation.Nullary.Reflects.html#1487" class="Bound">b</a> <a id="1497" href="Data.Bool.Base.html#1505" class="Function Operator">then</a> <a id="1502" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="1504" href="Data.Bool.Base.html#1505" class="Function Operator">else</a> <a id="1509" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1511" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="1513" class="Symbol">→</a> <a id="1515" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="1524" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="1526" href="Relation.Nullary.Reflects.html#1487" class="Bound">b</a>
|
||
<a id="1528" href="Relation.Nullary.Reflects.html#1479" class="Function">of</a> <a id="1531" class="Symbol">{</a><a id="1532" class="Argument">b</a> <a id="1534" class="Symbol">=</a> <a id="1536" href="Agda.Builtin.Bool.html#192" class="InductiveConstructor">false</a><a id="1541" class="Symbol">}</a> <a id="1543" href="Relation.Nullary.Reflects.html#1543" class="Bound">¬a</a> <a id="1546" class="Symbol">=</a> <a id="1548" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="1552" href="Relation.Nullary.Reflects.html#1543" class="Bound">¬a</a>
|
||
<a id="1555" href="Relation.Nullary.Reflects.html#1479" class="Function">of</a> <a id="1558" class="Symbol">{</a><a id="1559" class="Argument">b</a> <a id="1561" class="Symbol">=</a> <a id="1563" href="Agda.Builtin.Bool.html#198" class="InductiveConstructor">true</a> <a id="1568" class="Symbol">}</a> <a id="1571" href="Relation.Nullary.Reflects.html#1571" class="Bound">a</a> <a id="1573" class="Symbol">=</a> <a id="1575" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="1579" href="Relation.Nullary.Reflects.html#1571" class="Bound">a</a>
|
||
|
||
<a id="invert"></a><a id="1582" href="Relation.Nullary.Reflects.html#1582" class="Function">invert</a> <a id="1589" class="Symbol">:</a> <a id="1591" class="Symbol">∀</a> <a id="1593" class="Symbol">{</a><a id="1594" href="Relation.Nullary.Reflects.html#1594" class="Bound">b</a><a id="1595" class="Symbol">}</a> <a id="1597" class="Symbol">→</a> <a id="1599" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="1608" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="1610" href="Relation.Nullary.Reflects.html#1594" class="Bound">b</a> <a id="1612" class="Symbol">→</a> <a id="1614" href="Data.Bool.Base.html#1505" class="Function Operator">if</a> <a id="1617" href="Relation.Nullary.Reflects.html#1594" class="Bound">b</a> <a id="1619" href="Data.Bool.Base.html#1505" class="Function Operator">then</a> <a id="1624" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="1626" href="Data.Bool.Base.html#1505" class="Function Operator">else</a> <a id="1631" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="1633" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a>
|
||
<a id="1635" href="Relation.Nullary.Reflects.html#1582" class="Function">invert</a> <a id="1642" class="Symbol">(</a><a id="1643" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="1648" href="Relation.Nullary.Reflects.html#1648" class="Bound">a</a><a id="1649" class="Symbol">)</a> <a id="1651" class="Symbol">=</a> <a id="1653" href="Relation.Nullary.Reflects.html#1648" class="Bound">a</a>
|
||
<a id="1655" href="Relation.Nullary.Reflects.html#1582" class="Function">invert</a> <a id="1662" class="Symbol">(</a><a id="1663" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="1667" href="Relation.Nullary.Reflects.html#1667" class="Bound">¬a</a><a id="1669" class="Symbol">)</a> <a id="1671" class="Symbol">=</a> <a id="1673" href="Relation.Nullary.Reflects.html#1667" class="Bound">¬a</a>
|
||
|
||
<a id="1677" class="Comment">------------------------------------------------------------------------</a>
|
||
<a id="1750" class="Comment">-- Interaction with negation, product, sums etc.</a>
|
||
|
||
<a id="1800" class="Keyword">infixr</a> <a id="1807" class="Number">1</a> <a id="1809" href="Relation.Nullary.Reflects.html#2406" class="Function Operator">_⊎-reflects_</a>
|
||
<a id="1822" class="Keyword">infixr</a> <a id="1829" class="Number">2</a> <a id="1831" href="Relation.Nullary.Reflects.html#2183" class="Function Operator">_×-reflects_</a> <a id="1844" href="Relation.Nullary.Reflects.html#2625" class="Function Operator">_→-reflects_</a>
|
||
|
||
<a id="T-reflects"></a><a id="1858" href="Relation.Nullary.Reflects.html#1858" class="Function">T-reflects</a> <a id="1869" class="Symbol">:</a> <a id="1871" class="Symbol">∀</a> <a id="1873" href="Relation.Nullary.Reflects.html#1873" class="Bound">b</a> <a id="1875" class="Symbol">→</a> <a id="1877" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="1886" class="Symbol">(</a><a id="1887" href="Data.Bool.Base.html#1348" class="Function">T</a> <a id="1889" href="Relation.Nullary.Reflects.html#1873" class="Bound">b</a><a id="1890" class="Symbol">)</a> <a id="1892" href="Relation.Nullary.Reflects.html#1873" class="Bound">b</a>
|
||
<a id="1894" href="Relation.Nullary.Reflects.html#1858" class="Function">T-reflects</a> <a id="1905" href="Agda.Builtin.Bool.html#198" class="InductiveConstructor">true</a> <a id="1911" class="Symbol">=</a> <a id="1913" href="Relation.Nullary.Reflects.html#1479" class="Function">of</a> <a id="1916" class="Symbol">_</a>
|
||
<a id="1918" href="Relation.Nullary.Reflects.html#1858" class="Function">T-reflects</a> <a id="1929" href="Agda.Builtin.Bool.html#192" class="InductiveConstructor">false</a> <a id="1935" class="Symbol">=</a> <a id="1937" href="Relation.Nullary.Reflects.html#1479" class="Function">of</a> <a id="1940" href="Function.Base.html#704" class="Function">id</a>
|
||
|
||
<a id="1944" class="Comment">-- If we can decide A, then we can decide its negation.</a>
|
||
<a id="¬-reflects"></a><a id="2000" href="Relation.Nullary.Reflects.html#2000" class="Function">¬-reflects</a> <a id="2011" class="Symbol">:</a> <a id="2013" class="Symbol">∀</a> <a id="2015" class="Symbol">{</a><a id="2016" href="Relation.Nullary.Reflects.html#2016" class="Bound">b</a><a id="2017" class="Symbol">}</a> <a id="2019" class="Symbol">→</a> <a id="2021" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="2030" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="2032" href="Relation.Nullary.Reflects.html#2016" class="Bound">b</a> <a id="2034" class="Symbol">→</a> <a id="2036" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="2045" class="Symbol">(</a><a id="2046" href="Relation.Nullary.Negation.Core.html#698" class="Function Operator">¬</a> <a id="2048" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a><a id="2049" class="Symbol">)</a> <a id="2051" class="Symbol">(</a><a id="2052" href="Data.Bool.Base.html#941" class="Function">not</a> <a id="2056" href="Relation.Nullary.Reflects.html#2016" class="Bound">b</a><a id="2057" class="Symbol">)</a>
|
||
<a id="2059" href="Relation.Nullary.Reflects.html#2000" class="Function">¬-reflects</a> <a id="2070" class="Symbol">(</a><a id="2071" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2076" href="Relation.Nullary.Reflects.html#2076" class="Bound">a</a><a id="2077" class="Symbol">)</a> <a id="2079" class="Symbol">=</a> <a id="2081" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="2085" class="Symbol">(</a><a id="2086" href="Function.Base.html#1974" class="Function Operator">_$</a> <a id="2089" href="Relation.Nullary.Reflects.html#2076" class="Bound">a</a><a id="2090" class="Symbol">)</a>
|
||
<a id="2092" href="Relation.Nullary.Reflects.html#2000" class="Function">¬-reflects</a> <a id="2103" class="Symbol">(</a><a id="2104" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="2108" href="Relation.Nullary.Reflects.html#2108" class="Bound">¬a</a><a id="2110" class="Symbol">)</a> <a id="2112" class="Symbol">=</a> <a id="2114" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2118" href="Relation.Nullary.Reflects.html#2108" class="Bound">¬a</a>
|
||
|
||
<a id="2122" class="Comment">-- If we can decide A and Q then we can decide their product</a>
|
||
<a id="_×-reflects_"></a><a id="2183" href="Relation.Nullary.Reflects.html#2183" class="Function Operator">_×-reflects_</a> <a id="2196" class="Symbol">:</a> <a id="2198" class="Symbol">∀</a> <a id="2200" class="Symbol">{</a><a id="2201" href="Relation.Nullary.Reflects.html#2201" class="Bound">a</a> <a id="2203" href="Relation.Nullary.Reflects.html#2203" class="Bound">b</a><a id="2204" class="Symbol">}</a> <a id="2206" class="Symbol">→</a> <a id="2208" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="2217" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="2219" href="Relation.Nullary.Reflects.html#2201" class="Bound">a</a> <a id="2221" class="Symbol">→</a> <a id="2223" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="2232" href="Relation.Nullary.Reflects.html#710" class="Generalizable">B</a> <a id="2234" href="Relation.Nullary.Reflects.html#2203" class="Bound">b</a> <a id="2236" class="Symbol">→</a>
|
||
<a id="2253" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="2262" class="Symbol">(</a><a id="2263" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="2265" href="Data.Product.Base.html#1618" class="Function Operator">×</a> <a id="2267" href="Relation.Nullary.Reflects.html#710" class="Generalizable">B</a><a id="2268" class="Symbol">)</a> <a id="2270" class="Symbol">(</a><a id="2271" href="Relation.Nullary.Reflects.html#2201" class="Bound">a</a> <a id="2273" href="Data.Bool.Base.html#995" class="Function Operator">∧</a> <a id="2275" href="Relation.Nullary.Reflects.html#2203" class="Bound">b</a><a id="2276" class="Symbol">)</a>
|
||
<a id="2278" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2283" href="Relation.Nullary.Reflects.html#2283" class="Bound">a</a> <a id="2285" href="Relation.Nullary.Reflects.html#2183" class="Function Operator">×-reflects</a> <a id="2296" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2301" href="Relation.Nullary.Reflects.html#2301" class="Bound">b</a> <a id="2303" class="Symbol">=</a> <a id="2305" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2309" class="Symbol">(</a><a id="2310" href="Relation.Nullary.Reflects.html#2283" class="Bound">a</a> <a id="2312" href="Agda.Builtin.Sigma.html#235" class="InductiveConstructor Operator">,</a> <a id="2314" href="Relation.Nullary.Reflects.html#2301" class="Bound">b</a><a id="2315" class="Symbol">)</a>
|
||
<a id="2317" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2322" href="Relation.Nullary.Reflects.html#2322" class="Bound">a</a> <a id="2324" href="Relation.Nullary.Reflects.html#2183" class="Function Operator">×-reflects</a> <a id="2335" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="2339" href="Relation.Nullary.Reflects.html#2339" class="Bound">¬b</a> <a id="2342" class="Symbol">=</a> <a id="2344" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="2348" class="Symbol">(</a><a id="2349" href="Relation.Nullary.Reflects.html#2339" class="Bound">¬b</a> <a id="2352" href="Function.Base.html#1115" class="Function Operator">∘</a> <a id="2354" href="Data.Product.Base.html#650" class="Field">proj₂</a><a id="2359" class="Symbol">)</a>
|
||
<a id="2361" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="2365" href="Relation.Nullary.Reflects.html#2365" class="Bound">¬a</a> <a id="2368" href="Relation.Nullary.Reflects.html#2183" class="Function Operator">×-reflects</a> <a id="2379" class="Symbol">_</a> <a id="2386" class="Symbol">=</a> <a id="2388" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="2392" class="Symbol">(</a><a id="2393" href="Relation.Nullary.Reflects.html#2365" class="Bound">¬a</a> <a id="2396" href="Function.Base.html#1115" class="Function Operator">∘</a> <a id="2398" href="Data.Product.Base.html#636" class="Field">proj₁</a><a id="2403" class="Symbol">)</a>
|
||
|
||
<a id="_⊎-reflects_"></a><a id="2406" href="Relation.Nullary.Reflects.html#2406" class="Function Operator">_⊎-reflects_</a> <a id="2419" class="Symbol">:</a> <a id="2421" class="Symbol">∀</a> <a id="2423" class="Symbol">{</a><a id="2424" href="Relation.Nullary.Reflects.html#2424" class="Bound">a</a> <a id="2426" href="Relation.Nullary.Reflects.html#2426" class="Bound">b</a><a id="2427" class="Symbol">}</a> <a id="2429" class="Symbol">→</a> <a id="2431" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="2440" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="2442" href="Relation.Nullary.Reflects.html#2424" class="Bound">a</a> <a id="2444" class="Symbol">→</a> <a id="2446" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="2455" href="Relation.Nullary.Reflects.html#710" class="Generalizable">B</a> <a id="2457" href="Relation.Nullary.Reflects.html#2426" class="Bound">b</a> <a id="2459" class="Symbol">→</a>
|
||
<a id="2476" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="2485" class="Symbol">(</a><a id="2486" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="2488" href="Data.Sum.Base.html#625" class="Datatype Operator">⊎</a> <a id="2490" href="Relation.Nullary.Reflects.html#710" class="Generalizable">B</a><a id="2491" class="Symbol">)</a> <a id="2493" class="Symbol">(</a><a id="2494" href="Relation.Nullary.Reflects.html#2424" class="Bound">a</a> <a id="2496" href="Data.Bool.Base.html#1053" class="Function Operator">∨</a> <a id="2498" href="Relation.Nullary.Reflects.html#2426" class="Bound">b</a><a id="2499" class="Symbol">)</a>
|
||
<a id="2501" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2506" href="Relation.Nullary.Reflects.html#2506" class="Bound">a</a> <a id="2508" href="Relation.Nullary.Reflects.html#2406" class="Function Operator">⊎-reflects</a> <a id="2524" class="Symbol">_</a> <a id="2526" class="Symbol">=</a> <a id="2528" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2532" class="Symbol">(</a><a id="2533" href="Data.Sum.Base.html#675" class="InductiveConstructor">inj₁</a> <a id="2538" href="Relation.Nullary.Reflects.html#2506" class="Bound">a</a><a id="2539" class="Symbol">)</a>
|
||
<a id="2541" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="2545" href="Relation.Nullary.Reflects.html#2545" class="Bound">¬a</a> <a id="2548" href="Relation.Nullary.Reflects.html#2406" class="Function Operator">⊎-reflects</a> <a id="2559" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2564" href="Relation.Nullary.Reflects.html#2564" class="Bound">b</a> <a id="2566" class="Symbol">=</a> <a id="2568" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2572" class="Symbol">(</a><a id="2573" href="Data.Sum.Base.html#700" class="InductiveConstructor">inj₂</a> <a id="2578" href="Relation.Nullary.Reflects.html#2564" class="Bound">b</a><a id="2579" class="Symbol">)</a>
|
||
<a id="2581" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="2585" href="Relation.Nullary.Reflects.html#2585" class="Bound">¬a</a> <a id="2588" href="Relation.Nullary.Reflects.html#2406" class="Function Operator">⊎-reflects</a> <a id="2599" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="2603" href="Relation.Nullary.Reflects.html#2603" class="Bound">¬b</a> <a id="2606" class="Symbol">=</a> <a id="2608" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="2612" class="Symbol">(</a><a id="2613" href="Relation.Nullary.Reflects.html#2585" class="Bound">¬a</a> <a id="2616" href="Relation.Nullary.Negation.Core.html#1087" class="Function Operator">¬-⊎</a> <a id="2620" href="Relation.Nullary.Reflects.html#2603" class="Bound">¬b</a><a id="2622" class="Symbol">)</a>
|
||
|
||
<a id="_→-reflects_"></a><a id="2625" href="Relation.Nullary.Reflects.html#2625" class="Function Operator">_→-reflects_</a> <a id="2638" class="Symbol">:</a> <a id="2640" class="Symbol">∀</a> <a id="2642" class="Symbol">{</a><a id="2643" href="Relation.Nullary.Reflects.html#2643" class="Bound">a</a> <a id="2645" href="Relation.Nullary.Reflects.html#2645" class="Bound">b</a><a id="2646" class="Symbol">}</a> <a id="2648" class="Symbol">→</a> <a id="2650" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="2659" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="2661" href="Relation.Nullary.Reflects.html#2643" class="Bound">a</a> <a id="2663" class="Symbol">→</a> <a id="2665" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="2674" href="Relation.Nullary.Reflects.html#710" class="Generalizable">B</a> <a id="2676" href="Relation.Nullary.Reflects.html#2645" class="Bound">b</a> <a id="2678" class="Symbol">→</a>
|
||
<a id="2696" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="2705" class="Symbol">(</a><a id="2706" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="2708" class="Symbol">→</a> <a id="2710" href="Relation.Nullary.Reflects.html#710" class="Generalizable">B</a><a id="2711" class="Symbol">)</a> <a id="2713" class="Symbol">(</a><a id="2714" href="Data.Bool.Base.html#941" class="Function">not</a> <a id="2718" href="Relation.Nullary.Reflects.html#2643" class="Bound">a</a> <a id="2720" href="Data.Bool.Base.html#1053" class="Function Operator">∨</a> <a id="2722" href="Relation.Nullary.Reflects.html#2645" class="Bound">b</a><a id="2723" class="Symbol">)</a>
|
||
<a id="2725" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2730" href="Relation.Nullary.Reflects.html#2730" class="Bound">a</a> <a id="2732" href="Relation.Nullary.Reflects.html#2625" class="Function Operator">→-reflects</a> <a id="2743" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2748" href="Relation.Nullary.Reflects.html#2748" class="Bound">b</a> <a id="2750" class="Symbol">=</a> <a id="2752" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2756" class="Symbol">(</a><a id="2757" href="Function.Base.html#725" class="Function">const</a> <a id="2763" href="Relation.Nullary.Reflects.html#2748" class="Bound">b</a><a id="2764" class="Symbol">)</a>
|
||
<a id="2766" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2771" href="Relation.Nullary.Reflects.html#2771" class="Bound">a</a> <a id="2773" href="Relation.Nullary.Reflects.html#2625" class="Function Operator">→-reflects</a> <a id="2784" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="2788" href="Relation.Nullary.Reflects.html#2788" class="Bound">¬b</a> <a id="2791" class="Symbol">=</a> <a id="2793" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="2797" class="Symbol">(</a><a id="2798" href="Relation.Nullary.Reflects.html#2788" class="Bound">¬b</a> <a id="2801" href="Function.Base.html#1115" class="Function Operator">∘</a> <a id="2803" class="Symbol">(</a><a id="2804" href="Function.Base.html#1974" class="Function Operator">_$</a> <a id="2807" href="Relation.Nullary.Reflects.html#2771" class="Bound">a</a><a id="2808" class="Symbol">))</a>
|
||
<a id="2811" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="2815" href="Relation.Nullary.Reflects.html#2815" class="Bound">¬a</a> <a id="2818" href="Relation.Nullary.Reflects.html#2625" class="Function Operator">→-reflects</a> <a id="2829" class="Symbol">_</a> <a id="2836" class="Symbol">=</a> <a id="2838" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="2842" class="Symbol">(</a><a id="2843" href="Data.Empty.html#1050" class="Function">⊥-elim</a> <a id="2850" href="Function.Base.html#1115" class="Function Operator">∘</a> <a id="2852" href="Relation.Nullary.Reflects.html#2815" class="Bound">¬a</a><a id="2854" class="Symbol">)</a>
|
||
|
||
<a id="2857" class="Comment">------------------------------------------------------------------------</a>
|
||
<a id="2930" class="Comment">-- Other lemmas</a>
|
||
|
||
<a id="fromEquivalence"></a><a id="2947" href="Relation.Nullary.Reflects.html#2947" class="Function">fromEquivalence</a> <a id="2963" class="Symbol">:</a> <a id="2965" class="Symbol">∀</a> <a id="2967" class="Symbol">{</a><a id="2968" href="Relation.Nullary.Reflects.html#2968" class="Bound">b</a><a id="2969" class="Symbol">}</a> <a id="2971" class="Symbol">→</a> <a id="2973" class="Symbol">(</a><a id="2974" href="Data.Bool.Base.html#1348" class="Function">T</a> <a id="2976" href="Relation.Nullary.Reflects.html#2968" class="Bound">b</a> <a id="2978" class="Symbol">→</a> <a id="2980" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a><a id="2981" class="Symbol">)</a> <a id="2983" class="Symbol">→</a> <a id="2985" class="Symbol">(</a><a id="2986" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="2988" class="Symbol">→</a> <a id="2990" href="Data.Bool.Base.html#1348" class="Function">T</a> <a id="2992" href="Relation.Nullary.Reflects.html#2968" class="Bound">b</a><a id="2993" class="Symbol">)</a> <a id="2995" class="Symbol">→</a> <a id="2997" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="3006" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="3008" href="Relation.Nullary.Reflects.html#2968" class="Bound">b</a>
|
||
<a id="3010" href="Relation.Nullary.Reflects.html#2947" class="Function">fromEquivalence</a> <a id="3026" class="Symbol">{</a><a id="3027" class="Argument">b</a> <a id="3029" class="Symbol">=</a> <a id="3031" href="Agda.Builtin.Bool.html#198" class="InductiveConstructor">true</a><a id="3035" class="Symbol">}</a> <a id="3038" href="Relation.Nullary.Reflects.html#3038" class="Bound">sound</a> <a id="3044" href="Relation.Nullary.Reflects.html#3044" class="Bound">complete</a> <a id="3053" class="Symbol">=</a> <a id="3055" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="3059" class="Symbol">(</a><a id="3060" href="Relation.Nullary.Reflects.html#3038" class="Bound">sound</a> <a id="3066" class="Symbol">_)</a>
|
||
<a id="3069" href="Relation.Nullary.Reflects.html#2947" class="Function">fromEquivalence</a> <a id="3085" class="Symbol">{</a><a id="3086" class="Argument">b</a> <a id="3088" class="Symbol">=</a> <a id="3090" href="Agda.Builtin.Bool.html#192" class="InductiveConstructor">false</a><a id="3095" class="Symbol">}</a> <a id="3097" href="Relation.Nullary.Reflects.html#3097" class="Bound">sound</a> <a id="3103" href="Relation.Nullary.Reflects.html#3103" class="Bound">complete</a> <a id="3112" class="Symbol">=</a> <a id="3114" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="3118" href="Relation.Nullary.Reflects.html#3103" class="Bound">complete</a>
|
||
|
||
<a id="3128" class="Comment">-- `Reflects` is deterministic.</a>
|
||
<a id="det"></a><a id="3160" href="Relation.Nullary.Reflects.html#3160" class="Function">det</a> <a id="3164" class="Symbol">:</a> <a id="3166" class="Symbol">∀</a> <a id="3168" class="Symbol">{</a><a id="3169" href="Relation.Nullary.Reflects.html#3169" class="Bound">b</a> <a id="3171" href="Relation.Nullary.Reflects.html#3171" class="Bound">b′</a><a id="3173" class="Symbol">}</a> <a id="3175" class="Symbol">→</a> <a id="3177" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="3186" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="3188" href="Relation.Nullary.Reflects.html#3169" class="Bound">b</a> <a id="3190" class="Symbol">→</a> <a id="3192" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="3201" href="Relation.Nullary.Reflects.html#708" class="Generalizable">A</a> <a id="3203" href="Relation.Nullary.Reflects.html#3171" class="Bound">b′</a> <a id="3206" class="Symbol">→</a> <a id="3208" href="Relation.Nullary.Reflects.html#3169" class="Bound">b</a> <a id="3210" href="Agda.Builtin.Equality.html#150" class="Datatype Operator">≡</a> <a id="3212" href="Relation.Nullary.Reflects.html#3171" class="Bound">b′</a>
|
||
<a id="3215" href="Relation.Nullary.Reflects.html#3160" class="Function">det</a> <a id="3219" class="Symbol">(</a><a id="3220" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="3225" href="Relation.Nullary.Reflects.html#3225" class="Bound">a</a><a id="3226" class="Symbol">)</a> <a id="3228" class="Symbol">(</a><a id="3229" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="3234" class="Symbol">_)</a> <a id="3237" class="Symbol">=</a> <a id="3239" href="Agda.Builtin.Equality.html#207" class="InductiveConstructor">refl</a>
|
||
<a id="3244" href="Relation.Nullary.Reflects.html#3160" class="Function">det</a> <a id="3248" class="Symbol">(</a><a id="3249" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="3254" href="Relation.Nullary.Reflects.html#3254" class="Bound">a</a><a id="3255" class="Symbol">)</a> <a id="3257" class="Symbol">(</a><a id="3258" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="3262" href="Relation.Nullary.Reflects.html#3262" class="Bound">¬a</a><a id="3264" class="Symbol">)</a> <a id="3266" class="Symbol">=</a> <a id="3268" href="Relation.Nullary.Negation.Core.html#1226" class="Function">contradiction</a> <a id="3282" href="Relation.Nullary.Reflects.html#3254" class="Bound">a</a> <a id="3284" href="Relation.Nullary.Reflects.html#3262" class="Bound">¬a</a>
|
||
<a id="3287" href="Relation.Nullary.Reflects.html#3160" class="Function">det</a> <a id="3291" class="Symbol">(</a><a id="3292" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="3296" href="Relation.Nullary.Reflects.html#3296" class="Bound">¬a</a><a id="3298" class="Symbol">)</a> <a id="3300" class="Symbol">(</a><a id="3301" href="Relation.Nullary.Reflects.html#982" class="InductiveConstructor">ofʸ</a> <a id="3306" href="Relation.Nullary.Reflects.html#3306" class="Bound">a</a><a id="3307" class="Symbol">)</a> <a id="3309" class="Symbol">=</a> <a id="3311" href="Relation.Nullary.Negation.Core.html#1226" class="Function">contradiction</a> <a id="3325" href="Relation.Nullary.Reflects.html#3306" class="Bound">a</a> <a id="3327" href="Relation.Nullary.Reflects.html#3296" class="Bound">¬a</a>
|
||
<a id="3330" href="Relation.Nullary.Reflects.html#3160" class="Function">det</a> <a id="3334" class="Symbol">(</a><a id="3335" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="3339" href="Relation.Nullary.Reflects.html#3339" class="Bound">¬a</a><a id="3341" class="Symbol">)</a> <a id="3343" class="Symbol">(</a><a id="3344" href="Relation.Nullary.Reflects.html#1019" class="InductiveConstructor">ofⁿ</a> <a id="3349" class="Symbol">_)</a> <a id="3352" class="Symbol">=</a> <a id="3354" href="Agda.Builtin.Equality.html#207" class="InductiveConstructor">refl</a>
|
||
|
||
<a id="T-reflects-elim"></a><a id="3360" href="Relation.Nullary.Reflects.html#3360" class="Function">T-reflects-elim</a> <a id="3376" class="Symbol">:</a> <a id="3378" class="Symbol">∀</a> <a id="3380" class="Symbol">{</a><a id="3381" href="Relation.Nullary.Reflects.html#3381" class="Bound">a</a> <a id="3383" href="Relation.Nullary.Reflects.html#3383" class="Bound">b</a><a id="3384" class="Symbol">}</a> <a id="3386" class="Symbol">→</a> <a id="3388" href="Relation.Nullary.Reflects.html#938" class="Datatype">Reflects</a> <a id="3397" class="Symbol">(</a><a id="3398" href="Data.Bool.Base.html#1348" class="Function">T</a> <a id="3400" href="Relation.Nullary.Reflects.html#3381" class="Bound">a</a><a id="3401" class="Symbol">)</a> <a id="3403" href="Relation.Nullary.Reflects.html#3383" class="Bound">b</a> <a id="3405" class="Symbol">→</a> <a id="3407" href="Relation.Nullary.Reflects.html#3383" class="Bound">b</a> <a id="3409" href="Agda.Builtin.Equality.html#150" class="Datatype Operator">≡</a> <a id="3411" href="Relation.Nullary.Reflects.html#3381" class="Bound">a</a>
|
||
<a id="3413" href="Relation.Nullary.Reflects.html#3360" class="Function">T-reflects-elim</a> <a id="3429" class="Symbol">{</a><a id="3430" href="Relation.Nullary.Reflects.html#3430" class="Bound">a</a><a id="3431" class="Symbol">}</a> <a id="3433" href="Relation.Nullary.Reflects.html#3433" class="Bound">r</a> <a id="3435" class="Symbol">=</a> <a id="3437" href="Relation.Nullary.Reflects.html#3160" class="Function">det</a> <a id="3441" href="Relation.Nullary.Reflects.html#3433" class="Bound">r</a> <a id="3443" class="Symbol">(</a><a id="3444" href="Relation.Nullary.Reflects.html#1858" class="Function">T-reflects</a> <a id="3455" href="Relation.Nullary.Reflects.html#3430" class="Bound">a</a><a id="3456" class="Symbol">)</a>
|
||
</pre></body></html> |