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

Theorem 2sqlem11 23371
Description: Lemma for 2sq 23372. (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 461 . . . . 5  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  ( P  mod  4 )  =  1 )
2 simpl 457 . . . . . . 7  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  e.  Prime )
3 1ne2 10737 . . . . . . . . . . 11  |-  1  =/=  2
43necomi 2730 . . . . . . . . . 10  |-  2  =/=  1
5 oveq1 6282 . . . . . . . . . . . 12  |-  ( P  =  2  ->  ( P  mod  4 )  =  ( 2  mod  4
) )
6 2re 10594 . . . . . . . . . . . . 13  |-  2  e.  RR
7 4re 10601 . . . . . . . . . . . . . 14  |-  4  e.  RR
8 4pos 10620 . . . . . . . . . . . . . 14  |-  0  <  4
97, 8elrpii 11212 . . . . . . . . . . . . 13  |-  4  e.  RR+
10 0le2 10615 . . . . . . . . . . . . 13  |-  0  <_  2
11 2lt4 10695 . . . . . . . . . . . . 13  |-  2  <  4
12 modid 11976 . . . . . . . . . . . . 13  |-  ( ( ( 2  e.  RR  /\  4  e.  RR+ )  /\  ( 0  <_  2  /\  2  <  4
) )  ->  (
2  mod  4 )  =  2 )
136, 9, 10, 11, 12mp4an 673 . . . . . . . . . . . 12  |-  ( 2  mod  4 )  =  2
145, 13syl6eq 2517 . . . . . . . . . . 11  |-  ( P  =  2  ->  ( P  mod  4 )  =  2 )
1514neeq1d 2737 . . . . . . . . . 10  |-  ( P  =  2  ->  (
( P  mod  4
)  =/=  1  <->  2  =/=  1 ) )
164, 15mpbiri 233 . . . . . . . . 9  |-  ( P  =  2  ->  ( P  mod  4 )  =/=  1 )
1716necon2i 2703 . . . . . . . 8  |-  ( ( P  mod  4 )  =  1  ->  P  =/=  2 )
181, 17syl 16 . . . . . . 7  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  =/=  2 )
19 eldifsn 4145 . . . . . . 7  |-  ( P  e.  ( Prime  \  {
2 } )  <->  ( P  e.  Prime  /\  P  =/=  2 ) )
202, 18, 19sylanbrc 664 . . . . . 6  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  e.  ( Prime  \  { 2 } ) )
21 m1lgs 23358 . . . . . 6  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( -u 1  /L P )  =  1  <->  ( P  mod  4 )  =  1 ) )
2220, 21syl 16 . . . . 5  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  (
( -u 1  /L
P )  =  1  <-> 
( P  mod  4
)  =  1 ) )
231, 22mpbird 232 . . . 4  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  ( -u 1  /L P )  =  1 )
24 neg1z 10888 . . . . 5  |-  -u 1  e.  ZZ
25 lgsqr 23342 . . . . 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 ) ) ) )
2624, 20, 25sylancr 663 . . . 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
) ) ) )
2723, 26mpbid 210 . . 3  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  ( -.  P  ||  -u 1  /\  E. n  e.  ZZ  P  ||  ( ( n ^ 2 )  -  -u 1 ) ) )
2827simprd 463 . 2  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  E. n  e.  ZZ  P  ||  (
( n ^ 2 )  -  -u 1
) )
29 simprl 755 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  n  e.  ZZ )
30 1zzd 10884 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
1  e.  ZZ )
31 gcd1 14018 . . . . . 6  |-  ( n  e.  ZZ  ->  (
n  gcd  1 )  =  1 )
3231ad2antrl 727 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( n  gcd  1
)  =  1 )
33 eqidd 2461 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( ( n ^
2 )  +  1 )  =  ( ( n ^ 2 )  +  1 ) )
34 oveq1 6282 . . . . . . . 8  |-  ( x  =  n  ->  (
x  gcd  y )  =  ( n  gcd  y ) )
3534eqeq1d 2462 . . . . . . 7  |-  ( x  =  n  ->  (
( x  gcd  y
)  =  1  <->  (
n  gcd  y )  =  1 ) )
36 oveq1 6282 . . . . . . . . 9  |-  ( x  =  n  ->  (
x ^ 2 )  =  ( n ^
2 ) )
3736oveq1d 6290 . . . . . . . 8  |-  ( x  =  n  ->  (
( x ^ 2 )  +  ( y ^ 2 ) )  =  ( ( n ^ 2 )  +  ( y ^ 2 ) ) )
3837eqeq2d 2474 . . . . . . 7  |-  ( x  =  n  ->  (
( ( n ^
2 )  +  1 )  =  ( ( x ^ 2 )  +  ( y ^
2 ) )  <->  ( (
n ^ 2 )  +  1 )  =  ( ( n ^
2 )  +  ( y ^ 2 ) ) ) )
3935, 38anbi12d 710 . . . . . 6  |-  ( x  =  n  ->  (
( ( x  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( x ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( n  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( n ^
2 )  +  ( y ^ 2 ) ) ) ) )
40 oveq2 6283 . . . . . . . 8  |-  ( y  =  1  ->  (
n  gcd  y )  =  ( n  gcd  1 ) )
4140eqeq1d 2462 . . . . . . 7  |-  ( y  =  1  ->  (
( n  gcd  y
)  =  1  <->  (
n  gcd  1 )  =  1 ) )
42 oveq1 6282 . . . . . . . . . 10  |-  ( y  =  1  ->  (
y ^ 2 )  =  ( 1 ^ 2 ) )
43 sq1 12217 . . . . . . . . . 10  |-  ( 1 ^ 2 )  =  1
4442, 43syl6eq 2517 . . . . . . . . 9  |-  ( y  =  1  ->  (
y ^ 2 )  =  1 )
4544oveq2d 6291 . . . . . . . 8  |-  ( y  =  1  ->  (
( n ^ 2 )  +  ( y ^ 2 ) )  =  ( ( n ^ 2 )  +  1 ) )
4645eqeq2d 2474 . . . . . . 7  |-  ( y  =  1  ->  (
( ( n ^
2 )  +  1 )  =  ( ( n ^ 2 )  +  ( y ^
2 ) )  <->  ( (
n ^ 2 )  +  1 )  =  ( ( n ^
2 )  +  1 ) ) )
4741, 46anbi12d 710 . . . . . 6  |-  ( y  =  1  ->  (
( ( n  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( n ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( n  gcd  1 )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( n ^
2 )  +  1 ) ) ) )
4839, 47rspc2ev 3218 . . . . 5  |-  ( ( 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 ) ) ) )
4929, 30, 32, 33, 48syl112anc 1227 . . . 4  |-  ( ( ( 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 ) ) ) )
50 ovex 6300 . . . . 5  |-  ( ( n ^ 2 )  +  1 )  e. 
_V
51 eqeq1 2464 . . . . . . 7  |-  ( z  =  ( ( n ^ 2 )  +  1 )  ->  (
z  =  ( ( x ^ 2 )  +  ( y ^
2 ) )  <->  ( (
n ^ 2 )  +  1 )  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) )
5251anbi2d 703 . . . . . 6  |-  ( z  =  ( ( n ^ 2 )  +  1 )  ->  (
( ( x  gcd  y )  =  1  /\  z  =  ( ( x ^ 2 )  +  ( y ^ 2 ) ) )  <->  ( ( x  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) ) )
53522rexbidv 2973 . . . . 5  |-  ( 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 ) ) ) ) )
54 2sqlem7.2 . . . . 5  |-  Y  =  { z  |  E. x  e.  ZZ  E. y  e.  ZZ  ( ( x  gcd  y )  =  1  /\  z  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) }
5550, 53, 54elab2 3246 . . . 4  |-  ( ( ( n ^ 2 )  +  1 )  e.  Y  <->  E. x  e.  ZZ  E. y  e.  ZZ  ( ( x  gcd  y )  =  1  /\  ( ( n ^ 2 )  +  1 )  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) )
5649, 55sylibr 212 . . 3  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( ( n ^
2 )  +  1 )  e.  Y )
57 prmnn 14068 . . . 4  |-  ( P  e.  Prime  ->  P  e.  NN )
5857ad2antrr 725 . . 3  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  e.  NN )
59 simprr 756 . . . 4  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  ||  ( ( n ^ 2 )  -  -u 1 ) )
6029zcnd 10956 . . . . . 6  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  n  e.  CC )
6160sqcld 12263 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( n ^ 2 )  e.  CC )
62 ax-1cn 9539 . . . . 5  |-  1  e.  CC
63 subneg 9857 . . . . 5  |-  ( ( ( n ^ 2 )  e.  CC  /\  1  e.  CC )  ->  ( ( n ^
2 )  -  -u 1
)  =  ( ( n ^ 2 )  +  1 ) )
6461, 62, 63sylancl 662 . . . 4  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( ( n ^
2 )  -  -u 1
)  =  ( ( n ^ 2 )  +  1 ) )
6559, 64breqtrd 4464 . . 3  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  ||  ( ( n ^ 2 )  +  1 ) )
66 2sq.1 . . . 4  |-  S  =  ran  ( w  e.  ZZ[_i]  |->  ( ( abs `  w
) ^ 2 ) )
6766, 542sqlem10 23370 . . 3  |-  ( ( ( ( n ^
2 )  +  1 )  e.  Y  /\  P  e.  NN  /\  P  ||  ( ( n ^
2 )  +  1 ) )  ->  P  e.  S )
6856, 58, 65, 67syl3anc 1223 . 2  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  e.  S )
6928, 68rexlimddv 2952 1  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  e.  S )
Colors of variables: wff setvar class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 184    /\ wa 369    = wceq 1374    e. wcel 1762   {cab 2445    =/= wne 2655   E.wrex 2808    \ cdif 3466   {csn 4020   class class class wbr 4440    |-> cmpt 4498   ran crn 4993   ` cfv 5579  (class class class)co 6275   CCcc 9479   RRcr 9480   0cc0 9481   1c1 9482    + caddc 9484    < clt 9617    <_ cle 9618    - cmin 9794   -ucneg 9795   NNcn 10525   2c2 10574   4c4 10576   ZZcz 10853   RR+crp 11209    mod cmo 11952   ^cexp 12122   abscabs 13017    || cdivides 13836    gcd cgcd 13992   Primecprime 14065   ZZ[_i]cgz 14295    /Lclgs 23290
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1596  ax-4 1607  ax-5 1675  ax-6 1714  ax-7 1734  ax-8 1764  ax-9 1766  ax-10 1781  ax-11 1786  ax-12 1798  ax-13 1961  ax-ext 2438  ax-rep 4551  ax-sep 4561  ax-nul 4569  ax-pow 4618  ax-pr 4679  ax-un 6567  ax-inf2 8047  ax-cnex 9537  ax-resscn 9538  ax-1cn 9539  ax-icn 9540  ax-addcl 9541  ax-addrcl 9542  ax-mulcl 9543  ax-mulrcl 9544  ax-mulcom 9545  ax-addass 9546  ax-mulass 9547  ax-distr 9548  ax-i2m1 9549  ax-1ne0 9550  ax-1rid 9551  ax-rnegex 9552  ax-rrecex 9553  ax-cnre 9554  ax-pre-lttri 9555  ax-pre-lttrn 9556  ax-pre-ltadd 9557  ax-pre-mulgt0 9558  ax-pre-sup 9559  ax-addf 9560  ax-mulf 9561
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 969  df-3an 970  df-tru 1377  df-ex 1592  df-nf 1595  df-sb 1707  df-eu 2272  df-mo 2273  df-clab 2446  df-cleq 2452  df-clel 2455  df-nfc 2610  df-ne 2657  df-nel 2658  df-ral 2812  df-rex 2813  df-reu 2814  df-rmo 2815  df-rab 2816  df-v 3108  df-sbc 3325  df-csb 3429  df-dif 3472  df-un 3474  df-in 3476  df-ss 3483  df-pss 3485  df-nul 3779  df-if 3933  df-pw 4005  df-sn 4021  df-pr 4023  df-tp 4025  df-op 4027  df-uni 4239  df-int 4276  df-iun 4320  df-iin 4321  df-br 4441  df-opab 4499  df-mpt 4500  df-tr 4534  df-eprel 4784  df-id 4788  df-po 4793  df-so 4794  df-fr 4831  df-se 4832  df-we 4833  df-ord 4874  df-on 4875  df-lim 4876  df-suc 4877  df-xp 4998  df-rel 4999  df-cnv 5000  df-co 5001  df-dm 5002  df-rn 5003  df-res 5004  df-ima 5005  df-iota 5542  df-fun 5581  df-fn 5582  df-f 5583  df-f1 5584  df-fo 5585  df-f1o 5586  df-fv 5587  df-isom 5588  df-riota 6236  df-ov 6278  df-oprab 6279  df-mpt2 6280  df-of 6515  df-ofr 6516  df-om 6672  df-1st 6774  df-2nd 6775  df-supp 6892  df-tpos 6945  df-recs 7032  df-rdg 7066  df-1o 7120  df-2o 7121  df-oadd 7124  df-er 7301  df-ec 7303  df-qs 7307  df-map 7412  df-pm 7413  df-ixp 7460  df-en 7507  df-dom 7508  df-sdom 7509  df-fin 7510  df-fsupp 7819  df-sup 7890  df-oi 7924  df-card 8309  df-cda 8537  df-pnf 9619  df-mnf 9620  df-xr 9621  df-ltxr 9622  df-le 9623  df-sub 9796  df-neg 9797  df-div 10196  df-nn 10526  df-2 10583  df-3 10584  df-4 10585  df-5 10586  df-6 10587  df-7 10588  df-8 10589  df-9 10590  df-10 10591  df-n0 10785  df-z 10854  df-dec 10966  df-uz 11072  df-q 11172  df-rp 11210  df-fz 11662  df-fzo 11782  df-fl 11886  df-mod 11953  df-seq 12064  df-exp 12123  df-hash 12361  df-cj 12882  df-re 12883  df-im 12884  df-sqr 13018  df-abs 13019  df-dvds 13837  df-gcd 13993  df-prm 14066  df-phi 14144  df-pc 14209  df-gz 14296  df-struct 14481  df-ndx 14482  df-slot 14483  df-base 14484  df-sets 14485  df-ress 14486  df-plusg 14557  df-mulr 14558  df-starv 14559  df-sca 14560  df-vsca 14561  df-ip 14562  df-tset 14563  df-ple 14564  df-ds 14566  df-unif 14567  df-hom 14568  df-cco 14569  df-0g 14686  df-gsum 14687  df-prds 14692  df-pws 14694  df-imas 14752  df-divs 14753  df-mre 14830  df-mrc 14831  df-acs 14833  df-mnd 15721  df-mhm 15770  df-submnd 15771  df-grp 15851  df-minusg 15852  df-sbg 15853  df-mulg 15854  df-subg 15986  df-nsg 15987  df-eqg 15988  df-ghm 16053  df-cntz 16143  df-cmn 16589  df-abl 16590  df-mgp 16925  df-ur 16937  df-srg 16941  df-rng 16981  df-cring 16982  df-oppr 17049  df-dvdsr 17067  df-unit 17068  df-invr 17098  df-dvr 17109  df-rnghom 17141  df-drng 17174  df-field 17175  df-subrg 17203  df-lmod 17290  df-lss 17355  df-lsp 17394  df-sra 17594  df-rgmod 17595  df-lidl 17596  df-rsp 17597  df-2idl 17655  df-nzr 17681  df-rlreg 17695  df-domn 17696  df-idom 17697  df-assa 17725  df-asp 17726  df-ascl 17727  df-psr 17769  df-mvr 17770  df-mpl 17771  df-opsr 17773  df-evls 17935  df-evl 17936  df-psr1 17983  df-vr1 17984  df-ply1 17985  df-coe1 17986  df-evl1 18117  df-cnfld 18185  df-zring 18250  df-zrh 18301  df-zn 18304  df-mdeg 22181  df-deg1 22182  df-mon1 22259  df-uc1p 22260  df-q1p 22261  df-r1p 22262  df-lgs 23291
This theorem is referenced by:  2sq  23372
  Copyright terms: Public domain W3C validator