<?xml version="1.0"?>
<div class="add">

<span class="kw">let </span><font color="Maroon" title="c1">a</font> be   <a href="int_1.html#NM1" title="INT_1:NM.1">Integer</a>; <a class="txt" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="Red">::  thesis: </font></span></a><span class="hide"> for <font color="Olive" title="b1">p</font> being  <a href="newton.html#NM1" title="NEWTON:NM.1">Prime</a>  st <font color="Olive" title="b1">p</font> <a href="xxreal_0.html#NR4" title="XXREAL_0:NR.4">&gt;</a> 2 &amp; <font color="Maroon" title="c1">a</font> <a href="int_2.html#K3" title="INT_2:func.3">gcd</a> <font color="Olive" title="b1">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a> 1 &amp; <font color="Maroon" title="c1">a</font> <a href="int_5.html#R1" title="INT_5:pred.1">is_quadratic_residue_mod</a> <font color="Olive" title="b1">p</font> holds <br/> ex <font color="Olive" title="b2">x</font>, <font color="Olive" title="b3">y</font> being  <a href="int_1.html#NM1" title="INT_1:NM.1">Integer</a> st <br/>( <span class="p1">(<span class="default"><span class="p2">(<span class="default"><font color="Olive" title="b2">x</font> <a href="pepin.html#K2" title="PEPIN:func.2">^2</a> </span>)</span> <a href="xcmplx_0.html#K6" title="XCMPLX_0:func.6">-</a> <font color="Maroon" title="c1">a</font></span>)</span> <a href="int_1.html#K6" title="INT_1:func.6">mod</a> <font color="Olive" title="b1">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a>  &amp; <span class="p1">(<span class="default"><span class="p2">(<span class="default"><font color="Olive" title="b3">y</font> <a href="pepin.html#K2" title="PEPIN:func.2">^2</a> </span>)</span> <a href="xcmplx_0.html#K6" title="XCMPLX_0:func.6">-</a> <font color="Maroon" title="c1">a</font></span>)</span> <a href="int_1.html#K6" title="INT_1:func.6">mod</a> <font color="Olive" title="b1">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a>  &amp; not <font color="Olive" title="b2">x</font>,<font color="Olive" title="b3">y</font> <a href="int_1.html#R1" title="INT_1:pred.1">are_congruent_mod</a> <font color="Olive" title="b1">p</font> )</span><br/><span class="kw">let </span><font color="Maroon" title="c2">p</font> be   <a href="newton.html#NM1" title="NEWTON:NM.1">Prime</a>; <a class="txt" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="Red">::  thesis: </font></span></a><span class="hide"> ( <font color="Maroon" title="c2">p</font> <a href="xxreal_0.html#NR4" title="XXREAL_0:NR.4">&gt;</a> 2 &amp; <font color="Maroon" title="c1">a</font> <a href="int_2.html#K3" title="INT_2:func.3">gcd</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a> 1 &amp; <font color="Maroon" title="c1">a</font> <a href="int_5.html#R1" title="INT_5:pred.1">is_quadratic_residue_mod</a> <font color="Maroon" title="c2">p</font> implies  ex <font color="Olive" title="b1">x</font>, <font color="Olive" title="b2">y</font> being  <a href="int_1.html#NM1" title="INT_1:NM.1">Integer</a> st <br/>( <span class="p1">(<span class="default"><span class="p2">(<span class="default"><font color="Olive" title="b1">x</font> <a href="pepin.html#K2" title="PEPIN:func.2">^2</a> </span>)</span> <a href="xcmplx_0.html#K6" title="XCMPLX_0:func.6">-</a> <font color="Maroon" title="c1">a</font></span>)</span> <a href="int_1.html#K6" title="INT_1:func.6">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a>  &amp; <span class="p1">(<span class="default"><span class="p2">(<span class="default"><font color="Olive" title="b2">y</font> <a href="pepin.html#K2" title="PEPIN:func.2">^2</a> </span>)</span> <a href="xcmplx_0.html#K6" title="XCMPLX_0:func.6">-</a> <font color="Maroon" title="c1">a</font></span>)</span> <a href="int_1.html#K6" title="INT_1:func.6">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a>  &amp; not <font color="Olive" title="b1">x</font>,<font color="Olive" title="b2">y</font> <a href="int_1.html#R1" title="INT_1:pred.1">are_congruent_mod</a> <font color="Maroon" title="c2">p</font> ) )</span><br/>



