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

Theorem 2sqlem11 24382
Description: Lemma for 2sq 24383. (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 468 . . . . 5  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  ( P  mod  4 )  =  1 )
2 simpl 464 . . . . . . 7  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  e.  Prime )
3 1ne2 10845 . . . . . . . . . . 11  |-  1  =/=  2
43necomi 2697 . . . . . . . . . 10  |-  2  =/=  1
5 oveq1 6315 . . . . . . . . . . . 12  |-  ( P  =  2  ->  ( P  mod  4 )  =  ( 2  mod  4
) )
6 2re 10701 . . . . . . . . . . . . 13  |-  2  e.  RR
7 4re 10708 . . . . . . . . . . . . . 14  |-  4  e.  RR
8 4pos 10727 . . . . . . . . . . . . . 14  |-  0  <  4
97, 8elrpii 11328 . . . . . . . . . . . . 13  |-  4  e.  RR+
10 0le2 10722 . . . . . . . . . . . . 13  |-  0  <_  2
11 2lt4 10803 . . . . . . . . . . . . 13  |-  2  <  4
12 modid 12154 . . . . . . . . . . . . 13  |-  ( ( ( 2  e.  RR  /\  4  e.  RR+ )  /\  ( 0  <_  2  /\  2  <  4
) )  ->  (
2  mod  4 )  =  2 )
136, 9, 10, 11, 12mp4an 687 . . . . . . . . . . . 12  |-  ( 2  mod  4 )  =  2
145, 13syl6eq 2521 . . . . . . . . . . 11  |-  ( P  =  2  ->  ( P  mod  4 )  =  2 )
1514neeq1d 2702 . . . . . . . . . 10  |-  ( P  =  2  ->  (
( P  mod  4
)  =/=  1  <->  2  =/=  1 ) )
164, 15mpbiri 241 . . . . . . . . 9  |-  ( P  =  2  ->  ( P  mod  4 )  =/=  1 )
1716necon2i 2677 . . . . . . . 8  |-  ( ( P  mod  4 )  =  1  ->  P  =/=  2 )
181, 17syl 17 . . . . . . 7  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  =/=  2 )
19 eldifsn 4088 . . . . . . 7  |-  ( P  e.  ( Prime  \  {
2 } )  <->  ( P  e.  Prime  /\  P  =/=  2 ) )
202, 18, 19sylanbrc 677 . . . . . 6  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  e.  ( Prime  \  { 2 } ) )
21 m1lgs 24369 . . . . . 6  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( -u 1  /L P )  =  1  <->  ( P  mod  4 )  =  1 ) )
2220, 21syl 17 . . . . 5  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  (
( -u 1  /L
P )  =  1  <-> 
( P  mod  4
)  =  1 ) )
231, 22mpbird 240 . . . 4  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  ( -u 1  /L P )  =  1 )
24 neg1z 10997 . . . . 5  |-  -u 1  e.  ZZ
25 lgsqr 24353 . . . . 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 676 . . . 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 215 . . 3  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  ( -.  P  ||  -u 1  /\  E. n  e.  ZZ  P  ||  ( ( n ^ 2 )  -  -u 1 ) ) )
2827simprd 470 . 2  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  E. n  e.  ZZ  P  ||  (
( n ^ 2 )  -  -u 1
) )
29 simprl 772 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  n  e.  ZZ )
30 1zzd 10992 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
1  e.  ZZ )
31 gcd1 14575 . . . . . 6  |-  ( n  e.  ZZ  ->  (
n  gcd  1 )  =  1 )
3231ad2antrl 742 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( n  gcd  1
)  =  1 )
33 eqidd 2472 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( ( n ^
2 )  +  1 )  =  ( ( n ^ 2 )  +  1 ) )
34 oveq1 6315 . . . . . . . 8  |-  ( x  =  n  ->  (
x  gcd  y )  =  ( n  gcd  y ) )
3534eqeq1d 2473 . . . . . . 7  |-  ( x  =  n  ->  (
( x  gcd  y
)  =  1  <->  (
n  gcd  y )  =  1 ) )
36 oveq1 6315 . . . . . . . . 9  |-  ( x  =  n  ->  (
x ^ 2 )  =  ( n ^
2 ) )
3736oveq1d 6323 . . . . . . . 8  |-  ( x  =  n  ->  (
( x ^ 2 )  +  ( y ^ 2 ) )  =  ( ( n ^ 2 )  +  ( y ^ 2 ) ) )
3837eqeq2d 2481 . . . . . . 7  |-  ( x  =  n  ->  (
( ( n ^
2 )  +  1 )  =  ( ( x ^ 2 )  +  ( y ^
2 ) )  <->  ( (
n ^ 2 )  +  1 )  =  ( ( n ^
2 )  +  ( y ^ 2 ) ) ) )
3935, 38anbi12d 725 . . . . . 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 6316 . . . . . . . 8  |-  ( y  =  1  ->  (
n  gcd  y )  =  ( n  gcd  1 ) )
4140eqeq1d 2473 . . . . . . 7  |-  ( y  =  1  ->  (
( n  gcd  y
)  =  1  <->  (
n  gcd  1 )  =  1 ) )
42 oveq1 6315 . . . . . . . . . 10  |-  ( y  =  1  ->  (
y ^ 2 )  =  ( 1 ^ 2 ) )
43 sq1 12407 . . . . . . . . . 10  |-  ( 1 ^ 2 )  =  1
4442, 43syl6eq 2521 . . . . . . . . 9  |-  ( y  =  1  ->  (
y ^ 2 )  =  1 )
4544oveq2d 6324 . . . . . . . 8  |-  ( y  =  1  ->  (
( n ^ 2 )  +  ( y ^ 2 ) )  =  ( ( n ^ 2 )  +  1 ) )
4645eqeq2d 2481 . . . . . . 7  |-  ( y  =  1  ->  (
( ( n ^
2 )  +  1 )  =  ( ( n ^ 2 )  +  ( y ^
2 ) )  <->  ( (
n ^ 2 )  +  1 )  =  ( ( n ^
2 )  +  1 ) ) )
4741, 46anbi12d 725 . . . . . 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 3149 . . . . 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 1296 . . . 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 6336 . . . . 5  |-  ( ( n ^ 2 )  +  1 )  e. 
_V
51 eqeq1 2475 . . . . . . 7  |-  ( z  =  ( ( n ^ 2 )  +  1 )  ->  (
z  =  ( ( x ^ 2 )  +  ( y ^
2 ) )  <->  ( (
n ^ 2 )  +  1 )  =  ( ( x ^
2 )  +  ( y ^ 2 ) ) ) )
5251anbi2d 718 . . . . . 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 2897 . . . . 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 3176 . . . 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 217 . . 3  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( ( n ^
2 )  +  1 )  e.  Y )
57 prmnn 14704 . . . 4  |-  ( P  e.  Prime  ->  P  e.  NN )
5857ad2antrr 740 . . 3  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  e.  NN )
59 simprr 774 . . . 4  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  ||  ( ( n ^ 2 )  -  -u 1 ) )
6029zcnd 11064 . . . . . 6  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  n  e.  CC )
6160sqcld 12452 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( n ^ 2 )  e.  CC )
62 ax-1cn 9615 . . . . 5  |-  1  e.  CC
63 subneg 9943 . . . . 5  |-  ( ( ( n ^ 2 )  e.  CC  /\  1  e.  CC )  ->  ( ( n ^
2 )  -  -u 1
)  =  ( ( n ^ 2 )  +  1 ) )
6461, 62, 63sylancl 675 . . . 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 4420 . . 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 24381 . . 3  |-  ( ( ( ( n ^
2 )  +  1 )  e.  Y  /\  P  e.  NN  /\  P  ||  ( ( n ^
2 )  +  1 ) )  ->  P  e.  S )
6856, 58, 65, 67syl3anc 1292 . 2  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  e.  S )
6928, 68rexlimddv 2875 1  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  e.  S )
Colors of variables: wff setvar class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 189    /\ wa 376    = wceq 1452    e. wcel 1904   {cab 2457    =/= wne 2641   E.wrex 2757    \ cdif 3387   {csn 3959   class class class wbr 4395    |-> cmpt 4454   ran crn 4840   ` cfv 5589  (class class class)co 6308   CCcc 9555   RRcr 9556   0cc0 9557   1c1 9558    + caddc 9560    < clt 9693    <_ cle 9694    - cmin 9880   -ucneg 9881   NNcn 10631   2c2 10681   4c4 10683   ZZcz 10961   RR+crp 11325    mod cmo 12129   ^cexp 12310   abscabs 13374    || cdvds 14382    gcd cgcd 14547   Primecprime 14701   ZZ[_i]cgz 14952    /Lclgs 24301
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1677  ax-4 1690  ax-5 1766  ax-6 1813  ax-7 1859  ax-8 1906  ax-9 1913  ax-10 1932  ax-11 1937  ax-12 1950  ax-13 2104  ax-ext 2451  ax-rep 4508  ax-sep 4518  ax-nul 4527  ax-pow 4579  ax-pr 4639  ax-un 6602  ax-inf2 8164  ax-cnex 9613  ax-resscn 9614  ax-1cn 9615  ax-icn 9616  ax-addcl 9617  ax-addrcl 9618  ax-mulcl 9619  ax-mulrcl 9620  ax-mulcom 9621  ax-addass 9622  ax-mulass 9623  ax-distr 9624  ax-i2m1 9625  ax-1ne0 9626  ax-1rid 9627  ax-rnegex 9628  ax-rrecex 9629  ax-cnre 9630  ax-pre-lttri 9631  ax-pre-lttrn 9632  ax-pre-ltadd 9633  ax-pre-mulgt0 9634  ax-pre-sup 9635  ax-addf 9636  ax-mulf 9637
This theorem depends on definitions:  df-bi 190  df-or 377  df-an 378  df-3or 1008  df-3an 1009  df-tru 1455  df-ex 1672  df-nf 1676  df-sb 1806  df-eu 2323  df-mo 2324  df-clab 2458  df-cleq 2464  df-clel 2467  df-nfc 2601  df-ne 2643  df-nel 2644  df-ral 2761  df-rex 2762  df-reu 2763  df-rmo 2764  df-rab 2765  df-v 3033  df-sbc 3256  df-csb 3350  df-dif 3393  df-un 3395  df-in 3397  df-ss 3404  df-pss 3406  df-nul 3723  df-if 3873  df-pw 3944  df-sn 3960  df-pr 3962  df-tp 3964  df-op 3966  df-uni 4191  df-int 4227  df-iun 4271  df-iin 4272  df-br 4396  df-opab 4455  df-mpt 4456  df-tr 4491  df-eprel 4750  df-id 4754  df-po 4760  df-so 4761  df-fr 4798  df-se 4799  df-we 4800  df-xp 4845  df-rel 4846  df-cnv 4847  df-co 4848  df-dm 4849  df-rn 4850  df-res 4851  df-ima 4852  df-pred 5387  df-ord 5433  df-on 5434  df-lim 5435  df-suc 5436  df-iota 5553  df-fun 5591  df-fn 5592  df-f 5593  df-f1 5594  df-fo 5595  df-f1o 5596  df-fv 5597  df-isom 5598  df-riota 6270  df-ov 6311  df-oprab 6312  df-mpt2 6313  df-of 6550  df-ofr 6551  df-om 6712  df-1st 6812  df-2nd 6813  df-supp 6934  df-tpos 6991  df-wrecs 7046  df-recs 7108  df-rdg 7146  df-1o 7200  df-2o 7201  df-oadd 7204  df-er 7381  df-ec 7383  df-qs 7387  df-map 7492  df-pm 7493  df-ixp 7541  df-en 7588  df-dom 7589  df-sdom 7590  df-fin 7591  df-fsupp 7902  df-sup 7974  df-inf 7975  df-oi 8043  df-card 8391  df-cda 8616  df-pnf 9695  df-mnf 9696  df-xr 9697  df-ltxr 9698  df-le 9699  df-sub 9882  df-neg 9883  df-div 10292  df-nn 10632  df-2 10690  df-3 10691  df-4 10692  df-5 10693  df-6 10694  df-7 10695  df-8 10696  df-9 10697  df-10 10698  df-n0 10894  df-z 10962  df-dec 11075  df-uz 11183  df-q 11288  df-rp 11326  df-fz 11811  df-fzo 11943  df-fl 12061  df-mod 12130  df-seq 12252  df-exp 12311  df-hash 12554  df-cj 13239  df-re 13240  df-im 13241  df-sqrt 13375  df-abs 13376  df-dvds 14383  df-gcd 14548  df-prm 14702  df-phi 14793  df-pc 14866  df-gz 14953  df-struct 15201  df-ndx 15202  df-slot 15203  df-base 15204  df-sets 15205  df-ress 15206  df-plusg 15281  df-mulr 15282  df-starv 15283  df-sca 15284  df-vsca 15285  df-ip 15286  df-tset 15287  df-ple 15288  df-ds 15290  df-unif 15291  df-hom 15292  df-cco 15293  df-0g 15418  df-gsum 15419  df-prds 15424  df-pws 15426  df-imas 15485  df-qus 15487  df-mre 15570  df-mrc 15571  df-acs 15573  df-mgm 16566  df-sgrp 16605  df-mnd 16615  df-mhm 16660  df-submnd 16661  df-grp 16751  df-minusg 16752  df-sbg 16753  df-mulg 16754  df-subg 16892  df-nsg 16893  df-eqg 16894  df-ghm 16959  df-cntz 17049  df-cmn 17510  df-abl 17511  df-mgp 17802  df-ur 17814  df-srg 17818  df-ring 17860  df-cring 17861  df-oppr 17929  df-dvdsr 17947  df-unit 17948  df-invr 17978  df-dvr 17989  df-rnghom 18021  df-drng 18055  df-field 18056  df-subrg 18084  df-lmod 18171  df-lss 18234  df-lsp 18273  df-sra 18473  df-rgmod 18474  df-lidl 18475  df-rsp 18476  df-2idl 18533  df-nzr 18559  df-rlreg 18584  df-domn 18585  df-idom 18586  df-assa 18613  df-asp 18614  df-ascl 18615  df-psr 18657  df-mvr 18658  df-mpl 18659  df-opsr 18661  df-evls 18806  df-evl 18807  df-psr1 18850  df-vr1 18851  df-ply1 18852  df-coe1 18853  df-evl1 18982  df-cnfld 19048  df-zring 19117  df-zrh 19152  df-zn 19155  df-mdeg 23083  df-deg1 23084  df-mon1 23159  df-uc1p 23160  df-q1p 23161  df-r1p 23162  df-lgs 24302
This theorem is referenced by:  2sq  24383
  Copyright terms: Public domain W3C validator