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

Theorem 2sqlem11 22714
Description: Lemma for 2sq 22715. (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 10534 . . . . . . . . . . 11  |-  1  =/=  2
43necomi 2694 . . . . . . . . . 10  |-  2  =/=  1
5 oveq1 6098 . . . . . . . . . . . 12  |-  ( P  =  2  ->  ( P  mod  4 )  =  ( 2  mod  4
) )
6 2re 10391 . . . . . . . . . . . . 13  |-  2  e.  RR
7 4re 10398 . . . . . . . . . . . . . 14  |-  4  e.  RR
8 4pos 10417 . . . . . . . . . . . . . 14  |-  0  <  4
97, 8elrpii 10994 . . . . . . . . . . . . 13  |-  4  e.  RR+
10 0le2 10412 . . . . . . . . . . . . 13  |-  0  <_  2
11 2lt4 10492 . . . . . . . . . . . . 13  |-  2  <  4
12 modid 11732 . . . . . . . . . . . . 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 2491 . . . . . . . . . . 11  |-  ( P  =  2  ->  ( P  mod  4 )  =  2 )
1514neeq1d 2621 . . . . . . . . . 10  |-  ( P  =  2  ->  (
( P  mod  4
)  =/=  1  <->  2  =/=  1 ) )
164, 15mpbiri 233 . . . . . . . . 9  |-  ( P  =  2  ->  ( P  mod  4 )  =/=  1 )
1716necon2i 2658 . . . . . . . 8  |-  ( ( P  mod  4 )  =  1  ->  P  =/=  2 )
181, 17syl 16 . . . . . . 7  |-  ( ( P  e.  Prime  /\  ( P  mod  4 )  =  1 )  ->  P  =/=  2 )
19 eldifsn 4000 . . . . . . 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 22701 . . . . . 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 10681 . . . . 5  |-  -u 1  e.  ZZ
25 lgsqr 22685 . . . . 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 10677 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
1  e.  ZZ )
31 gcd1 13716 . . . . . 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 2444 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( ( n ^
2 )  +  1 )  =  ( ( n ^ 2 )  +  1 ) )
34 oveq1 6098 . . . . . . . 8  |-  ( x  =  n  ->  (
x  gcd  y )  =  ( n  gcd  y ) )
3534eqeq1d 2451 . . . . . . 7  |-  ( x  =  n  ->  (
( x  gcd  y
)  =  1  <->  (
n  gcd  y )  =  1 ) )
36 oveq1 6098 . . . . . . . . 9  |-  ( x  =  n  ->  (
x ^ 2 )  =  ( n ^
2 ) )
3736oveq1d 6106 . . . . . . . 8  |-  ( x  =  n  ->  (
( x ^ 2 )  +  ( y ^ 2 ) )  =  ( ( n ^ 2 )  +  ( y ^ 2 ) ) )
3837eqeq2d 2454 . . . . . . 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 6099 . . . . . . . 8  |-  ( y  =  1  ->  (
n  gcd  y )  =  ( n  gcd  1 ) )
4140eqeq1d 2451 . . . . . . 7  |-  ( y  =  1  ->  (
( n  gcd  y
)  =  1  <->  (
n  gcd  1 )  =  1 ) )
42 oveq1 6098 . . . . . . . . . 10  |-  ( y  =  1  ->  (
y ^ 2 )  =  ( 1 ^ 2 ) )
43 sq1 11960 . . . . . . . . . 10  |-  ( 1 ^ 2 )  =  1
4442, 43syl6eq 2491 . . . . . . . . 9  |-  ( y  =  1  ->  (
y ^ 2 )  =  1 )
4544oveq2d 6107 . . . . . . . 8  |-  ( y  =  1  ->  (
( n ^ 2 )  +  ( y ^ 2 ) )  =  ( ( n ^ 2 )  +  1 ) )
4645eqeq2d 2454 . . . . . . 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 3081 . . . . 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 1222 . . . 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 6116 . . . . 5  |-  ( ( n ^ 2 )  +  1 )  e. 
_V
51 eqeq1 2449 . . . . . . 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 2758 . . . . 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 3109 . . . 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 13766 . . . 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 10748 . . . . . 6  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  n  e.  CC )
6160sqcld 12006 . . . . 5  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  -> 
( n ^ 2 )  e.  CC )
62 ax-1cn 9340 . . . . 5  |-  1  e.  CC
63 subneg 9658 . . . . 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 4316 . . 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 22713 . . 3  |-  ( ( ( ( n ^
2 )  +  1 )  e.  Y  /\  P  e.  NN  /\  P  ||  ( ( n ^
2 )  +  1 ) )  ->  P  e.  S )
6856, 58, 65, 67syl3anc 1218 . 2  |-  ( ( ( P  e.  Prime  /\  ( P  mod  4
)  =  1 )  /\  ( n  e.  ZZ  /\  P  ||  ( ( n ^
2 )  -  -u 1
) ) )  ->  P  e.  S )
6928, 68rexlimddv 2845 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 1369    e. wcel 1756   {cab 2429    =/= wne 2606   E.wrex 2716    \ cdif 3325   {csn 3877   class class class wbr 4292    e. cmpt 4350   ran crn 4841   ` cfv 5418  (class class class)co 6091   CCcc 9280   RRcr 9281   0cc0 9282   1c1 9283    + caddc 9285    < clt 9418    <_ cle 9419    - cmin 9595   -ucneg 9596   NNcn 10322   2c2 10371   4c4 10373   ZZcz 10646   RR+crp 10991    mod cmo 11708   ^cexp 11865   abscabs 12723    || cdivides 13535    gcd cgcd 13690   Primecprime 13763   ZZ[_i]cgz 13990    /Lclgs 22633
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1591  ax-4 1602  ax-5 1670  ax-6 1708  ax-7 1728  ax-8 1758  ax-9 1760  ax-10 1775  ax-11 1780  ax-12 1792  ax-13 1943  ax-ext 2423  ax-rep 4403  ax-sep 4413  ax-nul 4421  ax-pow 4470  ax-pr 4531  ax-un 6372  ax-inf2 7847  ax-cnex 9338  ax-resscn 9339  ax-1cn 9340  ax-icn 9341  ax-addcl 9342  ax-addrcl 9343  ax-mulcl 9344  ax-mulrcl 9345  ax-mulcom 9346  ax-addass 9347  ax-mulass 9348  ax-distr 9349  ax-i2m1 9350  ax-1ne0 9351  ax-1rid 9352  ax-rnegex 9353  ax-rrecex 9354  ax-cnre 9355  ax-pre-lttri 9356  ax-pre-lttrn 9357  ax-pre-ltadd 9358  ax-pre-mulgt0 9359  ax-pre-sup 9360  ax-addf 9361  ax-mulf 9362
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1372  df-ex 1587  df-nf 1590  df-sb 1701  df-eu 2257  df-mo 2258  df-clab 2430  df-cleq 2436  df-clel 2439  df-nfc 2568  df-ne 2608  df-nel 2609  df-ral 2720  df-rex 2721  df-reu 2722  df-rmo 2723  df-rab 2724  df-v 2974  df-sbc 3187  df-csb 3289  df-dif 3331  df-un 3333  df-in 3335  df-ss 3342  df-pss 3344  df-nul 3638  df-if 3792  df-pw 3862  df-sn 3878  df-pr 3880  df-tp 3882  df-op 3884  df-uni 4092  df-int 4129  df-iun 4173  df-iin 4174  df-br 4293  df-opab 4351  df-mpt 4352  df-tr 4386  df-eprel 4632  df-id 4636  df-po 4641  df-so 4642  df-fr 4679  df-se 4680  df-we 4681  df-ord 4722  df-on 4723  df-lim 4724  df-suc 4725  df-xp 4846  df-rel 4847  df-cnv 4848  df-co 4849  df-dm 4850  df-rn 4851  df-res 4852  df-ima 4853  df-iota 5381  df-fun 5420  df-fn 5421  df-f 5422  df-f1 5423  df-fo 5424  df-f1o 5425  df-fv 5426  df-isom 5427  df-riota 6052  df-ov 6094  df-oprab 6095  df-mpt2 6096  df-of 6320  df-ofr 6321  df-om 6477  df-1st 6577  df-2nd 6578  df-supp 6691  df-tpos 6745  df-recs 6832  df-rdg 6866  df-1o 6920  df-2o 6921  df-oadd 6924  df-er 7101  df-ec 7103  df-qs 7107  df-map 7216  df-pm 7217  df-ixp 7264  df-en 7311  df-dom 7312  df-sdom 7313  df-fin 7314  df-fsupp 7621  df-sup 7691  df-oi 7724  df-card 8109  df-cda 8337  df-pnf 9420  df-mnf 9421  df-xr 9422  df-ltxr 9423  df-le 9424  df-sub 9597  df-neg 9598  df-div 9994  df-nn 10323  df-2 10380  df-3 10381  df-4 10382  df-5 10383  df-6 10384  df-7 10385  df-8 10386  df-9 10387  df-10 10388  df-n0 10580  df-z 10647  df-dec 10756  df-uz 10862  df-q 10954  df-rp 10992  df-fz 11438  df-fzo 11549  df-fl 11642  df-mod 11709  df-seq 11807  df-exp 11866  df-hash 12104  df-cj 12588  df-re 12589  df-im 12590  df-sqr 12724  df-abs 12725  df-dvds 13536  df-gcd 13691  df-prm 13764  df-phi 13841  df-pc 13904  df-gz 13991  df-struct 14176  df-ndx 14177  df-slot 14178  df-base 14179  df-sets 14180  df-ress 14181  df-plusg 14251  df-mulr 14252  df-starv 14253  df-sca 14254  df-vsca 14255  df-ip 14256  df-tset 14257  df-ple 14258  df-ds 14260  df-unif 14261  df-hom 14262  df-cco 14263  df-0g 14380  df-gsum 14381  df-prds 14386  df-pws 14388  df-imas 14446  df-divs 14447  df-mre 14524  df-mrc 14525  df-acs 14527  df-mnd 15415  df-mhm 15464  df-submnd 15465  df-grp 15545  df-minusg 15546  df-sbg 15547  df-mulg 15548  df-subg 15678  df-nsg 15679  df-eqg 15680  df-ghm 15745  df-cntz 15835  df-cmn 16279  df-abl 16280  df-mgp 16592  df-ur 16604  df-srg 16608  df-rng 16647  df-cring 16648  df-oppr 16715  df-dvdsr 16733  df-unit 16734  df-invr 16764  df-dvr 16775  df-rnghom 16806  df-drng 16834  df-field 16835  df-subrg 16863  df-lmod 16950  df-lss 17014  df-lsp 17053  df-sra 17253  df-rgmod 17254  df-lidl 17255  df-rsp 17256  df-2idl 17314  df-nzr 17340  df-rlreg 17354  df-domn 17355  df-idom 17356  df-assa 17384  df-asp 17385  df-ascl 17386  df-psr 17423  df-mvr 17424  df-mpl 17425  df-opsr 17427  df-evls 17588  df-evl 17589  df-psr1 17636  df-vr1 17637  df-ply1 17638  df-coe1 17639  df-evl1 17751  df-cnfld 17819  df-zring 17884  df-zrh 17935  df-zn 17938  df-mdeg 21524  df-deg1 21525  df-mon1 21602  df-uc1p 21603  df-q1p 21604  df-r1p 21605  df-lgs 22634
This theorem is referenced by:  2sq  22715
  Copyright terms: Public domain W3C validator