MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  2sqlem11 Unicode version

Theorem 2sqlem11 20614
Description: Lemma for 2sq 20615. (Contributed by Mario Carneiro, 19-Jun-2015.)
Hypotheses
Ref Expression
2sq.1  |-  S  =  ran  ( w  e.  ZZ [ _i ]  |->  ( ( abs `  w
) ^ 2 ) )
2sqlem7.2  |-  Y  =  { z  |  E. x  e.  ZZ  E. y  e.  ZZ  ( ( x  gcd  y )  =  1  /\  z  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) }
Assertion
Ref Expression
2sqlem11  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  e.  S )
Distinct variable groups:    x, w, y, z    x, S, y, z    x, Y, y   
x, P, y
Allowed substitution hints:    P( z, w)    S( w)    Y( z, w)

Proof of Theorem 2sqlem11
Dummy variable  n is distinct from all other variables.
StepHypRef Expression
1 simpr 447 . . . . 5  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  ( P  mod  4 )  =  1 )
2 simpl 443 . . . . . . 7  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  e.  Prime )
3 1ne2 9931 . . . . . . . . . . 11  |-  1  =/=  2
43necomi 2528 . . . . . . . . . 10  |-  2  =/=  1
5 oveq1 5865 . . . . . . . . . . . 12  |-  ( P  =  2  ->  ( P  mod  4 )  =  ( 2  mod  4
) )
6 2re 9815 . . . . . . . . . . . . 13  |-  2  e.  RR
7 4re 9819 . . . . . . . . . . . . . 14  |-  4  e.  RR
8 4pos 9832 . . . . . . . . . . . . . 14  |-  0  <  4
97, 8elrpii 10357 . . . . . . . . . . . . 13  |-  4  e.  RR+
10 0re 8838 . . . . . . . . . . . . . 14  |-  0  e.  RR
11 2pos 9828 . . . . . . . . . . . . . 14  |-  0  <  2
1210, 6, 11ltleii 8941 . . . . . . . . . . . . 13  |-  0  <_  2
13 2lt4 9890 . . . . . . . . . . . . 13  |-  2  <  4
14 modid 10993 . . . . . . . . . . . . 13  |-  ( ( ( 2  e.  RR  /\  4  e.  RR+ )  /\  ( 0  <_  2  /\  2  <  4
) )  ->  (
2  mod  4 )  =  2 )
156, 9, 12, 13, 14mp4an 654 . . . . . . . . . . . 12  |-  ( 2  mod  4 )  =  2
165, 15syl6eq 2331 . . . . . . . . . . 11  |-  ( P  =  2  ->  ( P  mod  4 )  =  2 )
1716neeq1d 2459 . . . . . . . . . 10  |-  ( P  =  2  ->  (
( P  mod  4
)  =/=  1  <->  2  =/=  1 ) )
184, 17mpbiri 224 . . . . . . . . 9  |-  ( P  =  2  ->  ( P  mod  4 )  =/=  1 )
1918necon2i 2493 . . . . . . . 8  |-  ( ( P  mod  4 )  =  1  ->  P  =/=  2 )
201, 19syl 15 . . . . . . 7  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  =/=  2 )
21 eldifsn 3749 . . . . . . 7  |-  ( P  e.  ( Prime  \  {
2 } )  <->  ( P  e.  Prime  /\  P  =/=  2 ) )
222, 20, 21sylanbrc 645 . . . . . 6  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  e.  ( Prime  \  { 2 } ) )
23 m1lgs 20601 . . . . . 6  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( -u 1  / L P )  =  1  <->  ( P  mod  4 )  =  1 ) )
2422, 23syl 15 . . . . 5  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  (
( -u 1  / L P )  =  1  <-> 
( P  mod  4
)  =  1 ) )
251, 24mpbird 223 . . . 4  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  ( -u 1  / L P
)  =  1 )
26 1z 10053 . . . . . 6  |-  1  e.  ZZ
27 znegcl 10055 . . . . . 6  |-  ( 1  e.  ZZ  ->  -u 1  e.  ZZ )
2826, 27ax-mp 8 . . . . 5  |-  -u 1  e.  ZZ
29 lgsqr 20585 . . . . 5  |-  ( (
-u 1  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( ( -u 1  / L P
)  =  1  <->  ( -.  P  ||  -u 1  /\  E. n  e.  ZZ  P  ||  ( ( n ^ 2 )  -  -u 1 ) ) ) )
3028, 22, 29sylancr 644 . . . 4  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  (
( -u 1  / L P )  =  1  <-> 
( -.  P  ||  -u 1  /\  E. n  e.  ZZ  P  ||  (
( n ^ 2 )  -  -u 1
) ) ) )
3125, 30mpbid 201 . . 3  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  ( -.  P  ||  -u 1  /\  E. n  e.  ZZ  P  ||  ( ( n ^ 2 )  -  -u 1 ) ) )
3231simprd 449 . 2  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  E. n  e.  ZZ  P  ||  (
( n ^ 2 )  -  -u 1
) )
33 simprl 732 . . . . . . 7  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  n  e.  ZZ )
3426a1i 10 . . . . . . 7  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
1  e.  ZZ )
35 gcd1 12711 . . . . . . . 8  |-  ( n  e.  ZZ  ->  (
n  gcd  1 )  =  1 )
3635ad2antrl 708 . . . . . . 7  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( n  gcd  1
)  =  1 )
37 eqidd 2284 . . . . . . 7  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( ( n ^
2 )  +  1 )  =  ( ( n ^ 2 )  +  1 ) )
38 oveq1 5865 . . . . . . . . . 10  |-  ( x  =  n  ->  (
x  gcd  y )  =  ( n  gcd  y ) )
3938eqeq1d 2291 . . . . . . . . 9  |-  ( x  =  n  ->  (
( x  gcd  y
)  =  1  <->  (
n  gcd  y )  =  1 ) )
40 oveq1 5865 . . . . . . . . . . 11  |-  ( x  =  n  ->  (
x ^ 2 )  =  ( n ^
2 ) )
4140oveq1d 5873 . . . . . . . . . 10  |-  ( x  =  n  ->  (
( x ^ 2 )  +  ( y ^ 2 ) )  =  ( ( n ^ 2 )  +  ( y ^ 2 ) ) )
4241eqeq2d 2294 . . . . . . . . 9  |-  ( x  =  n  ->  (
( ( n ^
2 )  +  1 )  =  ( ( x ^ 2 )  +  ( y ^
2 ) )  <->  ( (
n ^ 2 )  +  1 )  =  ( ( n ^
2 )  +  ( y ^ 2 ) ) ) )
4339, 42anbi12d 691 . . . . . . . 8  |-  ( x  =  n  ->  (
( ( x  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( x ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( n  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( n ^
2 )  +  ( y ^ 2 ) ) ) ) )
44 oveq2 5866 . . . . . . . . . 10  |-  ( y  =  1  ->  (
n  gcd  y )  =  ( n  gcd  1 ) )
4544eqeq1d 2291 . . . . . . . . 9  |-  ( y  =  1  ->  (
( n  gcd  y
)  =  1  <->  (
n  gcd  1 )  =  1 ) )
46 oveq1 5865 . . . . . . . . . . . 12  |-  ( y  =  1  ->  (
y ^ 2 )  =  ( 1 ^ 2 ) )
47 sq1 11198 . . . . . . . . . . . 12  |-  ( 1 ^ 2 )  =  1
4846, 47syl6eq 2331 . . . . . . . . . . 11  |-  ( y  =  1  ->  (
y ^ 2 )  =  1 )
4948oveq2d 5874 . . . . . . . . . 10  |-  ( y  =  1  ->  (
( n ^ 2 )  +  ( y ^ 2 ) )  =  ( ( n ^ 2 )  +  1 ) )
5049eqeq2d 2294 . . . . . . . . 9  |-  ( y  =  1  ->  (
( ( n ^
2 )  +  1 )  =  ( ( n ^ 2 )  +  ( y ^
2 ) )  <->  ( (
n ^ 2 )  +  1 )  =  ( ( n ^
2 )  +  1 ) ) )
5145, 50anbi12d 691 . . . . . . . 8  |-  ( y  =  1  ->  (
( ( n  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( n ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( n  gcd  1 )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( n ^
2 )  +  1 ) ) ) )
5243, 51rspc2ev 2892 . . . . . . 7  |-  ( ( n  e.  ZZ  /\  1  e.  ZZ  /\  (
( n  gcd  1
)  =  1  /\  ( ( n ^
2 )  +  1 )  =  ( ( n ^ 2 )  +  1 ) ) )  ->  E. x  e.  ZZ  E. y  e.  ZZ  ( ( x  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) )
5333, 34, 36, 37, 52syl112anc 1186 . . . . . 6  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  E. x  e.  ZZ  E. y  e.  ZZ  (
( x  gcd  y
)  =  1  /\  ( ( n ^
2 )  +  1 )  =  ( ( x ^ 2 )  +  ( y ^
2 ) ) ) )
54 ovex 5883 . . . . . . 7  |-  ( ( n ^ 2 )  +  1 )  e. 
_V
55 eqeq1 2289 . . . . . . . . 9  |-  ( z  =  ( ( n ^ 2 )  +  1 )  ->  (
z  =  ( ( x ^ 2 )  +  ( y ^
2 ) )  <->  ( (
n ^ 2 )  +  1 )  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) )
5655anbi2d 684 . . . . . . . 8  |-  ( z  =  ( ( n ^ 2 )  +  1 )  ->  (
( ( x  gcd  y )  =  1  /\  z  =  ( ( x ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( x  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) ) )
57562rexbidv 2586 . . . . . . 7  |-  ( z  =  ( ( n ^ 2 )  +  1 )  ->  ( E. x  e.  ZZ  E. y  e.  ZZ  (
( x  gcd  y
)  =  1  /\  z  =  ( ( x ^ 2 )  +  ( y ^
2 ) ) )  <->  E. x  e.  ZZ  E. y  e.  ZZ  (
( x  gcd  y
)  =  1  /\  ( ( n ^
2 )  +  1 )  =  ( ( x ^ 2 )  +  ( y ^
2 ) ) ) ) )
58 2sqlem7.2 . . . . . . 7  |-  Y  =  { z  |  E. x  e.  ZZ  E. y  e.  ZZ  ( ( x  gcd  y )  =  1  /\  z  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) }
5954, 57, 58elab2 2917 . . . . . 6  |-  ( ( ( n ^ 2 )  +  1 )  e.  Y  <->  E. x  e.  ZZ  E. y  e.  ZZ  ( ( x  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) )
6053, 59sylibr 203 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( ( n ^
2 )  +  1 )  e.  Y )
61 prmnn 12761 . . . . . 6  |-  ( P  e.  Prime  ->  P  e.  NN )
6261ad2antrr 706 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  e.  NN )
63 simprr 733 . . . . . 6  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  ||  ( ( n ^ 2 )  -  -u 1 ) )
6433zcnd 10118 . . . . . . . 8  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  n  e.  CC )
6564sqcld 11243 . . . . . . 7  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( n ^ 2 )  e.  CC )
66 ax-1cn 8795 . . . . . . 7  |-  1  e.  CC
67 subneg 9096 . . . . . . 7  |-  ( ( ( n ^ 2 )  e.  CC  /\  1  e.  CC )  ->  ( ( n ^
2 )  -  -u 1
)  =  ( ( n ^ 2 )  +  1 ) )
6865, 66, 67sylancl 643 . . . . . 6  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( ( n ^
2 )  -  -u 1
)  =  ( ( n ^ 2 )  +  1 ) )
6963, 68breqtrd 4047 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  ||  ( ( n ^ 2 )  +  1 ) )
70 2sq.1 . . . . . 6  |-  S  =  ran  ( w  e.  ZZ [ _i ]  |->  ( ( abs `  w
) ^ 2 ) )
7170, 582sqlem10 20613 . . . . 5  |-  ( ( ( ( n ^
2 )  +  1 )  e.  Y  /\  P  e.  NN  /\  P  ||  ( ( n ^
2 )  +  1 ) )  ->  P  e.  S )
7260, 62, 69, 71syl3anc 1182 . . . 4  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  e.  S )
7372expr 598 . . 3  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  n  e.  ZZ )  ->  ( P  ||  ( ( n ^
2 )  -  -u 1
)  ->  P  e.  S ) )
7473rexlimdva 2667 . 2  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  ( E. n  e.  ZZ  P  ||  ( ( n ^ 2 )  -  -u 1 )  ->  P  e.  S ) )
7532, 74mpd 14 1  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  e.  S )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 176    /\ wa 358    = wceq 1623    e. wcel 1684   {cab 2269    =/= wne 2446   E.wrex 2544    \ cdif 3149   {csn 3640   class class class wbr 4023    e. cmpt 4077   ran crn 4690   ` cfv 5255  (class class class)co 5858   CCcc 8735   RRcr 8736   0cc0 8737   1c1 8738    + caddc 8740    < clt 8867    <_ cle 8868    - cmin 9037   -ucneg 9038   NNcn 9746   2c2 9795   4c4 9797   ZZcz 10024   RR+crp 10354    mod cmo 10973   ^cexp 11104   abscabs 11719    || cdivides 12531    gcd cgcd 12685   Primecprime 12758   ZZ [ _i ]cgz 12976    / Lclgs 20533
This theorem is referenced by:  2sq  20615
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1533  ax-5 1544  ax-17 1603  ax-9 1635  ax-8 1643  ax-13 1686  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-rep 4131  ax-sep 4141  ax-nul 4149  ax-pow 4188  ax-pr 4214  ax-un 4512  ax-inf2 7342  ax-cnex 8793  ax-resscn 8794  ax-1cn 8795  ax-icn 8796  ax-addcl 8797  ax-addrcl 8798  ax-mulcl 8799  ax-mulrcl 8800  ax-mulcom 8801  ax-addass 8802  ax-mulass 8803  ax-distr 8804  ax-i2m1 8805  ax-1ne0 8806  ax-1rid 8807  ax-rnegex 8808  ax-rrecex 8809  ax-cnre 8810  ax-pre-lttri 8811  ax-pre-lttrn 8812  ax-pre-ltadd 8813  ax-pre-mulgt0 8814  ax-pre-sup 8815  ax-addf 8816  ax-mulf 8817
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 935  df-3an 936  df-tru 1310  df-ex 1529  df-nf 1532  df-sb 1630  df-eu 2147  df-mo 2148  df-clab 2270  df-cleq 2276  df-clel 2279  df-nfc 2408  df-ne 2448  df-nel 2449  df-ral 2548  df-rex 2549  df-reu 2550  df-rmo 2551  df-rab 2552  df-v 2790  df-sbc 2992  df-csb 3082  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-pss 3168  df-nul 3456  df-if 3566  df-pw 3627  df-sn 3646  df-pr 3647  df-tp 3648  df-op 3649  df-uni 3828  df-int 3863  df-iun 3907  df-iin 3908  df-br 4024  df-opab 4078  df-mpt 4079  df-tr 4114  df-eprel 4305  df-id 4309  df-po 4314  df-so 4315  df-fr 4352  df-se 4353  df-we 4354  df-ord 4395  df-on 4396  df-lim 4397  df-suc 4398  df-om 4657  df-xp 4695  df-rel 4696  df-cnv 4697  df-co 4698  df-dm 4699  df-rn 4700  df-res 4701  df-ima 4702  df-iota 5219  df-fun 5257  df-fn 5258  df-f 5259  df-f1 5260  df-fo 5261  df-f1o 5262  df-fv 5263  df-isom 5264  df-ov 5861  df-oprab 5862  df-mpt2 5863  df-of 6078  df-ofr 6079  df-1st 6122  df-2nd 6123  df-tpos 6234  df-riota 6304  df-recs 6388  df-rdg 6423  df-1o 6479  df-2o 6480  df-oadd 6483  df-er 6660  df-ec 6662  df-qs 6666  df-map 6774  df-pm 6775  df-ixp 6818  df-en 6864  df-dom 6865  df-sdom 6866  df-fin 6867  df-sup 7194  df-oi 7225  df-card 7572  df-cda 7794  df-pnf 8869  df-mnf 8870  df-xr 8871  df-ltxr 8872  df-le 8873  df-sub 9039  df-neg 9040  df-div 9424  df-nn 9747  df-2 9804  df-3 9805  df-4 9806  df-5 9807  df-6 9808  df-7 9809  df-8 9810  df-9 9811  df-10 9812  df-n0 9966  df-z 10025  df-dec 10125  df-uz 10231  df-q 10317  df-rp 10355  df-fz 10783  df-fzo 10871  df-fl 10925  df-mod 10974  df-seq 11047  df-exp 11105  df-hash 11338  df-cj 11584  df-re 11585  df-im 11586  df-sqr 11720  df-abs 11721  df-dvds 12532  df-gcd 12686  df-prm 12759  df-phi 12834  df-pc 12890  df-gz 12977  df-struct 13150  df-ndx 13151  df-slot 13152  df-base 13153  df-sets 13154  df-ress 13155  df-plusg 13221  df-mulr 13222  df-starv 13223  df-sca 13224  df-vsca 13225  df-tset 13227  df-ple 13228  df-ds 13230  df-hom 13232  df-cco 13233  df-prds 13348  df-pws 13350  df-0g 13404  df-gsum 13405  df-imas 13411  df-divs 13412  df-mre 13488  df-mrc 13489  df-acs 13491  df-mnd 14367  df-mhm 14415  df-submnd 14416  df-grp 14489  df-minusg 14490  df-sbg 14491  df-mulg 14492  df-subg 14618  df-nsg 14619  df-eqg 14620  df-ghm 14681  df-cntz 14793  df-cmn 15091  df-abl 15092  df-mgp 15326  df-rng 15340  df-cring 15341  df-ur 15342  df-oppr 15405  df-dvdsr 15423  df-unit 15424  df-invr 15454  df-rnghom 15496  df-drng 15514  df-field 15515  df-subrg 15543  df-lmod 15629  df-lss 15690  df-lsp 15729  df-sra 15925  df-rgmod 15926  df-lidl 15927  df-rsp 15928  df-2idl 15984  df-nzr 16010  df-rlreg 16024  df-domn 16025  df-idom 16026  df-assa 16053  df-asp 16054  df-ascl 16055  df-psr 16098  df-mvr 16099  df-mpl 16100  df-evls 16101  df-evl 16102  df-opsr 16106  df-psr1 16257  df-vr1 16258  df-ply1 16259  df-evl1 16261  df-coe1 16262  df-cnfld 16378  df-zrh 16455  df-zn 16458  df-mdeg 19441  df-deg1 19442  df-mon1 19516  df-uc1p 19517  df-q1p 19518  df-r1p 19519  df-lgs 20534
  Copyright terms: Public domain W3C validator