<span class="kw">assume </span><span class="kw">that </span><br/><a NAME="E1:20"/><span class="lab"><font color="Green" title="E17">A1</font></span>: 
<font color="Maroon" title="c2">p</font> <a href="xxreal_0.html#NR4" title="XXREAL_0:NR.4">&gt;</a> 2
 <span class="kw">and </span><br/><a NAME="E2:20"/><span class="lab"><font color="Green" title="E18">A2</font></span>: 
<font color="Maroon" title="c1">a</font> <a href="int_2.html#K3" title="INT_2:func.3">gcd</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a> 1
 <span class="kw">and </span><br/><a NAME="E3:20"/><span class="lab"><font color="Green" title="E19">A3</font></span>: 
<font color="Maroon" title="c1">a</font> <a href="int_5.html#R1" title="INT_5:pred.1">is_quadratic_residue_mod</a> <font color="Maroon" title="c2">p</font>
 ; <a class="txt" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="Red">::  thesis: </font></span></a><span class="hide">  ex <font color="Olive" title="b1">x</font>, <font color="Olive" title="b2">y</font> being  <a href="int_1.html#NM1" title="INT_1:NM.1">Integer</a> st <br/>( <span class="p1">(<span class="default"><span class="p2">(<span class="default"><font color="Olive" title="b1">x</font> <a href="pepin.html#K2" title="PEPIN:func.2">^2</a> </span>)</span> <a href="xcmplx_0.html#K6" title="XCMPLX_0:func.6">-</a> <font color="Maroon" title="c1">a</font></span>)</span> <a href="int_1.html#K6" title="INT_1:func.6">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a>  &amp; <span class="p1">(<span class="default"><span class="p2">(<span class="default"><font color="Olive" title="b2">y</font> <a href="pepin.html#K2" title="PEPIN:func.2">^2</a> </span>)</span> <a href="xcmplx_0.html#K6" title="XCMPLX_0:func.6">-</a> <font color="Maroon" title="c1">a</font></span>)</span> <a href="int_1.html#K6" title="INT_1:func.6">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a>  &amp; not <font color="Olive" title="b1">x</font>,<font color="Olive" title="b2">y</font> <a href="int_1.html#R1" title="INT_1:pred.1">are_congruent_mod</a> <font color="Maroon" title="c2">p</font> )</span><br/>

<span class="kw">consider </span><font color="Maroon" title="c3">x</font> being   <a href="int_1.html#NM1" title="INT_1:NM.1">Integer</a><span class="kw"> such that </span><br/><a NAME="E5:20"/><span class="lab"><font color="Green" title="E20">A4</font></span>: 
<span class="p1">(<span class="default"><span class="p2">(<span class="default"><font color="Maroon" title="c3">x</font> <a href="pepin.html#K2" title="PEPIN:func.2">^2</a> </span>)</span> <a href="xcmplx_0.html#K6" title="XCMPLX_0:func.6">-</a> <font color="Maroon" title="c1">a</font></span>)</span> <a href="int_1.html#K6" title="INT_1:func.6">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a> 
 <span class="kw">by</span> <span class="lab"><a class="txt" href="#E3:20"><span class="lab"><font color="Green" title="E19">A3</font></span></a>, <a class="ref" href="int_5.html#D2" target="_self" title="INT_5:def.2">Def2</a></span>;<br/>
