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

<b>let </b><font color="Maroon" title="c1">a</font> be   <a href="int_1.html#NM1" title="INT_1:NM.1">Integer</a>;<br/><b>let </b><font color="Maroon" title="c2">p</font> be   <a href="newton.html#NM1" title="NEWTON:NM.1">Prime</a>;<br/>



<b>assume </b><a NAME="E1:21"/><i><font color="Green" title="E17">A1</font></i>: 
( <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> )
 ;<br/>

<b>then consider </b><font color="Maroon" title="c3">x</font> being   <a href="int_1.html#NM1" title="INT_1:NM.1">Integer</a><b> such that </b><br/><a NAME="E3:21"/><i><font color="Green" title="E18">A2</font></i>: 
<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> 
 <b>by </b><i><a class="ref" href="int_5.html#D2" target="_self" title="INT_5:def.2">Def2</a></i>;<br/>
<a NAME="E4:21"/><i><font color="Green" title="E19">A3</font></i>: 
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="21_1"><b>proof </b></a><div class="add">

<b>assume </b><a NAME="E1:21_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>
 ;<br/>

<a NAME="E2:21_1"/><b>then </b>
<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>
 
<b>by </b><i><a class="ref" href="int_2.html#T19" title="INT_2:th.19">INT_2:19</a></i>;<br/>
<a NAME="E3:21_1"/><b>then </b><i><font color="Green" title="E20">A4</font></i>: 
<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:21_1"/>
2,<font color="Maroon" title="c2">p</font> <a href="int_2.html#R1" title="INT_2:pred.1">are_relative_prime</a> 
 
<b>by </b><i><a class="txt" href="int_5.html#E1:21"><i><font color="Green" title="E17">A1</font></i></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></i>;<br/>
<a NAME="E5:21_1"/><b>then </b>
2 <a href="nat_d.html#K6" title="NAT_D:func.6">hcf</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a> 1
 
<b>by </b><i><a class="ref" href="int_2.html#D4" title="INT_2:def.4">INT_2:def 4</a></i>;<br/>
<a NAME="E6:21_1"/><b>then </b>
<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>
 
<b>by </b><i><a class="txt" href="int_5.html#E3:21_1"><i><font color="Green" title="E20">A4</font></i></a>, <a class="ref" href="wsierp_1.html#T36" title="WSIERP_1:th.36">WSIERP_1:36</a></i>;<br/>
<b>then consider </b><font color="Maroon" title="c4">i</font> being   <a href="int_1.html#NM1" title="INT_1:NM.1">Integer</a><b> such that </b><br/><a NAME="E8:21_1"/><i><font color="Green" title="E21">A5</font></i>: 
<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="c4">i</font>
 <b>by </b><i><a class="ref" href="int_1.html#D9" title="INT_1:def.9">INT_1:def 9</a></i>;<br/>
<a NAME="E9:21_1"/>
<font color="Maroon" title="c3">x</font> <a href="hidden.html#NR2" title="HIDDEN:NR.2">&lt;&gt;</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a> 
 
<div><a class="txt" onclick="hs2(this)" href="javascript:()" title="21_1_1"><b>proof </b></a><div class="add">

<b>assume </b><a NAME="E1:21_1_1"/>
<font color="Maroon" title="c3">x</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a> 
 ;<br/>

<a NAME="E2:21_1_1"/><b>then </b>
<font color="Maroon" title="c2">p</font> <a href="int_1.html#R2" title="INT_1:pred.2">divides</a>  <a href="xcmplx_0.html#K4" title="XCMPLX_0:func.4">-</a> <font color="Maroon" title="c1">a</font>
 
<b>by </b><i><a class="txt" href="int_5.html#E3:21"><i><font color="Green" title="E18">A2</font></i></a>, <a class="ref" href="int_1.html#T89" title="INT_1:th.89">INT_1:89</a></i>;<br/>
<a NAME="E3:21_1_1"/><b>then </b>
<font color="Maroon" title="c2">p</font> <a href="int_1.html#R2" title="INT_1:pred.2">divides</a> <font color="Maroon" title="c1">a</font> <a href="xcmplx_0.html#K3" title="XCMPLX_0:func.3">*</a> 1
 
