<?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" onmouseover="tooltip.show('hs',this)" onmouseout="tooltip.hide()" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="firebrick">::  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#K1" title="PEPIN:func.1">^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#K5" title="INT_1:func.5">mod</a> <font color="Olive" title="b1">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K5" title="NUMBERS:func.5">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#K1" title="PEPIN:func.1">^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#K5" title="INT_1:func.5">mod</a> <font color="Olive" title="b1">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K5" title="NUMBERS:func.5">0</a>  &amp;  not <font color="Olive" title="b2">x</font>,<font color="Olive" title="b3">y</font> <a href="int_1.html#R2" title="INT_1:pred.2">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" onmouseover="tooltip.show('hs',this)" onmouseout="tooltip.hide()" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="firebrick">::  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#K1" title="PEPIN:func.1">^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#K5" title="INT_1:func.5">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K5" title="NUMBERS:func.5">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#K1" title="PEPIN:func.1">^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#K5" title="INT_1:func.5">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K5" title="NUMBERS:func.5">0</a>  &amp;  not <font color="Olive" title="b1">x</font>,<font color="Olive" title="b2">y</font> <a href="int_1.html#R2" title="INT_1:pred.2">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:19"/><span class="lab"><font color="Green" title="E16">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:19"/><span class="lab"><font color="Green" title="E17">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:19"/><span class="lab"><font color="Green" title="E18">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" onmouseover="tooltip.show('hs',this)" onmouseout="tooltip.hide()" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="firebrick">::  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#K1" title="PEPIN:func.1">^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#K5" title="INT_1:func.5">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K5" title="NUMBERS:func.5">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#K1" title="PEPIN:func.1">^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#K5" title="INT_1:func.5">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K5" title="NUMBERS:func.5">0</a>  &amp;  not <font color="Olive" title="b1">x</font>,<font color="Olive" title="b2">y</font> <a href="int_1.html#R2" title="INT_1:pred.2">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:19"/><span class="lab"><font color="Green" title="E19">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#K1" title="PEPIN:func.1">^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#K5" title="INT_1:func.5">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K5" title="NUMBERS:func.5">0</a> 
 <span class="kw">by</span> <span class="lab"><a class="txt" href="#E3:19"><span class="lab"><font color="Green" title="E18">A3</font></span></a></span>;<br/>
<span class="kw">take </span>
<font color="Maroon" title="c3">x</font>
; <a class="txt" onmouseover="tooltip.show('hs',this)" onmouseout="tooltip.hide()" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="firebrick">::  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#K1" title="PEPIN:func.1">^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#K5" title="INT_1:func.5">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K5" title="NUMBERS:func.5">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#K1" title="PEPIN:func.1">^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#K5" title="INT_1:func.5">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K5" title="NUMBERS:func.5">0</a>  &amp;  not <font color="Maroon" title="c3">x</font>,<font color="Olive" title="b1">y</font> <a href="int_1.html#R2" title="INT_1:pred.2">are_congruent_mod</a> <font color="Maroon" title="c2">p</font> )</span><br/>

<span class="kw">take </span>
 <a href="xcmplx_0.html#K4" title="XCMPLX_0:func.4">-</a> <font color="Maroon" title="c3">x</font>
; <a class="txt" onmouseover="tooltip.show('hs',this)" onmouseout="tooltip.hide()" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="firebrick">::  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#K1" title="PEPIN:func.1">^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#K5" title="INT_1:func.5">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K5" title="NUMBERS:func.5">0</a>  &amp; <span class="p1">(<span class="default"><span class="p2">(<span class="default"><span class="p3">(<span class="default"><a href="xcmplx_0.html#K4" title="XCMPLX_0:func.4">-</a> <font color="Maroon" title="c3">x</font></span>)</span> <a href="pepin.html#K1" title="PEPIN:func.1">^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#K5" title="INT_1:func.5">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K5" title="NUMBERS:func.5">0</a>  &amp;  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#R2" title="INT_1:pred.2">are_congruent_mod</a> <font color="Maroon" title="c2">p</font> )</span><br/>

<a NAME="E6:19"/>
 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#R2" title="INT_1:pred.2">are_congruent_mod</a> <font color="Maroon" title="c2">p</font>
 
<div><a class="txt" onmouseover="tooltip.show('hs2',this)" onmouseout="tooltip.hide()" onclick="hs2(this)" href="javascript:()" title="19_1"><span class="kw">proof </span></a><div class="add">

<span class="kw">assume </span><a NAME="E1:19_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#R2" title="INT_1:pred.2">are_congruent_mod</a> <font color="Maroon" title="c2">p</font>
 ; <a class="txt" onmouseover="tooltip.show('hs',this)" onmouseout="tooltip.hide()" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="firebrick">::  thesis: </font></span></a><span class="hide"> contradiction</span><br/>