<span class="kw">take </span>
<font color="Maroon" title="c3">x</font>
; <a class="txt" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="Red">::  thesis: </font></span></a><span class="hide">  ex <font color="Olive" title="b1">y</font> being  <a href="int_1.html#NM1" title="INT_1:NM.1">Integer</a> st <br/>( <span class="p1">(<span class="default"><span class="p2">(<span class="default"><font color="Maroon" title="c3">x</font> <a href="pepin.html#K2" title="PEPIN:func.2">^2</a> </span>)</span> <a href="xcmplx_0.html#K6" title="XCMPLX_0:func.6">-</a> <font color="Maroon" title="c1">a</font></span>)</span> <a href="int_1.html#K6" title="INT_1:func.6">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a>  &amp; <span class="p1">(<span class="default"><span class="p2">(<span class="default"><font color="Olive" title="b1">y</font> <a href="pepin.html#K2" title="PEPIN:func.2">^2</a> </span>)</span> <a href="xcmplx_0.html#K6" title="XCMPLX_0:func.6">-</a> <font color="Maroon" title="c1">a</font></span>)</span> <a href="int_1.html#K6" title="INT_1:func.6">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a>  &amp; not <font color="Maroon" title="c3">x</font>,<font color="Olive" title="b1">y</font> <a href="int_1.html#R1" title="INT_1:pred.1">are_congruent_mod</a> <font color="Maroon" title="c2">p</font> )</span><br/>

<span class="kw">take </span><font color="Maroon" title="c4">y</font> =  <a href="xcmplx_0.html#K4" title="XCMPLX_0:func.4">-</a> <font color="Maroon" title="c3">x</font>; <a class="txt" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="Red">::  thesis: </font></span></a><span class="hide"> ( <span class="p1">(<span class="default"><span class="p2">(<span class="default"><font color="Maroon" title="c3">x</font> <a href="pepin.html#K2" title="PEPIN:func.2">^2</a> </span>)</span> <a href="xcmplx_0.html#K6" title="XCMPLX_0:func.6">-</a> <font color="Maroon" title="c1">a</font></span>)</span> <a href="int_1.html#K6" title="INT_1:func.6">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a>  &amp; <span class="p1">(<span class="default"><span class="p2">(<span class="default"><font color="Maroon" title="c4">y</font> <a href="pepin.html#K2" title="PEPIN:func.2">^2</a> </span>)</span> <a href="xcmplx_0.html#K6" title="XCMPLX_0:func.6">-</a> <font color="Maroon" title="c1">a</font></span>)</span> <a href="int_1.html#K6" title="INT_1:func.6">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a>  &amp; not <font color="Maroon" title="c3">x</font>,<font color="Maroon" title="c4">y</font> <a href="int_1.html#R1" title="INT_1:pred.1">are_congruent_mod</a> <font color="Maroon" title="c2">p</font> )</span><br/>

<a NAME="E6:20"/>
not <font color="Maroon" title="c3">x</font>, <a href="xcmplx_0.html#K4" title="XCMPLX_0:func.4">-</a> <font color="Maroon" title="c3">x</font> <a href="int_1.html#R1" title="INT_1:pred.1">are_congruent_mod</a> <font color="Maroon" title="c2">p</font>
 
<div><a class="txt" onclick="hs2(this)" href="javascript:()" title="20_1"><span class="kw">proof </span></a><div class="add">

<span class="kw">assume </span><a NAME="E1:20_1"/>
<font color="Maroon" title="c3">x</font>, <a href="xcmplx_0.html#K4" title="XCMPLX_0:func.4">-</a> <font color="Maroon" title="c3">x</font> <a href="int_1.html#R1" title="INT_1:pred.1">are_congruent_mod</a> <font color="Maroon" title="c2">p</font>
 ; <a class="txt" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="Red">::  thesis: </font></span></a><span class="hide"> contradiction</span><br/>