<b>by </b><i><a class="ref" href="int_2.html#T14" title="INT_2:th.14">INT_2:14</a></i>;<br/>
<a NAME="E4:21_1_1"/><b>then </b>
<font color="Maroon" title="c2">p</font> <a href="xxreal_0.html#R1" title="XXREAL_0:pred.1">&lt;=</a> 1
 
<b>by </b><i><a class="txt" href="int_5.html#E1:21"><i><font color="Green" title="E17">A1</font></i></a>, <a class="ref" href="nat_d.html#T7" title="NAT_D:th.7">NAT_D:7</a>, <a class="ref" href="wsierp_1.html#T36" title="WSIERP_1:th.36">WSIERP_1:36</a></i>;<br/>
<b>hence </b><a NAME="E5:21_1_1"/>
contradiction
 <b>by </b><i><a class="ref" href="int_2.html#D5" title="INT_2:def.5">INT_2:def 5</a></i>;<br/>


</div><b>end;</b></div>
<a NAME="E10:21_1"/><b>then </b><i><font color="Green" title="E22">A6</font></i>: 
<font color="Maroon" title="c4">i</font> <a href="hidden.html#NR2" title="HIDDEN:NR.2">&lt;&gt;</a>  <a href="numbers.html#K6" title="NUMBERS:func.6">0</a> 
 
<b>by </b><i><a class="txt" href="int_5.html#E8:21_1"><i><font color="Green" title="E21">A5</font></i></a></i>;<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="c4">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>
<b>by </b><i><a class="txt" href="int_5.html#E8:21_1"><i><font color="Green" title="E21">A5</font></i></a></i>
<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="c4">i</font> <a href="int_2.html#K3" title="INT_2:func.3">gcd</a> 1</span>)</span>
<b>by </b><i><a class="txt" href="int_5.html#E10:21_1"><i><font color="Green" title="E22">A6</font></i></a>, <a class="ref" href="euler_1.html#T16" title="EULER_1:th.16">EULER_1:16</a></i>
<br/>.= 
<font color="Maroon" title="c2">p</font> <a href="nat_1.html#K3" title="NAT_1:func.3">*</a> 1
<b>by </b><i><a class="ref" href="wsierp_1.html#T13" title="WSIERP_1:th.13">WSIERP_1:13</a></i>
;<br/>
<a NAME="E12:21_1"/><b>then </b>
<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
 
<b>by </b><i><a class="ref" href="int_2.html#D5" title="INT_2:def.5">INT_2:def 5</a></i>;<br/>
<a NAME="E13:21_1"/><b>then </b>
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> 
 
<b>by </b><i><a class="ref" href="int_2.html#D4" title="INT_2:def.4">INT_2:def 4</a></i>;<br/>
<b>hence </b><a NAME="E14:21_1"/>
contradiction
 <b>by </b><i><a class="txt" href="int_5.html#E1:21"><i><font color="Green" title="E17">A1</font></i></a>, <a class="txt" href="int_5.html#E3:21"><i><font color="Green" title="E18">A2</font></i></a>, <a class="ref" href="int_5.html#T14" target="_self" title="INT_5:th.14">Th14</a></i>;<br/>


</div><b>end;</b></div>
<b>take </b>
<font color="Maroon" title="c3">x</font>
;<br/>

<b>take </b><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>;<br/>

<b>thus </b><a NAME="E5:21"/>
( <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> )
 <b>by </b><i><a class="txt" href="int_5.html#E3:21"><i><font color="Green" title="E18">A2</font></i></a>, <a class="txt" href="int_5.html#E4:21"><i><font color="Green" title="E19">A3</font></i></a></i>;<br/>


</div>