<a NAME="E2:19_1"/><span class="kw">then </span><span class="lab"><font color="Green" title="E20">A5</font></span>: 
<font color="Maroon" title="c2">p</font> <a href="int_1.html#R1" title="INT_1:pred.1">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="E3:19_1"/>
2,<font color="Maroon" title="c2">p</font> <a href="int_2.html#R1" title="INT_2:pred.1">are_coprime</a> 
 
<span class="kw">by</span> <span class="lab"><a class="txt" href="#E1:19"><span class="lab"><font color="Green" title="E16">A1</font></span></a>, <a class="ref" href="int_2.html#T28" onmouseover="rs('int_2/T28')" onmouseout="rh()">INT_2:28</a>, <a class="ref" href="int_2.html#T30" onmouseover="rs('int_2/T30')" onmouseout="rh()">INT_2:30</a></span>;<br/>
<a NAME="E4:19_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#D3" onmouseover="rs('int_2/D3')" onmouseout="rh()">INT_2:def 3</a></span>;<br/>
<a NAME="E5:19_1"/><span class="kw">then </span>
<font color="Maroon" title="c2">p</font> <a href="int_1.html#R1" title="INT_1:pred.1">divides</a> <font color="Maroon" title="c3">x</font>
 
<span class="kw">by</span> <span class="lab"><a class="txt" href="#E2:19_1"><span class="lab"><font color="Green" title="E20">A5</font></span></a>, <a class="ref" href="wsierp_1.html#T29" onmouseover="rs('wsierp_1/T29')" onmouseout="rh()">WSIERP_1:29</a></span>;<br/>
<span class="kw">then </span><span class="kw">consider </span><font color="Maroon" title="c4">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="E7:19_1"/><span class="lab"><font color="Green" title="E21">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="c4">i</font>
 ;<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="xcmplx_0.html#K3" title="XCMPLX_0:func.3">*</a> 1</span>)</span>
<span class="kw">by</span> <span class="lab"><a class="txt" href="#E7:19_1"><span class="lab"><font color="Green" title="E21">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="c4">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#T15" onmouseover="rs('euler_1/T15')" onmouseout="rh()">EULER_1:15</a></span>
<br/>.= 
<font color="Maroon" title="c2">p</font> <a href="xcmplx_0.html#K3" title="XCMPLX_0:func.3">*</a> 1
<span class="kw">by</span> <span class="lab"><a class="ref" href="wsierp_1.html#T8" onmouseover="rs('wsierp_1/T8')" onmouseout="rh()">WSIERP_1:8</a></span>
;<br/>
<a NAME="E9:19_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#D4" onmouseover="rs('int_2/D4')" onmouseout="rh()">INT_2:def 4</a></span>;<br/>
<a NAME="E10:19_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_coprime</a> 
 
<span class="kw">by</span> <span class="lab"><a class="ref" href="int_2.html#D3" onmouseover="rs('int_2/D3')" onmouseout="rh()">INT_2:def 3</a></span>;<br/>
<span class="kw">hence </span><a NAME="E11:19_1"/>
contradiction
 <span class="kw">by</span> <span class="lab"><a class="txt" href="#E2:19"><span class="lab"><font color="Green" title="E17">A2</font></span></a>, <a class="txt" href="#E5:19"><span class="lab"><font color="Green" title="E19">A4</font></span></a>, <a class="ref" href="int_5.html#T14" target="_self" onmouseover="rs('int_5/T14')" onmouseout="rh()">Th14</a></span>; <a class="txt" onmouseover="tooltip.show('hs',this)" onmouseout="tooltip.hide()" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="firebrick">::  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:19"/>
( <span class="p1">(<span class="default"><span class="p2">(<span class="default"><font color="Maroon" title="c3">x</font> <a href="pepin.html#K1" title="PEPIN:func.1">^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#K5" title="INT_1:func.5">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K5" title="NUMBERS:func.5">0</a>  &amp; <span class="p1">(<span class="default"><span class="p2">(<span class="default"><span class="p3">(<span class="default"><a href="xcmplx_0.html#K4" title="XCMPLX_0:func.4">-</a> <font color="Maroon" title="c3">x</font></span>)</span> <a href="pepin.html#K1" title="PEPIN:func.1">^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#K5" title="INT_1:func.5">mod</a> <font color="Maroon" title="c2">p</font> <a href="hidden.html#R1" title="HIDDEN:pred.1">=</a>  <a href="numbers.html#K5" title="NUMBERS:func.5">0</a>  &amp;  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#R2" title="INT_1:pred.2">are_congruent_mod</a> <font color="Maroon" title="c2">p</font> )
 <span class="kw">by</span> <span class="lab"><a class="txt" href="#E5:19"><span class="lab"><font color="Green" title="E19">A4</font></span></a></span>; <a class="txt" onmouseover="tooltip.show('hs',this)" onmouseout="tooltip.hide()" onclick="hs(this)" href="javascript:()"><span class="comment"><font color="firebrick">::  thesis: </font></span></a><span class="hide"> verum</span><br/>


</div>