<a NAME="E2:20_1"/><span class="kw">then </span>
<font color="Maroon" title="c2">p</font> <a href="int_1.html#R2" title="INT_1:pred.2">divides</a> <font color="Maroon" title="c3">x</font> <a href="xcmplx_0.html#K6" title="XCMPLX_0:func.6">-</a> <span class="p1">(<span class="default"><a href="xcmplx_0.html#K4" title="XCMPLX_0:func.4">-</a> <font color="Maroon" title="c3">x</font></span>)</span>
 
<span class="kw">by</span> <span class="lab"><a class="ref" href="int_2.html#T19" title="INT_2:th.19">INT_2:19</a></span>;<br/>
<a NAME="E3:20_1"/><span class="kw">then </span><span class="lab"><font color="Green" title="E21">A5</font></span>: 
<font color="Maroon" title="c2">p</font> <a href="int_1.html#R2" title="INT_1:pred.2">divides</a> 2 <a href="xcmplx_0.html#K3" title="XCMPLX_0:func.3">*</a> <font color="Maroon" title="c3">x</font>
 
;<br/>
<a NAME="E4:20_1"/>
2,<font color="Maroon" title="c2">p</font> <a href="int_2.html#R1" title="INT_2:pred.1">are_relative_prime</a> 
 
<span class="kw">by</span> <span class="lab"><a class="txt" href="#E1:20"><span class="lab"><font color="Green" title="E17">A1</font></span></a>, <a class="ref" href="int_2.html#T44" title="INT_2:th.44">INT_2:44</a>, <a class="ref" href="int_2.html#T47" title="INT_2:th.47">INT_2:47</a></span>;<br/>
<a NAME="E5:20_1"/><span class="kw">then </span>
2 <a href="int_2.html#K3" title="INT_2:func.3">gcd</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a> 1
 
<span class="kw">by</span> <span class="lab"><a class="ref" href="int_2.html#D4" title="INT_2:def.4">INT_2:def 4</a></span>;<br/>
<a NAME="E6:20_1"/><span class="kw">then </span>
<font color="Maroon" title="c2">p</font> <a href="int_1.html#R2" title="INT_1:pred.2">divides</a> <font color="Maroon" title="c3">x</font>
 
<span class="kw">by</span> <span class="lab"><a class="txt" href="#E3:20_1"><span class="lab"><font color="Green" title="E21">A5</font></span></a>, <a class="ref" href="wsierp_1.html#T36" title="WSIERP_1:th.36">WSIERP_1:36</a></span>;<br/>
<span class="kw">then </span><span class="kw">consider </span><font color="Maroon" title="c5">i</font> being   <a href="int_1.html#NM1" title="INT_1:NM.1">Integer</a><span class="kw"> such that </span><br/><a NAME="E8:20_1"/><span class="lab"><font color="Green" title="E22">A6</font></span>: 
<font color="Maroon" title="c3">x</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a> <font color="Maroon" title="c2">p</font> <a href="xcmplx_0.html#K3" title="XCMPLX_0:func.3">*</a> <font color="Maroon" title="c5">i</font>
 <span class="kw">by</span> <span class="lab"><a class="ref" href="int_1.html#D9" title="INT_1:def.9">INT_1:def 9</a></span>;<br/>
