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

Theorem 2sqlem11 20630
Description: Lemma for 2sq 20631. (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 9947 . . . . . . . . . . 11  |-  1  =/=  2
43necomi 2541 . . . . . . . . . 10  |-  2  =/=  1
5 oveq1 5881 . . . . . . . . . . . 12  |-  ( P  =  2  ->  ( P  mod  4 )  =  ( 2  mod  4
) )
6 2re 9831 . . . . . . . . . . . . 13  |-  2  e.  RR
7 4re 9835 . . . . . . . . . . . . . 14  |-  4  e.  RR
8 4pos 9848 . . . . . . . . . . . . . 14  |-  0  <  4
97, 8elrpii 10373 . . . . . . . . . . . . 13  |-  4  e.  RR+
10 0re 8854 . . . . . . . . . . . . . 14  |-  0  e.  RR
11 2pos 9844 . . . . . . . . . . . . . 14  |-  0  <  2
1210, 6, 11ltleii 8957 . . . . . . . . . . . . 13  |-  0  <_  2
13 2lt4 9906 . . . . . . . . . . . . 13  |-  2  <  4
14 modid 11009 . . . . . . . . . . . . 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 2344 . . . . . . . . . . 11  |-  ( P  =  2  ->  ( P  mod  4 )  =  2 )
1716neeq1d 2472 . . . . . . . . . 10  |-  ( P  =  2  ->  (
( P  mod  4
)  =/=  1  <->  2  =/=  1 ) )
184, 17mpbiri 224 . . . . . . . . 9  |-  ( P  =  2  ->  ( P  mod  4 )  =/=  1 )
1918necon2i 2506 . . . . . . . 8  |-  ( ( P  mod  4 )  =  1  ->  P  =/=  2 )
201, 19syl 15 . . . . . . 7  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  =/=  2 )
21 eldifsn 3762 . . . . . . 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 20617 . . . . . 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 10069 . . . . . 6  |-  1  e.  ZZ
27 znegcl 10071 . . . . . 6  |-  ( 1  e.  ZZ  ->  -u 1  e.  ZZ )
2826, 27ax-mp 8 . . . . 5  |-  -u 1  e.  ZZ
29 lgsqr 20601 . . . . 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 12727 . . . . . . . 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 2297 . . . . . . 7  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( ( n ^
2 )  +  1 )  =  ( ( n ^ 2 )  +  1 ) )
38 oveq1 5881 . . . . . . . . . 10  |-  ( x  =  n  ->  (
x  gcd  y )  =  ( n  gcd  y ) )
3938eqeq1d 2304 . . . . . . . . 9  |-  ( x  =  n  ->  (
( x  gcd  y
)  =  1  <->  (
n  gcd  y )  =  1 ) )
40 oveq1 5881 . . . . . . . . . . 11  |-  ( x  =  n  ->  (
x ^ 2 )  =  ( n ^
2 ) )
4140oveq1d 5889 . . . . . . . . . 10  |-  ( x  =  n  ->  (
( x ^ 2 )  +  ( y ^ 2 ) )  =  ( ( n ^ 2 )  +  ( y ^ 2 ) ) )
4241eqeq2d 2307 . . . . . . . . 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 5882 . . . . . . . . . 10  |-  ( y  =  1  ->  (
n  gcd  y )  =  ( n  gcd  1 ) )
4544eqeq1d 2304 . . . . . . . . 9  |-  ( y  =  1  ->  (
( n  gcd  y
)  =  1  <->  (
n  gcd  1 )  =  1 ) )
46 oveq1 5881 . . . . . . . . . . . 12  |-  ( y  =  1  ->  (
y ^ 2 )  =  ( 1 ^ 2 ) )
47 sq1 11214 . . . . . . . . . . . 12  |-  ( 1 ^ 2 )  =  1
4846, 47syl6eq 2344 . . . . . . . . . . 11  |-  ( y  =  1  ->  (
y ^ 2 )  =  1 )
4948oveq2d 5890 . . . . . . . . . 10  |-  ( y  =  1  ->  (
( n ^ 2 )  +  ( y ^ 2 ) )  =  ( ( n ^ 2 )  +  1 ) )
5049eqeq2d 2307 . . . . . . . . 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 2905 . . . . . . 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 5899 . . . . . . 7  |-  ( ( n ^ 2 )  +  1 )  e. 
_V
55 eqeq1 2302 . . . . . . . . 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 2599 . . . . . . 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 2930 . . . . . 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 12777 . . . . . 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 10134 . . . . . . . 8  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  n  e.  CC )
6564sqcld 11259 . . . . . . 7  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( n ^ 2 )  e.  CC )
66 ax-1cn 8811 . . . . . . 7  |-  1  e.  CC
67 subneg 9112 . . . . . . 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 4063 . . . . 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 20629 . . . . 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 2680 . 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 1632    e. wcel 1696   {cab 2282    =/= wne 2459   E.wrex 2557    \ cdif 3162   {csn 3653   class class class wbr 4039    e. cmpt 4093   ran crn 4706   ` cfv 5271  (class class class)co 5874   CCcc 8751   RRcr 8752   0cc0 8753   1c1 8754    + caddc 8756    < clt 8883    <_ cle 8884    - cmin 9053   -ucneg 9054   NNcn 9762   2c2 9811   4c4 9813   ZZcz 10040   RR+crp 10370    mod cmo 10989   ^cexp 11120   abscabs 11735    || cdivides 12547    gcd cgcd 12701   Primecprime 12774   ZZ [ _i ]cgz 12992    / Lclgs 20549
This theorem is referenced by:  2sq  20631
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1536  ax-5 1547  ax-17 1606  ax-9 1644  ax-8 1661  ax-13 1698  ax-14 1700  ax-6 1715  ax-7 1720  ax-11 1727  ax-12 1878  ax-ext 2277  ax-rep 4147  ax-sep 4157  ax-nul 4165  ax-pow 4204  ax-pr 4230  ax-un 4528  ax-inf2 7358  ax-cnex 8809  ax-resscn 8810  ax-1cn 8811  ax-icn 8812  ax-addcl 8813  ax-addrcl 8814  ax-mulcl 8815  ax-mulrcl 8816  ax-mulcom 8817  ax-addass 8818  ax-mulass 8819  ax-distr 8820  ax-i2m1 8821  ax-1ne0 8822  ax-1rid 8823  ax-rnegex 8824  ax-rrecex 8825  ax-cnre 8826  ax-pre-lttri 8827  ax-pre-lttrn 8828  ax-pre-ltadd 8829  ax-pre-mulgt0 8830  ax-pre-sup 8831  ax-addf 8832  ax-mulf 8833
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 1532  df-nf 1535  df-sb 1639  df-eu 2160  df-mo 2161  df-clab 2283  df-cleq 2289  df-clel 2292  df-nfc 2421  df-ne 2461  df-nel 2462  df-ral 2561  df-rex 2562  df-reu 2563  df-rmo 2564  df-rab 2565  df-v 2803  df-sbc 3005  df-csb 3095  df-dif 3168  df-un 3170  df-in 3172  df-ss 3179  df-pss 3181  df-nul 3469  df-if 3579  df-pw 3640  df-sn 3659  df-pr 3660  df-tp 3661  df-op 3662  df-uni 3844  df-int 3879  df-iun 3923  df-iin 3924  df-br 4040  df-opab 4094  df-mpt 4095  df-tr 4130  df-eprel 4321  df-id 4325  df-po 4330  df-so 4331  df-fr 4368  df-se 4369  df-we 4370  df-ord 4411  df-on 4412  df-lim 4413  df-suc 4414  df-om 4673  df-xp 4711  df-rel 4712  df-cnv 4713  df-co 4714  df-dm 4715  df-rn 4716  df-res 4717  df-ima 4718  df-iota 5235  df-fun 5273  df-fn 5274  df-f 5275  df-f1 5276  df-fo 5277  df-f1o 5278  df-fv 5279  df-isom 5280  df-ov 5877  df-oprab 5878  df-mpt2 5879  df-of 6094  df-ofr 6095  df-1st 6138  df-2nd 6139  df-tpos 6250  df-riota 6320  df-recs 6404  df-rdg 6439  df-1o 6495  df-2o 6496  df-oadd 6499  df-er 6676  df-ec 6678  df-qs 6682  df-map 6790  df-pm 6791  df-ixp 6834  df-en 6880  df-dom 6881  df-sdom 6882  df-fin 6883  df-sup 7210  df-oi 7241  df-card 7588  df-cda 7810  df-pnf 8885  df-mnf 8886  df-xr 8887  df-ltxr 8888  df-le 8889  df-sub 9055  df-neg 9056  df-div 9440  df-nn 9763  df-2 9820  df-3 9821  df-4 9822  df-5 9823  df-6 9824  df-7 9825  df-8 9826  df-9 9827  df-10 9828  df-n0 9982  df-z 10041  df-dec 10141  df-uz 10247  df-q 10333  df-rp 10371  df-fz 10799  df-fzo 10887  df-fl 10941  df-mod 10990  df-seq 11063  df-exp 11121  df-hash 11354  df-cj 11600  df-re 11601  df-im 11602  df-sqr 11736  df-abs 11737  df-dvds 12548  df-gcd 12702  df-prm 12775  df-phi 12850  df-pc 12906  df-gz 12993  df-struct 13166  df-ndx 13167  df-slot 13168  df-base 13169  df-sets 13170  df-ress 13171  df-plusg 13237  df-mulr 13238  df-starv 13239  df-sca 13240  df-vsca 13241  df-tset 13243  df-ple 13244  df-ds 13246  df-hom 13248  df-cco 13249  df-prds 13364  df-pws 13366  df-0g 13420  df-gsum 13421  df-imas 13427  df-divs 13428  df-mre 13504  df-mrc 13505  df-acs 13507  df-mnd 14383  df-mhm 14431  df-submnd 14432  df-grp 14505  df-minusg 14506  df-sbg 14507  df-mulg 14508  df-subg 14634  df-nsg 14635  df-eqg 14636  df-ghm 14697  df-cntz 14809  df-cmn 15107  df-abl 15108  df-mgp 15342  df-rng 15356  df-cring 15357  df-ur 15358  df-oppr 15421  df-dvdsr 15439  df-unit 15440  df-invr 15470  df-rnghom 15512  df-drng 15530  df-field 15531  df-subrg 15559  df-lmod 15645  df-lss 15706  df-lsp 15745  df-sra 15941  df-rgmod 15942  df-lidl 15943  df-rsp 15944  df-2idl 16000  df-nzr 16026  df-rlreg 16040  df-domn 16041  df-idom 16042  df-assa 16069  df-asp 16070  df-ascl 16071  df-psr 16114  df-mvr 16115  df-mpl 16116  df-evls 16117  df-evl 16118  df-opsr 16122  df-psr1 16273  df-vr1 16274  df-ply1 16275  df-evl1 16277  df-coe1 16278  df-cnfld 16394  df-zrh 16471  df-zn 16474  df-mdeg 19457  df-deg1 19458  df-mon1 19532  df-uc1p 19533  df-q1p 19534  df-r1p 19535  df-lgs 20550
  Copyright terms: Public domain W3C validator