<font color="Maroon" title="c3">x</font> <a href="int_2.html#K3" title="INT_2:func.3">gcd</a> <font color="Maroon" title="c2">p</font> = 
<span class="p1">(<span class="default"><font color="Maroon" title="c2">p</font> <a href="xcmplx_0.html#K3" title="XCMPLX_0:func.3">*</a> <font color="Maroon" title="c5">i</font></span>)</span> <a href="int_2.html#K3" title="INT_2:func.3">gcd</a> <span class="p1">(<span class="default"><font color="Maroon" title="c2">p</font> <a href="nat_1.html#K3" title="NAT_1:func.3">*</a> 1</span>)</span>
<span class="kw">by</span> <span class="lab"><a class="txt" href="#E8:20_1"><span class="lab"><font color="Green" title="E22">A6</font></span></a></span>
<br/>.= 
<font color="Maroon" title="c2">p</font> <a href="xcmplx_0.html#K3" title="XCMPLX_0:func.3">*</a> <span class="p1">(<span class="default"><font color="Maroon" title="c5">i</font> <a href="int_2.html#K3" title="INT_2:func.3">gcd</a> 1</span>)</span>
<span class="kw">by</span> <span class="lab"><a class="ref" href="euler_1.html#T16" title="EULER_1:th.16">EULER_1:16</a></span>
<br/>.= 
<font color="Maroon" title="c2">p</font> <a href="nat_1.html#K3" title="NAT_1:func.3">*</a> 1
<span class="kw">by</span> <span class="lab"><a class="ref" href="wsierp_1.html#T13" title="WSIERP_1:th.13">WSIERP_1:13</a></span>
;<br/>
<a NAME="E10:20_1"/><span class="kw">then </span>
<font color="Maroon" title="c3">x</font> <a href="int_2.html#K3" title="INT_2:func.3">gcd</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#NR2" title="HIDDEN:NR.2">&lt;&gt;</a> 1
 
<span class="kw">by</span> <span class="lab"><a class="ref" href="int_2.html#D5" title="INT_2:def.5">INT_2:def 5</a></span>;<br/>
<a NAME="E11:20_1"/><span class="kw">then </span>
not <font color="Maroon" title="c3">x</font>,<font color="Maroon" title="c2">p</font> <a href="int_2.html#R1" title="INT_2:pred.1">are_relative_prime</a> 
 
<span class="kw">by</span> <span class="lab"><a class="ref" href="int_2.html#D4" title="INT_2:def.4">INT_2:def 4</a></span>;<br/>
<span class="kw">hence </span><a NAME="E12:20_1"/>
contradiction
 <span class="kw">by</span> <span class="lab"><a class="txt" href="#E2:20"><span class="lab"><font color="Green" title="E18">A2</font></span></a>, <a class="txt" href="#E5:20"><span class="lab"><font color="Green" title="E20">A4</font></span></a>, <a class="ref" href="int_5.html#T14" target="_self" title="INT_5:th.14">Th14</a></span>; <a class="txt" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="Red">::  thesis: </font></span></a><span class="hide"> verum</span><br/>


</div><span class="kw">end;</span></div>
<span class="kw">hence </span><a NAME="E7:20"/>
( <span class="p1">(<span class="default"><span class="p2">(<span class="default"><font color="Maroon" title="c3">x</font> <a href="pepin.html#K2" title="PEPIN:func.2">^2</a> </span>)</span> <a href="xcmplx_0.html#K6" title="XCMPLX_0:func.6">-</a> <font color="Maroon" title="c1">a</font></span>)</span> <a href="int_1.html#K6" title="INT_1:func.6">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a>  &amp; <span class="p1">(<span class="default"><span class="p2">(<span class="default"><font color="Maroon" title="c4">y</font> <a href="pepin.html#K2" title="PEPIN:func.2">^2</a> </span>)</span> <a href="xcmplx_0.html#K6" title="XCMPLX_0:func.6">-</a> <font color="Maroon" title="c1">a</font></span>)</span> <a href="int_1.html#K6" title="INT_1:func.6">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a>  &amp; not <font color="Maroon" title="c3">x</font>,<font color="Maroon" title="c4">y</font> <a href="int_1.html#R1" title="INT_1:pred.1">are_congruent_mod</a> <font color="Maroon" title="c2">p</font> )
 <span class="kw">by</span> <span class="lab"><a class="txt" href="#E5:20"><span class="lab"><font color="Green" title="E20">A4</font></span></a></span>; <a class="txt" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="Red">::  thesis: </font></span></a><span class="hide"> verum</span><br/>


</div>
